diff options
author | Tom Tromey <tromey@adacore.com> | 2022-08-08 10:41:43 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2022-09-20 12:25:19 -0600 |
commit | 9e468e953cd2f605a3f51d6ef6532e46b8fdd7b4 (patch) | |
tree | 2368c5b3ea5ed2f5aa78b92c384186f3290763b2 /gdb/gdbarch.c | |
parent | 5898c79ae692ed02dd9267888541b352423a9331 (diff) | |
download | fsf-binutils-gdb-9e468e953cd2f605a3f51d6ef6532e46b8fdd7b4.zip fsf-binutils-gdb-9e468e953cd2f605a3f51d6ef6532e46b8fdd7b4.tar.gz fsf-binutils-gdb-9e468e953cd2f605a3f51d6ef6532e46b8fdd7b4.tar.bz2 |
Move solib_ops into gdbarch
This changs solib_ops to be an ordinary gdbarch value and updates all
the uses. This removes a longstanding FIXME and makes the code
somewhat cleaner as well.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 0edae7f..18d46a3 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -153,6 +153,7 @@ struct gdbarch gdbarch_single_step_through_delay_ftype *single_step_through_delay = nullptr; gdbarch_print_insn_ftype *print_insn = nullptr; gdbarch_skip_trampoline_code_ftype *skip_trampoline_code = nullptr; + const struct target_so_ops * so_ops = 0; gdbarch_skip_solib_resolver_ftype *skip_solib_resolver = nullptr; gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline = nullptr; gdbarch_in_indirect_branch_thunk_ftype *in_indirect_branch_thunk = nullptr; @@ -504,6 +505,8 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of single_step_through_delay, has predicate. */ /* Skip verify of print_insn, invalid_p == 0 */ /* Skip verify of skip_trampoline_code, invalid_p == 0 */ + if (gdbarch->so_ops == 0) + gdbarch->so_ops = &solib_target_so_ops; /* Skip verify of skip_solib_resolver, invalid_p == 0 */ /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */ /* Skip verify of in_indirect_branch_thunk, invalid_p == 0 */ @@ -1013,6 +1016,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: skip_trampoline_code = <%s>\n", host_address_to_string (gdbarch->skip_trampoline_code)); gdb_printf (file, + "gdbarch_dump: so_ops = %s\n", + host_address_to_string (gdbarch->so_ops)); + gdb_printf (file, "gdbarch_dump: skip_solib_resolver = <%s>\n", host_address_to_string (gdbarch->skip_solib_resolver)); gdb_printf (file, @@ -3366,6 +3372,22 @@ set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch->skip_trampoline_code = skip_trampoline_code; } +const struct target_so_ops * +gdbarch_so_ops (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + if (gdbarch_debug >= 2) + gdb_printf (gdb_stdlog, "gdbarch_so_ops called\n"); + return gdbarch->so_ops; +} + +void +set_gdbarch_so_ops (struct gdbarch *gdbarch, + const struct target_so_ops * so_ops) +{ + gdbarch->so_ops = so_ops; +} + CORE_ADDR gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) { |