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/windows-nat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/windows-nat.c') diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index b98efe8..205bf01 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1441,7 +1441,7 @@ windows_nat_target::resume (ptid_t ptid, int step, enum gdb_signal sig) if (step) { /* Single step by setting t bit. */ - struct regcache *regcache = get_current_regcache (); + regcache *regcache = get_thread_regcache (inferior_thread ()); struct gdbarch *gdbarch = regcache->arch (); fetch_registers (regcache, gdbarch_ps_regnum (gdbarch)); th->wow64_context.EFlags |= FLAG_TRACE_BIT; @@ -1469,7 +1469,7 @@ windows_nat_target::resume (ptid_t ptid, int step, enum gdb_signal sig) if (step) { /* Single step by setting t bit. */ - struct regcache *regcache = get_current_regcache (); + regcache *regcache = get_thread_regcache (inferior_thread ()); struct gdbarch *gdbarch = regcache->arch (); fetch_registers (regcache, gdbarch_ps_regnum (gdbarch)); th->context.EFlags |= FLAG_TRACE_BIT; -- cgit v1.1