From ce81f9d6fa885a3faa41613debc8771304dc469b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 8 Aug 2022 09:56:47 -0600 Subject: [PATCH] Fix regression from gdbarch registry change The gdbarch registry patch introduced a regression that could cause a crash when opening files in gdb. The bug is that, previously, the solib ops would default to current_target_so_ops; but the patch changed this code to default to nullptr. This patch fixes the bug by reintroducing the earlier behavior. This is PR gdb/29449. I managed to reproduce the bug with a riscv-elf build and then verified that this fixes the problem. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29449 --- gdb/solib.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/solib.c b/gdb/solib.c index d889673dabf..25adf586a02 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -64,7 +64,13 @@ static const registry::key