home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / programm / 4595 < prev    next >
Encoding:
Internet Message Format  |  1992-09-09  |  1.7 KB

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