diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2021-03-24 18:08:12 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-03-24 18:08:24 -0400 |
commit | 328d42d87e97c75d6e52800bfd4bc1bfdfb745d2 (patch) | |
tree | 4dee500fe0bf6acd7dcb8153aabebaa27936c564 /gdb/breakpoint.c | |
parent | d777bf0df22f1048fd24999ae563e30abcbcfbe7 (diff) | |
download | gdb-328d42d87e97c75d6e52800bfd4bc1bfdfb745d2.zip gdb-328d42d87e97c75d6e52800bfd4bc1bfdfb745d2.tar.gz gdb-328d42d87e97c75d6e52800bfd4bc1bfdfb745d2.tar.bz2 |
gdb: remove current_top_target function
The current_top_target function is a hidden dependency on the current
inferior. Since I'd like to slowly move towards reducing our dependency
on the global current state, remove this function and make callers use
current_inferior ()->top_target ()
There is no expected change in behavior, but this one step towards
making those callers use the inferior from their context, rather than
refer to the global current inferior.
gdb/ChangeLog:
* target.h (current_top_target): Remove, make callers use the
current inferior instead.
* target.c (current_top_target): Remove.
Change-Id: Iccd457036f84466cdaa3865aa3f9339a24ea001d
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index de1e79b..16cf797 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -3598,8 +3598,8 @@ create_exception_master_breakpoint_hook (objfile *objfile) } addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->exception_msym); - addr = gdbarch_convert_from_func_ptr_addr (gdbarch, addr, - current_top_target ()); + addr = gdbarch_convert_from_func_ptr_addr + (gdbarch, addr, current_inferior ()->top_target ()); b = create_internal_breakpoint (gdbarch, addr, bp_exception_master, &internal_breakpoint_ops); initialize_explicit_location (&explicit_loc); @@ -4869,7 +4869,7 @@ watchpoints_triggered (struct target_waitstatus *ws) return 0; } - if (!target_stopped_data_address (current_top_target (), &addr)) + if (!target_stopped_data_address (current_inferior ()->top_target (), &addr)) { /* We were stopped by a watchpoint, but we don't know where. Mark all watchpoints as unknown. */ @@ -4909,9 +4909,9 @@ watchpoints_triggered (struct target_waitstatus *ws) } } /* Exact match not required. Within range is sufficient. */ - else if (target_watchpoint_addr_within_range (current_top_target (), - addr, loc->address, - loc->length)) + else if (target_watchpoint_addr_within_range + (current_inferior ()->top_target (), addr, loc->address, + loc->length)) { w->watchpoint_triggered = watch_triggered_yes; break; |