6b53073eae
This is a reland of commit 38ef28a058
Fixes:
* Fix comparisons in ASSERT_EQUAL statements on 32-bit architectures.
* Take simulated architectures into account when deciding whether
to use dlopen() for native shared object formats.
* Fix struct/field name collision for GCC.
* Use CPU_TYPE_ANY/CPU_SUBTYPE_ANY for architectures that do not
have more specific cpu_type_t/cpu_subtype_t constants defined.
Original change's description:
> [vm, gen_snapshot] Add app-aot-macho-dylib option for AOT snapshots.
>
> This is the initial framework for creating snapshots as Mach-O dynamic
> libraries. Note that this framework is not 100% feature complete
> compared to generating Mach-O snapshots via assembly. In particular,
> the directly-compiled Mach-O dylib does not yet contain compact
> unwinding information.
>
> Other changes:
>
> * Adds UuidCommand to the native_stack_traces package's Mach-O reader,
> which now appropriately returns the UUID as the build ID for Mach-O
> shared objects.
>
> * Adds Utils::Basename(path) for portably retrieving the basename
> from a path. (Returns nullptr for all arguments where it is not
> currently implemented on Fuchsia or Windows.)
>
> * Adjusts vm/timeline.h to avoid pulling in <mach_o/loader.h> on MacOS,
> as that interferes with uses of the namespaced Mach-O definitions
> in platform/mach_o.h.
>
> * Only attempt to dlopen() a snapshot if ELF is the native format
> for the host platform or the snapshot is not an ELF shared object.
> If dlopen() is used, report the error message if it fails rather
> than attempting to manually load the snapshot as an ELF shared object.
>
> * Fix the magic number stored in DylibAppSnapshot for loaded non-ELF
> dynamic libraries.
>
> * Remove the detection of reverse-endian Mach-O magic numbers in
> DartUtils::SniffForMagicNumber(), since all our Mach-O related code
> assumes host-endian Mach-O files and so there's no point other than
> to give a slightly better error message when failing.
>
> TEST=vm/dart/exported_symbols_test
> vm/dart/unobfuscated_static_symbols_test
> vm/dart/use_dwarf_stack_traces_flag_test
> vm/cc/CanDetectMachOFiles
>
> Issue: https://github.com/dart-lang/sdk/issues/60307
> Change-Id: Idf5b49d6c6d035ab033509613212b95520d65965
> Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-mac-release-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-fuchsia-release-x64-try,vm-fuchsia-release-arm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415020
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Tess Strickland <sstrickl@google.com>
TEST=vm/dart/exported_symbols_test
vm/dart/unobfuscated_static_symbols_test
vm/dart/use_dwarf_stack_traces_flag_test
vm/cc/CanDetectMachOFiles
ci on trybots that failed on the original CL
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-mac-release-arm64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-mac-debug-arm64-try,vm-fuchsia-release-x64-try,vm-fuchsia-release-arm64-try,vm-linux-debug-ia32-try,vm-aot-linux-debug-simarm_x64-try,vm-aot-linux-debug-simriscv32-try,vm-aot-linux-debug-simriscv64-try,vm-aot-linux-release-simarm_x64-try,vm-gcc-linux-try,vm-ubsan-linux-release-arm64-try
Change-Id: Iaffea0ddc6173100c8b5b2a9fe46c45f4f611a2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431240
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
4.2 KiB
4.2 KiB
0.6.1
- Add handling for Mach-O UUID load commands.
0.6.1-wip
- Update SDK constraint to
^3.5.0.
0.6.0
- Make return type of DwarfContainer reader methods nullable so null can be returned if there is no relevant DWARF information.
- Allow DwarfSnapshot.fromDwarfContainer to return null if the DwarfContainer contents is missing expected DWARF information (that is, if any of the used DwarfContainer reader methods return null).
0.5.7
- Translates non-symbolic stack traces that include information for deferred loading units.
0.5.6
- Added retrieval of the static symbol table contents for use in Dart tests.
- Don't require Mach-O files to contain DWARF to be read by the Mach-O reader.
0.5.5
- Fixed issue introduced by 0.5.4.
0.5.4
- Relaxed requirement for spaces before non-symbolic stack trace line.
0.5.3
- Exported more ELF utilities for use in Dart tests.
0.5.2
- Adjusted logic for finding the DWARF MachO file in a dSYM.
- Added support for retrieving DWARF information from universal macOS binaries using the new architecture information.
- Added logic to handle unknown DW_AT, DW_FORM, and DW_TAG codes.
0.5.1
- Parse new OS and architecture information from non-symbolic stack trace headers and store that information in PCOffsets when available.
0.5.0
- Require Dart >= 2.17 (enhanced enum support)
- Add support for parsing DWARF in Mach-O files and dSYM directories.
- Add some support for DWARF5.
- Add
dumpcommand to replace the old--dump_debug_file_contentsflag tofindandtranslate.
0.4.6
- Upgrade to
package:lints2.0. - Populate the pubspec
repositoryfield.
0.4.5
- Handle stack traces larger than 100 entries.
0.4.5-dev
- Require Dart >= 2.14
0.4.4
- Added handling of dynamic tables for testing.
0.4.3
- Exported some more of the ELF utilities for use in Dart tests.
0.4.2
- When decoding a stack trace, frames corresponding to the functions with DW_AT_artificial DWARF attribute are now omitted from the symbolized stack traces. This is needed because Dart VM no longer omits invisible functions from binary stack traces in certain cases.
0.4.1
- Exported some ELF utilities in lib/elf.dart for use in Dart tests.
0.4.0
- Stable null safe version of package.
0.4.0-nullsafety
- Unstable null safe version of package.
0.3.8
- Support columns when present in line number programs.
0.3.7
- Added buildId accessor for retrieving GNU build IDs from DWARF files that include them.
0.3.6
- Adjusts RegExp for stack trace header line to be more flexible in what it permits to allow additional information to be added in the Dart VM.
0.3.5
- Use virtual addresses in non-symbolic stack frames as a fallback if we cannot retrieve an appropriate offset from the instructions section otherwise.
0.3.4
-
Decoded Dart calls are now never considered internal, only VM stub calls. This is due to a concurrent change in the Dart VM that no longer prints non-symbolic frames for functions considered invisible, which matches the symbolic frame printer and removes the need for the decoder to guess which frames should be hidden.
This package still works on earlier versions of Dart, so the dependencies have not changed. However, it may print more frame information than expected when decoding stack frames from a Dart VM that does not include this change to non-symbolic stack printing.
0.3.3
- No externally visible changes.
0.3.2
- The
findcommand can now look up addresses given as offsets from static symbols, not just hexadecimal virtual or absolute addresses. - Integer inputs (addresses or offsets) without an '0x' prefix or hexadecimal
digits will now be parsed as decimal unless the
-x/--force_hexadecimalflag is used.
0.3.1
- Uses dynamic symbol information embedded in stack frame lines when available.
0.3.0
- Adds handling of virtual addresses within stub code payloads.
0.2.2
- Finds instruction sections by the dynamic symbols the Dart VM creates instead of assuming there are two text sections.
0.2.1
- Added static method
Dwarf.fromBuffer.
0.2.0
- API and documentation cleanups
0.1.0
- Initial release