Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Oct 2002 10:37:22 -0500 (EST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Nate Lawson <nate@root.org>
Cc:        freebsd-hackers@freebsd.org, Zhihui Zhang <zzhang@cs.binghamton.edu>
Subject:   RE: Command used to trace the stack of a process
Message-ID:  <XFMail.20021030103722.jhb@FreeBSD.org>
In-Reply-To: <Pine.BSF.4.21.0210291539240.88401-100000@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 29-Oct-2002 Nate Lawson wrote:
> l *routine + 0x350 or if you use a core file with symbols (-g), gdb will
> do it automatically.  Please read the gdb docs for better info.

You can also use 'nm' with grep to find routine's start address.  Then
add the offset to that and use 'addr2line' to find the line number.
This might be easier to throw into a shell script than firing up
gdb for example (not to mention quicker).
 
> On Tue, 29 Oct 2002, Zhihui Zhang wrote:
> 
>> 
>> Thanks. The backtrace often gives something like:
>> 
>>     <routine name> + 0x350
>> 
>> Is there a way to quickly determine the correponding source code line?
>> 
>> -Zhihui
>> 
>> On Tue, 29 Oct 2002, Nate Lawson wrote:
>> 
>> > On Tue, 29 Oct 2002, John Baldwin wrote:
>> > > On 29-Oct-2002 Zhihui Zhang wrote:
>> > > > 
>> > > > I remember there is a command in either gdb or ddb which enable you to
>> > > > display the stack of a particular process. Can anyone tell me if there is
>> > > > such a command and what the command is?  Thanks!
>> > > 
>> > > In ddb you can do 'tr <pid>' where <pid> is the PID of the process.
>> > 
>> > In gdb, it's bt.
>> > 
>> > 
>> > To Unsubscribe: send mail to majordomo@FreeBSD.org
>> > with "unsubscribe freebsd-hackers" in the body of the message
>> > 
>> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20021030103722.jhb>