Re: [RFA] Support for x86 on-stack trampolines

Jerome Guitton
2011-05-04T15:17:41Z

Mark Kettenis (mark.kettenis@xs4all.nl):

> Hmm, I think the new name for i386_match_insn is confusing. Also, it
> isn't really necessary to change its prototype. It returns a pointer
> to the matched pattern, so some trivial pointer arithmetic will give
> you the index into the array of patterns.

OK, I don't mind pointer arithmetics. I'm not sure about the name; I haven't
much imagination for names, I must say. Any suggestion?

The thing that I would like to make clear is that this new function is
different from i386_find_insn: it only checks one instruction
pattern. It is used by both i386_find_insn (which tries to match one
instruction against any pattern in a set) and by i386_match_insn_block
(which checks that a given PC points inside a block of instruction
matching an ordered list of patterns).

> Is checking the instructions before checking the name the most
> efficient way of doing this?

I guess that it depends (big symbol tables vs low connection to
target). In any case, to be consistent with the other sniffers, I
should probably check the name first.

Otherwise, I have taken the rest of your comments into account; and I
will send an updated patch as soon as we have some proper name for
i386_match_insn. Thank you for your review!