home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!sun-barr!ames!nsisrv!nsisrv!kstailey
- From: kstailey@leidecker.gsfc.nasa.gov (Kenneth Stailey)
- Subject: Re: Program name from a core file
- In-Reply-To: puglia@cucbs.chem.columbia.edu's message of 12 Sep 92 17: 34:14 GMT
- Message-ID: <KSTAILEY.92Sep14185120@leidecker.gsfc.nasa.gov>
- Sender: usenet@nsisrv.gsfc.nasa.gov (Usenet)
- Nntp-Posting-Host: leidecker.gsfc.nasa.gov
- Organization: /kstailey/.organization
- References: <1992Sep12.173414.20931@cucbs.chem.columbia.edu>
- Date: Mon, 14 Sep 1992 23:51:20 GMT
- Lines: 31
-
- In article <1992Sep12.173414.20931@cucbs.chem.columbia.edu> puglia@cucbs.chem.columbia.edu (Paul Puglia) writes:
-
- I as a goof I took on the problem of writing a program to extract
- the filename out of a core file. The program below seems to
- work fine with core generated when you issue a QUIT signal from
- the terminal. It doesn't work with arbitrary core files. I have
- alot of core from mwm and xdt lying around the system, but this
- program doesn't seem to be able to snag their name.
-
- While developing the program, I did discover a method that seems
- to always work. It relies on the fact that the program's full
- pathname is located after the the characters _= . I can't figure
- out if it is the shell that stores this or it is a result of the
- the core dump. This sequence is close to the SHELL environment so
- I would guess that it is store as part of the shell. It is
- really easy to extract the programs name out of the the core using
- this the sequence:
-
- If anyone can explain why my program doesn't work, and what the _=
- sequence is and who generates it I would appreciate it greatly .
-
- "_" is a ksh variable meaning "last command run from the shell"
-
- BTW. "dbx /bin/ls core" will print "core file program () does not match..."
- with the () filled in with the program name from the core file.
-
- --
- -----------------------------------------------------------------
- It's not just my .signature file, It's also a client!
-
- replys to kstailey@gnu.ai.mit.edu or kstailey@leidecker.gsfc.nasa.gov
-