Skip to content

Dart DevTools automatically resumes when opening the tool #56873

@jensjoha

Description

@jensjoha

Say I have this file t.dart:

import "dart:developer";

void main() {
  int i = 42;
  debugger();
  print(i);
}

and I run it like this:

out/ReleaseX64/dart --enable-vm-service t.dart

I'll be told something like

The Dart VM service is listening on http://127.0.0.1:8181/QHkuXd4SI-g=/
The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/QHkuXd4SI-g=/devtools/?uri=ws://127.0.0.1:8181/QHkuXd4SI-g=/ws

Going to either address will take me to a webpage that after a while says "Disconnected":

image

At the same time the script will have finished in the terminal:

$ out/ReleaseX64/dart --enable-vm-service t.dart
The Dart VM service is listening on http://127.0.0.1:8181/QHkuXd4SI-g=/
The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/QHkuXd4SI-g=/devtools/?uri=ws://127.0.0.1:8181/QHkuXd4SI-g=/ws
42
$ echo $?
0

It seems that it has automatically resumed without me asking it to. Indeed adding another debugger() call and it doesn't happen:

import "dart:developer";

void main() {
  int i = 42;
  print("Will wait");
  debugger();

  print("Will wait again");
  debugger();

  print(i);
}

after opening the tool the output in the terminal is now

$ out/ReleaseX64/dart --enable-vm-service t.dart
Will wait
The Dart VM service is listening on http://127.0.0.1:8181/6pwtMho6irY=/
The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/6pwtMho6irY=/devtools/?uri=ws://127.0.0.1:8181/6pwtMho6irY=/ws
Will wait again

Is this the intended behavior, and if it is, why? If not can we have it fixed?

This started to happen with adfbcc7

Metadata

Metadata

Assignees

Labels

area-dart-cliUse area-dart-cli for issues related to the 'dart' command like tool.dart-cli-devtoolsIssues related to the 'dart devtools' tool

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions