From: CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 5-OCT-1989 09:34 To: MRGATE::"ARISIA::EVERHART" Subj: Producing a debug-version of an executable file Message-Id: <8910051305.AA09677@crdgw1.ge.com> Received: From CUNYVM.CUNY.EDU by CRVAX.SRI.COM with TCP; Thu, 5 OCT 89 03:25:25 PDT Received: from ITOPOLI.BITNET by CUNYVM.CUNY.EDU (IBM VM SMTP R1.2.1MX) with BSMTP id 5948; Thu, 05 Oct 89 06:26:16 EDT Date: Thu, 5 Oct 89 11:21 GMT+1 From: "P.L. Montessoro * CENS-CNR * +39-11-556.7013" Subject: Producing a debug-version of an executable file To: INFO-VAX@KL.SRI.COM X-Vms-To: @[.DIS]INFOVAX Hello to everybody. E.Heuser-Hofmann (CHWEYRIC@DKNKURZ1.BITNET) proposed the following solution to force an executable image file to run with the VMS debugger: > patch/abs xxx.exe > exa 20 > if 20 = 01000028 then: > dep 20 = 01000029 > update > exit It seems not to work if the executable file has been linked using the /NODEBUG/NOTRACEBACK options: in such a case the entry address of the debugger is missed. I couldn't find any documentation about the debug information in the header of the .EXE files, but it is possible to understand enough comparing the dump of two test files, one linked with the /DEBUG option, and the oter one with /NODEBUG/NOTRACEBACK. The following C program modifies the header in order to insert the missing information. It runs under VMS 5.1, I don't remember if it is the original one that I wrote for VMS 4.7, of if I had to upgrade it. **************************************************************************** #include main() { int fp, fpout; char filename[32]; char buffer [512]; int cnt; printf ("\nfilename (without extension): "); scanf ("%s", filename); strcat (filename, ".exe"); if ((fp = open (filename,0)) == -1) { printf ("open error\n"); exit(4); } fpout = creat (filename,0,"mrs=512","rfm=fix","bls=512"); read (fp, buffer, 512); buffer [52] = buffer [48]; buffer [53] = buffer [49]; buffer [54] = buffer [50]; buffer [55] = buffer [51]; buffer [48] = 0x68; buffer [49] = 0xDF; buffer [50] = 0xFE; buffer [51] = 0x7F; buffer [32] = 0x29; buffer [68] = 0x42; write (fpout, buffer, 512); while (read (fp, buffer, 512)) { write (fpout, buffer, 512); } close (fp); close (fpout); } **************************************************************************** Pier Luca MONTESSORO CENS-CNR Dipartimento di Automatica e Informatica Politecnico di Torino Corso Duca degli Abruzzi 24 10129 Torino ITALY Tel. 011-556.7013 (Int. + 39-11-556.7013) Fax. 011-556.7099 (Int. + 39-11-556.7099) Telex. 220646 POLITO I Bitnet: pierluca@itopoli.bitnet Span/Physnet: 39494::PIERLUCA