From: John Gilmore <gnu@toad.com>
To: Paul_Koning@Dell.com
Cc: gnu@toad.com, tromey@redhat.com, palves@redhat.com,
mark.kettenis@xs4all.nl, brobecker@adacore.com,
gdb@sourceware.org
Subject: Re: Time to expand "Program received signal" ?
Date: Fri, 16 Nov 2012 00:22:00 -0000 [thread overview]
Message-ID: <201211160022.qAG0Mb2N030287@new.toad.com> (raw)
In-Reply-To: <C75A84166056C94F84D238A44AF9F6AD2A2CA1@AUSX10MPC103.AMER.DELL.COM>
> >> 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
next prev parent reply other threads:[~2012-11-16 0:22 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
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 [this message]
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=201211160022.qAG0Mb2N030287@new.toad.com \
--to=gnu@toad.com \
--cc=Paul_Koning@Dell.com \
--cc=brobecker@adacore.com \
--cc=gdb@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
--cc=palves@redhat.com \
--cc=tromey@redhat.com \
/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