public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb@sources.redhat.com
Subject: Re: new option --readnever & script gstack?
Date: Tue, 23 Nov 2004 16:34:00 -0000	[thread overview]
Message-ID: <41A363FE.9060307@redhat.com> (raw)
In-Reply-To: <01c4d151$Blat.v2.2.2$ca52d9c0@zahav.net.il>

[-- Attachment #1: Type: text/plain, Size: 2432 bytes --]

Eli Zaretskii wrote:
>>Date: Mon, 22 Nov 2004 15:34:22 -0500
>>From: Andrew Cagney <ac131313@redhat.com>
>>
>>As the oposite to --readnow, I'd like to propose a new option 
>>--readnever (i.e., don't read in the symbolic debug inf).  That and a 
>>few lines of script should let GDB implemement a direct equivalent to 
>>pstack (called gstack say).
> 
> 
> An alternative to this would be to have a --read=WHEN switch, which
> could accept 3 arguments: `now', `asneeded' (the default), and
> `never'.
> 
> However, I must admit that, like Mark, I don't see the situation where
> this would be useful.  Could you perhaps describe such a situation,
> and explain how the existance of the new option would help, including
> the auxiliary script and the relation to `pstack'?

Lets focus on "pstack", or a potential GDB alternative, "gstack".

The pstack program attaches to a running process, dumps out a minimal 
backtrace (i.e., no symbolic information such as parameter names) of all 
threads, and then detaches. It's useful when tying to quickly capture 
information from a live system.

The top three google hits for "pstack" are:

http://packages.debian.org/unstable/devel/pstack
The existing pstack port.  Last time I checked it didn't work with 
threads, didn't work when there was no unwind information, and didn't 
work on most architectures (i386 specific)?

http://oss.oracle.com/projects/pstack-gdb/
An existing wrapper to GDB.  It works as well as GDB (i.e., threads, 
when there's no unwind information, and across architectures).

http://docs.sun.com/doc/816-0210/6m6nb7mih?a=view
For reference, doco on the entire p* family of commands.

Now to get a more functional pstack, I can think of two strategies:

- throw new code at pstack (or similar) until it supports threads, 
non-debug-info frames and multiple architectures, ...

- modify the existing GDB, which already handles threads and 
non-debug-info frames, and multiple architectures, so that it can 
implement pstack.

I've attached a prototype GDB wrapper that implements the second 
alternative.  The only missing piece is the suppression of symbolic info 
in the backtrace - pstack, which is trying to be quick, doesn't include 
that more detailed information.

So, to my questions:

- what of an option to suppress symbolic debug info (--readnever, 
--read=never, --symtab-read=never, ...)?
- what of a new script called gstack, bundled with GDB?

Andrew

[-- Attachment #2: gstack.sh --]
[-- Type: application/x-shellscript, Size: 505 bytes --]

  reply	other threads:[~2004-11-23 16:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-22 20:52 Andrew Cagney
2004-11-22 21:42 ` Mark Kettenis
2004-11-22 22:24   ` Andrew Cagney
2004-11-23 11:46     ` Mark Kettenis
2004-11-23 12:28 ` Eli Zaretskii
2004-11-23 16:34   ` Andrew Cagney [this message]
2004-11-23 21:21     ` Eli Zaretskii
2004-11-23 21:46       ` Andrew Burgess
2004-11-24  9:19         ` Eli Zaretskii
2004-11-29 16:11           ` Andrew Cagney
2004-11-29 16:14             ` Daniel Jacobowitz
2004-11-29 17:50               ` Daniel Jacobowitz
2004-11-29 22:08             ` Eli Zaretskii
2004-11-24 18:04       ` Frank Ch. Eigler
2004-11-23 16:58 Bloch, Jack
2004-11-23 20:45 ` Eli Zaretskii
2004-11-24  3:44 Bloch, Jack
2004-11-24  6:56 ` Eli Zaretskii

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=41A363FE.9060307@redhat.com \
    --to=ac131313@redhat.com \
    --cc=eliz@gnu.org \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).