aboutsummaryrefslogtreecommitdiff
path: root/gdb/ia64-tdep.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-06-07 18:08:25 +0000
committerAndrew Cagney <cagney@redhat.com>2003-06-07 18:08:25 +0000
commitbd1ce8ba9bdc886115d11aa491e108c578345985 (patch)
tree667b37aa166f5ca58e2143386d085574377444ea /gdb/ia64-tdep.c
parentec5cbaecff9fe229c30b15490b9b7e6839a398c5 (diff)
downloadgdb-bd1ce8ba9bdc886115d11aa491e108c578345985.zip
gdb-bd1ce8ba9bdc886115d11aa491e108c578345985.tar.gz
gdb-bd1ce8ba9bdc886115d11aa491e108c578345985.tar.bz2
2003-06-07 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (TARGET_READ_SP): Add predicate, delete default. * gdbarch.h, gdbarch.c: Regenerate. * mn10300-tdep.c: Include "gdb_assert.h". (mn10300_read_fp): New function. (mn10300_gdbarch_init): Set deprecated_target_read_fp to mn10300_read_fp. Do not set read_sp to generic_target_read_sp. * ia64-tdep.c: Include "gdb_assert.h". (ia64_read_fp): New function. (ia64_gdbarch_init): Set deprecated_target_read_fp to ia64_read_sp. Do not set read_sp to generic_target_read_sp. * regcache.c (generic_target_read_sp): Delete function. (read_sp): Try TARGET_READ_SP and SP_REGNUM for the SP register. * inferior.h (generic_target_read_sp): Delete declaration. * frv-tdep.c (frv_gdbarch_init): Do not set read_sp to generic_target_read_sp. * m68hc11-tdep.c (m68hc11_gdbarch_init): Ditto. * sparc-tdep.c (sparc_gdbarch_init): Ditto * sh-tdep.c (sh_gdbarch_init): Ditto. * rs6000-tdep.c (rs6000_gdbarch_init): Ditto. * Makefile.in (mn10300-tdep.o, ia64-tdep.o): Update dependencies.
Diffstat (limited to 'gdb/ia64-tdep.c')
-rw-r--r--gdb/ia64-tdep.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 4697574..89d623f 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -28,7 +28,7 @@
#include "regcache.h"
#include "doublest.h"
#include "value.h"
-
+#include "gdb_assert.h"
#include "objfiles.h"
#include "elf/common.h" /* for DT_PLTGOT value */
#include "elf-bfd.h"
@@ -623,6 +623,18 @@ ia64_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
return breakpoint;
}
+static CORE_ADDR
+ia64_read_fp (void)
+{
+ /* We won't necessarily have a frame pointer and even if we do, it
+ winds up being extraordinarly messy when attempting to find the
+ frame chain. So for the purposes of creating frames (which is
+ all deprecated_read_fp() is used for), simply use the stack
+ pointer value instead. */
+ gdb_assert (SP_REGNUM >= 0);
+ return read_register (SP_REGNUM);
+}
+
CORE_ADDR
ia64_read_pc (ptid_t ptid)
{
@@ -2296,12 +2308,11 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
frame chain. So for the purposes of creating frames (which is
all deprecated_read_fp() is used for), simply use the stack
pointer value instead. */
- set_gdbarch_deprecated_target_read_fp (gdbarch, generic_target_read_sp);
+ set_gdbarch_deprecated_target_read_fp (gdbarch, ia64_read_fp);
/* Settings that should be unnecessary. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
- set_gdbarch_read_sp (gdbarch, generic_target_read_sp);
set_gdbarch_deprecated_dummy_write_sp (gdbarch, generic_target_write_sp);
set_gdbarch_decr_pc_after_break (gdbarch, 0);