Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* mn10300: skip movm checks if PC is on movm
@ 2004-06-02 21:50 Alexandre Oliva
  2004-06-07 15:24 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Oliva @ 2004-06-02 21:50 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 284 bytes --]

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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: mn10300-gdb-pc-on-movm.patch --]
[-- Type: text/x-patch, Size: 783 bytes --]

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;

[-- Attachment #3: Type: text/plain, Size: 188 bytes --]


-- 
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}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-06-07 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-02 21:50 mn10300: skip movm checks if PC is on movm Alexandre Oliva
2004-06-07 15:24 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox