Files
sdk/pkg/analyzer/tool/analysis_driver/inspect_exception.dart
T
Brian Wilkerson 5f0de26d48 Clean up the remaining copyright notices
Change-Id: If099be4f71ba551df0dc3d69815ae6a9f55d1eba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97781
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-24 20:11:28 +00:00

49 lines
1.1 KiB
Dart

// 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('');
});
}