Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!emory!hubcap!grimlok From: grimlok@hubcap.clemson.edu (Mike Percy) Newsgroups: comp.sys.ibm.pc.programmer Subject: Re: Turbo C Debugger Message-ID: <8665@hubcap.clemson.edu> Date: 9 Apr 90 18:43:25 GMT References: Distribution: comp Organization: Clemson University, Clemson, SC Lines: 40 I tried to mail this, but it bounced. simon@shiva.trl.oz (Simon Michnowicz - A Free Spirit): > > This question refers to the Disassembler in TurboC's > Stand-alone debugger. > > It has a really nice feature, namely printing a line > of C code, and the assembly instructions that are > equivalent to it. > > This is really useful to me, and I would like to > get the WHOLE file done like that. However there > seems to be no easy way of doing this. The only way > I can think of is to dump each window full of information > to a log file. Tedious for long progams!! > Well, in answer to your question, I found it to be a handy feature too, and wanted to get a whole program listed in this form. What I did was to write a REXX exec that reads in the C program and merges it with the ASM file. I meant to get around to re-writing the exec in C, but haven't so far. You should be able to do it pretty simply, though. Have a look at the output of the following: tcc -S prog.c (namely prog.asm) Notice the lines labeled ; debug L ## (## is the corresponding line in the C prog) So now make a C prog that reads in a C source code into an array (because you may need to reference them more than once) and then read the .ASM file. When you see a line with the above prefix, spit out the C line with the right number. Lines without the right prefix, just spit out. You could avoid the array by doing a simple merge kind-of-thing. For the few cases when you would need a line from the source more than once, you could vote to simply put out the ?debug line. Good luck.