From owner-freebsd-questions Wed May 22 22:04:51 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id WAA15754 for questions-outgoing; Wed, 22 May 1996 22:04:51 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id WAA15732 for ; Wed, 22 May 1996 22:04:43 -0700 (PDT) Received: from msmith@localhost by genesis.atrad.adelaide.edu.au (8.6.12/8.6.9) id OAA07249; Thu, 23 May 1996 14:49:15 +0930 From: Michael Smith Message-Id: <199605230519.OAA07249@genesis.atrad.adelaide.edu.au> Subject: Re: stack trace library? To: archie@whistle.com (Archie Cobbs) Date: Thu, 23 May 1996 14:49:14 +0930 (CST) Cc: freebsd-questions@freebsd.org In-Reply-To: <199605230209.TAA10682@bubba.whistle.com> from "Archie Cobbs" at May 22, 96 07:09:56 pm MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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 [[