Opened 8 years ago

Last modified 21 months ago

#410 reopened enhancement

Component script debugger

Reported by: Philip Taylor Owned by: Yves
Priority: Should Have Milestone: Backlog
Component: UI & Simulation Keywords:
Cc: Patch:

Description (last modified by leper)

Component scripts are likely to get complex, so there needs to be a reasonable way to debug them. Currently there's just print() going to stdout, which isn't great.

Ideally there'd be a full graphical debugger with source code display and breakpoints and watches and stepping and so on. But that sounds really complex so maybe something simpler would be a more realistic idea.

The implementation should use https://developer.mozilla.org/en-US/docs/Tools/Debugger-API (and likely also https://wiki.mozilla.org/Remote_Debugging_Protocol)

The debugger should be able to pause execution. That means the thread running scripts will be paused inside its JS API calls, and the simulation will be in an inconsistent state. We could perhaps allow the engine to keep running (by using a reentrant game loop, or splitting the simulation into a secondary thread), but we'd need to be very careful since the engine isn't currently designed to do that. It might be better to implement the debugger as part of Atlas (which runs in its own independent thread), so it can communicate with an entirely paused engine, and also so it can use wxWidgets for the UI.

Change History (17)

comment:1 Changed 8 years ago by Philip Taylor

Noticed on #jsapi IRC:

Note that any new debugger work on top of jsdbgapi.h is likely to be throw-away code in a month or two! Or three. I think the new API will be much like http://code.google.com/p/v8/wiki/DebuggerProtocol

comment:2 Changed 7 years ago by (none)

Milestone: Unclassified

Milestone Unclassified deleted

comment:3 Changed 7 years ago by Andrew

Milestone: Backlog

comment:4 Changed 6 years ago by Kenny Long

Owner: changed from Philip Taylor to Kenny Long
Status: newassigned

comment:5 Changed 6 years ago by Kieran P

Milestone: BacklogAlpha 7

comment:6 Changed 6 years ago by Kieran P

Type: taskenhancement

comment:7 Changed 6 years ago by Kieran P

Milestone: Alpha 7Alpha 8

comment:8 Changed 6 years ago by Kieran P

Milestone: Alpha 8Alpha 9
Priority: Should HaveNice to Have

comment:9 Changed 6 years ago by Ben Brian

Owner: Kenny Long deleted
Status: assignednew

comment:10 Changed 6 years ago by Kieran P

Milestone: Alpha 9Backlog

comment:11 Changed 5 years ago by Yves

Milestone: BacklogAlpha 13
Owner: set to Yves

I've started working on something like that and would like to get it stable enough to commit until Alpha 13. I'll keep updating the forum thread: http://www.wildfiregames.com/forum/index.php?showtopic=16942

comment:13 Changed 5 years ago by Yves

In 13238:

Adds the server-side part of the javascript debugger. Refs #410

comment:14 Changed 5 years ago by Yves

In 13239:

The original web GUI for the jsdebugger from contributor mmayfield45. I only removed the jquery demo directory and added some licensing information. This is for an older version of the debuggers server-side part, so it doesn't work anymore. The required modifications will be committed soon. Refs #410

comment:15 Changed 5 years ago by Yves

Resolution: fixed
Status: assignedclosed

In 13240:

My modifications to the jsdebugger's web GUI. Adds a few features and makes it compatible with the current server-side code. Closes #410

comment:17 Changed 21 months ago by leper

Description: modified (diff)
Milestone: Alpha 13Backlog
Priority: Nice to HaveShould Have
Resolution: fixed
Status: closedreopened
Note: See TracTickets for help on using tickets.