This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] info threads sort by name and name regex matching


Here is an updated patch. I have changed the options to be as follows.

'info threads [-a] [ id ... | -r regex ]'

-a enables sorting by thread name
-r regex matches regex with thread names.

I have not changed the threads array to a VEC as of yet. At this point
it seems like more trouble than it's worth. But I suppose it could be
done if people think it's necessary.

On Thu, Aug 23, 2012 at 9:00 AM, Tom Tromey <tromey@redhat.com> wrote:
>
> Sergio> Why not `-r regex'?  I think it would be more clear.
>
> Me too.
>
> Sergio> Other commands (`sharedlibrary', `info variables', etc) take a regex as
> Sergio> their first argument, without requiring a modifier like `-r'.  If the
> Sergio> "pipe" patch were already in, this alphabetical sorting would not be
> Sergio> needed...  Anyway, just thinking here.
>
> Piping is nice but I think it is also good to have options for common
> cases.
>
> Sergio> I guess Tom did not suggest this because of performance per se, but
> Sergio> rather because if you have to make a list in GDB then it is already a
> Sergio> convention to use VEC for these things.
>
> Yeah.  I thought it would make the code simpler.
>
> Tom

Attachment: thread_sorting_regex_with-a-r-options.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]