[PATCH] h8300-tdep.c: Fix saved regs location

Corinna Vinschen vinschen@redhat.com
Fri Sep 20 07:26:00 GMT 2002


Hi,

another obvious one.  Especially the usage of the local var 'r' is very
interesting here and it's weird that it didn't result in FAILs in the
testsuite even though it's totally wrong.

Corinna

	* h8300-tdep.c (h8300_examine_prologue): Match saved regs location
        with what gcc thinks is correct.

Index: h8300-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/h8300-tdep.c,v
retrieving revision 1.20
diff -u -p -r1.20 h8300-tdep.c
--- h8300-tdep.c        20 Sep 2002 12:08:37 -0000      1.20
+++ h8300-tdep.c        20 Sep 2002 14:20:36 -0000
@@ -412,10 +412,10 @@ h8300_examine_prologue (register CORE_AD
 
       if (IS_PUSH (insn_word))
        {
+         auto_depth += 2 + adjust;
+         fsr[insn_word & 0x7] = after_prolog_fp - auto_depth;
          ip = next_ip;
          next_ip = h8300_next_prologue_insn (ip, limit, &insn_word);
-         fsr[r] = after_prolog_fp + auto_depth;
-         auto_depth += 2 + adjust;
          continue;
        }
 
@@ -431,8 +431,8 @@ h8300_examine_prologue (register CORE_AD
 
          for (i = start; i < start + count; i++)
            {
-             fsr[i] = after_prolog_fp + auto_depth;
              auto_depth += 4;
+             fsr[i] = after_prolog_fp - auto_depth;
            }
        }
       break;

-- 
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
mailto:vinschen@redhat.com



More information about the Gdb-patches mailing list