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: "Pedro Alves" <pedro_alves at portugalmail dot pt>
- To: "Pierre Muller" <muller at ics dot u-strasbg dot fr>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 10 Dec 2007 18:08:30 +0000
- Subject: Re: [RFC] Enhance backtrace for microsoft system DLL calls
- References: <000001c83b4a$573b4560$05b1d020$@u-strasbg.fr>
> @@ -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
>
>
>
Oh, I forgot to ask on the previous mail -- Is there a reason you don't
read both bytes in one go?
/* small hot patching description here. */
gdb_byte hot_patch[2] = { 0x8b, 0xff };
read_memory_nobpt (pc, buf, 2);
if (memcmp (hot_patch, buf) == 0)
pc += 2;
read_memory_nobpt (pc, &op, 1);
if (op == 0x55) /* pushl %ebp */
... and since this isn't really frame setup code, it
could be moved into a separate function called from
i386_analyze_prologue, probably even before
i386_follow_jump, as this is put really at the
start of the function </end nit>
--
Pedro Alves