From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10573 invoked by alias); 22 Aug 2012 10:06:12 -0000 Received: (qmail 10535 invoked by uid 22791); 22 Aug 2012 10:06:10 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Aug 2012 10:05:29 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1T47oW-00052G-Ix from Hafiz_Abid@mentor.com ; Wed, 22 Aug 2012 03:05:28 -0700 Received: from SVR-IES-FEM-03.mgc.mentorg.com ([137.202.0.108]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 22 Aug 2012 03:05:28 -0700 Received: from EU-MBX-03.mgc.mentorg.com ([169.254.2.57]) by SVR-IES-FEM-03.mgc.mentorg.com ([169.254.100.23]) with mapi id 14.01.0289.001; Wed, 22 Aug 2012 11:02:55 +0100 From: "Abid, Hafiz" To: Aaron Gamble , "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 Message-ID: References: In-Reply-To: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00607.txt.bz2 >+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_rest= art below. >+ >+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" e= xecutable [list debug "additional_flags=3D-DNR_THREADS=3D$NR_THREADS"]] != =3D "" } { >+ 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 >=20 > Hello all, >=20 > Here is a patch for adding sorting by name in 'info threads' and regex > pattern matching of thread names for filtering threads. >=20 > With this patch sorting by name will happen always. (Perhaps a switch > to enable sorting would be better?) >=20 > Regex matching is specified by doing 'info threads r'. This is > not ambiguous with previous behavior where parameters to info threads > were only numbers. (spaces between 'r' and are ignored) >=20 > e.g. info threads r ^name_prefix >=20 > Regards, >=20 > gdb/ChangeLog: > * gdbthread.h: Add char *cached_name to struct thread_info for use > when sorting. > * thread.c: #include . > (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. >=20 > 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. >=20 > doc/ > * gdb.texinfo (Threads): Add information about sorting and regex > parameters.