Can't attach to debugger on Dart VM running frontend_server
- 主要语言
- Dart
- 星标
- 1.7k
- 派生
- 404
- 平均合并
- 6 天 17 小时
- 30 天内合并 PR
- 18
描述
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.

贡献指南
调研方向
首先使用 frontend_server 快照和 VM Service 重现该问题,并将报告中描述的 Observatory 行为作为对比。阅读 packages/flutter_tools/lib/src/compile.dart 和 resident_runner.dart,包括 frontend_server 的启动选项以及 alternative-invalidation-strategy 的设置。当 VM 报告执行已暂停时,如果 DevTools 显示调试器面板且单步执行正常工作,则表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- dart
- 领域
- devtools, tooling
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 30/100