Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 May 1996 14:49:14 +0930 (CST)
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        archie@whistle.com (Archie Cobbs)
Cc:        freebsd-questions@freebsd.org
Subject:   Re: stack trace library?
Message-ID:  <199605230519.OAA07249@genesis.atrad.adelaide.edu.au>
In-Reply-To: <199605230209.TAA10682@bubba.whistle.com> from "Archie Cobbs" at May 22, 96 07:09:56 pm

next in thread | previous in thread | raw e-mail | index | archive | help
Archie Cobbs stands accused of saying:
> 
> Does there exist a library with routines that a program (linked with -g)
> can use for doing stack crawls?

'man nlist' may help.

> For example, suppose you
> 
>     signal(SIGSEGV, CatchBug);
> 
> Then when CatchBug() is called, you want the program to display a
> stack trace from the point at which the signal occurred, a la gdb's
> "where" command. Then we could have self debugging programs! :-)

Note that it would probably almost as easy to fork off a subprocess, start
gdb and attach it to the offending process, run a few commands in it,
detach it and exit.

> -Archie

-- 
]] Mike Smith, Software Engineer        msmith@atrad.adelaide.edu.au    [[
]] Genesis Software                     genesis@atrad.adelaide.edu.au   [[
]] High-speed data acquisition and      (GSM mobile) 0411-222-496       [[
]] realtime instrument control          (ph/fax)  +61-8-267-3039        [[
]] Collector of old Unix hardware.      "Where are your PEZ?" The Tick  [[



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