This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
mn10300: skip movm checks if PC is on movm
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: 02 Jun 2004 18:50:43 -0300
- Subject: mn10300: skip movm checks if PC is on movm
- Organization: Red Hat Global Engineering Services Compiler Team
When we attempt to set up a frame while PC is on the initial movm
instruction of a function, and then read the saved PC from it, we get
the wrong value, because we fail to disregard the offsets introduced
by movm, that hasn't run yet. This patch fixes this problem. Ok to
install?
Index: gdb/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* mn10300-tdep.c (mn10300_analyze_prologue): Don't compute saved
regs if PC is on movm.
Index: gdb/mn10300-tdep.c
===================================================================
RCS file: /cvs/uberbaum/gdb/mn10300-tdep.c,v
retrieving revision 1.105
diff -u -p -r1.105 mn10300-tdep.c
--- gdb/mn10300-tdep.c 8 May 2004 22:19:30 -0000 1.105
+++ gdb/mn10300-tdep.c 2 Jun 2004 21:46:41 -0000
@@ -457,8 +457,8 @@ mn10300_analyze_prologue (struct frame_i
addr = func_addr;
/* Suck in two bytes. */
- status = read_memory_nobpt (addr, buf, 2);
- if (status != 0)
+ if (addr + 2 >= stop
+ || (status = read_memory_nobpt (addr, buf, 2)) != 0)
{
fix_frame_pointer (fi, 0);
return addr;
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}