I'm newbie to emulator. Nowadays I try to view src code of mgba(GBA Emulator).
https://github.com/mgba-emu/mgba
I built and found option -g
.
-g
option means Start GDB session (default port 2345)
from help.
Is it able to be debugged with GDB?
How can I debug with GDB?
Please tell me how to or other methods to trace source code?
(Sorry for my poor English.)
The
-g
option means you can remotely debug your rom with a remote debugger ofgdb
likegdb
,ghidra
orradare2
. You will need another tool as mentioned before.Sadly you can not debug remotely a classic gameboy rom. It only works for gameboy advance roms.
If you just want to debug the rom with no remote debugging access you can still use gdb from mgba with no remote debugging using the command
a terminal should start. Then use gdb commands such as
c
to continue.If you do not like gdb, you can get a look at
BGB
if you prefer a more graphic debugger.