* Time to expand "Program received signal" ?
@ 2012-11-12 18:27 Pedro Alves
2012-11-13 16:25 ` Joel Brobecker
0 siblings, 1 reply; 23+ messages in thread
From: Pedro Alves @ 2012-11-12 18:27 UTC (permalink / raw)
To: gdb
Part of the confusion on <http://sourceware.org/ml/gdb/2012-11/msg00005.html>
can be attributed to the fact that:
Program received signal SIGUSR1, User defined signal 1.
Program received signal SIGUSR1, User defined signal 1.
Program received signal SIGUSR1, User defined signal 1.
Program received signal SIGUSR1, User defined signal 1.
33 tgkill (getpid (), gettid (), SIGUSR1); /* step-2 */
doesn't give any clue that these were different threads getting the
SIGUSR1 signal.
I had chickened out before in changing this output, but today
I've decided to try raising the issue. :-)
So today, for signals, we have:
Program received signal SIGUSR1, User defined signal 1.
and for "interrupt" (GDB_SIGNAL_0), we get:
[Thread 0x7ffff7fd0700 (LWP 15209)] #2 stopped.
A patch like the below would result in:
Thread 2 [Thread 0x7ffff7fcf700 (LWP 12023) "sigstep-threads"] received signal SIGUSR1, User defined signal 1.
Thread 1 [Thread 0x7ffff7fd0740 (LWP 12019) "sigstep-threads"] received signal SIGUSR1, User defined signal 1.
And (for "interrupt"):
Thread 2 [Thread 0x7ffff7fd0700 (LWP 12077) "threads"] stopped.
"Thread" appears twice on this target, but on others it wouldn't.
The second "Thread " is responsability of target_pid_to_str
(the whole "Thread 0x7ffff7fcf700 (LWP 12023)" in fact), while
the first is hard coded. E.g., with some targets, we might see:
Thread 1 [process PID] received signal SIGUSR1, User defined signal 1.
or:
Thread 1 [<main task>] received signal SIGUSR1, User defined signal 1.
and if there's target thread extra info, we could see:
Thread 1 [Thread 0x7ffff7fd0740 (LWP 12019) "sigstep-threads" (Exiting)] received signal SIGUSR1, User defined signal 1.
Roughly, in printf-style, that's:
printf (Thread %d [%s "%s" (%s)],
gdb-thread-number,
target_pid_to_str(),
target_extra_thread_info(),
target_thread_name())
where the stuff in []'s is exactly the same format as we have in "info threads", e.g.:
...
2 Thread 0x7ffff7fd0700 (LWP 15209) "threads" 0x0000003de92ba6cd in nanosleep () from /lib64/libc.so.6
...
An option to avoid the duplicate "Thread" would be to stick with the
current "stopped" output. To recap, for "interrupt" (GDB_SIGNAL_0), we get:
[Thread 0x7ffff7fd0700 (LWP 15209)] #2 stopped.
The difference is that "Thread N" is not a prefix, but instead we
get #N after the target_pid_to_str, etc.
Which would make for:
[Thread 0x7ffff7fcf700 (LWP 12023) "sigstep-threads"] #2 received signal SIGUSR1, User defined signal 1.
[Thread 0x7ffff7fd0740 (LWP 12019) "sigstep-threads"] #1 received signal SIGUSR1, User defined signal 1.
Not sure whether people find the #2/#1 confusing/not obvious.
Also not sure people find that including thread number, target string, thread
name and target extra thread info, too much and too long. OTOH, I like having
all the info available (best while looking at logs, where it is too late to
do "info threads"). I could think of a lot of alternative variations, with
varying amounts of info, and with varying placements of the info on the line...
If being verbose with all the thread info is good, then it might be a good idea
to expand the "Switching to ..." output to match (and others that might make
sense).
I count 65 instances of "Program received" in the test suite, and surprisingly,
only one relevant in the manual in an example for $_siginfo.
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 4efc2af..6c8164e 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -5877,32 +5877,57 @@ print_signal_received_reason (enum gdb_signal siggnal)
annotate_signal ();
- if (siggnal == GDB_SIGNAL_0 && !ui_out_is_mi_like_p (uiout))
+ if (!ui_out_is_mi_like_p (uiout))
{
struct thread_info *t = inferior_thread ();
+ char *extra_info, *name, *target_id;
+ struct cleanup *str_cleanup;
+ char *contents;
+
+ ui_out_text (uiout, "\nThread ");
+ ui_out_field_fmt (uiout, "thread-id", "%d [", t->num);
+
+ target_id = target_pid_to_str (t->ptid);
+ extra_info = target_extra_thread_info (t);
+ name = t->name ? t->name : target_thread_name (t);
+
+ if (extra_info != NULL && name != NULL)
+ contents = xstrprintf ("%s \"%s\" (%s)", target_id,
+ name, extra_info);
+ else if (extra_info != NULL)
+ contents = xstrprintf ("%s (%s)", target_id, extra_info);
+ else if (name)
+ contents = xstrprintf ("%s \"%s\"", target_id, name);
+ else
+ contents = xstrdup (target_id);
+ str_cleanup = make_cleanup (xfree, contents);
+
+ ui_out_field_string (uiout, "thread-name", contents);
+ do_cleanups (str_cleanup);
+
+ if (siggnal == GDB_SIGNAL_0)
+ {
+ ui_out_text (uiout, "] stopped.\n");
+ return;
+ }
- ui_out_text (uiout, "\n[");
- ui_out_field_string (uiout, "thread-name",
- target_pid_to_str (t->ptid));
- ui_out_field_fmt (uiout, "thread-id", "] #%d", t->num);
- ui_out_text (uiout, " stopped");
+ ui_out_text (uiout, "] received signal ");
}
else
- {
- ui_out_text (uiout, "\nProgram received signal ");
- annotate_signal_name ();
- if (ui_out_is_mi_like_p (uiout))
- ui_out_field_string
+ ui_out_text (uiout, "Program received signal ");
+
+ annotate_signal_name ();
+ if (ui_out_is_mi_like_p (uiout))
+ ui_out_field_string
(uiout, "reason", async_reason_lookup (EXEC_ASYNC_SIGNAL_RECEIVED));
- ui_out_field_string (uiout, "signal-name",
+ ui_out_field_string (uiout, "signal-name",
gdb_signal_to_name (siggnal));
- annotate_signal_name_end ();
- ui_out_text (uiout, ", ");
- annotate_signal_string ();
- ui_out_field_string (uiout, "signal-meaning",
- gdb_signal_to_string (siggnal));
- annotate_signal_string_end ();
- }
+ annotate_signal_name_end ();
+ ui_out_text (uiout, ", ");
+ annotate_signal_string ();
+ ui_out_field_string (uiout, "signal-meaning",
+ gdb_signal_to_string (siggnal));
+ annotate_signal_string_end ();
ui_out_text (uiout, ".\n");
}
diff --git a/gdb/testsuite/gdb.threads/sigstep-threads.exp b/gdb/testsuite/gdb.threads/sigstep-threads.exp
index 484ca37..4397dc2 100644
--- a/gdb/testsuite/gdb.threads/sigstep-threads.exp
+++ b/gdb/testsuite/gdb.threads/sigstep-threads.exp
@@ -45,7 +45,7 @@ for {set i 0} {$i < 100} {incr i} {
# Presume this step failed - as in the case of a timeout.
set failed 1
gdb_test_multiple "step" $test {
- -re "\r\nProgram received signal SIGUSR1, User defined signal 1.\r\n" {
+ -re "received signal SIGUSR1, User defined signal 1.\r\n" {
exp_continue -continue_timer
}
-re "step-(\[012\]).*\r\n$gdb_prompt $" {
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: Time to expand "Program received signal" ?
2012-11-12 18:27 Time to expand "Program received signal" ? Pedro Alves
@ 2012-11-13 16:25 ` Joel Brobecker
2012-11-13 16:40 ` Mark Kettenis
0 siblings, 1 reply; 23+ messages in thread
From: Joel Brobecker @ 2012-11-13 16:25 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb
> A patch like the below would result in:
>
> Thread 2 [Thread 0x7ffff7fcf700 (LWP 12023) "sigstep-threads"] received signal SIGUSR1, User defined signal 1.
[...]
> An option to avoid the duplicate "Thread" would be to stick with the
> current "stopped" output.
[...]
> [Thread 0x7ffff7fcf700 (LWP 12023) "sigstep-threads"] #2 received signal SIGUSR1, User defined signal 1.
> [Thread 0x7ffff7fd0740 (LWP 12019) "sigstep-threads"] #1 received signal SIGUSR1, User defined signal 1.
FWIW, I think that your first choice is best. I don't think that
the "Thread" duplication is a problem, whereas I do indeed find
the #1/#2 confusing.
--
Joel
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-13 16:25 ` Joel Brobecker
@ 2012-11-13 16:40 ` Mark Kettenis
2012-11-13 17:22 ` Pedro Alves
2012-11-13 17:23 ` Joel Brobecker
0 siblings, 2 replies; 23+ messages in thread
From: Mark Kettenis @ 2012-11-13 16:40 UTC (permalink / raw)
To: brobecker; +Cc: palves, gdb
> Date: Tue, 13 Nov 2012 08:25:30 -0800
> From: Joel Brobecker <brobecker@adacore.com>
>
> > A patch like the below would result in:
> >
> > Thread 2 [Thread 0x7ffff7fcf700 (LWP 12023) "sigstep-threads"] received signal SIGUSR1, User defined signal 1.
> [...]
> > An option to avoid the duplicate "Thread" would be to stick with the
> > current "stopped" output.
> [...]
> > [Thread 0x7ffff7fcf700 (LWP 12023) "sigstep-threads"] #2 received signal SIGUSR1, User defined signal 1.
> > [Thread 0x7ffff7fd0740 (LWP 12019) "sigstep-threads"] #1 received signal SIGUSR1, User defined signal 1.
>
> FWIW, I think that your first choice is best. I don't think that
> the "Thread" duplication is a problem, whereas I do indeed find
> the #1/#2 confusing.
I do find the strings somewhat long though. The lines wrap, and that
distracts people from the important bit, which is that a signal was
received. Are people really interested in the bit between. Isn't it
better to print just:
Thread 2 received signal SIGUSR1, User defined signal 1.
Folks can then use "info threads" to look at the details of the thread.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-13 16:40 ` Mark Kettenis
@ 2012-11-13 17:22 ` Pedro Alves
2012-11-13 22:40 ` John Gilmore
2012-11-13 17:23 ` Joel Brobecker
1 sibling, 1 reply; 23+ messages in thread
From: Pedro Alves @ 2012-11-13 17:22 UTC (permalink / raw)
To: Mark Kettenis; +Cc: brobecker, gdb
On 11/13/2012 04:40 PM, Mark Kettenis wrote:
>> Date: Tue, 13 Nov 2012 08:25:30 -0800
>> From: Joel Brobecker <brobecker@adacore.com>
>>
>>> A patch like the below would result in:
>>>
>>> Thread 2 [Thread 0x7ffff7fcf700 (LWP 12023) "sigstep-threads"] received signal SIGUSR1, User defined signal 1.
>> [...]
>>> An option to avoid the duplicate "Thread" would be to stick with the
>>> current "stopped" output.
>> [...]
>>> [Thread 0x7ffff7fcf700 (LWP 12023) "sigstep-threads"] #2 received signal SIGUSR1, User defined signal 1.
>>> [Thread 0x7ffff7fd0740 (LWP 12019) "sigstep-threads"] #1 received signal SIGUSR1, User defined signal 1.
>>
>> FWIW, I think that your first choice is best. I don't think that
>> the "Thread" duplication is a problem, whereas I do indeed find
>> the #1/#2 confusing.
>
> I do find the strings somewhat long though. The lines wrap, and that
> distracts people from the important bit, which is that a signal was
> received. Are people really interested in the bit between. Isn't it
> better to print just:
>
> Thread 2 received signal SIGUSR1, User defined signal 1.
>
> Folks can then use "info threads" to look at the details of the thread.
I've been hacking a bit today with a top gdb that has the patch
applied, and I've definitely come to agree. The string is indeed too
long and distracting. The idea was to have as much in a log as possible,
but I guess that if I want that, I can just issue extra "info threads".
--
Pedro Alves
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-13 17:22 ` Pedro Alves
@ 2012-11-13 22:40 ` John Gilmore
2012-11-14 10:26 ` Pedro Alves
2012-11-15 19:27 ` Tom Tromey
0 siblings, 2 replies; 23+ messages in thread
From: John Gilmore @ 2012-11-13 22:40 UTC (permalink / raw)
To: Pedro Alves; +Cc: Mark Kettenis, brobecker, gdb
>>>> [Thread 0x7ffff7fd0740 (LWP 12019) "sigstep-threads"] #1 received signal SIGUSR1, User defined signal 1.
> Thread 2 received signal SIGUSR1, User defined signal 1.
GDB shouldn't mention threads at all, unless the program being debugged
is multi-threaded.
John
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-13 22:40 ` John Gilmore
@ 2012-11-14 10:26 ` Pedro Alves
2012-11-14 19:54 ` John Gilmore
2012-11-15 19:27 ` Tom Tromey
1 sibling, 1 reply; 23+ messages in thread
From: Pedro Alves @ 2012-11-14 10:26 UTC (permalink / raw)
To: John Gilmore; +Cc: Mark Kettenis, brobecker, gdb
On 11/13/2012 10:40 PM, John Gilmore wrote:
>>>>> [Thread 0x7ffff7fd0740 (LWP 12019) "sigstep-threads"] #1 received signal SIGUSR1, User defined signal 1.
>> Thread 2 received signal SIGUSR1, User defined signal 1.
>
> GDB shouldn't mention threads at all, unless the program being debugged
> is multi-threaded.
Since 7.0 GDB models non-threaded programs as single threaded.
--
Pedro Alves
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-14 10:26 ` Pedro Alves
@ 2012-11-14 19:54 ` John Gilmore
2012-11-15 10:36 ` Pedro Alves
0 siblings, 1 reply; 23+ messages in thread
From: John Gilmore @ 2012-11-14 19:54 UTC (permalink / raw)
To: Pedro Alves; +Cc: John Gilmore, Mark Kettenis, brobecker, gdb
> > GDB shouldn't mention threads at all, unless the program being debugged
> > is multi-threaded.
>
> Since 7.0 GDB models non-threaded programs as single threaded.
OK, then, you can call it what you want. GDB shouldn't mention
threads at all, unless the program being debugged has more than a
single thread.
Printing a thread identifier is extraneous information that the user
will just have to skip over to get to the real information (that their
program got a signal).
John
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-14 19:54 ` John Gilmore
@ 2012-11-15 10:36 ` Pedro Alves
2012-11-15 16:58 ` Eli Zaretskii
0 siblings, 1 reply; 23+ messages in thread
From: Pedro Alves @ 2012-11-15 10:36 UTC (permalink / raw)
To: John Gilmore; +Cc: Mark Kettenis, brobecker, gdb
On 14-11-2012 19:54, John Gilmore wrote:
>>> GDB shouldn't mention threads at all, unless the program being debugged
>>> is multi-threaded.
>>
>> Since 7.0 GDB models non-threaded programs as single threaded.
>
> OK, then, you can call it what you want.
I call it what it is.
GDB shouldn't mention
> threads at all, unless the program being debugged has more than a
> single thread.
See? If it has a single thread, GDB calls that thread "thread 1".
> Printing a thread identifier is extraneous information that the user
> will just have to skip over to get to the real information (that their
> program got a signal).
You're making things more complicated than they are.
There's nothing to skip over. GDB's model calls the unit of scheduling
in the inferior that got the signal "Thread N". You can "thread N" to
switch to it.
(gdb) maint print target-stack
The current target stack is:
- child (Unix child process)
- exec (Local exec file)
- None (None)
(gdb) info threads
Id Target Id Frame
* 1 process 9939 "break" main (argc=1, argv=0x7fffffffdc48, envp=0x7fffffffdc58) at ../../../src/gdb/testsuite/gdb.base/break.c:89
(gdb) clone-inferior
Added inferior 2.
(gdb) info inferiors
Num Description Executable
2 <null> /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/break
* 1 process 9939 /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/break
(gdb) info threads
Id Target Id Frame
* 1 process 9939 "break" main (argc=1, argv=0x7fffffffdc48, envp=0x7fffffffdc58) at ../../../src/gdb/testsuite/gdb.base/break.c:89
(gdb) inferior 2
[Switching to inferior 2 [<null>] (/home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/break)]
(gdb) start
Temporary breakpoint 2 at 0x4006bf: main. (2 locations)
Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/break
Temporary breakpoint 2,
main (argc=1, argv=0x7fffffffdc48, envp=0x7fffffffdc58) at ../../../src/gdb/testsuite/gdb.base/break.c:89
89 if (argc == 12345) { /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */
(gdb) info inferiors
Num Description Executable
* 2 process 9943 /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/break
1 process 9939 /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/break
(gdb) info threads
Id Target Id Frame
* 2 process 9943 "break" main (argc=1, argv=0x7fffffffdc48, envp=0x7fffffffdc58) at ../../../src/gdb/testsuite/gdb.base/break.c:89
1 process 9939 "break" main (argc=1, argv=0x7fffffffdc48, envp=0x7fffffffdc58) at ../../../src/gdb/testsuite/gdb.base/break.c:89
(gdb)
--
Pedro Alves
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: Time to expand "Program received signal" ?
2012-11-15 10:36 ` Pedro Alves
@ 2012-11-15 16:58 ` Eli Zaretskii
2012-11-15 17:21 ` Pedro Alves
0 siblings, 1 reply; 23+ messages in thread
From: Eli Zaretskii @ 2012-11-15 16:58 UTC (permalink / raw)
To: Pedro Alves; +Cc: gnu, mark.kettenis, brobecker, gdb
> Date: Thu, 15 Nov 2012 10:36:26 +0000
> From: Pedro Alves <palves@redhat.com>
> CC: Mark Kettenis <mark.kettenis@xs4all.nl>, brobecker@adacore.com, gdb@sourceware.org
>
> > GDB shouldn't mention
> > threads at all, unless the program being debugged has more than a
> > single thread.
>
> See? If it has a single thread, GDB calls that thread "thread 1".
To propose a compromise: can we call the only thread "main thread"
instead of "thread 1"?
> GDB's model calls the unit of scheduling in the inferior that got
> the signal "Thread N". You can "thread N" to switch to it.
>
> (gdb) maint print target-stack
> The current target stack is:
> - child (Unix child process)
> - exec (Local exec file)
> - None (None)
> (gdb) info threads
> Id Target Id Frame
> * 1 process 9939 "break" main (argc=1, argv=0x7fffffffdc48, envp=0x7fffffffdc58) at ../../../src/gdb/testsuite/gdb.base/break.c:89
This just says that GDB's model is self-consistent. Being consistent
doesn't necessarily mean being correct ;-)
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-15 16:58 ` Eli Zaretskii
@ 2012-11-15 17:21 ` Pedro Alves
2012-11-15 17:51 ` Joel Brobecker
2012-11-15 18:16 ` Eli Zaretskii
0 siblings, 2 replies; 23+ messages in thread
From: Pedro Alves @ 2012-11-15 17:21 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gnu, mark.kettenis, brobecker, gdb
On 15-11-2012 16:59, Eli Zaretskii wrote:
>> Date: Thu, 15 Nov 2012 10:36:26 +0000
>> From: Pedro Alves <palves@redhat.com>
>> CC: Mark Kettenis <mark.kettenis@xs4all.nl>, brobecker@adacore.com, gdb@sourceware.org
>>
>>> GDB shouldn't mention
>>> threads at all, unless the program being debugged has more than a
>>> single thread.
>>
>> See? If it has a single thread, GDB calls that thread "thread 1".
>
> To propose a compromise: can we call the only thread "main thread"
> instead of "thread 1"?
Not really. You can end up with one thread in the list, even after
the "main thread" having exited.
Then, if you have two inferiors, each of them is non-threaded, saying
"main thread" still doesn't tell you which of the inferiors got the
signal. My previous paste hinted at it.
We could say "inferior N" instead, but it's just much simpler to always call
the single thread in single-threaded inferiors a thread, rather than
having to explain (and care for) the special case of non-threaded
vs single-threaded. I'd very much dislike that inconsistency. I wouldn't
even know how to distinguish the cases, since with remote debugging,
GDB has no clue on whether the other end is threaded or not.
Some other points:
It makes no sense to me to have "thread apply all FOO" do nothing
for non-threaded inferiors.
E.g., this allows things like "b foo thread 1" to refer to the
main "thread" of a non-threaded program, even if it becomes
threaded by a later dlopen.
Etc.
>
>> GDB's model calls the unit of scheduling in the inferior that got
>> the signal "Thread N". You can "thread N" to switch to it.
>>
>> (gdb) maint print target-stack
>> The current target stack is:
>> - child (Unix child process)
>> - exec (Local exec file)
>> - None (None)
>> (gdb) info threads
>> Id Target Id Frame
>> * 1 process 9939 "break" main (argc=1, argv=0x7fffffffdc48, envp=0x7fffffffdc58) at ../../../src/gdb/testsuite/gdb.base/break.c:89
>
> This just says that GDB's model is self-consistent. Being consistent
> doesn't necessarily mean being correct ;-)
Nor wrong. But self-consistent is certainly better than inconsistent.
--
Pedro Alves
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-15 17:21 ` Pedro Alves
@ 2012-11-15 17:51 ` Joel Brobecker
2012-11-15 18:16 ` Eli Zaretskii
1 sibling, 0 replies; 23+ messages in thread
From: Joel Brobecker @ 2012-11-15 17:51 UTC (permalink / raw)
To: Pedro Alves; +Cc: Eli Zaretskii, gnu, mark.kettenis, gdb
FWIW, it feels like we're making a big fuss out of one detail. I don't
think that calling the main thread of a non-threaded program "thread"
is that big of a deal. Certainly not worth complexifying GDB over it,
IMO, however trivial people might think it is (and I am not sure that
it is, in fact, trivial).
--
Joel
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-15 17:21 ` Pedro Alves
2012-11-15 17:51 ` Joel Brobecker
@ 2012-11-15 18:16 ` Eli Zaretskii
2012-11-15 18:27 ` Paul_Koning
2012-11-15 18:27 ` Pedro Alves
1 sibling, 2 replies; 23+ messages in thread
From: Eli Zaretskii @ 2012-11-15 18:16 UTC (permalink / raw)
To: Pedro Alves; +Cc: gnu, mark.kettenis, brobecker, gdb
> Date: Thu, 15 Nov 2012 17:21:23 +0000
> From: Pedro Alves <palves@redhat.com>
> CC: gnu@toad.com, mark.kettenis@xs4all.nl, brobecker@adacore.com,
> gdb@sourceware.org
>
> On 15-11-2012 16:59, Eli Zaretskii wrote:
> >> Date: Thu, 15 Nov 2012 10:36:26 +0000
> >> From: Pedro Alves <palves@redhat.com>
> >> CC: Mark Kettenis <mark.kettenis@xs4all.nl>, brobecker@adacore.com, gdb@sourceware.org
> >>
> >>> GDB shouldn't mention
> >>> threads at all, unless the program being debugged has more than a
> >>> single thread.
> >>
> >> See? If it has a single thread, GDB calls that thread "thread 1".
> >
> > To propose a compromise: can we call the only thread "main thread"
> > instead of "thread 1"?
>
> Not really. You can end up with one thread in the list, even after
> the "main thread" having exited.
Doesn't GDB already know whether some threading library is linked into
the program? If it does, then it knows whether another thread is
possible or not.
> Then, if you have two inferiors, each of them is non-threaded, saying
> "main thread" still doesn't tell you which of the inferiors got the
> signal.
Neither does "thread 1", AFAIU.
> My previous paste hinted at it.
I must be blind or stupid, because I don't see any hints as to how
would a signal be announced in your example.
> It makes no sense to me to have "thread apply all FOO" do nothing
> for non-threaded inferiors.
No one said it should do nothing. "Main thread" implies there _is_ a
thread.
> E.g., this allows things like "b foo thread 1" to refer to the
> main "thread" of a non-threaded program, even if it becomes
> threaded by a later dlopen.
Who said that the main thread is necessarily thread 1? You cannot
count on that.
> > This just says that GDB's model is self-consistent. Being consistent
> > doesn't necessarily mean being correct ;-)
>
> Nor wrong.
Of course.
> But self-consistent is certainly better than inconsistent.
We are in violent agreement on this one.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-15 18:16 ` Eli Zaretskii
@ 2012-11-15 18:27 ` Paul_Koning
2012-11-15 18:27 ` Pedro Alves
1 sibling, 0 replies; 23+ messages in thread
From: Paul_Koning @ 2012-11-15 18:27 UTC (permalink / raw)
To: eliz; +Cc: palves, gnu, mark.kettenis, brobecker, gdb
On Nov 15, 2012, at 1:16 PM, Eli Zaretskii wrote:
>> Date: Thu, 15 Nov 2012 17:21:23 +0000
>> From: Pedro Alves <palves@redhat.com>
>> CC: gnu@toad.com, mark.kettenis@xs4all.nl, brobecker@adacore.com,
>> gdb@sourceware.org
>>
>> On 15-11-2012 16:59, Eli Zaretskii wrote:
>>>> Date: Thu, 15 Nov 2012 10:36:26 +0000
>>>> From: Pedro Alves <palves@redhat.com>
>>>> CC: Mark Kettenis <mark.kettenis@xs4all.nl>, brobecker@adacore.com, gdb@sourceware.org
>>>>
>>>>> GDB shouldn't mention
>>>>> threads at all, unless the program being debugged has more than a
>>>>> single thread.
>>>>
>>>> See? If it has a single thread, GDB calls that thread "thread 1".
>>>
>>> To propose a compromise: can we call the only thread "main thread"
>>> instead of "thread 1"?
>>
>> Not really. You can end up with one thread in the list, even after
>> the "main thread" having exited.
>
> Doesn't GDB already know whether some threading library is linked into
> the program? If it does, then it knows whether another thread is
> possible or not.
That doesn't tell you. While threaded programs will often be linked with a threading library, they don't need to be. Given an OS where threading is a basic service (as in NetBSD and I believe Linux) an application can create threads simply by calling the appropriate system service.
For that matter, even if it uses pthreads that doesn't mean it is linked against a dynamic library with a recognizable name. The pthreads code might be statically linked, so it isn't readily visible when you look at the program executable file.
paul
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-15 18:16 ` Eli Zaretskii
2012-11-15 18:27 ` Paul_Koning
@ 2012-11-15 18:27 ` Pedro Alves
2012-11-15 19:07 ` Eli Zaretskii
1 sibling, 1 reply; 23+ messages in thread
From: Pedro Alves @ 2012-11-15 18:27 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gnu, mark.kettenis, brobecker, gdb
On 15-11-2012 18:16, Eli Zaretskii wrote:
>>> To propose a compromise: can we call the only thread "main thread"
>>> instead of "thread 1"?
>>
>> Not really. You can end up with one thread in the list, even after
>> the "main thread" having exited.
>
> Doesn't GDB already know whether some threading library is linked into
> the program? If it does, then it knows whether another thread is
> possible or not.
In some cases yes. But in general, no. Most importantly, it doesn't
in the case people could care the most, which is remote debugging (of
random bare metal targets and RTOSs).
>> Then, if you have two inferiors, each of them is non-threaded, saying
>> "main thread" still doesn't tell you which of the inferiors got the
>> signal.
>
> Neither does "thread 1", AFAIU.
It does. The number space of threads is the same for all inferiors.
There's only one thread 1. That, would be a separate discussion...
>
>> My previous paste hinted at it.
>
> I must be blind or stupid,
I know you're neither. :-)
> because I don't see any hints as to how would a signal be announced in your example.
(gdb) info inferiors
Num Description Executable
* 2 process 9943 /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/break
1 process 9939 /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/break
(gdb) info threads
Id Target Id Frame
* 2 process 9943 "break" main (argc=1, argv=0x7fffffffdc48, envp=0x7fffffffdc58) at ../../../src/gdb/testsuite/gdb.base/break.c:89
1 process 9939 "break" main (argc=1, argv=0x7fffffffdc48, envp=0x7fffffffdc58) at ../../../src/gdb/testsuite/gdb.base/break.c:89
(gdb)
Thread 1 received signal SIGFOO
Thread 2 received signal SIGFOO
Those would be different inferiors.
>
>> It makes no sense to me to have "thread apply all FOO" do nothing
>> for non-threaded inferiors.
>
> No one said it should do nothing. "Main thread" implies there _is_ a
> thread.
Yes, and my point is, if people have no problem in calling these special
cases single-threaded (where single implies more than zero), and if
as you say, there _is_ a thread, then the discussion we're having
of whether to say "Thread 1 received ..." is a bit silly. Either we assume
non-threaded == single-threaded, and admit that in that case non-threaded
inferiors always have at least one thread, or we don't, and "thread apply
all " should not apply to non-threaded inferiors. As you called it, it's a
matter of self-consistency.
>
>> E.g., this allows things like "b foo thread 1" to refer to the
>> main "thread" of a non-threaded program, even if it becomes
>> threaded by a later dlopen.
>
> Who said that the main thread is necessarily thread 1? You cannot
> count on that.
I can, for non-threaded inferiors, which was my example. In that
case, you either count 0 threads, or 1 thread, depending on calling
it non-threaded, or single-threaded. But you can't ever have thread
N>1 before the inferior becomes multi-threaded (say, loads a threading
library).
--
Pedro Alves
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-15 18:27 ` Pedro Alves
@ 2012-11-15 19:07 ` Eli Zaretskii
2012-11-15 20:33 ` Pedro Alves
0 siblings, 1 reply; 23+ messages in thread
From: Eli Zaretskii @ 2012-11-15 19:07 UTC (permalink / raw)
To: Pedro Alves; +Cc: gnu, mark.kettenis, brobecker, gdb
> Date: Thu, 15 Nov 2012 18:27:23 +0000
> From: Pedro Alves <palves@redhat.com>
> CC: gnu@toad.com, mark.kettenis@xs4all.nl, brobecker@adacore.com,
> gdb@sourceware.org
>
> > Doesn't GDB already know whether some threading library is linked into
> > the program? If it does, then it knows whether another thread is
> > possible or not.
>
> In some cases yes. But in general, no. Most importantly, it doesn't
> in the case people could care the most, which is remote debugging (of
> random bare metal targets and RTOSs).
That's just too bad.
> >> Then, if you have two inferiors, each of them is non-threaded, saying
> >> "main thread" still doesn't tell you which of the inferiors got the
> >> signal.
> >
> > Neither does "thread 1", AFAIU.
>
> It does. The number space of threads is the same for all inferiors.
> There's only one thread 1.
Which is even worse: now I still cannot know which inferior got the
signal, and in addition I cannot even know which thread belongs to
what inferior.
> Thread 1 received signal SIGFOO
> Thread 2 received signal SIGFOO
>
> Those would be different inferiors.
Or 2 threads from the same inferior getting thread-specific signals.
> >> It makes no sense to me to have "thread apply all FOO" do nothing
> >> for non-threaded inferiors.
> >
> > No one said it should do nothing. "Main thread" implies there _is_ a
> > thread.
>
> Yes, and my point is, if people have no problem in calling these special
> cases single-threaded (where single implies more than zero), and if
> as you say, there _is_ a thread, then the discussion we're having
> of whether to say "Thread 1 received ..." is a bit silly.
It's not silly, because these are two different use cases. In one use
case, the _user_ types a thread-related command. In the other, _GDB_
talks about threads in the context of a single-threaded program. The
former case cannot possibly cause user confusion, because it was the
user who mentioned threads in the first place.
> Either we assume non-threaded == single-threaded, and admit that in
> that case non-threaded inferiors always have at least one thread, or
> we don't, and "thread apply all " should not apply to non-threaded
> inferiors. As you called it, it's a matter of self-consistency.
The OP's concern was about the UI, not about GDB's own internal
consistency.
> >> E.g., this allows things like "b foo thread 1" to refer to the
> >> main "thread" of a non-threaded program, even if it becomes
> >> threaded by a later dlopen.
> >
> > Who said that the main thread is necessarily thread 1? You cannot
> > count on that.
>
> I can, for non-threaded inferiors, which was my example. In that
> case, you either count 0 threads, or 1 thread, depending on calling
> it non-threaded, or single-threaded. But you can't ever have thread
> N>1 before the inferior becomes multi-threaded (say, loads a threading
> library).
You are missing the point, I think. Again, the issue is not how GDB
does its internal bookkeeping of threads. The issue is how to present
that to the user of a single-threaded program who might be confused to
hear anything about threads, because she didn't start any.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-15 19:07 ` Eli Zaretskii
@ 2012-11-15 20:33 ` Pedro Alves
2012-11-15 20:58 ` Eli Zaretskii
0 siblings, 1 reply; 23+ messages in thread
From: Pedro Alves @ 2012-11-15 20:33 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gnu, mark.kettenis, brobecker, gdb
On 15-11-2012 19:08, Eli Zaretskii wrote:
>> Date: Thu, 15 Nov 2012 18:27:23 +0000
>> From: Pedro Alves <palves@redhat.com>
>>>> Then, if you have two inferiors, each of them is non-threaded, saying
>>>> "main thread" still doesn't tell you which of the inferiors got the
>>>> signal.
>>>
>>> Neither does "thread 1", AFAIU.
>>
>> It does. The number space of threads is the same for all inferiors.
>> There's only one thread 1.
>
> Which is even worse: now I still cannot know which inferior got the
> signal,
(It's not worse than "Program received signal", which tells you nothing.)
Ideally you should be able to. I tend to think of it as a separate
problem. We could say something like "Inferior I, thread T received signal".
"Thread I.T" is more compact, and more "standard", if it weren't for the
current flat numbering scheme. If there's a good suggestion
(that is implementable and correct; just suppressing the thread
number when there's only a single thread in the inferior is not) to tweak
to output, I'll implement it.
> and in addition I cannot even know which thread belongs to
> what inferior.
Yes, that's a problem. But it's a larger problem than this specific
"received signal" issue though.
>
>> Thread 1 received signal SIGFOO
>> Thread 2 received signal SIGFOO
>>
>> Those would be different inferiors.
>
> Or 2 threads from the same inferior getting thread-specific signals.
Sure, but the important point is that there's a unique identifier,
better than "Program". And it seems to me that at least mentioning
"Thread N" when there's only one thread would still be desirable.
>
>>>> It makes no sense to me to have "thread apply all FOO" do nothing
>>>> for non-threaded inferiors.
>>>
>>> No one said it should do nothing. "Main thread" implies there _is_ a
>>> thread.
>>
>> Yes, and my point is, if people have no problem in calling these special
>> cases single-threaded (where single implies more than zero), and if
>> as you say, there _is_ a thread, then the discussion we're having
>> of whether to say "Thread 1 received ..." is a bit silly.
>
> It's not silly, because these are two different use cases. In one use
> case, the _user_ types a thread-related command. In the other, _GDB_
> talks about threads in the context of a single-threaded program. The
> former case cannot possibly cause user confusion, because it was the
> user who mentioned threads in the first place.
>
>> Either we assume non-threaded == single-threaded, and admit that in
>> that case non-threaded inferiors always have at least one thread, or
>> we don't, and "thread apply all " should not apply to non-threaded
>> inferiors. As you called it, it's a matter of self-consistency.
>
> The OP's concern was about the UI, not about GDB's own internal
> consistency.
But I'm talking about UI! "thread apply all" is a user command.
If you'd expect "thread apply all bt" to produce a backtrace on a
non-threaded inferior, wouldn't you say that's because there _is_ _a_
thread in the inferior? And if so then that thread must have a number
the user can refer to? And if so, what is the issue with always
consistently telling the user the thread that got the signal?
I can't honestly believe any real user would be confused by this.
>
>>>> E.g., this allows things like "b foo thread 1" to refer to the
>>>> main "thread" of a non-threaded program, even if it becomes
>>>> threaded by a later dlopen.
>>>
>>> Who said that the main thread is necessarily thread 1? You cannot
>>> count on that.
>>
>> I can, for non-threaded inferiors, which was my example. In that
>> case, you either count 0 threads, or 1 thread, depending on calling
>> it non-threaded, or single-threaded. But you can't ever have thread
>> N>1 before the inferior becomes multi-threaded (say, loads a threading
>> library).
>
> You are missing the point, I think. Again, the issue is not how GDB
> does its internal bookkeeping of threads.
I'm explaining that we can refer to the main thread of non-threaded
programs in the CLI, which is a UI. That the way to do that, is to refer
to thread 1. IOW, in the UI, the main thread of non-threaded programs
is thread 1.
> The issue is how to present
> that to the user of a single-threaded program who might be confused to
> hear anything about threads, because she didn't start any.
I don't believe any user would be confused. If there's any little confusion
at all, it can't seriously go beyond: "What's this thread 1 GDB is
talking about? I didn't start any! - It's the main thread. - Oh, makes
sense."
Oh well, I'm beginning to consider dropping the patch for now.
--
Pedro Alves
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-15 20:33 ` Pedro Alves
@ 2012-11-15 20:58 ` Eli Zaretskii
0 siblings, 0 replies; 23+ messages in thread
From: Eli Zaretskii @ 2012-11-15 20:58 UTC (permalink / raw)
To: Pedro Alves; +Cc: gnu, mark.kettenis, brobecker, gdb
> Date: Thu, 15 Nov 2012 20:33:26 +0000
> From: Pedro Alves <palves@redhat.com>
> CC: gnu@toad.com, mark.kettenis@xs4all.nl, brobecker@adacore.com,
> gdb@sourceware.org
>
> >>>> It makes no sense to me to have "thread apply all FOO" do nothing
> >>>> for non-threaded inferiors.
> >>>
> >>> No one said it should do nothing. "Main thread" implies there _is_ a
> >>> thread.
> >>
> >> Yes, and my point is, if people have no problem in calling these special
> >> cases single-threaded (where single implies more than zero), and if
> >> as you say, there _is_ a thread, then the discussion we're having
> >> of whether to say "Thread 1 received ..." is a bit silly.
> >
> > It's not silly, because these are two different use cases. In one use
> > case, the _user_ types a thread-related command. In the other, _GDB_
> > talks about threads in the context of a single-threaded program. The
> > former case cannot possibly cause user confusion, because it was the
> > user who mentioned threads in the first place.
> >
> >> Either we assume non-threaded == single-threaded, and admit that in
> >> that case non-threaded inferiors always have at least one thread, or
> >> we don't, and "thread apply all " should not apply to non-threaded
> >> inferiors. As you called it, it's a matter of self-consistency.
> >
> > The OP's concern was about the UI, not about GDB's own internal
> > consistency.
>
> But I'm talking about UI! "thread apply all" is a user command.
> If you'd expect "thread apply all bt" to produce a backtrace on a
> non-threaded inferior, wouldn't you say that's because there _is_ _a_
> thread in the inferior? And if so then that thread must have a number
> the user can refer to? And if so, what is the issue with always
> consistently telling the user the thread that got the signal?
> I can't honestly believe any real user would be confused by this.
We are talking about 2 different users here. One is who types "thread
apply all SOMETHING" -- this one evidently expects a single-threaded
program to behave as a threaded one with 1 thread. The other user is
who didn't type any thread-related commands, just had GDB print
Thread XYZ received signal SIGFOO
This one _might_ be confused.
> Oh well, I'm beginning to consider dropping the patch for now.
That was not my intent. I don't object to the patch.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-13 22:40 ` John Gilmore
2012-11-14 10:26 ` Pedro Alves
@ 2012-11-15 19:27 ` Tom Tromey
2012-11-15 22:21 ` John Gilmore
1 sibling, 1 reply; 23+ messages in thread
From: Tom Tromey @ 2012-11-15 19:27 UTC (permalink / raw)
To: John Gilmore; +Cc: Pedro Alves, Mark Kettenis, brobecker, gdb
John> GDB shouldn't mention threads at all, unless the program being debugged
John> is multi-threaded.
Why? What is the downside of the current approach?
Tom
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-15 19:27 ` Tom Tromey
@ 2012-11-15 22:21 ` John Gilmore
2012-11-15 22:27 ` Paul_Koning
0 siblings, 1 reply; 23+ messages in thread
From: John Gilmore @ 2012-11-15 22:21 UTC (permalink / raw)
To: Tom Tromey; +Cc: John Gilmore, Pedro Alves, Mark Kettenis, brobecker, gdb
> John> GDB shouldn't mention threads at all, unless the program being debugged
> John> is multi-threaded.
>
> Why? What is the downside of the current approach?
GDB is used by many novices at programming. I discovered early in my
stewardship of it that the biggest thing that got in their way was its
complexity. Roland Pesch and I shrunk the GDB manual into a reference
card -- and put the six or seven commands that you actually NEEDED to
know on the very front of the reference card. (gdb, b, bt, p, c, n,
s.) It's in gdb-x.x/gdb/doc/refcard.tex. (It looks like it hasn't
been updated since GDB version 5 -- and most places you find the
refcard on the net are still offering version 4.) We used to ship the
PostScript version, already formatted, in the release, so that people
didn't need TeX to print one. This seems to have gone by the wayside
too. Most folks on the web seem to offer it in PDF now.
Anyway, we got so much good feedback from this "totally simple"
introduction to gdb that we strove to keep the GDB user interface
simple as well. GDB's strength comes not only from being able to do
cool things like reverse execution, watchpoints, simulation, or cross
debugging of arbitrary object file formats -- but also from being able
to do simple things simply, to help simple or naive users get their
work done. The debugger should "get out of the way" and let the
user focus on interacting with the program being debugged.
When a student is debugging their "hello world" style program, the
last thing they need is for GDB to throw threads in their face. (It's
already enough trouble that they have to ignore the long hex numbers
printed in the backtrace, when using a "source level" debugger.) And
if they don't have a positive experience while debugging a small
program, they're less likely to try GDB for larger programs, nor plumb
the depths of everything complicated that it can do for them.
John
PS: The Firesign Theatre made some good humor out of the crazy things
that old DEC operating systems printed out all the time -- like "Amylfax
shuffle time is less than 1% of freight drain." Let's not
give them any more material to work with. Like, why do we print
"[Thread debugging using libthread_db enabled]" when running a program?
Was that a debugging message that nobody ever disabled?
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-15 22:21 ` John Gilmore
@ 2012-11-15 22:27 ` Paul_Koning
2012-11-16 0:22 ` John Gilmore
2012-11-16 8:25 ` Eli Zaretskii
0 siblings, 2 replies; 23+ messages in thread
From: Paul_Koning @ 2012-11-15 22:27 UTC (permalink / raw)
To: gnu; +Cc: tromey, palves, mark.kettenis, brobecker, gdb
On Nov 15, 2012, at 5:21 PM, John Gilmore wrote:
>> John> GDB shouldn't mention threads at all, unless the program being debugged
>> John> is multi-threaded.
But you didn't address the issue that you can't readily tell whether a program is multi-threaded. It may have had multiple threads but it doesn't now, or it may have more later. This may be true even though it's not linked to libpthread -- that library might not even exist on the OS in question, or it may be linked in static, or the program may simply call the kernel's "create me a thread" syscall.
paul
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-15 22:27 ` Paul_Koning
@ 2012-11-16 0:22 ` John Gilmore
2012-11-16 8:25 ` Eli Zaretskii
1 sibling, 0 replies; 23+ messages in thread
From: John Gilmore @ 2012-11-16 0:22 UTC (permalink / raw)
To: Paul_Koning; +Cc: gnu, tromey, palves, mark.kettenis, brobecker, gdb
> >> John> GDB shouldn't mention threads at all, unless the program being debugged
> >> John> is multi-threaded.
>
> But you didn't address the issue that you can't readily tell whether a program is multi-threaded. It may have had multiple threads but it doesn't now, or it may have more later. This may be true even though it's not linked to libpthread -- that library might not even exist on the OS in question, or it may be linked in static, or the program may simply call the kernel's "create me a thread" syscall.
This isn't rocket science.
If the program "used to" have multiple threads, and only has one now,
it should be treated as single-threaded -- until it creates another thread.
If GDB can't tell whether there's more than one thread, it has to
treat the program as single-threaded.
What does GDB do if the user sets "scheduler-locking on" and GDB isn't
sure whether the target has multiple threads? In general, GDB should
not let itself get into a situation where it doesn't know whether
there are other threads, since in that state it will violate its own
specifications. Just as GDB shouldn't ever print a bogus value for a
variable. The user should be able to depend on anything GDB tells
them about the program. If they have to debug GDB, or work around
well-known bugs in it that make it lie about the state of the program,
they can't trust what it tells them about their own program.
John
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-15 22:27 ` Paul_Koning
2012-11-16 0:22 ` John Gilmore
@ 2012-11-16 8:25 ` Eli Zaretskii
1 sibling, 0 replies; 23+ messages in thread
From: Eli Zaretskii @ 2012-11-16 8:25 UTC (permalink / raw)
To: Paul_Koning; +Cc: gnu, tromey, palves, mark.kettenis, brobecker, gdb
> From: <Paul_Koning@Dell.com>
> CC: <tromey@redhat.com>, <palves@redhat.com>, <mark.kettenis@xs4all.nl>, <brobecker@adacore.com>, <gdb@sourceware.org>
> Date: Thu, 15 Nov 2012 22:26:27 +0000
>
> But you didn't address the issue that you can't readily tell whether a program is multi-threaded. It may have had multiple threads but it doesn't now, or it may have more later.
At least on MS-Windows, GDB tells me when a new thread is created.
So it does know. I have no experience with threads on Posix
platforms, so I don't know for sure that the same is possible there.
But the "set print thread-events" command is not Windows-specific, so
I believe the above is also true for Posix platforms.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Time to expand "Program received signal" ?
2012-11-13 16:40 ` Mark Kettenis
2012-11-13 17:22 ` Pedro Alves
@ 2012-11-13 17:23 ` Joel Brobecker
1 sibling, 0 replies; 23+ messages in thread
From: Joel Brobecker @ 2012-11-13 17:23 UTC (permalink / raw)
To: Mark Kettenis; +Cc: palves, gdb
> I do find the strings somewhat long though. The lines wrap, and that
> distracts people from the important bit, which is that a signal was
> received. Are people really interested in the bit between. Isn't it
> better to print just:
>
> Thread 2 received signal SIGUSR1, User defined signal 1.
>
> Folks can then use "info threads" to look at the details of the thread.
Same here, and I'd be OK with the output you suggest. But the extra
info might be useful if the thread disappeared before the user had
a chance to do "info threads"... Perhaps this is a good situation
where we should provide an option, so that the short output is used
by default, but still allow a longer output when needed.
--
Joel
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2012-11-16 8:25 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-12 18:27 Time to expand "Program received signal" ? Pedro Alves
2012-11-13 16:25 ` Joel Brobecker
2012-11-13 16:40 ` Mark Kettenis
2012-11-13 17:22 ` Pedro Alves
2012-11-13 22:40 ` John Gilmore
2012-11-14 10:26 ` Pedro Alves
2012-11-14 19:54 ` John Gilmore
2012-11-15 10:36 ` Pedro Alves
2012-11-15 16:58 ` Eli Zaretskii
2012-11-15 17:21 ` Pedro Alves
2012-11-15 17:51 ` Joel Brobecker
2012-11-15 18:16 ` Eli Zaretskii
2012-11-15 18:27 ` Paul_Koning
2012-11-15 18:27 ` Pedro Alves
2012-11-15 19:07 ` Eli Zaretskii
2012-11-15 20:33 ` Pedro Alves
2012-11-15 20:58 ` Eli Zaretskii
2012-11-15 19:27 ` Tom Tromey
2012-11-15 22:21 ` John Gilmore
2012-11-15 22:27 ` Paul_Koning
2012-11-16 0:22 ` John Gilmore
2012-11-16 8:25 ` Eli Zaretskii
2012-11-13 17:23 ` Joel Brobecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox