From owner-freebsd-hackers Wed Oct 30 7:37:33 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 799D937B502 for ; Wed, 30 Oct 2002 07:37:24 -0800 (PST) Received: from mail.speakeasy.net (mail16.speakeasy.net [216.254.0.216]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0958843E3B for ; Wed, 30 Oct 2002 07:37:24 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 743 invoked from network); 30 Oct 2002 15:37:26 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail16.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 30 Oct 2002 15:37:26 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.6/8.12.6) with ESMTP id g9UFbMn5025682; Wed, 30 Oct 2002 10:37:22 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Wed, 30 Oct 2002 10:37:22 -0500 (EST) From: John Baldwin To: Nate Lawson Subject: RE: Command used to trace the stack of a process Cc: freebsd-hackers@freebsd.org, Zhihui Zhang Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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: >> >> + 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 ' where 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 <>< 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