Debugger

BlitzMax Forums/BlitzMax Programming/Debugger

PhotonTom(Posted 2015) [#1]
I'd like to start using the command line to compile and run my applications, is there an external debugger anywhere that could be used? Do people use a debugger other than the MaxIDE one and if so what advantages does it bring?

(I've seen talk about it on different forum posts but could never find a link to anything)


markcw(Posted 2015) [#2]
You use gdb.

http://stackoverflow.com/questions/4671900/how-do-i-use-the-mingw-gdb-debugger-to-debug-a-c-program-in-windows


Brucey(Posted 2015) [#3]
You can't use gdb to debug legacy BlitzMax stuff because everything is in assembler and there are no symbols.

You either,
1) need something which understands the debug syntax/interactive commands or
2) compile your app using a different bcc compiler which outputs gdb friendlier code.

There are several modules which provide for 1, in various ways (bah.appstubrdb - remote debugging via tcp, bah.dbgp - DBGP support)
For both of those, there's no direct usage as such, and they would need to be used with some other package to be useful.

Not many options for 2. :-p


skidracer(Posted 2015) [#4]
MaxIDE communicates with the BlitzMax app debugger using Standard IO.

You don't need MaxIDE to use the BlitzMax debugger.

From the command line, run a BlitzMax debug mode app that has a DebugStop command.

When it breaks you should get the ~> prompt.

If you then type H the embedded debugger replies with the commands it supports:



~>DebugStop:
~>
H
~>T - Stack trace
~>R - Run from here
~>S - Step through source code
~>E - Step into function call
~>L - Leave function or local block
~>Q - Quit
~>H - This text
~>Dxxxxxxxx - Dump object at hex address xxxxxxxx
~>
T
~>StackTrace{
~>@...;
~>Function untitled1
~>Local a:Int=20
~>}
~>