Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging dart programs from the command line

Tags:

dart

Is it possible to use a gdb-like debugger to debug dart programs on the terminal, or is the only debugger available the one packaged with the Dart Editor?

like image 459
nsg Avatar asked May 11 '14 11:05

nsg


People also ask

Can you debug from command line?

To activate the debugger at the command prompt In the Session List window, do one of the following: Choose Debug Next. The debugger is now active and is waiting to attach to a session. Select a session, and then choose Debug.

How do I run the DART program from the command line?

Run the app To run the app from the command line, use the Dart VM by running the dart run command in the app's top directory: $ cd cli $ dart run Hello world: 42!


1 Answers

update

As far as I remember, this was only experimental and was removed quite some time ago.

The Dart VM has a service API and provides a browser UI (Observatory) to debug a running VM instance.

This service API can also be used to build custom debugger interfaces but the Dart SDK doesn't provide one out-of-the-box.

original

This blog post is a bit outdated but maybe it still contains some information that help to figure out how to debug on the command line.

http://financecoding.blogspot.co.at/2012/05/first-steps-to-dart-debugging.html

When you start a dart application with the --debug flat the Dart VM listens on 127.0.0.1:5858 for debug commands

dart --debug myapp.dart
telnet 127.0.0.1 5858 # on another console

But it seems to expect commands in JSON format and I couldn't find the ddbg command mentioned in the blog.

like image 117
Günter Zöchbauer Avatar answered Oct 11 '22 21:10

Günter Zöchbauer