]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: pass program space to entry_point_address
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 16 May 2024 21:04:13 +0000 (17:04 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 15 Jul 2024 18:34:12 +0000 (14:34 -0400)
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>
gdb/arc-tdep.c
gdb/arch-utils.c
gdb/infcall.c
gdb/objfiles.c
gdb/objfiles.h

index 9491107ecffbe528cd94b62cc79a9946bfc58744..4fc1ea1dc46463ac29aa06acd7c723514457b8ec 100644 (file)
@@ -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;
 }
 
index 83e29470bf78a5bf7dd9e54f57aa054f57cd32a9..fb5634d5fa07b73a67595459a53e707aba0813a8 100644 (file)
@@ -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
index edac9a7417916219de3f05e25a91dbd2212f4476..559fcb7f9a6af149812617ce45b9020f1c574f25 100644 (file)
@@ -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.
index b9333b6c9f46f4de651cff8fb5b8e05d0106665b..f54813d9f8f272377ff177a0b07e092843d7fcd9 100644 (file)
@@ -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;
index 45a06ec6a9ecae0d6fcc295c3c67bd5114745908..9143fbf4a91dc593befc0c1239802e886ff8636e 100644 (file)
@@ -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 *);