Game Development Community

Debugger API: Breakpoints Don't Stop

by J "hplus" W · in Torque Game Engine · 09/10/2006 (10:12 am) · 11 replies

I'm trying to put a small GUI on top of the telnet debugger API, and everything goes swimmingly, except for one thing: After I've set a breakpoint, and execution reaches that function, the execution doesn't actually stop.

In my main.cs, I have the code:
dbgSetParameters(12345,"password");

In my debugger, I do the file list and breakable lines list thing, and then set a breakpoint. If I set it on a non-breakabale line, I get the breakpoint-moved indication, so it seems to me that the breakpoint command is proper. It just doesn't stop!

Here's a log from the communication:

Received: PASS Connected.
Sent: BRKCLRALL
Sent: FILELIST
Received: FILELISTOUT GameOne/server/horse.cs GameOne/server/logoitem.cs {list shortened in post}
Sent: BREAKLIST GameOne/client/clientGame.cs
Received: BREAKLISTOUT GameOne/client/clientGame.cs 2 2 1 4 1
Sent: BRKSET GameOne/client/clientGame.cs 3 true 1



Is there something special I need to do to make the script engine stop for breakpoints?

#1
09/10/2006 (10:13 am)
Btw: I've also tried it with passCount of 0 (i e, BRKSET file line true 0)
#2
09/10/2006 (11:26 am)
I briefly had some success when using "1" instead of "true," and I had the theory that, although the Wiki documentation says the value should be "true" for auto-clearing the breakpoint count, maybe it should be "1" instead. However, after trying some more, it again doesn't break for me when I set breakpoints and should hit them.

Are there known bugs? Are there known-working code samples? Is there a nice Windows GUI debugger for TorqueScript available for download, and I just missed it?
#3
09/10/2006 (12:50 pm)
If you do that for linux : great , I am interesting to help you.

For windows codeweaver and torsion are available , free and work well.

tdn.garagegames.com/wiki/TorqueScript/IDE/Guide
#4
09/10/2006 (3:11 pm)
Nah, I'm doing it in .NET / WinForms. Of course, I don't use anything special, so mono ought to run it fine.

Besides, it's a fun project, so I'd like to at least make it work reliably. Any ideas on what could be going wrong, when the debugger seems to be aware of the breakpoints, but hitting those locations doesn't actually break? Where in the C++ code could I start investigating to see why the breakpoints aren't being matched?
#5
09/10/2006 (3:20 pm)
Heh. Torsion claims to be alpha, and expires on Sept 17 2006...
#6
09/10/2006 (4:14 pm)
It is and does. ;)
#7
09/10/2006 (7:47 pm)
Best bet if you're having a spot of trouble w/ the script debug stuff is to set a breakpoint on that command in the TelnetDebugger and see exactly what's going on. In theory the docs are accurate (they were accurate enough for Tom to write extensive debugging functionality on top of it), but if you want/need complete information then running under the Visual Studio debugger (or your favorite debugger) is the way to go.
#8
09/10/2006 (8:04 pm)
Yes, I'll probably have to do that. It's a shame, because the docs actually seemed pretty clear. (And I've written not one, but two real debuggers in former careers!)

However, it seems as if the commands are recognized well enough -- it behaves as if it's accepting the commands (if I set a breakpoint on a non-breakable line, it will move it to a breakable line and notify me, for example) -- it just doesn't actually stop when getting to that point in the source.
#9
09/10/2006 (8:41 pm)
OK, I found at least one problem: The "expr" argument is documented as optional, but is actually required. I updated the Wiki to reflect this.
#10
09/10/2006 (9:04 pm)
Another problem: the auto-clear flag seems to auto-clear the breakpoint, not just the breakpoint count, as indicated in the documentation. Updated again.
#11
09/12/2006 (1:56 pm)
Awesome, thanks for updating the wiki doc! Tom, if you get the chance can you look it over as well and make sure everything's up to date based on your knowledge of the debugger?