Editor 2: In-editor debugger


#1

Ho ho ho :santa:

We’ve just shipped the first version of an in-editor debugger for editor 2, available in the latest update!

This is the initial release of a quite big piece of functionality, and while there are lots of things we still want to do with it, we believe that it is now in a state that can provide a lot of value and benefit from more real-world usage.

As always, we are really interested in and appreciative of your feedback, so if you give it a go and find issues or have feature requests, please report them as usual on editor2-issues.

Some features:

  • One-click, zero-config “Run project with debugger”
  • Supports attaching to and debugging remote target on device
  • Inspect call stack
  • Inspect variables, including diving into tables
  • Evaluate arbitrary lua code at breakpoint

10 second crash-course:

  • To run your project with the debugger: select “Debug > Start with Debugger” (or F5)
  • To place a breakpoint: Click to the right of the line number in the code editor gutter (or F9).

Known issues:

  • 1517: Debugger cannot determine names of script component lifecycle functions (init/update/etc)
  • 1518: Evaluating a Lua expression does not have intended side-effects
  • 1519: Debugger does not break on breakpoints in builtins
  • 1520: Weird menu rendering artefact for “Stop Debugger” menu item

ZeroBrane doesn't handle .script files
#2

Really awesome christmas present.
Works like a charm!


#3

SUPER AWESOME!

Defold is getting better and better!


#4

Oh yeah, big thanks!!! :man_dancing:


#5

I just tried this and I had trouble finding how to add a breakpoint without coming here to the forums. The reason is that the documentation isn’t updated (https://www.defold.com/manuals/debugging/) and to me it was confusing that “Toggle breakpoint” is in the Edit menu and not in the Debug menu like all the other debug options.

Also, both Step Into and Step Out displays the same hotkey for me “fn F11” (Mac OS), but in reality I only have to press F11, since I have the “Use F1…F12 as regular function keys” or what ever the translation of that Mac OS keyboard option is. :slight_smile:


#6

Thanks for the feedback! Could you please report these issues on https://github.com/defold/editor2-issues/issues so we can track/plan them better?


#7

Thanks for pointing this out. This is on my list of things to fix. The whole documentation is going through a major overhaul now that we are switching to editor 2. PR:s are welcome. :slight_smile:


#8

Reported issues: