This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Enhance backtrace for microsoft system DLL calls
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: muller at ics dot u-strasbg dot fr
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 10 Dec 2007 19:54:09 +0100 (CET)
- Subject: Re: [RFC] Enhance backtrace for microsoft system DLL calls
- References: <000001c83b4a$573b4560$05b1d020$@u-strasbg.fr>
> 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
>
>
>