diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-03-01 00:15:07 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-03-01 00:15:07 +0000 |
commit | b5aff26825abb88d44d71392f759c0a89e979285 (patch) | |
tree | 45bbd9f8e1796481fc0b2a37c2f3c747d7488418 /gdb/mips-tdep.c | |
parent | 5143c305dd1b9c32cdee77c3d55e19c2e4c4d5ed (diff) | |
download | gdb-b5aff26825abb88d44d71392f759c0a89e979285.zip gdb-b5aff26825abb88d44d71392f759c0a89e979285.tar.gz gdb-b5aff26825abb88d44d71392f759c0a89e979285.tar.bz2 |
* mips-tdep.c (mips_step_skips_delay), config/mips/tm-mips.h
(STEP_SKIPS_DELAY): Added.
* infrun.c (proceed) [STEP_SKIPS_DELAY]: Check for a breakpoint in
the delay slot.
Diffstat (limited to 'gdb/mips-tdep.c')
-rw-r--r-- | gdb/mips-tdep.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 9a5d6b9..faaeb6e 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -32,9 +32,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "objfiles.h" #include "gdbtypes.h" -#if 0 #include "opcode/mips.h" -#endif #define VM_MIN_ADDRESS (unsigned)0x400000 @@ -921,8 +919,9 @@ mips_frame_num_args(fip) return -1; } -#if 0 /* Is this a branch with a delay slot? */ +static int is_delayed PARAMS ((unsigned long)); + static int is_delayed (insn) unsigned long insn; @@ -937,7 +936,18 @@ is_delayed (insn) | INSN_COND_BRANCH_DELAY | INSN_COND_BRANCH_LIKELY))); } -#endif + +int +mips_step_skips_delay (pc) + CORE_ADDR pc; +{ + char buf[4]; + + if (target_read_memory (pc, buf, 4) != 0) + /* If error reading memory, guess that it is not a delayed branch. */ + return 0; + return is_delayed (extract_unsigned_integer (buf, 4)); +} /* To skip prologues, I use this predicate. Returns either PC itself if the code at PC does not look like a function prologue; otherwise |