aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2009-07-28 16:39:06 +0000
committerDaniel Jacobowitz <drow@false.org>2009-07-28 16:39:06 +0000
commit3612b1927e247d33aab56de742e16f110f148711 (patch)
treefc046cc74e65e51ae57bcef2cbb2a8140a4edae8 /gdb
parentd551e57bf793cc95d833626ff467e84f0bfab146 (diff)
downloadgdb-3612b1927e247d33aab56de742e16f110f148711.zip
gdb-3612b1927e247d33aab56de742e16f110f148711.tar.gz
gdb-3612b1927e247d33aab56de742e16f110f148711.tar.bz2
* 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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog11
-rw-r--r--gdb/arch-utils.c4
-rw-r--r--gdb/cris-tdep.c1
-rw-r--r--gdb/infcall.c19
-rw-r--r--gdb/objfiles.c21
5 files changed, 39 insertions, 17 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 48743fd..fc1784e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index f3246eb..f075922 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -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. */
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 999231c..69e7e5b 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -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. */
diff --git a/gdb/infcall.c b/gdb/infcall.c
index 479492d..c9d98cf 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -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;
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 4662e1b..c983b11 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -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.