diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2024-05-16 17:04:13 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2024-07-15 14:34:12 -0400 |
commit | d1e4438fa183c92487d18b7ccfbe0c10166709d9 (patch) | |
tree | fa5b21bbe5b9d0dfe7546bc96c509ff8c341c72b | |
parent | b7513ebd18f4d930e8ff806609be1bf75a7b9b9a (diff) | |
download | binutils-d1e4438fa183c92487d18b7ccfbe0c10166709d9.zip binutils-d1e4438fa183c92487d18b7ccfbe0c10166709d9.tar.gz binutils-d1e4438fa183c92487d18b7ccfbe0c10166709d9.tar.bz2 |
gdb: pass program space to entry_point_address
Make the current program space reference bubble up one level.
Change-Id: Ifc9b8186abaefb10caf99f79ae09e526fa65c882
Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
-rw-r--r-- | gdb/arc-tdep.c | 2 | ||||
-rw-r--r-- | gdb/arch-utils.c | 2 | ||||
-rw-r--r-- | gdb/infcall.c | 2 | ||||
-rw-r--r-- | gdb/objfiles.c | 6 | ||||
-rw-r--r-- | gdb/objfiles.h | 4 |
5 files changed, 9 insertions, 7 deletions
diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c index 9491107..4fc1ea1 100644 --- a/gdb/arc-tdep.c +++ b/gdb/arc-tdep.c @@ -861,7 +861,7 @@ arc_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, struct regcache *regcache) { *real_pc = funaddr; - *bp_addr = entry_point_address (); + *bp_addr = entry_point_address (current_program_space); return sp; } diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 83e2947..fb5634d 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -56,7 +56,7 @@ displaced_step_at_entry_point (struct gdbarch *gdbarch) CORE_ADDR addr; int bp_len; - addr = entry_point_address (); + addr = entry_point_address (current_program_space); /* Inferior calls also use the entry point as a breakpoint location. We don't want displaced stepping to interfere with those diff --git a/gdb/infcall.c b/gdb/infcall.c index edac9a7..559fcb7 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -1271,7 +1271,7 @@ call_function_by_hand_dummy (struct value *function, CORE_ADDR dummy_addr; real_pc = funaddr; - dummy_addr = entry_point_address (); + dummy_addr = entry_point_address (current_program_space); /* A call dummy always consists of just a single breakpoint, so its address is the same as the address of the dummy. diff --git a/gdb/objfiles.c b/gdb/objfiles.c index b9333b6..f54813d 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -360,14 +360,14 @@ entry_point_address_query (program_space *pspace, CORE_ADDR *entry_p) return 1; } -/* Get current entry point address. Call error if it is not known. */ +/* See objfiles.h. */ CORE_ADDR -entry_point_address (void) +entry_point_address (program_space *pspace) { CORE_ADDR retval; - if (!entry_point_address_query (current_program_space, &retval)) + if (!entry_point_address_query (pspace, &retval)) error (_("Entry point address is not known.")); return retval; diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 45a06ec..9143fbf 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -918,7 +918,9 @@ obj_section::set_offset (CORE_ADDR offset) extern int entry_point_address_query (program_space *pspace, CORE_ADDR *entry_p); -extern CORE_ADDR entry_point_address (void); +/* Get the entry point address in PSPACE. Call error if it is not known. */ + +extern CORE_ADDR entry_point_address (program_space *pspace); extern void build_objfile_section_table (struct objfile *); |