Mail Archives: djgpp-workers/2003/04/26/08:50:43
> From: "Gisle Vanem" <giva AT bgnett DOT no>
> 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
- Raw text -