aboutsummaryrefslogtreecommitdiff
path: root/gdb/mips-tdep.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2007-07-20 17:29:59 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2007-07-20 17:29:59 +0000
commit193774b320954b04d92a71f3b9ce329c349dd505 (patch)
treea6aa790377796e6b7a9abe8c2af3ad4eaaef2c8a /gdb/mips-tdep.c
parentce1f96de2eb40b231d2c8a1e50f64f5000b7cde8 (diff)
downloadgdb-193774b320954b04d92a71f3b9ce329c349dd505.zip
gdb-193774b320954b04d92a71f3b9ce329c349dd505.tar.gz
gdb-193774b320954b04d92a71f3b9ce329c349dd505.tar.bz2
* mips-tdep.c (heuristic_proc_start): Add more MIPS16 function
prologue instructions.
Diffstat (limited to 'gdb/mips-tdep.c')
-rw-r--r--gdb/mips-tdep.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index b4153fd..531d936 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -2396,15 +2396,28 @@ heuristic-fence-post' command.\n", paddr_nz (pc), paddr_nz (pc));
/* On MIPS16, any one of the following is likely to be the
start of a function:
+ extend save
+ save
entry
addiu sp,-n
daddiu sp,-n
extend -n followed by 'addiu sp,+n' or 'daddiu sp,+n' */
inst = mips_fetch_instruction (start_pc);
- if (((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700) /* entry */
- || (inst & 0xff80) == 0x6380 /* addiu sp,-n */
- || (inst & 0xff80) == 0xfb80 /* daddiu sp,-n */
- || ((inst & 0xf810) == 0xf010 && seen_adjsp)) /* extend -n */
+ if ((inst & 0xff80) == 0x6480) /* save */
+ {
+ if (start_pc - instlen >= fence)
+ {
+ inst = mips_fetch_instruction (start_pc - instlen);
+ if ((inst & 0xf800) == 0xf000) /* extend */
+ start_pc -= instlen;
+ }
+ break;
+ }
+ else if (((inst & 0xf81f) == 0xe809
+ && (inst & 0x700) != 0x700) /* entry */
+ || (inst & 0xff80) == 0x6380 /* addiu sp,-n */
+ || (inst & 0xff80) == 0xfb80 /* daddiu sp,-n */
+ || ((inst & 0xf810) == 0xf010 && seen_adjsp)) /* extend -n */
break;
else if ((inst & 0xff00) == 0x6300 /* addiu sp */
|| (inst & 0xff00) == 0xfb00) /* daddiu sp */