Reland "[vm] Remove warnings about non-standard stack traces."
This is a reland of commit cc9d14d822222e27828318f5b13080c54a241479
TEST=vm/dart{,_2}/causal_stacks/async_throws_stack_lazy_non_symbolic_test
Original change's description:
> [vm] Remove warnings about non-standard stack traces.
>
> The language team has clarified in
> https://github.com/dart-lang/language/issues/1212 that the content of
> stack traces is not specified in a way that is violated by either
> obfuscation or non-symbolic stack traces. Thus, we remove the warnings
> about supposedly standard-violating stack traces.
>
> TEST=No change in actual functionality, so tested manually.
>
> Bug: https://github.com/dart-lang/sdk/issues/43388
> Change-Id: I2c7ac44cf2f9afafa85d902b2783e1173e727264
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249185
> Commit-Queue: Tess Strickland <sstrickl@google.com>
> Reviewed-by: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
Bug: https://github.com/dart-lang/sdk/issues/43388
Change-Id: Ifa7915b4ba21cca592ed5645cd9ad6cda1575f12
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249192
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
diff --git a/runtime/tests/vm/dart/causal_stacks/utils.dart b/runtime/tests/vm/dart/causal_stacks/utils.dart
index 2269e31..4356953 100644
--- a/runtime/tests/vm/dart/causal_stacks/utils.dart
+++ b/runtime/tests/vm/dart/causal_stacks/utils.dart
@@ -205,21 +205,26 @@
// Use the DWARF stack decoder if we're running in --dwarf-stack-traces mode
// and in precompiled mode (otherwise --dwarf-stack-traces has no effect).
- final decodeTrace = frames.first.startsWith('Warning:');
- if (decodeTrace) {
- Expect.isNotNull(debugInfoFilename);
- final dwarf = Dwarf.fromFile(debugInfoFilename!)!;
- frames = await Stream.fromIterable(original)
- .transform(DwarfStackTraceDecoder(dwarf))
- .where(_lineRE.hasMatch)
- .toList();
+ bool usingDwarf = false;
+ if (debugInfoFilename != null) {
+ try {
+ final dwarf = Dwarf.fromFile(debugInfoFilename)!;
+ usingDwarf = true;
+ frames = await Stream.fromIterable(original)
+ .transform(DwarfStackTraceDecoder(dwarf))
+ .where(_lineRE.hasMatch)
+ .toList();
+ } on FileSystemException {
+ // We're not running in precompiled mode, so the file doesn't exist and
+ // we can continue normally.
+ }
}
void printFrameInformation() {
print('RegExps for expected stack:');
expects.forEach((s) => print('"${s}"'));
print('');
- if (decodeTrace) {
+ if (usingDwarf) {
print('Non-symbolic actual stack:');
original.forEach(print);
print('');
diff --git a/runtime/tests/vm/dart_2/causal_stacks/utils.dart b/runtime/tests/vm/dart_2/causal_stacks/utils.dart
index d7c80d1..ec673b5 100644
--- a/runtime/tests/vm/dart_2/causal_stacks/utils.dart
+++ b/runtime/tests/vm/dart_2/causal_stacks/utils.dart
@@ -207,21 +207,26 @@
// Use the DWARF stack decoder if we're running in --dwarf-stack-traces mode
// and in precompiled mode (otherwise --dwarf-stack-traces has no effect).
- final decodeTrace = frames.first.startsWith('Warning:');
- if (decodeTrace) {
- Expect.isNotNull(debugInfoFilename);
- final dwarf = Dwarf.fromFile(debugInfoFilename);
- frames = await Stream.fromIterable(original)
- .transform(DwarfStackTraceDecoder(dwarf))
- .where(_lineRE.hasMatch)
- .toList();
+ bool usingDwarf = false;
+ if (debugInfoFilename != null) {
+ try {
+ final dwarf = Dwarf.fromFile(debugInfoFilename);
+ usingDwarf = true;
+ frames = await Stream.fromIterable(original)
+ .transform(DwarfStackTraceDecoder(dwarf))
+ .where(_lineRE.hasMatch)
+ .toList();
+ } on FileSystemException {
+ // We're not running in precompiled mode, so the file doesn't exist and
+ // we can continue normally.
+ }
}
void printFrameInformation() {
print('RegExps for expected stack:');
expects.forEach((s) => print('"${s}"'));
print('');
- if (decodeTrace) {
+ if (usingDwarf) {
print('Non-symbolic actual stack:');
original.forEach(print);
print('');
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index d20cf54..84694a6 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -1739,13 +1739,6 @@
// how the vm_tag (kEmbedderTagId) can be set, these tags need to
// move to the OSThread structure.
set_user_tag(UserTags::kDefaultUserTag);
-
- if (group()->obfuscate()) {
- OS::PrintErr(
- "Warning: This VM has been configured to obfuscate symbol information "
- "which violates the Dart standard.\n"
- " See dartbug.com/30524 for more information.\n");
- }
}
#undef REUSABLE_HANDLE_SCOPE_INIT
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 47633fe..8814320 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -25878,12 +25878,6 @@
isolate_instructions_image.instructions_relocated_address();
auto const vm_relocated_address =
vm_instructions_image.instructions_relocated_address();
- // The Dart standard requires the output of StackTrace.toString to include
- // all pending activations with precise source locations (i.e., to expand
- // inlined frames and provide line and column numbers).
- buffer.Printf(
- "Warning: This VM has been configured to produce stack traces "
- "that violate the Dart standard.\n");
// This prologue imitates Android's debuggerd to make it possible to paste
// the stack trace into ndk-stack.
buffer.Printf(