Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: pkg/analyzer/tool/analysis_driver/inspect_exception.dart

Issue 2809693002: Add a tool for inspecting AnalysisDriver crash logs. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/tool/analysis_driver/inspect_exception.dart
diff --git a/pkg/analyzer/tool/analysis_driver/inspect_exception.dart b/pkg/analyzer/tool/analysis_driver/inspect_exception.dart
new file mode 100644
index 0000000000000000000000000000000000000000..9813944964c037c8b151e54a203d05bb823c7131
--- /dev/null
+++ b/pkg/analyzer/tool/analysis_driver/inspect_exception.dart
@@ -0,0 +1,48 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+
+import 'package:analyzer/src/summary/idl.dart';
+import 'package:args/args.dart';
+
+main(List<String> args) {
+ ArgParser argParser = new ArgParser()..addFlag('raw');
+ ArgResults argResults = argParser.parse(args);
+ if (argResults.rest.length != 1) {
+ print(argParser.usage);
+ exitCode = 1;
+ return;
+ }
+
+ String path = argResults.rest[0];
+ List<int> bytes = new File(path).readAsBytesSync();
+ AnalysisDriverExceptionContext context =
+ new AnalysisDriverExceptionContext.fromBuffer(bytes);
+
+ print(context.path);
+ print('');
+ print('');
+ print('');
+
+ print(context.exception);
+ print('');
+ print('');
+ print('');
+
+ print(context.stackTrace);
+ print('');
+ print('');
+ print('');
+
+ context.files.forEach((file) {
+ print("=" * 40);
+ print('${file.path}');
+ print("-" * 40);
+ print('${file.content}');
+ print('');
+ print('');
+ print('');
+ });
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698