Breakpoints and Steps with GDB
So I tried a myriad combinations of gdb and vba builds trying to get simple breakpoints and step throughs to work.
Â
I think the closest I've got it to work is using VBA-SDL-H from romhacking.net and arm-elf-gdb from http://gnutoolchains.com/arm-elf/ (7.4; configured as "--host=i686-pc-mingw32 --target=arm-elf".)
Â
Break Points kind of work, the program will stop but the debugger doesn't know which line it stopped at. However, if I do a command like backtrace then I get info other than 00s and ??s
Code: Select all
-exec bt
#0 0x08000262 in main ()
Which is a huge improvement from everything else I tried. (Even Piping through GDB works)
Â
Now, I read somewhere that there is a emulator called vba-sdl-h2 where the author fixed a bunch of stuff with stepping and break points.. which is exactly what I need. However, it was hosted at pokecommunity and is now a dead link. Google revealed in one of VBA-M's update logs that someone got the source of h2 and implemented the GDB functionality into VBA-M which is why I'm here trying to get GDB to work with VBA-M. As of now, it links to gdb, but I get no stops and garbage response from commands like backtrace.
Â
My current setup is using VisualCode Studio and c++ tools with it. (I've attached my launch file). My goal is to get breakpoints and stepping working in windows.
Â
I'm using DevKitArm to build my .gba and .elf file with minimal flags
Code: Select all
ARCH := -mthumb -mthumb-interwork
CFLAGS := -g -Wall \
-mcpu=arm7tdmi -mtune=arm7tdmi\
$(ARCH)
CFLAGS += $(INCLUDE)
ASFLAGS := $(ARCH)
LDFLAGS = -g $(ARCH) -Wl,-Map,$(notdir $@).map
I was using the Insight GDB that is bundled with DevKitArm for a short while. However, it crashed and stopped reading any .elf files I give it. Even reinstalling it didn't help.
Â
Overall, my question here is: Is GDB with VBA-M expected to work on windows? if so then with what version of GDB? if not is GDB with VBA-M expected to work in linux? Also, if it doesn't work on the latest version then is there a prior version with it working?
Â
Maybe I'm completely off track and someone here can point me in the right direction [img]<fileStore.core_Emoticons>/emoticons/laugh.png[/img]/emoticons/laugh@2x.png 2x" width="20" height="20" />
Quick Update: I got it working with VisualBoyAdvance-SDL-H and the latest GDB (https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads ; GNU gdb (GNU Tools for ARM Embedded Processors 6-2017-q2-update) 7.12.1.20170417-git "--host=i686-w64-mingw32 --target=arm-none-eabi")
Â
If anyone happens to have a copy of SDL-H2 Let me know [img]<fileStore.core_Emoticons>/emoticons/smile.png[/img]/emoticons/smile@2x.png 2x" width="20" height="20" />