Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: gdb@sources.redhat.com
Subject: expected behavior of GNU/Linux gcore and corefiles
Date: Sun, 02 Mar 2003 03:14:00 -0000	[thread overview]
Message-ID: <3E617797.5000704@redhat.com> (raw)

(notes from a hallway conversation, I had a recollection that, at some 
stage, the attempt to load libthread db over a core file on GNU/Linux 
was disabled.)

When using GDB on a live threaded program that puts all threads into 
tight infinite loops (while (1);), I'll do something like:

     $ ./a.out &
     Pid 1234
     $ gdb ./a.out 1234
     (gdb) info threads
     ....
     (gdb) quit

As a user I'd also expect sequences such as:

     $ kill -QUIT 1234
     $ gdb ./a.out core
     (gdb) info threads
     ....
     (gdb) quit

and:

     $ gcore 1234
     $ gdb ./a.out core
     (gdb) info threads
     ....
     (gdb) quit

and:

     $ gdb ./a.out 1234
     (gdb) gcore
     (gdb) quit
     $ gdb ./a.out core
     (gdb) info threads

to all come back with effectively the same output.  Further, on both 
live and corefile targets, I'd expect to be able to select/examine each 
thread vis:

     (gdb) thread 5
     11    i = i + 1;
     (gdb) list
     10    __thread__ i = 1;
     11    i = i + 1;
     (gdb) print i
     $1 = 1

(which would involve thread local storage).

Two problems come to mind:

- Is the kernel including all the raw information needed to do this in 
the core file?

- For GDB to completly implement the above, is it forced to use 
libthread-db?

My instincts tell me that, to completly implement the above 
functionality, GDB is always going to need libthread-db.  If GDB could 
implement the above on a core file without using libthread-db, then GDB 
could also implement the above on a live target also without using 
libthread-db.  This is because a core file is always going to contain a 
subset of the information made available via ptrace et.al.

Andrew


             reply	other threads:[~2003-03-02  3:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-02  3:14 Andrew Cagney [this message]
2003-03-02  3:39 ` Daniel Jacobowitz
2003-03-02  3:46   ` Daniel Jacobowitz
2003-03-02 15:53     ` Andrew Cagney
2003-03-02 17:09       ` Daniel Jacobowitz
2003-03-02 18:29         ` Andrew Cagney
2003-03-02 18:33           ` Daniel Jacobowitz
2003-03-02 20:03             ` Andrew Cagney
2003-03-02 20:31               ` Daniel Jacobowitz
2003-03-02 15:25   ` Andrew Cagney
2003-03-02 20:15 ` Andrew Cagney
2003-03-02 20:32   ` Daniel Jacobowitz

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=3E617797.5000704@redhat.com \
    --to=ac131313@redhat.com \
    --cc=gdb@sources.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