From: Pedro Alves <pedro@codesourcery.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Only try to load libthread_db when we load libpthread.
Date: Fri, 07 Oct 2011 11:09:00 -0000 [thread overview]
Message-ID: <201110071209.18376.pedro@codesourcery.com> (raw)
In-Reply-To: <CADPb22T_DfQgfJqD2JP3rfTxEpAcc4+e4a9eB+vXR8S2CLcd3Q@mail.gmail.com>
On Thursday 06 October 2011 23:05:45, Doug Evans wrote:
> > What would the user expect to be able to do next?
> > I ask because I played with it, and things don't necessarily work,
> > e.g. if wrong_executable didn't have libpthread.
> > Perhaps more smarts could be added to file to make this work, or maybe
> > a new command could be added to (effectively) reattach so that the
> > initialization that attach does was redone (in case one is
> > uncomfortable with having file do that. Though I think commands
> > shouldn't try to do too much. Otherwise one could say "Why doesn't
> > attach automagically redo the "file" command since if the first "file"
> > wasn't done it would anyway?" Maybe attach should at least warn the
> > user though).
Well, at least things should work the same as before, which IMO
is good thing as it makes this change an optimization only.
> Blech, I forgot one bit of cleanup.
> Revised patch attached.
Still breaks activating thread_db when debugging cores of
static executables.
$ ./gdb -nx -q ./testsuite/gdb.threads/staticthreads
Reading symbols from /home/pedro/gdb/baseline/build/gdb/testsuite/gdb.threads/staticthreads...done.
(gdb) start
Temporary breakpoint 1 at 0x400548: file ../../../src/gdb/testsuite/gdb.threads/staticthreads.c, line 48.
Starting program: /home/pedro/gdb/baseline/build/gdb/testsuite/gdb.threads/staticthreads
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Temporary breakpoint 1, main (argc=1, argv=0x7fffffffe038) at ../../../src/gdb/testsuite/gdb.threads/staticthreads.c:48
48 {
(gdb) gcore core.test
Saved corefile core.test
Before:
$ ./gdb -nx -q ./testsuite/gdb.threads/staticthreads -c ./core.test
Reading symbols from /home/pedro/gdb/baseline/build/gdb/testsuite/gdb.threads/staticthreads...done.
[New LWP 32418]
[Thread debugging using libthread_db enabled]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Core was generated by `/home/pedro/gdb/baseline/build/gdb/testsuite/gdb.threads/staticthreads'.
Program terminated with signal 5, Trace/breakpoint trap.
#0 main (argc=1, argv=0x7fffffffe038) at ../../../src/gdb/testsuite/gdb.threads/staticthreads.c:48
48 {
(gdb)
After:
$ ./gdb -nx -q ./testsuite/gdb.threads/staticthreads -c ./core.test
Reading symbols from /home/pedro/gdb/baseline/build/gdb/testsuite/gdb.threads/staticthreads...done.
[New LWP 32418]
Core was generated by `/home/pedro/gdb/baseline/build/gdb/testsuite/gdb.threads/staticthreads'.
Program terminated with signal 5, Trace/breakpoint trap.
#0 main (argc=1, argv=0x7fffffffe038) at ../../../src/gdb/testsuite/gdb.threads/staticthreads.c:48
48 {
(gdb)
Did you try this suggestion?:
> I think we'll no longer activate thread_db when debugging core
> files of static executables (e.g., a core of gdb.threads/staticthreads).
> It works with live debugging since we call check_for_thread_db
> from linux_child_post_attach/linux_child_post_startup_inferior.
> Maybe moving that to an inferior_created observer in
> linux-thread-db.c would work.
--
Pedro Alves
next prev parent reply other threads:[~2011-10-07 11:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-05 18:27 Doug Evans
2011-10-06 11:22 ` Pedro Alves
2011-10-06 19:56 ` Pedro Alves
2011-10-06 20:08 ` Doug Evans
2011-10-06 20:26 ` Pedro Alves
2011-10-06 21:56 ` Doug Evans
2011-10-06 22:06 ` Doug Evans
2011-10-07 11:09 ` Pedro Alves [this message]
2011-10-10 5:01 ` Doug Evans
2011-10-10 18:23 ` Pedro Alves
2011-10-11 3:38 ` Doug Evans
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=201110071209.18376.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
/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