Remote Debugging Test

BlitzMax Forums/BlitzMax Programming/Remote Debugging Test

Brucey(Posted 2009) [#1]
Hello sports fans.

It's been another fairly unproductive weekend over here at BaH Central, but I've managed to knock together a little Windows demo/test which perhaps some of you might like to try out for me please.

The test consists of two executables. One is a "debug" app. The other is a "debugger".
You can start them both on the same machine if you like - or on different machines if you are feeling adventurous ;-)

remote_debugging_test_win32.rar (1.3meg)

When they are both running, you can enter the IP address of the machine where the "debug" app is running. The default is the same machine. The apps use Port 31666.
Then, try to "Connect". If successful it should indicate as such, and enable the Pause button.
Note, that the "debug" app is a plain-old-BlitzMax app, except that the "appstub" module has been enhanced to work over TCP instead of IO pipes. This means that in theory, your app itself requires no changes to support this :-)

When you hit Pause, it is as if you had a DebugStop command in the code at that very place. Think of it like pausing music, except that now we pause our App. Once paused you can view the application stack, and see variable values etc (as you would in the IDE).
You can also Step through... or simply hit "Continue" and let it continue as it was. You can Pause it again at any time.

Obviously the "debugger" part of this demo would be best placed in an IDE, but this is just a demo of the technology.

Screenie :


Sorry the test app isn't more exciting, but I only spent 10 mins putting it together...

Oh, other things of interest. This works across network, as well as across platforms. (yes, you can run an App on Mac, and debug it on Windows - for example)

Comments, criticism, sarcasm and feedback welcome as usual.

Anyways... happy Burns day :-)


markcw(Posted 2009) [#2]
Well I've no need for this myself but happy Burns day. Did you have a haggis?


d-bug(Posted 2009) [#3]
Do you have any plans to porting this to OSX? This would be a great addition for TextMate or JEdit users. :)


Brucey(Posted 2009) [#4]
Do you have any plans to porting this to OSX?

There's nothing to port. The code that does all the work is just a drop-in replacement for the default AppStub module (which every BlitzMax app already includes).
It was all developed 100% on Mac :-p
For the above example, all I did was drop the code into XP, and build it.

Oh, there's another thing this would be useful for (assuming you have a spare machine). It allows you to debug a full-screen Mac app - which you cannot currently do (for whatever reason).

I realise, with the game-centric nature of BlitzMax, most people won't get this whole "remote debugging" thing :-)
However, I think the ability to "break" into a running app is just as exciting. And, once I get "breakpoints" working, it should make tools such as Blide much more useful...

But, one step at a time.


Muttley(Posted 2009) [#5]
Very cool Brucey. :)


ziggy(Posted 2009) [#6]
This seems very interesting... The only problem I see with this to be supported by BLIde is that it relys on a tweak on the official modules. Anyway, it is very very interesting.


Brucey(Posted 2009) [#7]
...it relys on a tweak on the official modules.

Not necessarily.
Since we already have the ability to specify which appstub module we wish to link to (bmk option -b), it doesn't have to be an "official" module.

Of course, it would be nice if it was ;-)


Mr. Write Errors Man(Posted 2009) [#8]
This is cool. So theoretically I could send a debug version of an app to a customer who is experiencing problems and remotely debug the thing?


Brucey(Posted 2009) [#9]
In theory, yes.


Perturbatio(Posted 2009) [#10]
I presume you can change the port that it uses?


Brucey(Posted 2009) [#11]
Aye. It's hardcoded at the moment for (my) convenience. :-)


ziggy(Posted 2009) [#12]
I'll take a deeper look at this when I finish the new project management system for BLIde. Is this something you're planing to develop further or mantain?


Beaker(Posted 2009) [#13]
I must've missed this. It looks really good. I've always wanted a seperate debugger for BlitzMax to make it easier to program using a generic IDE (in my case UltraEdit).