Re: PATCH: Also check for `movl %esp, %ebp' for x32

H.J. Lu
2012-04-17T14:33:52Z

On Tue, Apr 17, 2012 at 3:49 AM, Yao Qi <yao@codesourcery.com> wrote:
> On 04/11/2012 04:29 AM, H.J. Lu wrote:
>> -       && memcmp (buf, mov_rsp_rbp_2, 3) != 0)
>> +       && memcmp (buf, mov_rsp_rbp_2, 3) != 0
>> +       && (gdbarch_ptr_bit (gdbarch) == 64
>> +           || (memcmp (buf, mov_rsp_rbp_1 + 1, 2) != 0
>                                                  ^^
>> +               && memcmp (buf, mov_rsp_rbp_2 + 1, 2) != 0)))
>                                                     ^^
>
> I don't understand these two constants "2" here.  Does this mean the
> encoding of `movl %esp, %ebp' is { 0x48, 0x89 } and { 0x48, 0x8b }?  If

movl %esp, %ebp is 0x89, 0xe5 or 0x8b, 0xec.

> my understand is correct, why don't we define two new array
> "movl_esp_ebp_1" and "movl_esp_ebp_2"? which is easier to read/understand.
>

I don't see it is necessary since the difference of movl and movq is
the 0x48 REX prefix.

--
H.J.