home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!rphroy!kocrsv01!c23st
- From: c23st@kocrsv01.delcoelect.com (Spiros Triantafyllopoulos)
- Newsgroups: comp.unix.programmer
- Subject: How can I get a stack trace within a program?
- Message-ID: <1992Sep9.211516.7531@kocrsv01.delcoelect.com>
- Date: 9 Sep 92 21:15:16 GMT
- Sender: news@kocrsv01.delcoelect.com (Usenet News Account)
- Organization: Delco Electronics Corp.
- Lines: 34
-
- Hello net,
-
- we're looking for a program to do stack a trace before it coredumps. We
- would like to see, for example, the sequences of calls that resulted
- in the program to bomb. I.e. something like that:
-
- Main:
- foo( )
- bar( )
- abnormal termination line so and so.
-
- Now we're doing lots of X windows stuff and once in a while we dump
- core and would like some hint as to why this happens. This should not
- be impossible as 'trace' does more or less what we want. We have our
- own signal catcher (signal 11, where are you?) and at least do some
- damage repair there but would very much like more information.
-
- I have seen how adb or dbx can do it (adb with '$c' and dbx/dbxtool
- with 'where') but what we really want is to have this compiled in to
- our code, and upon detection of the right signal (argh!), dump the
- stack trace in a file or the screen and exit. Doing it post-mortem on
- core files is not practical, and after we catch the signal there may
- not even be a core file in most cases.
-
- Any hints on how to do this would be vastly appreciated...
-
- Thanks in advance,
-
- Spiros
-
- --
- Spiros Triantafyllopoulos c23st@kocrsv01.delcoelect.com
- Software Technology, Delco Electronics striantafyll@kosds1.gm.hac.com
- GM Hughes Electronics, Kokomo, IN 46904 [A Different Kind of Disclaimer]
-