aboutsummaryrefslogtreecommitdiff
path: root/gdb/sparc-tdep.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1991-08-20 03:02:39 +0000
committerJohn Gilmore <gnu@cygnus>1991-08-20 03:02:39 +0000
commit5e5215eba77007511fb040ac842a935ec624b4a6 (patch)
treef658e7a0e4541ed5640fb9e5c5f998f272b19498 /gdb/sparc-tdep.c
parent24e2462158f159377ed7f0c2fe96683c3e1063c9 (diff)
downloadgdb-5e5215eba77007511fb040ac842a935ec624b4a6.zip
gdb-5e5215eba77007511fb040ac842a935ec624b4a6.tar.gz
gdb-5e5215eba77007511fb040ac842a935ec624b4a6.tar.bz2
* mcheck.c: Avoid warning about undeclared abort fn.
* tm-sparc.h (PC_ADJUST): Avoid calling error() from this; it causes recursive calls to error() when used in cleanups. To do so requires that we make it a function, so we do. * sparc-tdep.c (sparc_pc_adjust): New implem of PC_ADJUST. * utils.c (do_cleanups): Remove the current cleanup from the chain *before* calling it, in case error() is called from it. The result won't be pretty, but won't be an infinite loop either.
Diffstat (limited to 'gdb/sparc-tdep.c')
-rw-r--r--gdb/sparc-tdep.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index b718e4c..12ad9c5 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -614,6 +614,26 @@ sparc_pop_frame ()
read_pc ()));
}
+/* On the Sun 4 under SunOS, the compile will leave a fake insn which
+ encodes the structure size being returned. If we detect such
+ a fake insn, step past it. */
+
+CORE_ADDR
+sparc_pc_adjust(pc)
+ CORE_ADDR pc;
+{
+ long insn;
+ int err;
+
+ err = target_read_memory (pc + 8, (char *)&insn, sizeof(long));
+ SWAP_TARGET_AND_HOST (&insn, sizeof(long));
+ if ((err == 0) && (insn & 0xfffffe00) == 0)
+ return pc+12;
+ else
+ return pc+8;
+}
+
+
/* Structure of SPARC extended floating point numbers.
This information is not currently used by GDB, since no current SPARC
implementations support extended float. */