* [patch/doc] Tweak "info inferiors" output.
@ 2009-08-14 16:22 Pedro Alves
2009-08-14 17:38 ` Tom Tromey
2009-08-14 18:30 ` Eli Zaretskii
0 siblings, 2 replies; 14+ messages in thread
From: Pedro Alves @ 2009-08-14 16:22 UTC (permalink / raw)
To: gdb-patches
Here's a tiny piece I'm cutting out of the pending multi-exec patch.
(Tromey, we talked a bit about this bit at the end of
http://sourceware.org/ml/gdb-patches/2009-06/msg00668.html)
This tweaks the "info inferiors" output to align columns left, removes
the "Cur" header, and makes the command query the target how to
print a process id (or better, the inferior's target side ID, there
may be no concept of processes on the other end at all).
----------------------------------------------------------
Native:
Before After
(gdb) info inferiors (gdb) info inferiors
Cur Id PID Id Target ID
* 1 3099 * 1 process 3099
----------------------------------------------------------
Remote:
Before After
(gdb) info inferiors (gdb) info inferiors
Cur Id PID Id Target ID
* 1 42000 * 1 Remote target
(gdb)
(42000 is the magic pid that is an internal detail. The user
should never see it.)
----------------------------------------------------------
More columns will be added later when multi-executable support goes in.
Comments? Eli, documentation bits ok?
--
Pedro Alves
2009-08-14 Pedro Alves <pedro@codesourcery.com>
* inferior.c (print_inferior): Align columns left. Remove header
for the the "current" column. Print if there's no selected
inferior.
2009-08-14 Pedro Alves <pedro@codesourcery.com>
* gdb.texinfo (Debugging Multiple Inferiors): Add "info inferiors"
small example.
---
gdb/doc/gdb.texinfo | 7 +++++++
gdb/inferior.c | 14 ++++++++++----
2 files changed, 17 insertions(+), 4 deletions(-)
Index: src/gdb/inferior.c
===================================================================
--- src.orig/gdb/inferior.c 2009-08-14 16:10:15.000000000 +0100
+++ src/gdb/inferior.c 2009-08-14 16:13:11.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, "id", "Id");
+ ui_out_table_header (uiout, 17, ui_left, "target-id", "Target ID");
ui_out_table_body (uiout);
for (inf = inferior_list; inf; inf = inf->next)
@@ -344,12 +344,18 @@ print_inferior (struct ui_out *uiout, in
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_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-14 16:13:20.000000000 +0100
+++ src/gdb/doc/gdb.texinfo 2009-08-14 16:16:40.000000000 +0100
@@ -2376,6 +2376,13 @@ To find out what inferiors exist at any
Print a list of all inferiors currently being managed by @value{GDBN}.
@end table
+@smallexample
+(@value{GDBP}) info inferiors
+ Id Target ID
+* 1 process 2307
+ 2 process 3401
+@end smallexample
+
To switch focus between inferiors, use the @code{inferior} command:
@table @code
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch/doc] Tweak "info inferiors" output.
2009-08-14 16:22 [patch/doc] Tweak "info inferiors" output Pedro Alves
@ 2009-08-14 17:38 ` Tom Tromey
2009-08-14 18:30 ` Eli Zaretskii
1 sibling, 0 replies; 14+ messages in thread
From: Tom Tromey @ 2009-08-14 17:38 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
Pedro> Here's a tiny piece I'm cutting out of the pending multi-exec patch.
Pedro> (Tromey, we talked a bit about this bit at the end of
Pedro> http://sourceware.org/ml/gdb-patches/2009-06/msg00668.html)
Thanks for doing this.
Tom
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch/doc] Tweak "info inferiors" output.
2009-08-14 16:22 [patch/doc] Tweak "info inferiors" output Pedro Alves
2009-08-14 17:38 ` Tom Tromey
@ 2009-08-14 18:30 ` Eli Zaretskii
2009-08-14 19:27 ` Pedro Alves
1 sibling, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2009-08-14 18:30 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
> From: Pedro Alves <pedro@codesourcery.com>
> Date: Fri, 14 Aug 2009 16:46:00 +0100
>
> Eli, documentation bits ok?
I have two comments:
. Does "ID" and the numbers below it really fail to align, as the
example shows? If so, perhaps we should align them.
. I'd prefer to explain what can appear under "Target".
Thanks.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch/doc] Tweak "info inferiors" output.
2009-08-14 18:30 ` Eli Zaretskii
@ 2009-08-14 19:27 ` Pedro Alves
2009-08-14 20:59 ` Eli Zaretskii
0 siblings, 1 reply; 14+ messages in thread
From: Pedro Alves @ 2009-08-14 19:27 UTC (permalink / raw)
To: gdb-patches, Eli Zaretskii
On Friday 14 August 2009 18:56:23, Eli Zaretskii wrote:
> > From: Pedro Alves <pedro@codesourcery.com>
> > Date: Fri, 14 Aug 2009 16:46:00 +0100
> >
> > Eli, documentation bits ok?
>
> I have two comments:
>
> . Does "ID" and the numbers below it really fail to align, as the
> example shows? If so, perhaps we should align them.
It's a single column called "Target ID". The target can put there
whatever it wants, though "process foo" will be the most common.
E.g.,
(gdb) info inferiors
Id Target ID
* 1 process 309954
4 capsule 2342
2 process 109
3 process 56
5 foo 1234
6 remote target
This second column is very much like the second column
of "info threads", except, "info threads" doesn't have
column headers ...:
(gdb) info threads
1 Thread 0x7ffff7fd76e0 (LWP 22139) main (argc=1, argv=0x7fffffffe378) at ../../src/gdb/gdb.c:26
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The target decides what to print here.
Maybe there's a better name for the column. Some debuggers
seem to call that the system ID (although most can assume
an unix-like system). Target ID sounded more GDB-ish
to me. (it may well be it sounds implementor speak, I
dunno).
> . I'd prefer to explain what can appear under "Target".
Okay, I can do that.
--
Pedro Alves
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch/doc] Tweak "info inferiors" output.
2009-08-14 19:27 ` Pedro Alves
@ 2009-08-14 20:59 ` Eli Zaretskii
2009-08-17 14:37 ` Pedro Alves
0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2009-08-14 20:59 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
> From: Pedro Alves <pedro@codesourcery.com>
> Date: Fri, 14 Aug 2009 20:15:59 +0100
>
> > . Does "ID" and the numbers below it really fail to align, as the
> > example shows? If so, perhaps we should align them.
>
> It's a single column called "Target ID". The target can put there
> whatever it wants, though "process foo" will be the most common.
Then I suggest to drop the "ID" part and just say "Target". Or maybe
"Inferior", this being "info inferiors".
> (gdb) info inferiors
> Id Target ID
> * 1 process 309954
> 4 capsule 2342
> 2 process 109
> 3 process 56
> 5 foo 1234
> 6 remote target
What can appear there beyond "process NNN" and "remote rarget"? Are
the other examples above real or just hypothetical?
For processes, I'd prefer "process (PID NNN)". Just "process NNN" is
not enough to unequivocally indicate what the number is, IMO.
> The target decides what to print here.
Well, I rather hope that the programmer, i.e. the GDB developers,
decide what to print there ;-)
> > . I'd prefer to explain what can appear under "Target".
>
> Okay, I can do that.
Thanks.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch/doc] Tweak "info inferiors" output.
2009-08-14 20:59 ` Eli Zaretskii
@ 2009-08-17 14:37 ` Pedro Alves
2009-08-17 14:45 ` Pedro Alves
2009-08-17 17:55 ` Eli Zaretskii
0 siblings, 2 replies; 14+ messages in thread
From: Pedro Alves @ 2009-08-17 14:37 UTC (permalink / raw)
To: gdb-patches, Eli Zaretskii
On Friday 14 August 2009 21:13:24, Eli Zaretskii wrote:
> > From: Pedro Alves <pedro@codesourcery.com>
> > Date: Fri, 14 Aug 2009 20:15:59 +0100
> >
> > > . Does "ID" and the numbers below it really fail to align, as the
> > > example shows? If so, perhaps we should align them.
> >
> > It's a single column called "Target ID". The target can put there
> > whatever it wants, though "process foo" will be the most common.
>
> Then I suggest to drop the "ID" part and just say "Target". Or maybe
> "Inferior", this being "info inferiors".
"Target", me don't likes. "Inferior", hmm, maybe that's good. Before
I change that, if we were to add column headers to "info threads", what
would we call it's second column? This is really the same thing
applied to inferiors.
Here's what the docs say when describing "info threads":
@item
the target system's inferior identifier (@var{systag})
@end enumerate
@var{systag} is then mentioned in several other places
where that string can appear. I think we'll want to do
the same for cases where we will print the inferior's
target system's ID (--- we're going to add more of
those for sure).
>
> > (gdb) info inferiors
> > Id Target ID
> > * 1 process 309954
> > 4 capsule 2342
> > 2 process 109
> > 3 process 56
> > 5 foo 1234
> > 6 remote target
>
> What can appear there beyond "process NNN" and "remote rarget"? Are
> the other examples above real or just hypothetical?
Whatever appears there is the result of a target_pid_to_str call, just
like the second column in "info threads". Currently, the others are
hypothetical, but I can see us adding a few more. E.g, remote-sim
would likely print something different, and you may want (or not) to
hide the magic 42 used by go32-nat.c.
> For processes, I'd prefer "process (PID NNN)".
Hmm, not sure. The data in parentheses looks like
something that isn't mandatory to be displayed, just
something extra when there's row space for it. But, just "process"
doesn't make sense here.
> Just "process NNN" is
> not enough to unequivocally indicate what the number is, IMO.
That's how we've printed a process id forever. It's just
target_pid_to_str -> normal_pid_to_str.
>
> > The target decides what to print here.
>
> Well, I rather hope that the programmer, i.e. the GDB developers,
> decide what to print there ;-)
Eh. :-) By target I meant the target_ops.
>
> > > . I'd prefer to explain what can appear under "Target".
> >
> > Okay, I can do that.
I've looked at the description of "info threads", and carried
over. While doing so, I've noticed that we should be calling
GDB inferior numbers "Numbers", not "IDs". "info breakpoints"
also calls the first column "Num".
What do you think of this one? We just need to settle on the
column name, I think.
--
Pedro Alves
2009-08-14 Pedro Alves <pedro@codesourcery.com>
* inferior.c (print_inferior): Align columns left. Remove header
for the the "current" column. Rename column "Id" to "Num".
Rename column "PID" to "Target ID". Print if there's no selected
inferior.
2009-08-14 Pedro Alves <pedro@codesourcery.com>
* 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-14 18:39:17.000000000 +0100
+++ src/gdb/inferior.c 2009-08-17 15:17:03.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", "Target ID");
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-14 18:39:17.000000000 +0100
+++ src/gdb/doc/gdb.texinfo 2009-08-17 15:15:02.000000000 +0100
@@ -2374,17 +2374,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{*} to the left of 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 Target ID
+* 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
@@ -2392,15 +2415,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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch/doc] Tweak "info inferiors" output.
2009-08-17 14:37 ` Pedro Alves
@ 2009-08-17 14:45 ` Pedro Alves
2009-08-17 17:55 ` Eli Zaretskii
1 sibling, 0 replies; 14+ messages in thread
From: Pedro Alves @ 2009-08-17 14:45 UTC (permalink / raw)
To: gdb-patches; +Cc: Eli Zaretskii
On Monday 17 August 2009 15:37:27, Pedro Alves wrote:
> Here's what the docs say when describing "info threads":
>
> @item
> the target system's inferior identifier (@var{systag})
> @end enumerate
>
Grrr, sorry, pasto. It actually shows:
@item
the target system's thread identifier (@var{systag})
.... of course. You get the point. ;-)
--
Pedro Alves
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch/doc] Tweak "info inferiors" output.
2009-08-17 14:37 ` Pedro Alves
2009-08-17 14:45 ` Pedro Alves
@ 2009-08-17 17:55 ` Eli Zaretskii
2009-08-17 18:01 ` Tom Tromey
1 sibling, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2009-08-17 17:55 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
> From: Pedro Alves <pedro@codesourcery.com>
> Date: Mon, 17 Aug 2009 15:37:27 +0100
>
> Before
> I change that, if we were to add column headers to "info threads", what
> would we call it's second column? This is really the same thing
> applied to inferiors.
Let me turn the table around and ask you how about if we remove the
column headers from "info inferiors" display, like with "info
threads"?
> Here's what the docs say when describing "info threads":
>
> @item
> the target system's thread identifier (@var{systag})
> @end enumerate
I can live with that.
> > For processes, I'd prefer "process (PID NNN)".
>
> Hmm, not sure. The data in parentheses looks like
> something that isn't mandatory to be displayed, just
> something extra when there's row space for it. But, just "process"
> doesn't make sense here.
We use something similar to my suggestion when we report the LWP
thread IDs. But I see now that we use "process NNN" in "info
threads", so I guess there are precedents and we can go with your
original suggestion, although I can't say I like this form.
> What do you think of this one?
It's fine, thanks.
> We just need to settle on the column name, I think.
Or lack thereof ;-)
> +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.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch/doc] Tweak "info inferiors" output.
2009-08-17 17:55 ` Eli Zaretskii
@ 2009-08-17 18:01 ` Tom Tromey
2009-08-17 19:28 ` Eli Zaretskii
0 siblings, 1 reply; 14+ messages in thread
From: Tom Tromey @ 2009-08-17 18:01 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Pedro Alves, gdb-patches
>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> 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.
Tom
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch/doc] Tweak "info inferiors" output.
2009-08-17 18:01 ` Tom Tromey
@ 2009-08-17 19:28 ` Eli Zaretskii
2009-08-17 20:12 ` Stan Shebs
0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2009-08-17 19:28 UTC (permalink / raw)
To: tromey; +Cc: pedro, gdb-patches
> From: Tom Tromey <tromey@redhat.com>
> Cc: Pedro Alves <pedro@codesourcery.com>, gdb-patches@sourceware.org
> Date: Mon, 17 Aug 2009 11:52:46 -0600
>
> >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> 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.
Thanks.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch/doc] Tweak "info inferiors" output.
2009-08-17 19:28 ` Eli Zaretskii
@ 2009-08-17 20:12 ` Stan Shebs
2009-08-24 11:15 ` Pedro Alves
0 siblings, 1 reply; 14+ messages in thread
From: Stan Shebs @ 2009-08-17 20:12 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: tromey, pedro, gdb-patches
Eli Zaretskii wrote:
>> From: Tom Tromey <tromey@redhat.com>
>> Cc: Pedro Alves <pedro@codesourcery.com>, gdb-patches@sourceware.org
>> Date: Mon, 17 Aug 2009 11:52:46 -0600
>>
>>
>>>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> 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.
We alway change it later if user feedback is negative.
Stan
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch/doc] Tweak "info inferiors" output.
2009-08-17 20:12 ` Stan Shebs
@ 2009-08-24 11:15 ` Pedro Alves
2009-08-24 18:54 ` Eli Zaretskii
0 siblings, 1 reply; 14+ messages in thread
From: Pedro Alves @ 2009-08-24 11:15 UTC (permalink / raw)
To: Stan Shebs; +Cc: Eli Zaretskii, tromey, gdb-patches
On Monday 17 August 2009 20:57:19, Stan Shebs wrote:
> Eli Zaretskii wrote:
> >> From: Tom Tromey <tromey@redhat.com>
> >> Cc: Pedro Alves <pedro@codesourcery.com>, gdb-patches@sourceware.org
> >> Date: Mon, 17 Aug 2009 11:52:46 -0600
> >>
> >>
> >>>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> 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 <pedro@codesourcery.com>
* 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 <pedro@codesourcery.com>
* 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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch/doc] Tweak "info inferiors" output.
2009-08-24 11:15 ` Pedro Alves
@ 2009-08-24 18:54 ` Eli Zaretskii
2009-08-25 15:40 ` Pedro Alves
0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2009-08-24 18:54 UTC (permalink / raw)
To: Pedro Alves; +Cc: stan, tromey, gdb-patches
> From: Pedro Alves <pedro@codesourcery.com>
> Date: Mon, 24 Aug 2009 11:55:16 +0100
> Cc: Eli Zaretskii <eliz@gnu.org>,
> tromey@redhat.com,
> gdb-patches@sourceware.org
>
> Is this OK then?
Yes, but I have one tiny nit:
> +@item
> +the target system's inferior identifier (@var{systag})
We don't seem to use @var{systag} in this text; do we really need it?
Otherwise, fine with me. Thanks.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [patch/doc] Tweak "info inferiors" output.
2009-08-24 18:54 ` Eli Zaretskii
@ 2009-08-25 15:40 ` Pedro Alves
0 siblings, 0 replies; 14+ messages in thread
From: Pedro Alves @ 2009-08-25 15:40 UTC (permalink / raw)
To: gdb-patches
On Monday 24 August 2009 19:32:26, Eli Zaretskii wrote:
> > From: Pedro Alves <pedro@codesourcery.com>
> >
> > Is this OK then?
>
> Yes, but I have one tiny nit:
>
> > +@item
> > +the target system's inferior identifier (@var{systag})
>
> We don't seem to use @var{systag} in this text; do we really need it?
Nope, I've removed it.
> Otherwise, fine with me. Thanks.
Thanks. I've checked it in.
--
Pedro Alves
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2009-08-25 15:29 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-14 16:22 [patch/doc] Tweak "info inferiors" output Pedro Alves
2009-08-14 17:38 ` Tom Tromey
2009-08-14 18:30 ` Eli Zaretskii
2009-08-14 19:27 ` Pedro Alves
2009-08-14 20:59 ` Eli Zaretskii
2009-08-17 14:37 ` Pedro Alves
2009-08-17 14:45 ` Pedro Alves
2009-08-17 17:55 ` Eli Zaretskii
2009-08-17 18:01 ` Tom Tromey
2009-08-17 19:28 ` Eli Zaretskii
2009-08-17 20:12 ` Stan Shebs
2009-08-24 11:15 ` Pedro Alves
2009-08-24 18:54 ` Eli Zaretskii
2009-08-25 15:40 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox