This is the mail archive of the gdb-patches@sourceware.org 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: [RFC] Enhance backtrace for microsoft system DLL calls


> From: "Pierre Muller" <muller@ics.u-strasbg.fr>
> Date: Mon, 10 Dec 2007 17:33:05 +0100
> 
>   The main question is whether this patch is acceptable
> for gdb as it is in a i386 common file, while 
> it most probably only applies to MS operating system.

I have no problem with adding this to the generic i386, but I'd prefer
to put this code in a seperate function called
i386_skip_nops(CORE_ADDR pc); And call that function from
i386_analyze_prologue(), instead of adding this code to
i386_analyze_frame_setup().

> Pierre Muller
> 
> ChangeLog entry:
> 
> 2007-12-10  Pierre Muller  <muller@ics.u-strasbg.fr>
> 
> 	* i386-tdep.c (i386_analyze_frame_setup): Ignore `mov %edi,%edi'
> instruction
> 	used at entry of some operating system calls.
> 
> 	
> 
> 
> Index: gdb/i386-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/i386-tdep.c,v
> retrieving revision 1.246
> diff -u -p -r1.246 i386-tdep.c
> --- gdb/i386-tdep.c     6 Dec 2007 16:32:59 -0000       1.246
> +++ gdb/i386-tdep.c     10 Dec 2007 16:22:21 -0000
> @@ -650,6 +650,17 @@ i386_analyze_frame_setup (CORE_ADDR pc,
> 
>    read_memory_nobpt (pc, &op, 1);
> 
> +  if (op == 0x8b) /* Ignore no-op instruction `mov %edi, %edi' */
> +    {
> +      read_memory_nobpt (pc + 1, &op, 1);
> +      if (op == 0xff)
> +       {
> +         pc += 2;
> +         read_memory_nobpt (pc, &op, 1);
> +       }
> +      else
> +       op = 0x8b;
> +    }
>    if (op == 0x55)              /* pushl %ebp */
>      {
>        /* Take into account that we've executed the `pushl %ebp' that
> 
> 
> 


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