🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3581

Re: programatically accessing call stack information

#3581
From: Scott Dudley
Date: Tue, 06 Feb 2001 01:25
26 lines
2013 bytes
sorry for lack of specifics.  i need a solution that will work on linux and
aix.

thanks nate.


Nate Eldredge wrote:

> 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
Technical Details
Message-ID: <3A7F5283.79FFEC81@telesoft.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-xit-01!supernews.com!newshub2.rdc1.sfba.home.com!news.home.com!enews.sgi.com!news.good.net!news.goodnet.com!not-for-mail
References: <3A7F351C.3DBDD790@telesoft.com> <833dds39a3.fsf@mercury.st.hmc.edu>

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: fc89c,c855886e49da0ecc
X-Google-Attributes: gidfc89c,public
X-Google-Thread: 1014db,c855886e49da0ecc
X-Google-Attributes: gid1014db,public
X-Google-ArrivalTime: 2001-02-05 17:25:37 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-xit-01!supernews.com!newshub2.rdc1.sfba.home.com!news.home.com!enews.sgi.com!news.good.net!news.goodnet.com!not-for-mail
Message-ID: <3A7F5283.79FFEC81@telesoft.com>
From: Scott Dudley <scott@telesoft.com>
Organization: Telesoft Corp.
X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14-5.0 i686)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.unix.programmer,gnu.gcc.help,comp.lang.c
Subject: Re: programatically accessing call stack information
References: <3A7F351C.3DBDD790@telesoft.com> <833dds39a3.fsf@mercury.st.hmc.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 27
Date: Mon, 05 Feb 2001 18:25:23 -0700
NNTP-Posting-Host: 207.204.153.196
X-Complaints-To: abuse@winstar.net
X-Trace: news.goodnet.com 981422735 207.204.153.196 (Mon, 05 Feb 2001 18:25:35 MST)
NNTP-Posting-Date: Mon, 05 Feb 2001 18:25:35 MST