Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Michael Snyder <msnyder@vmware.com>
Cc: "gdb-patches\@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFC] info threads takes an argument
Date: Tue, 15 Feb 2011 19:58:00 -0000	[thread overview]
Message-ID: <m3fwrp859h.fsf@fleche.redhat.com> (raw)
In-Reply-To: <4D598863.1030507@vmware.com> (Michael Snyder's message of "Mon,	14 Feb 2011 11:54:11 -0800")

>>>>> "Michael" == Michael Snyder <msnyder@vmware.com> writes:

Michael>  static void
Michael>  info_threads_command (char *arg, int from_tty)
[...]
Michael> +      int tmp_tid
Michael> +	= (int) parse_and_eval_long (scan_expression_with_cleanup (&arg,
Michael> +								   NULL));

parse_and_eval_long means that expressions will be accepted here.  But
then I think it will do the wrong thing if you actually pass multiple
IDs -- I think it will syntax error instead of parsing each separately.

I'd suggest just parsing out an integer and using atoi or the like.
(I'm not sure if there is already a convenience function for this -- I'm
always a little surprised at how few argument-parsing convenience
functions there are for the CLI.)


I like "thread find", it seems handy.

Matching both the ID and the target PID means that using numbers here
will be over-eager.  Why match the ID?  "info thread ID" seems good
enough.

Michael> +  add_info ("threads", info_threads_command, 
Michael> +	    _("Display currently known threads.\n\
Michael> +Usage: info threads [ID [ID]...]\n\

I think it is more typical to write this as:

Usage: info threads [ID]...

Michael> +  add_cmd ("find", no_class, thread_find_command, _("\
Michael> +Find thread ids with a name, target pid, or extra info matching REGEXP."),
Michael> +	   &thread_cmd_list);

How about a Usage here, too?  Like:

Find threads that match a regular expression.
Usage: thread find REGEXP
This command will display all the threads whose name, target PID, or
extra info matches REGEXP.

Michael> +* GDB has a new command: "thread find [regexp]".

I'd make regexp all upper-case, in keeping with a GNU documentation
convention.

Tom


  parent reply	other threads:[~2011-02-15 19:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-11  1:52 Michael Snyder
2011-02-11  6:09 ` Joel Brobecker
2011-02-11 19:23   ` Michael Snyder
2011-02-11 21:14     ` Tom Tromey
     [not found]       ` <4D55B1ED.5020808@vmware.com>
     [not found]         ` <m3k4h2e6xu.fsf@fleche.redhat.com>
2011-02-14 20:03           ` Michael Snyder
2011-02-14 20:40             ` Eli Zaretskii
2011-02-15 19:58             ` Tom Tromey [this message]
2011-02-15 21:44               ` Michael Snyder
2011-02-16 11:58                 ` Pedro Alves
2011-02-16 18:47                   ` Michael Snyder
2011-02-17 16:57                     ` Jan Kratochvil
2011-02-17 19:12                       ` Michael Snyder
2011-02-17 20:11                       ` Michael Snyder
2011-02-17 21:22                         ` Jan Kratochvil
2011-02-21 18:45                 ` 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=m3fwrp859h.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.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