Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: John Gilmore <gnu@toad.com>
Cc: Mark Kettenis <mark.kettenis@xs4all.nl>,
	brobecker@adacore.com,        gdb@sourceware.org
Subject: Re: Time to expand "Program received signal" ?
Date: Thu, 15 Nov 2012 10:36:00 -0000	[thread overview]
Message-ID: <50A4C5AA.70304@redhat.com> (raw)
In-Reply-To: <201211141954.qAEJsQ2N026469@new.toad.com>

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


  reply	other threads:[~2012-11-15 10:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-12 18:27 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 [this message]
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                     ` 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 18:27                     ` Paul_Koning
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

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=50A4C5AA.70304@redhat.com \
    --to=palves@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=gnu@toad.com \
    --cc=mark.kettenis@xs4all.nl \
    /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