* arch-utils.c (displaced_step_at_entry_point): Do not call
authorDaniel Jacobowitz <drow@false.org>
Tue, 28 Jul 2009 16:39:06 +0000 (16:39 +0000)
committerDaniel Jacobowitz <drow@false.org>
Tue, 28 Jul 2009 16:39:06 +0000 (16:39 +0000)
gdbarch_convert_from_func_ptr_addr.
* cris-tdep.c: Remove outdated comment.
* infcall.c (call_function_by_hand): Do not call
gdbarch_convert_from_func_ptr_addr after entry_point_address.
* objfiles.c (entry_point_address): Call both
gdbarch_convert_from_func_ptr_addr and
gdbarch_addr_bits_remove.

gdb/ChangeLog
gdb/arch-utils.c
gdb/cris-tdep.c
gdb/infcall.c
gdb/objfiles.c

index 48743fd48025a03b4dc4525acdb15e92196e332f..fc1784e58b8c4e1a4d941ddf125aae64cfa162d0 100644 (file)
@@ -1,3 +1,14 @@
+2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * arch-utils.c (displaced_step_at_entry_point): Do not call
+       gdbarch_convert_from_func_ptr_addr.
+       * cris-tdep.c: Remove outdated comment.
+       * infcall.c (call_function_by_hand): Do not call
+       gdbarch_convert_from_func_ptr_addr after entry_point_address.
+       * objfiles.c (entry_point_address): Call both
+       gdbarch_convert_from_func_ptr_addr and
+       gdbarch_addr_bits_remove.
+
 2009-07-28  Aleksandar Ristovski  <aristovski@qnx.com>
 
        * nto-tdep.c (nto_thread_state_str): New array.
index f3246eb0baa5a7c76848eb98eb240608118e37f0..f075922bf04596d73c1351a1d7bac18ff1ef9bc5 100644 (file)
@@ -76,10 +76,6 @@ displaced_step_at_entry_point (struct gdbarch *gdbarch)
 
   addr = entry_point_address ();
 
-  /* Make certain that the address points at real code, and not a
-     function descriptor.  */
-  addr = gdbarch_convert_from_func_ptr_addr (gdbarch, addr, &current_target);
-
   /* Inferior calls also use the entry point as a breakpoint location.
      We don't want displaced stepping to interfere with those
      breakpoints, so leave space.  */
index 999231cfe06700bcea37a3097a039ebcdd21b7a4..69e7e5bd4bcbbf190858f172778fa883ed21698a 100644 (file)
@@ -39,7 +39,6 @@
 #include "regcache.h"
 #include "gdb_assert.h"
 
-/* To get entry_point_address.  */
 #include "objfiles.h"
 
 #include "solib.h"              /* Support for shared libraries.  */
index 479492dec29dde1a3aeae39b1e3ea1f3f118e7f8..c9d98cf65eb2173808a66f48b2ef52fdf5233dd9 100644 (file)
@@ -592,11 +592,6 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
 
        real_pc = funaddr;
        dummy_addr = entry_point_address ();
-       /* Make certain that the address points at real code, and not a
-          function descriptor.  */
-       dummy_addr = gdbarch_convert_from_func_ptr_addr (gdbarch,
-                                                        dummy_addr,
-                                                        &current_target);
        /* A call dummy always consists of just a single breakpoint, so
           its address is the same as the address of the dummy.  */
        bp_addr = dummy_addr;
@@ -614,14 +609,16 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
        sym = lookup_minimal_symbol ("__CALL_DUMMY_ADDRESS", NULL, NULL);
        real_pc = funaddr;
        if (sym)
-         dummy_addr = SYMBOL_VALUE_ADDRESS (sym);
+         {
+           dummy_addr = SYMBOL_VALUE_ADDRESS (sym);
+           /* Make certain that the address points at real code, and not
+              a function descriptor.  */
+           dummy_addr = gdbarch_convert_from_func_ptr_addr (gdbarch,
+                                                            dummy_addr,
+                                                            &current_target);
+         }
        else
          dummy_addr = entry_point_address ();
-       /* Make certain that the address points at real code, and not
-          a function descriptor.  */
-       dummy_addr = gdbarch_convert_from_func_ptr_addr (gdbarch,
-                                                        dummy_addr,
-                                                        &current_target);
        /* A call dummy always consists of just a single breakpoint,
           so it's address is the same as the address of the dummy.  */
        bp_addr = dummy_addr;
index 4662e1b12121788cfc90daf050a3761cb9d182e8..c983b116135107e0bde0d09dd1e2e9fa926584bf 100644 (file)
@@ -279,7 +279,26 @@ init_entry_point_info (struct objfile *objfile)
 CORE_ADDR
 entry_point_address (void)
 {
-  return symfile_objfile ? symfile_objfile->ei.entry_point : 0;
+  struct gdbarch *gdbarch;
+  CORE_ADDR entry_point;
+
+  if (symfile_objfile == NULL)
+    return 0;
+
+  gdbarch = get_objfile_arch (symfile_objfile);
+
+  entry_point = symfile_objfile->ei.entry_point;
+
+  /* Make certain that the address points at real code, and not a
+     function descriptor.  */
+  entry_point = gdbarch_convert_from_func_ptr_addr (gdbarch, entry_point,
+                                                   &current_target);
+
+  /* Remove any ISA markers, so that this matches entries in the
+     symbol table.  */
+  entry_point = gdbarch_addr_bits_remove (gdbarch, entry_point);
+
+  return entry_point;
 }
 
 /* Create the terminating entry of OBJFILE's minimal symbol table.