Post Reply 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Breakpoints and Steps with GDB
Author Message
izackp Offline
Junior Member

Posts: 1
Joined: Jul 2017
Reputation: 0
Post: #1
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 and arm-elf-gdb from (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
-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
ARCH    :=    -mthumb -mthumb-interwork

CFLAGS    :=    -g -Wall \
            -mcpu=arm7tdmi -mtune=arm7tdmi\

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 xD

Quick Update: I got it working with VisualBoyAdvance-SDL-H and the latest GDB ( ; GNU gdb (GNU Tools for ARM Embedded Processors 6-2017-q2-update) "--host=i686-w64-mingw32 --target=arm-none-eabi")

If anyone happens to have a copy of SDL-H2 Let me know Smile

Attached File(s)
.txt  launch.json.txt (Size: 771 bytes / Downloads: 2)
(This post was last modified: 07-13-2017 12:36 AM by izackp.)
07-12-2017 10:32 AM
Find all posts by this user Quote this message in a reply
AdamN Offline

Posts: 43
Joined: Apr 2011
Reputation: 2
Post: #2
RE: Breakpoints and Steps with GDB

The last time i tried to use GDB with VBA-M on windows it cause my GDB to stop responding >.< and i ended modifying the internal debugger on VBA-M svn1030e in order to put breakpoints (by address or value being written/read) to analyze wireless adapter data, but that was years ago, not sure about the latest one.

You can checkout checkout the Debugger on VBA-M 1030e (my mod) to see if it's helpfull Smile but i didn't touch the GDB code though
it was on archive (before vba-m forum got rolled back)
(This post was last modified: 07-14-2017 10:44 PM by AdamN.)
07-14-2017 10:38 PM
Find all posts by this user Quote this message in a reply
Post Reply 

Forum Jump:

User(s) browsing this thread: 1 Guest(s)

 Quick Theme: