🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3580

Re: programatically accessing call stack information

#3580
From: Nate Eldredge
Date: Tue, 06 Feb 2001 01:11
18 lines
1877 bytes
Scott Dudley <scott@telesoft.com> writes:

> is there a way to access call stack information at run time from within
> a program?  i've been maintaining my own crude stack using __FUNCTION__
> and linked lists but can't help but think there's gotta be a better
> way...

It depends on your system.  If you have glibc 2.1 or newer, you may
have the `backtrace' function and its relatives.  See <execinfo.h>.
Other systems may have other ways-- what is yours?

Note that the way you're currently using is almost certainly the only
one guaranteed to work on every system.

-- 

Nate Eldredge
neldredge@hmc.edu
Technical Details
Message-ID: <833dds39a3.fsf@mercury.st.hmc.edu>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.stanford.edu!headwall.stanford.edu!feeder.via.net!sjc1.nntp.concentric.net!newsfeed.concentric.net!news.interworld.net!not-for-mail
References: <3A7F351C.3DBDD790@telesoft.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,c855886e49da0ecc
X-Google-Attributes: gid11318c,public
X-Google-Thread: 1014db,c855886e49da0ecc
X-Google-Attributes: gid1014db,public
X-Google-Thread: fc89c,c855886e49da0ecc
X-Google-Attributes: gidfc89c,public
X-Google-ArrivalTime: 2001-02-05 17:11:35 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.stanford.edu!headwall.stanford.edu!feeder.via.net!sjc1.nntp.concentric.net!newsfeed.concentric.net!news.interworld.net!not-for-mail
From: Nate Eldredge <neldredge@hmc.edu>
Newsgroups: comp.unix.programmer,gnu.gcc.help,comp.lang.c
Subject: Re: programatically accessing call stack information
Date: 05 Feb 2001 17:11:32 -0800
Organization: InterWorld Communications
Lines: 18
Sender: nate@mercury.st.hmc.edu
Message-ID: <833dds39a3.fsf@mercury.st.hmc.edu>
References: <3A7F351C.3DBDD790@telesoft.com>
NNTP-Posting-Host: mercury.st.hmc.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: nntp1.interworld.net 981421894 91098 134.173.57.219 (6 Feb 2001 01:11:34 GMT)
X-Complaints-To: usenet@news.interworld.net
NNTP-Posting-Date: Tue, 6 Feb 2001 01:11:34 +0000 (UTC)
User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.5