aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcall.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/infcall.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/infcall.c')
-rw-r--r--gdb/infcall.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/infcall.c b/gdb/infcall.c
index e62c220..8252fee 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -482,7 +482,7 @@ get_call_return_value (struct call_return_meta_info *ri)
else
{
gdbarch_return_value_as_value (ri->gdbarch, ri->function, ri->value_type,
- get_current_regcache (),
+ get_thread_regcache (inferior_thread ()),
&retval, NULL);
if (stack_temporaries && class_or_union_p (ri->value_type))
{
@@ -1068,7 +1068,7 @@ call_function_by_hand_dummy (struct value *function,
sp = push_dummy_code (gdbarch, sp, funaddr, args,
target_values_type, &real_pc, &bp_addr,
- get_current_regcache ());
+ get_thread_regcache (inferior_thread ()));
/* Write a legitimate instruction at the point where the infcall
breakpoint is going to be inserted. While this instruction
@@ -1270,7 +1270,8 @@ call_function_by_hand_dummy (struct value *function,
/* Create the dummy stack frame. Pass in the call dummy address as,
presumably, the ABI code knows where, in the call dummy, the
return address should be pointed. */
- sp = gdbarch_push_dummy_call (gdbarch, function, get_current_regcache (),
+ sp = gdbarch_push_dummy_call (gdbarch, function,
+ get_thread_regcache (inferior_thread ()),
bp_addr, args.size (), args.data (),
sp, return_method, struct_addr);