From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,f2a96e8c61f621a1 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-09-12 15:40:10 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.uchicago.edu!vixen.cso.uiuc.edu!hardy.tc.umn.edu!news.nodak.edu!not-for-mail From: mooney@dogbert.cc.ndsu.NoDak.edu (Tim Mooney) Newsgroups: comp.unix.tru64 Subject: Re: Segmentation fault (core dumped) Date: 12 Sep 2001 22:31:25 GMT Organization: North Dakota Higher Education Computing Network (NDHECN) Message-ID: <9nonnt$lkb$7@news.ndsu.nodak.edu> References: <3B9DAFD3.714AC82C@ilt.fhg.de> NNTP-Posting-Host: dogbert.cc.ndsu.nodak.edu Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: news.ndsu.nodak.edu 1000333885 22155 134.129.106.23 (12 Sep 2001 22:31:25 GMT) X-Complaints-To: abuse@nodak.edu NNTP-Posting-Date: 12 Sep 2001 22:31:25 GMT X-Newsreader: trn 4.0-test74 (May 26, 2000) Originator: mooney@dogbert.cc.ndsu.NoDak.edu (Tim Mooney) Xref: archiver1.google.com comp.unix.tru64:4866 In article <3B9DAFD3.714AC82C@ilt.fhg.de>, Rolf Wester wrote: > Hi, > > I have a question concerning core dumps. I have a program written in c++ > (compiler is cxx) that makes a segmentation fault with subsequent core > dump. This happens some time after program start, so debugging would be > quite tedious. I think you're confusing "debugging" with single-stepping through a program. Try this: ladebug your-program-name and then within ladebug type run any arguments you would normally supply on the command line go here i.e. if you normally would run you program and give it the name of a file to read data from, you just run filename Then just use your program as you normally do. When your program gets a fatal signal, ladebug will catch it before the program cores and before it exits. From there you can use commands like `where' to get a stack back trace and `print' to get information on variables. If your program wasn't compiled with debugging symbols, you'll have an easier time getting more and better information if you recompile it with debugging symbols (i.e. -g option to compiler and/or linker, and don't strip the binary -- running `file' on the program should indicate `not stripped' in the output). > Is it possible to get information about the source line > where the segmentation fault happens from the core dump? Yup. It's generally easier to do more if you catch the fatal signal while running under a debugger, but you can even get some postmortem just by doing ladebug programname core and then typing where Be sure you're using a recent version of ladebug. It's improved a lot. I would recommend the GNU debugger gdb, but it frankly doesn't work all that well on Tru64. Tim -- Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu Information Technology Services (701) 231-1076 (Voice) Room 242-J6, IACC Building (701) 231-8541 (Fax) North Dakota State University, Fargo, ND 58105-5164