From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8797 invoked by alias); 24 Aug 2009 10:55:34 -0000 Received: (qmail 8785 invoked by uid 22791); 24 Aug 2009 10:55:33 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_37,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Aug 2009 10:55:25 +0000 Received: (qmail 7526 invoked from network); 24 Aug 2009 10:55:17 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 24 Aug 2009 10:55:17 -0000 From: Pedro Alves To: Stan Shebs Subject: Re: [patch/doc] Tweak "info inferiors" output. Date: Mon, 24 Aug 2009 11:15:00 -0000 User-Agent: KMail/1.9.10 Cc: Eli Zaretskii , tromey@redhat.com, gdb-patches@sourceware.org References: <200908141646.01031.pedro@codesourcery.com> <83eirai8et.fsf@gnu.org> <4A89B61F.5090307@codesourcery.com> In-Reply-To: <4A89B61F.5090307@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200908241155.17035.pedro@codesourcery.com> X-IsSubscribed: yes 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: 2009-08/txt/msg00384.txt.bz2 On Monday 17 August 2009 20:57:19, Stan Shebs wrote: > Eli Zaretskii wrote: > >> From: Tom Tromey > >> Cc: Pedro Alves , gdb-patches@sourceware.org > >> Date: Mon, 17 Aug 2009 11:52:46 -0600 > >> > >> > >>>>>>> "Eli" == Eli Zaretskii writes: > >>>>>>> > >> Eli> Let me turn the table around and ask you how about if we remove the > >> Eli> column headers from "info inferiors" display, like with "info > >> Eli> threads"? > >> > >> Please don't. The column headers provide actually useful information to > >> the user. It is a bug that info threads doesn't have them. > >> > > > > Fair enough, but then please suggest useful headers for these two > > displays. > > > I think "ID" for the first column is fine, and maybe just "Description" > for the second. I don't think we require targets to promise uniqueness > for their own info, and the column headers are just hints, not complete > documentation on what one might expect to see in the column; so it > should be something a little vague and generic. > 'Description' works for me. Thanks. > We alway change it later if user feedback is negative. Indeed. (gdb) info inferiors Num Description * 1 process 30154 2 process 10992 On Monday 17 August 2009 18:44:42, Eli Zaretskii wrote: > > +An asterisk @samp{*} to the left of the @value{GDBN} inferior number > > That's really a nit, but if we ever get GDB speak other languages, > that ``to the left of'' will be incorrect with some languages. Maybe > ``preceding the @value{GDBN} inferior number'' is better. Changed. Is this OK then? -- Pedro Alves 2009-08-24 Pedro Alves * inferior.c (print_inferior): Align columns left. Remove header for the the "current" column. Rename column "Id" to "Num". Rename column "PID" to "Description". Print if there's no selected inferior. 2009-08-24 Pedro Alves * gdb.texinfo (Debugging Multiple Inferiors): Add "info inferiors" small example, and describe its columns. Replace "inferior-id" by "infno" throughout. --- gdb/doc/gdb.texinfo | 47 +++++++++++++++++++++++++++++++++++------------ gdb/inferior.c | 16 +++++++++++----- 2 files changed, 46 insertions(+), 17 deletions(-) Index: src/gdb/inferior.c =================================================================== --- src.orig/gdb/inferior.c 2009-08-24 11:28:23.000000000 +0100 +++ src/gdb/inferior.c 2009-08-24 11:34:43.000000000 +0100 @@ -324,9 +324,9 @@ print_inferior (struct ui_out *uiout, in old_chain = make_cleanup_ui_out_table_begin_end (uiout, 3, inf_count, "inferiors"); - ui_out_table_header (uiout, 3, ui_right, "current", "Cur"); - ui_out_table_header (uiout, 4, ui_right, "id", "Id"); - ui_out_table_header (uiout, 7, ui_right, "target-id", "PID"); + ui_out_table_header (uiout, 1, ui_left, "current", ""); + ui_out_table_header (uiout, 4, ui_left, "number", "Num"); + ui_out_table_header (uiout, 17, ui_left, "target-id", "Description"); ui_out_table_body (uiout); for (inf = inferior_list; inf; inf = inf->next) @@ -343,13 +343,19 @@ print_inferior (struct ui_out *uiout, in else ui_out_field_skip (uiout, "current"); - ui_out_field_int (uiout, "id", inf->num); - ui_out_field_int (uiout, "target-id", inf->pid); + ui_out_field_int (uiout, "number", inf->num); + ui_out_field_string (uiout, "target-id", + target_pid_to_str (pid_to_ptid (inf->pid))); ui_out_text (uiout, "\n"); do_cleanups (chain2); } + if (inferior_list + && ptid_equal (inferior_ptid, null_ptid)) + ui_out_message (uiout, 0, "\n\ +No selected inferior/thread. See `help thread' or `help inferior'.\n"); + do_cleanups (old_chain); } Index: src/gdb/doc/gdb.texinfo =================================================================== --- src.orig/gdb/doc/gdb.texinfo 2009-08-24 11:29:16.000000000 +0100 +++ src/gdb/doc/gdb.texinfo 2009-08-24 11:44:04.000000000 +0100 @@ -2375,17 +2375,40 @@ To find out what inferiors exist at any @kindex info inferiors @item info inferiors Print a list of all inferiors currently being managed by @value{GDBN}. + +@value{GDBN} displays for each inferior (in this order): + +@enumerate +@item +the inferior number assigned by @value{GDBN} + +@item +the target system's inferior identifier (@var{systag}) +@end enumerate + +@noindent +An asterisk @samp{*} preceding the @value{GDBN} inferior number +indicates the current inferior. + +For example, @end table +@c end table here to get a little more width for example + +@smallexample +(@value{GDBP}) info inferiors + Num Description +* 1 process 2307 + 2 process 3401 +@end smallexample To switch focus between inferiors, use the @code{inferior} command: @table @code -@kindex inferior @var{inferior-id} -@item inferior @var{inferior-id} -Make inferior number @var{inferior-id} the current inferior. The -argument @var{inferior-id} is the internal inferior number assigned by -@value{GDBN}, as shown in the first field of the @samp{info inferiors} -display. +@kindex inferior @var{infno} +@item inferior @var{infno} +Make inferior number @var{infno} the current inferior. The argument +@var{infno} is the inferior number assigned by @value{GDBN}, as shown +in the first field of the @samp{info inferiors} display. @end table To quit debugging one of the inferiors, you can either detach from it @@ -2393,15 +2416,15 @@ by using the @w{@code{detach inferior}} independently), or kill it using the @w{@code{kill inferior}} command: @table @code -@kindex detach inferior @var{inferior-id} -@item detach inferior @var{inferior-id} +@kindex detach inferior @var{infno} +@item detach inferior @var{infno} Detach from the inferior identified by @value{GDBN} inferior number -@var{inferior-id}, and remove it from the inferior list. +@var{infno}, and remove it from the inferior list. -@kindex kill inferior @var{inferior-id} -@item kill inferior @var{inferior-id} +@kindex kill inferior @var{infno} +@item kill inferior @var{infno} Kill the inferior identified by @value{GDBN} inferior number -@var{inferior-id}, and remove it from the inferior list. +@var{infno}, and remove it from the inferior list. @end table To be notified when inferiors are started or exit under @value{GDBN}'s