sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Dart DevTools automatically resumes when opening the tool

Open jensjoha opened this issue 1 year ago • 2 comments

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 adfbcc7657248be8a64ad1313c15f7a58cf15e23

jensjoha avatar Oct 09 '24 13:10 jensjoha