Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: gdb-patches@sourceware.org, Gary Benson <gbenson@redhat.com>
Subject: Re: [RFA] Improved linker-debugger interface
Date: Sat, 05 May 2012 06:03:00 -0000	[thread overview]
Message-ID: <20120505060312.GA7019@host2.jankratochvil.net> (raw)
In-Reply-To: <m37gwrs0m6.fsf@redhat.com>

On Sat, 05 May 2012 06:38:57 +0200, Sergio Durigan Junior wrote:
> On Friday, May 04 2012, Gary Benson wrote:
> > +struct probe_info
> > +  {
> > +    /* The name of the probe.  */
> > +    const char *name;
> > +
> > +    /* Nonzero if this probe must be stopped at even when
> > +       stop-on-solib-events is off.  */
> > +    int mandatory;
> 
> I don't know what others think about it, but the `mandatory' flag can be
> a bitfield, like this:
> 
>   int mandatory_p : 1;

In such case 'unsigned mandatory_p : 1' as otherwise its true value is -1.


> Also, since this is a predicate to indicate whether or not something
> happens, it's better to put the `_p' suffix.

'_p' as a predicate usually flags validity of some other field (such as
a hypothetical field 'mandatory' in this case).  I do not see the 'predicate'
need to be valid here, this is normal flag.


> > +static const struct probe_info probe_info[] =
> > +{
> > +  {"rtld_init_start", 0},
> > +  {"rtld_init_complete", 1},
> > +  {"rtld_map_start", 0},
> > +  {"rtld_reloc_complete", 1},
> > +  {"rtld_unmap_start", 0},
> > +  {"rtld_unmap_complete", 1},
> > +};
[...]
> The brackets should be indented like this:
> 
> struct foo bar[] =
>   {
>     { "bla", 0 },
>     ...
>   };

No - see GNU Coding Standards, there is an example for it.  Current GDB
codebase is not always correct in this regard.


> Also, I've been thinking about creating some predicate that would
> confirm if some probe is of certain type of not.

There is that
	gdb_assert (probe_generic->pops == &stap_probe_ops);

for this purpose.


(This is not a Gary's patch review yet.)


Thanks,
Jan


  reply	other threads:[~2012-05-05  6:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-04 15:22 Gary Benson
2012-05-05  4:39 ` Sergio Durigan Junior
2012-05-05  6:03   ` Jan Kratochvil [this message]
2012-05-05  6:11     ` Sergio Durigan Junior
2012-05-05  6:23       ` Jan Kratochvil
2012-05-07 16:57 ` Jan Kratochvil
2012-05-07 17:51   ` Sergio Durigan Junior
2012-05-07 20:27   ` Tom Tromey
2012-05-07 21:32     ` Mark Kettenis
2012-05-07 21:44       ` Jan Kratochvil
2012-05-08  5:45       ` Sergio Durigan Junior
2012-05-08 13:37       ` Tom Tromey
2012-05-09  8:12         ` Mark Kettenis
2012-05-09 15:57           ` Tom Tromey

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=20120505060312.GA7019@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gbenson@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@redhat.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