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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:io';
6
7 import 'package:analyzer/src/summary/idl.dart';
8 import 'package:args/args.dart';
9
10 main(List<String> args) {
11 ArgParser argParser = new ArgParser()..addFlag('raw');
12 ArgResults argResults = argParser.parse(args);
13 if (argResults.rest.length != 1) {
14 print(argParser.usage);
15 exitCode = 1;
16 return;
17 }
18
19 String path = argResults.rest[0];
20 List<int> bytes = new File(path).readAsBytesSync();
21 AnalysisDriverExceptionContext context =
22 new AnalysisDriverExceptionContext.fromBuffer(bytes);
23
24 print(context.path);
25 print('');
26 print('');
27 print('');
28
29 print(context.exception);
30 print('');
31 print('');
32 print('');
33
34 print(context.stackTrace);
35 print('');
36 print('');
37 print('');
38
39 context.files.forEach((file) {
40 print("=" * 40);
41 print('${file.path}');
42 print("-" * 40);
43 print('${file.content}');
44 print('');
45 print('');
46 print('');
47 });
48 }
OLDNEW
« 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