This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Add missing opcodes in i386 prologue analyzer


Caught this on i386-pc-solaris2.9.  Apparently the Sun assembler uses
an alternate encoding for `xorl'.

Committed.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* i386-tdep.c (i386_analyze_frame_setup): Add missing encodings
	for `subl' and `xorl' instructions.

Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.177
diff -u -p -r1.177 i386-tdep.c
--- i386-tdep.c 20 Nov 2003 22:37:50 -0000 1.177
+++ i386-tdep.c 14 Dec 2003 10:55:46 -0000
@@ -508,9 +508,13 @@ i386_analyze_frame_setup (CORE_ADDR pc, 
 	    subl %edx, %edx
 	    subl %eax, %eax
 
+	 Because of the symmetry, there are actually two ways to
+	 encode these instructions; with opcode bytes 0x29 and 0x2b
+	 for `subl' and opcode bytes 0x31 and 0x33 for `xorl'.
+
 	 Make sure we only skip these instructions if we later see the
 	 `movl %esp, %ebp' that actually sets up the frame.  */
-      while (op == 0x29 || op == 0x31)
+      while (op == 0x29 || op == 0x2b || op == 0x31 || op == 0x33)
 	{
 	  op = read_memory_unsigned_integer (pc + skip + 2, 1);
 	  switch (op)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]