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


> @@ -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


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