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]

Re: [RFA] x86 - jump instruction after the prologue


   Date: Tue, 27 Apr 2004 18:37:25 +0200
   From: Jerome Guitton <guitton@act-europe.fr>

   Ping? Still waiting for approval...

Sorry about that.  I've reviewed your patch.  I've tweaked the comment
a bit and checked in the attached.

Thanks,

Mark


Index: ChangeLog
from  Jerome Guitton  <guitton@gnat.com>
	Mark Kettenis  <kettenis@gnu.org>

	* i386-tdep.c (i386_skip_prologue): follow the last jump only if
	the function begins with a branch instruction.

Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.188
diff -u -p -r1.188 i386-tdep.c
--- i386-tdep.c 29 Apr 2004 16:13:21 -0000 1.188
+++ i386-tdep.c 29 Apr 2004 16:20:47 -0000
@@ -750,7 +750,13 @@ i386_skip_prologue (CORE_ADDR start_pc)
 	}
     }
 
-  return i386_follow_jump (pc);
+  /* If the function starts with a branch (to startup code at the end)
+     the last instruction should bring us back to the first
+     instruction of the real code.  */
+  if (i386_follow_jump (start_pc) != start_pc)
+    pc = i386_follow_jump (pc);
+
+  return pc;
 }
 
 /* This function is 64-bit safe.  */


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