aboutsummaryrefslogtreecommitdiff
path: root/gdb/ns32k-tdep.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>1999-05-05 14:45:51 +0000
committerStan Shebs <shebs@codesourcery.com>1999-05-05 14:45:51 +0000
commitb83266a0e1813b7f4891d5d6b0ed6b7302a3fe98 (patch)
treec59a94fbe917e0839329b872139198c2a7a05ab1 /gdb/ns32k-tdep.c
parente1346c8d0969dad58ddc13c9c741cb0f4e6345a5 (diff)
downloadgdb-b83266a0e1813b7f4891d5d6b0ed6b7302a3fe98.zip
gdb-b83266a0e1813b7f4891d5d6b0ed6b7302a3fe98.tar.gz
gdb-b83266a0e1813b7f4891d5d6b0ed6b7302a3fe98.tar.bz2
import gdb-19990504 snapshot
Diffstat (limited to 'gdb/ns32k-tdep.c')
-rw-r--r--gdb/ns32k-tdep.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c
index 3edb7f5..775e8af 100644
--- a/gdb/ns32k-tdep.c
+++ b/gdb/ns32k-tdep.c
@@ -26,6 +26,46 @@ _initialize_ns32k_tdep ()
tm_print_insn = print_insn_ns32k;
}
+/* Advance PC across any function entry prologue instructions
+ to reach some "real" code. */
+
+CORE_ADDR
+merlin_skip_prologue (pc)
+ CORE_ADDR pc;
+{
+ register int op = read_memory_integer (pc, 1);
+ if (op == 0x82)
+ {
+ op = read_memory_integer (pc+2,1);
+ if ((op & 0x80) == 0)
+ pc += 3;
+ else if ((op & 0xc0) == 0x80)
+ pc += 4;
+ else pc += 6;
+ }
+ return pc;
+}
+
+CORE_ADDR
+umax_skip_prologue (pc)
+ CORE_ADDR pc;
+{
+ register unsigned char op = read_memory_integer (pc, 1);
+ if (op == 0x82)
+ {
+ op = read_memory_integer (pc+2,1);
+ if ((op & 0x80) == 0)
+ pc += 3;
+ else if ((op & 0xc0) == 0x80)
+ pc += 4;
+ else
+ pc += 6;
+ }
+ return pc;
+}
+
+
+
sign_extend (value, bits)
{
value = value & ((1 << bits) - 1);