aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-darwin.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-11-05 04:47:26 +0000
committerSimon Marchi <simon.marchi@efficios.com>2023-11-17 20:01:37 +0000
commit9c742269ec8507d924d7a0c815155ca5aa21467a (patch)
tree311e5334f6a80b23a0b361e8f916a5df9a57ab0e /gdb/solib-darwin.c
parent7438771288f1acd5ab25277188a75ce9e48e256c (diff)
downloadgdb-9c742269ec8507d924d7a0c815155ca5aa21467a.zip
gdb-9c742269ec8507d924d7a0c815155ca5aa21467a.tar.gz
gdb-9c742269ec8507d924d7a0c815155ca5aa21467a.tar.bz2
gdb: remove get_current_regcache
Remove get_current_regcache, inlining the call to get_thread_regcache in callers. When possible, pass the right thread_info object known from the local context. Otherwise, fall back to passing `inferior_thread ()`. This makes the reference to global context bubble up one level, a small step towards the long term goal of reducing the number of references to global context (or rather, moving those references as close as possible to the top of the call tree). No behavior change expected. Change-Id: Ifa6980c88825d803ea586546b6b4c633c33be8d6
Diffstat (limited to 'gdb/solib-darwin.c')
-rw-r--r--gdb/solib-darwin.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c
index 4f9ba99..c18791c 100644
--- a/gdb/solib-darwin.c
+++ b/gdb/solib-darwin.c
@@ -362,7 +362,7 @@ darwin_read_exec_load_addr_at_init (struct darwin_info *info)
gdb_byte buf[8];
/* Get SP. */
- if (regcache_cooked_read_unsigned (get_current_regcache (),
+ if (regcache_cooked_read_unsigned (get_thread_regcache (inferior_thread ()),
gdbarch_sp_regnum (gdbarch),
&load_ptr_addr) != REG_VALID)
return 0;
@@ -450,7 +450,7 @@ darwin_solib_get_all_image_info_addr_at_init (struct darwin_info *info)
/* We find the dynamic linker's base address by examining
the current pc (which should point at the entry point for the
dynamic linker) and subtracting the offset of the entry point. */
- load_addr = (regcache_read_pc (get_current_regcache ())
+ load_addr = (regcache_read_pc (get_thread_regcache (inferior_thread ()))
- bfd_get_start_address (dyld_bfd.get ()));
/* Now try to set a breakpoint in the dynamic linker. */
@@ -574,7 +574,7 @@ darwin_solib_create_inferior_hook (int from_tty)
for the dynamic linker) and subtracting the offset of
the entry point. */
- pc = regcache_read_pc (get_current_regcache ());
+ pc = regcache_read_pc (get_thread_regcache (inferior_thread ()));
dyld_relocated_base_address = pc - dyld_bfd_start_address;
/* We get the proper notifier relocated address by