Files
sdk/pkg/native_stack_traces/lib/src/dwarf_container.dart
T
Tess Strickland 0a4cb4d43e [pkg/native_stack_traces] Add support for MacOS universal binaries.
In addition to adding a parser for the universal binary format, this
also requires major reworks to handle files that contain different
DWARF information for different architectures, and how to pass the
architecture down to where it's needed.

Also fix dSYM handling: instead of assuming the name of the MachO file
corresponds exactly to the basename of the dSYM with the extension
stripped, just look for the single file within the
Contents/Resources/DWARF directory.

Also add `unrecognized` enum entries for DW_TAG, DW_AT, and DW_FORM
values that aren't handled.

Issue: https://github.com/flutter/flutter/pull/101586
Change-Id: Ief5edc275ccd1192669252140d128136cd2bed26
Cq-Include-Trybots: luci.dart.try:vm-kernel-nnbd-mac-release-arm64-try,vm-kernel-precomp-mac-product-x64-try,vm-kernel-precomp-nnbd-mac-release-arm64-try,vm-kernel-nnbd-mac-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252821
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-08-25 13:27:24 +00:00

44 lines
1.2 KiB
Dart

// Copyright (c) 2022, 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 'reader.dart';
abstract class DwarfContainerStringTable {
String? operator [](int index);
}
abstract class DwarfContainerSymbol {
int get value;
String get name;
}
abstract class DwarfContainer {
/// Returns the architecture of the container as reported by Dart (e.g.,
/// 'x64' or 'arm'). Returns null if the architecture of the container does
/// not match any expected Dart architecture.
String? get architecture;
Reader debugInfoReader(Reader containerReader);
Reader lineNumberInfoReader(Reader containerReader);
Reader abbreviationsTableReader(Reader containerReader);
DwarfContainerSymbol? staticSymbolAt(int address);
int? get vmStartAddress;
int? get isolateStartAddress;
String? get buildId;
DwarfContainerStringTable? get debugStringTable;
DwarfContainerStringTable? get debugLineStringTable;
void writeToStringBuffer(StringBuffer buffer);
@override
String toString() {
final buffer = StringBuffer();
writeToStringBuffer(buffer);
return buffer.toString();
}
}