[PATCH/i386newframe] Some i386-tdep.c fixes

Mark Kettenis kettenis@chello.nl
Sat May 10 21:58:00 GMT 2003


Just some things I spotted.

Checked in.

Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>
 
	* i386-tdep.c (i386_analyze_struct_return): Correctly indent
	comment.
	(i386_analyze_frame_setup): Report correct bug after matching
	initial `pushl %ebp'.

 
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.138.2.8
diff -u -p -r1.138.2.8 i386-tdep.c
--- i386-tdep.c 10 May 2003 15:18:06 -0000 1.138.2.8
+++ i386-tdep.c 10 May 2003 21:54:41 -0000
@@ -355,15 +355,14 @@ i386_analyze_struct_return (CORE_ADDR pc
 {
   /* Functions that return a structure or union start with:
 
-         popl %eax             0x58
-         xchgl %eax, (%esp)    0x87 0x04 0x24
-      or xchgl %eax, 0(%esp)   0x87 0x44 0x24 0x00
-
-      (the System V compiler puts out the second `xchg'
-      instruction, and the assembler doesn't try to optimize it, so
-      the 'sib' form gets generated).  This sequence is used to get
-      the address of the return buffer for a function that returns
-      a structure.  */
+        popl %eax             0x58
+        xchgl %eax, (%esp)    0x87 0x04 0x24
+     or xchgl %eax, 0(%esp)   0x87 0x44 0x24 0x00
+
+     (the System V compiler puts out the second `xchg' instruction,
+     and the assembler doesn't try to optimize it, so the 'sib' form
+     gets generated).  This sequence is used to get the address of the
+     return buffer for a function that returns a structure.  */
   static unsigned char proto1[3] = { 0x87, 0x04, 0x24 };
   static unsigned char proto2[4] = { 0x87, 0x44, 0x24, 0x00 };
   unsigned char buf[4];
@@ -473,14 +472,14 @@ i386_analyze_frame_setup (CORE_ADDR pc, 
 	{
 	case 0x8b:
 	  if (read_memory_unsigned_integer (pc + 2, 1) != 0xec)
-	    return pc;
+	    return pc + 1;
 	  break;
 	case 0x89:
 	  if (read_memory_unsigned_integer (pc + 2, 1) != 0xe5)
-	    return pc;
+	    return pc + 1;
 	  break;
 	default:
-	  return pc;
+	  return pc + 1;
 	}
 
       /* OK, we actually have a frame.  We just don't know how large it is



More information about the Gdb-patches mailing list