gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Why can't I see the source in arm-gdb?

#7829 - fawnha - Thu Jun 26, 2003 3:44 am

Hi,
I am trying to debug using arm-gdb but when I select SOURCE it returns to assembly output (and selects ASSEMBLY). When I select MIXED it does show mixed output. Can anyone suggest why I can't see the source? I think it might be something to do with how I compile the program. My NMAKE file is as follows (the name of the program is "Third Strike" and I have one source file called "main.c"):

CFLAGS = -c -O0
MODEL = -mthumb -mthumb-interwork

all : thirdstrike.bin

thirdstrike.bin : thirdstrike.elf
objcopy -O binary thirdstrike.elf thirdstrike.bin

thirdstrike.elf : main.o
gcc $(MODEL) -g -o thirdstrike.elf main.o

main.o : main.c
gcc $(CFLAGS) -g $(MODEL) main.c

Thanks for any help,
Hamish

#7836 - Drago - Thu Jun 26, 2003 10:03 am

Try using -ggdb. Im not sure if you can use both -g and -ggdb but I think -ggdb may help...

#7864 - ampz - Fri Jun 27, 2003 4:00 am

What's wrong with using the mixed mode?
It's the best mode anyway.

You are using gdb in combination with an GBA emulator I guess?

#7866 - fawnha - Fri Jun 27, 2003 7:07 am

Drago, I have tried using -ggdb. It didn't help. I haven't tried it with -g though.

ampz, yes, I am using GDB with VisualBoyAdvance