Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: guitton@adacore.com
Cc: mark.kettenis@xs4all.nl, gdb-patches@sourceware.org
Subject: Re: [RFA] Support for x86 on-stack trampolines
Date: Wed, 04 May 2011 15:31:00 -0000	[thread overview]
Message-ID: <201105041530.p44FUMhC015899@glazunov.sibelius.xs4all.nl> (raw)
In-Reply-To: <20110504151723.GB64873@adacore.com> (message from Jerome Guitton	on Wed, 4 May 2011 17:17:23 +0200)

> Date: Wed, 4 May 2011 17:17:23 +0200
> From: Jerome Guitton <guitton@adacore.com>
> 
> 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).

Ah, it looks like I created some confusement.  It is i386_find_insn()
as a name that I object to; simply name that funcion i386_match_insn()
and give it the old comment for i386_match_insn(), and I'm happy.
That way you don't have to adjust any of its callers.

i386_match_pattern() is fine as the name for the broken out code that
matches only a single pattern.

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

Yeah, it's not clear what's more efficient.  But consistency is always
good.

Cheers,

Mark


  reply	other threads:[~2011-05-04 15:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-04  0:21 Jerome Guitton
2011-05-04  8:55 ` Pedro Alves
2011-05-04 14:52   ` Jerome Guitton
2011-05-04 10:20 ` Mark Kettenis
2011-05-04 15:17   ` Jerome Guitton
2011-05-04 15:31     ` Mark Kettenis [this message]
2011-05-05 15:10       ` Jerome Guitton
2011-05-05 15:18         ` Mark Kettenis
2011-05-05 16:03           ` Jerome Guitton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201105041530.p44FUMhC015899@glazunov.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=gdb-patches@sourceware.org \
    --cc=guitton@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox