From: "Abid, Hafiz" <Hafiz_Abid@mentor.com>
To: Aaron Gamble <agamble@google.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [patch] info threads sort by name and name regex matching
Date: Wed, 22 Aug 2012 10:06:00 -0000 [thread overview]
Message-ID: <EB3B29AD43CA924DA27099BC851923762A33CA@EU-MBX-03.mgc.mentorg.com> (raw)
In-Reply-To: <CAHX8C+KCFAa0=Cgh1hfZuTp_QqQtmq4ASKRKoktpPue1QQ-Heg@mail.gmail.com>
>+set NR_THREADS 4
>+
>+standard_testfile
>+
>+# Start with a fresh gdb.
>+gdb_exit
>+gdb_start
I think you don't need gdb_exit and gdb_start when you are doing clean_restart below.
>+
>+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "additional_flags=-DNR_THREADS=$NR_THREADS"]] != "" } {
>+ return -1
>+}
>+
>+clean_restart ${binfile}
>+
>+if { ![runto_main] } {
>+ fail "Can't run to main"
>+ return 0
>+}
>+
Regards,
Abid
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Aaron Gamble
> Sent: Tuesday, August 21, 2012 10:19 PM
> To: gdb-patches@sourceware.org
> Subject: [patch] info threads sort by name and name regex matching
>
> Hello all,
>
> Here is a patch for adding sorting by name in 'info threads' and regex
> pattern matching of thread names for filtering threads.
>
> With this patch sorting by name will happen always. (Perhaps a switch
> to enable sorting would be better?)
>
> Regex matching is specified by doing 'info threads r<regex>'. This is
> not ambiguous with previous behavior where parameters to info threads
> were only numbers. (spaces between 'r' and <regex> are ignored)
>
> e.g. info threads r ^name_prefix
>
> Regards,
>
> gdb/ChangeLog:
> * gdbthread.h: Add char *cached_name to struct thread_info for use
> when sorting.
> * thread.c: #include <stdlib.h>.
> (thread_list_size): New global.
> (init_Thread_list): Initialize it.
> (free_thread): Decrement it.
> (new_thread): Increment it.
> (print_thread_filter_check): New function.
> (print_thread_sort_cmp): New function.
> (print_thread_info_single): New function.
> (print_thread_info): Sort threads by name and filter by regex
> match.
>
> testsuite/
> * gdb.threads/Makefile.in (EXECUTABLES): Add info-thread-sort-
> regex.
> * gdb.threads/info-thread-sort-regex.c: New file.
> * gdb.threads/info-thread-sort-regex.exp: New file.
>
> doc/
> * gdb.texinfo (Threads): Add information about sorting and regex
> parameters.
next prev parent reply other threads:[~2012-08-22 10:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 21:19 Aaron Gamble
2012-08-22 10:06 ` Abid, Hafiz [this message]
2012-08-22 17:15 ` Eli Zaretskii
2012-08-22 18:52 ` Tom Tromey
2012-08-22 22:37 ` Aaron Gamble
2012-08-22 23:30 ` Sergio Durigan Junior
2012-08-23 16:00 ` Tom Tromey
2012-08-24 1:09 ` Aaron Gamble
2012-08-24 17:58 ` Tom Tromey
2012-08-24 22:23 ` Aaron Gamble
2012-08-24 22:32 ` Sergio Durigan Junior
2012-08-24 23:21 ` Aaron Gamble
2012-08-24 23:28 ` Aaron Gamble
2012-08-25 3:12 ` Sergio Durigan Junior
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=EB3B29AD43CA924DA27099BC851923762A33CA@EU-MBX-03.mgc.mentorg.com \
--to=hafiz_abid@mentor.com \
--cc=agamble@google.com \
--cc=gdb-patches@sourceware.org \
/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