]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* mips-tdep.c (heuristic_proc_start): Add more MIPS16 function
authorMaciej W. Rozycki <macro@linux-mips.org>
Fri, 20 Jul 2007 17:29:59 +0000 (17:29 +0000)
committerMaciej W. Rozycki <macro@linux-mips.org>
Fri, 20 Jul 2007 17:29:59 +0000 (17:29 +0000)
prologue instructions.

gdb/ChangeLog
gdb/mips-tdep.c

index aaac11dbf89f756589e0178e295a515679c724dc..60f4e9af76739ce258d5f805de850cc61c87a8cb 100644 (file)
@@ -1,3 +1,8 @@
+2004-07-20  Chris Dearman  <chris@mips.com>
+
+       * mips-tdep.c (heuristic_proc_start): Add more MIPS16 function
+       prologue instructions.
+
 2007-07-20  Maciej W. Rozycki  <macro@mips.com>
 
        * mips-tdep.c (mips_next_pc): Use is_mips16_addr() instead of
index b4153fd0fdf3f7898e1877dc2ff6bcf1f0f3af1d..531d93610bf5cd872ecc58104cc76022d2e5a915 100644 (file)
@@ -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 */