Observatory Docs Home | Edit these docs


Observatory’s debugger displays stack frames and the isolate’s event queue. The debugger is controlled by text commands that support tab completion. If you have used gdb, the debugger should feel familiar.

You can set and clear breakpoints in Observatory in one of three ways:

The debugger is not fully documented, but the following tips can help get you started:

How do I open the debugger?

When you open Observatory a debugger link appears on the main VM page for each running isolate. Clicking one of these links opens the debugger for the corresponding isolate. Enter h or help into the text box for a list of available commands.

How can I start debugging my program before main() executes?

You have two choices:

  • Launch the app by specifying the --pause-isolates-on-start flag. Bring up the debugger. You can step through execution, or set breakpoints, as you choose.

  • Import the dart:developer package and add a debugger(); call to the beginning of main.

How do I set a breakpoint?

You have two choices:

  • Set a breakpoint in the text box using break. You can use tab completion, for example, typing break m<tab> completes to break main if there is only one method beginning with m, otherwise it brings up a list of possible methods.

  • Set breakpoints programmatically using the dart:developer library. Import the dart:developer package and add a debugger(); call wherever you want to break.

How do I resume a paused isolate?

Enter c or continue into the text box.

How do I get a list of all breakpoints?

Enter info breakpoints.

How do I clear a breakpoint?

You can clear a breakpoint using the clear command, specifying the source location or function name. Enter help clear for more information.

Privacy Policy