aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-svr4.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2018-06-07 17:27:46 +0100
committerPedro Alves <palves@redhat.com>2018-06-07 17:27:46 +0100
commit8b88a78e63526b84d540b9c7d5f459593a248d5e (patch)
tree3d1a43354d8b4cb169f2f9cff422531daee350b2 /gdb/solib-svr4.c
parentc7110220be62590222e35525dda499902ee49a89 (diff)
downloadgdb-8b88a78e63526b84d540b9c7d5f459593a248d5e.zip
gdb-8b88a78e63526b84d540b9c7d5f459593a248d5e.tar.gz
gdb-8b88a78e63526b84d540b9c7d5f459593a248d5e.tar.bz2
target_stack -> current_top_target() throughout
The recent C++ification of target_ops replaced references to the old "current_target" squashed target throughout with references to a "target_stack" pointer. I had picked the "target_stack" name very early in the multi-target work, and managed to stick with it, even though it's a bit of a misnomer, since it isn't really a "target stack" object, but a pointer into the current top target in the stack. As I'm splitting more pieces off of the multi-target branch, I've come to think that it's better to rename it now. A following patch will introduce a new class to represent a target stack, and "target_stack" would be _its_ ideal name. (In the branch, the class is called a_target_stack to work around the clash.) Thus this commit renames target_stack to current_top_target and replaces all references throughout. Also, while at it, current_top_target is made a function instead of a pointer, to make it possible to change its internal implementation without leaking implementation details out. In a couple patches, the implementation of the function will change to refer to a target stack object, and then further down the multi-target work, it'll change again to find the right target stack for the current inferior. gdb/ChangeLog: 2018-06-07 Pedro Alves <palves@redhat.com> * target.h (target_stack): Delete. (current_top_target): Declare function. * target.c (target_stack): Delete. (g_current_top_target): New. (current_top_target): New function. * auxv.c: Use current_top_target instead of target_stack throughout. * avr-tdep.c: Likewise. * breakpoint.c: Likewise. * corefile.c: Likewise. * elfread.c: Likewise. * eval.c: Likewise. * exceptions.c: Likewise. * frame.c: Likewise. * gdbarch-selftests.c: Likewise. * gnu-v3-abi.c: Likewise. * ia64-tdep.c: Likewise. * ia64-vms-tdep.c: Likewise. * infcall.c: Likewise. * infcmd.c: Likewise. * infrun.c: Likewise. * linespec.c: Likewise. * linux-tdep.c: Likewise. * minsyms.c: Likewise. * ppc-linux-nat.c: Likewise. * ppc-linux-tdep.c: Likewise. * procfs.c: Likewise. * regcache.c: Likewise. * remote.c: Likewise. * rs6000-tdep.c: Likewise. * s390-linux-nat.c: Likewise. * s390-tdep.c: Likewise. * solib-aix.c: Likewise. * solib-darwin.c: Likewise. * solib-dsbt.c: Likewise. * solib-spu.c: Likewise. * solib-svr4.c: Likewise. * solib-target.c: Likewise. * sparc-tdep.c: Likewise. * sparc64-tdep.c: Likewise. * spu-tdep.c: Likewise. * symfile.c: Likewise. * symtab.c: Likewise. * target-descriptions.c: Likewise. * target-memory.c: Likewise. * target.c: Likewise. * target.h: Likewise. * tracefile-tfile.c: Likewise. * tracepoint.c: Likewise. * valops.c: Likewise. * valprint.c: Likewise. * value.c: Likewise. * windows-tdep.c: Likewise. * mi/mi-main.c: Likewise.
Diffstat (limited to 'gdb/solib-svr4.c')
-rw-r--r--gdb/solib-svr4.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index f9936b3..d012f08 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -432,11 +432,11 @@ read_program_header (int type, int *p_sect_size, int *p_arch_size,
int pt_phdr_p = 0;
/* Get required auxv elements from target. */
- if (target_auxv_search (target_stack, AT_PHDR, &at_phdr) <= 0)
+ if (target_auxv_search (current_top_target (), AT_PHDR, &at_phdr) <= 0)
return 0;
- if (target_auxv_search (target_stack, AT_PHENT, &at_phent) <= 0)
+ if (target_auxv_search (current_top_target (), AT_PHENT, &at_phent) <= 0)
return 0;
- if (target_auxv_search (target_stack, AT_PHNUM, &at_phnum) <= 0)
+ if (target_auxv_search (current_top_target (), AT_PHNUM, &at_phnum) <= 0)
return 0;
if (!at_phdr || !at_phnum)
return 0;
@@ -1244,7 +1244,7 @@ svr4_current_sos_via_xfer_libraries (struct svr4_library_list *list,
/* Fetch the list of shared libraries. */
gdb::optional<gdb::char_vector> svr4_library_document
- = target_read_stralloc (target_stack, TARGET_OBJECT_LIBRARIES_SVR4,
+ = target_read_stralloc (current_top_target (), TARGET_OBJECT_LIBRARIES_SVR4,
annex);
if (!svr4_library_document)
return 0;
@@ -2217,9 +2217,10 @@ enable_break (struct svr4_info *info, int from_tty)
struct obj_section *os;
sym_addr = gdbarch_addr_bits_remove
- (target_gdbarch (), gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
- sym_addr,
- target_stack));
+ (target_gdbarch (),
+ gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
+ sym_addr,
+ current_top_target ()));
/* On at least some versions of Solaris there's a dynamic relocation
on _r_debug.r_brk and SYM_ADDR may not be relocated yet, e.g., if
@@ -2334,7 +2335,7 @@ enable_break (struct svr4_info *info, int from_tty)
/* If we were not able to find the base address of the loader
from our so_list, then try using the AT_BASE auxilliary entry. */
if (!load_addr_found)
- if (target_auxv_search (target_stack, AT_BASE, &load_addr) > 0)
+ if (target_auxv_search (current_top_target (), AT_BASE, &load_addr) > 0)
{
int addr_bit = gdbarch_addr_bit (target_gdbarch ());
@@ -2459,7 +2460,7 @@ enable_break (struct svr4_info *info, int from_tty)
sym_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr,
- target_stack);
+ current_top_target ());
svr4_create_solib_event_breakpoints (target_gdbarch (), sym_addr);
return 1;
}
@@ -2476,7 +2477,7 @@ enable_break (struct svr4_info *info, int from_tty)
sym_addr = BMSYMBOL_VALUE_ADDRESS (msymbol);
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (),
sym_addr,
- target_stack);
+ current_top_target ());
svr4_create_solib_event_breakpoints (target_gdbarch (), sym_addr);
return 1;
}
@@ -2571,7 +2572,7 @@ svr4_exec_displacement (CORE_ADDR *displacementp)
if ((bfd_get_file_flags (exec_bfd) & DYNAMIC) == 0)
return 0;
- if (target_auxv_search (target_stack, AT_ENTRY, &entry_point) <= 0)
+ if (target_auxv_search (current_top_target (), AT_ENTRY, &entry_point) <= 0)
return 0;
exec_displacement = entry_point - bfd_get_start_address (exec_bfd);