home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / aix / 9654 < prev    next >
Encoding:
Text File  |  1992-09-14  |  2.1 KB  |  45 lines

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