flutter / flutter/devtools

Can't attach to debugger on Dart VM running frontend_server

Đang mở
#2,938 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug P3 reproduce to verify
Ngôn ngữ chính
Dart
Star
1.7k
Fork
404
Merge trung bình
6 ngày 17 giờ
Pull request đã merge (30 ngày)
18

Mô tả

I'm not sure the exact scenario required to trigger this, but attempting to connect to the VM Service of a frontend_server snapshot was sufficient to reproduce it. Debugging from the Observatory works.

To get the Observatory to print out:

```diff
diff --git a/packages/flutter_tools/lib/src/compile.dart b/packages/flutter_tools/lib/src/compile.dart
index 76ba6793b8..bc681ee8c9 100644
--- a/packages/flutter_tools/lib/src/compile.dart
+++ b/packages/flutter_tools/lib/src/compile.dart
@@ -696,11 +696,13 @@ class DefaultResidentCompiler implements ResidentCompiler {
);
final List command = [
_artifacts.getHostArtifact(HostArtifact.engineDartBinary).path,
+ '--observe',
'--disable-dart-dev',
frontendServer,
'--sdk-root',
sdkRoot,
'--incremental',
+ '--verbose',
if (testCompilation)
'--no-print-incremental-dependencies',
'--target=$targetModel',
```

To trigger the crash I'm trying to debug (requires running a flutter web app)

```diff
diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart
index 0342a56138..786db092cd 100644
--- a/packages/flutter_tools/lib/src/resident_runner.dart
+++ b/packages/flutter_tools/lib/src/resident_runner.dart
@@ -116,6 +116,7 @@ class FlutterDevice {
} else {
assert(false);
}
+ extraFrontEndOptions.add('--enable-experiment=alternative-invalidation-strategy');

generator = ResidentCompiler(
globals.artifacts.getHostArtifact(HostArtifact.flutterWebSdk).path,
```

Note that it says it is paused in the debugger, but there is no debugger pane and hitting step doesn't seem to do anything.

![Dart DevTools - Google Chrome 4_25_2021 10_52_52 AM](https://user-images.githubusercontent.com/8975114/116003791-69a43e80-a5b4-11eb-9295-bef5e43e24ff.png)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện vấn đề với một snapshot của frontend_server và VM Service, sử dụng hành vi của Observatory được mô tả trong báo cáo để so sánh. Đọc packages/flutter_tools/lib/src/compile.dart và resident_runner.dart, bao gồm các tùy chọn khởi chạy frontend_server và thiết lập alternative-invalidation-strategy. Được xem là hoàn tất khi DevTools hiển thị ngăn trình gỡ lỗi và thao tác thực thi từng bước hoạt động khi VM báo rằng quá trình thực thi đã tạm dừng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
dart
Lĩnh vực
devtools, tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.