From 9c742269ec8507d924d7a0c815155ca5aa21467a Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sun, 5 Nov 2023 04:47:26 +0000 Subject: 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 --- gdb/infcmd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gdb/infcmd.c') diff --git a/gdb/infcmd.c b/gdb/infcmd.c index cf8cd52..8890a16 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -496,7 +496,8 @@ run_command_1 (const char *args, int from_tty, enum run_how run_how) /* Start the target running. Do not use -1 continuation as it would skip breakpoint right at the entry point. */ - proceed (regcache_read_pc (get_current_regcache ()), GDB_SIGNAL_0); + proceed (regcache_read_pc (get_thread_regcache (inferior_thread ())), + GDB_SIGNAL_0); /* Since there was no error, there's no need to finish the thread states here. */ @@ -1466,7 +1467,7 @@ advance_command (const char *arg, int from_tty) struct value * get_return_value (struct symbol *func_symbol, struct value *function) { - regcache *stop_regs = get_current_regcache (); + regcache *stop_regs = get_thread_regcache (inferior_thread ()); struct gdbarch *gdbarch = stop_regs->arch (); struct value *value; -- cgit v1.1