Date: Sat, 26 Apr 2003 15:11:21 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: giva AT bgnett DOT no Message-Id: <3405-Sat26Apr2003151120+0300-eliz@elta.co.il> X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9 CC: djgpp-workers AT delorie DOT com In-reply-to: <001e01c30be4$c8fbcca0$0600000a@broadpark.no> (giva@bgnett.no) Subject: Re: Debuglines for asm-code References: <001e01c30be4$c8fbcca0$0600000a AT broadpark DOT no> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "Gisle Vanem" > Date: Sat, 26 Apr 2003 13:12:54 +0200 > > My makefile has this rule: > $(OBJDIR)/%.o: %.s > $(CC) -g -Wall -x assembler-with-cpp -o $@ -c $< > > This gets impossible to step through with RHGDB, since gcc gives > 'as' a temp file as input. 'objdump -s file.o' is showing debug-info > like: > Contents of section .debug_line: > 0000 ab000000 02002600 00000101 fb0e0a00 ......&......... > 0010 01010101 00000001 00633a2f 74656d70 .........c:/temp > 0020 2f636356 45434c33 642e7300 00000000 /ccVECL3d.s..... > > RHGDB is asking for c:\temp\ccVECL3d.s. How do I solve this > w/o the need for a temp .s file for RHGDB to debug? One way is to have two rules: one to preprocess the .S file into .s, the other to assemble it. I didn't try that, so it's just an idea to try. Another possibility is to give GCC the -save-temps switch, which should cause it not to delete temporary files; then RHIDE will indeed find the file it is looking for. Yet another possibility is to try a different debug-info format (-gcoff, -gstabs+, etc.). That might supply a work-around for the problem if nothing else does. Anyway, what exactly do you need the debug info for in the asm source? What debugger commands don't work on machine code with no debug info? > I noticed the libc sources uses a similar '.S.o' rule. How are you > djgpp-workers debugging as-code? I'm guessing we mostly don't ;-) All I ever do with asm sources is step through them using "stepi" and "nexti" which step by machine instructions. Normally, I also do a "display/i $pc" before I start such stepping, which causes GDB to disassemble each instruction and display it before it gets executed by stepi/nexti. I find this more than sufficient for debugging at the machine code level. HTH