aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-08-22Upgrade google-breakpad to 922d49bdfe3c92e5d35c406f87f2c354637a2f8b am: ↵HEADmastermainSadaf Ebrahimi
8bac876145 am: c5a0c8e46e am: e6b2e13bd8 am: 0b812164b7 am: d668033f29 Original change: https://android-review.googlesource.com/c/platform/external/google-breakpad/+/2720095 Change-Id: Id854c5af5285fdbb50be3ef10b35ac55d600f98e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-22Upgrade google-breakpad to 922d49bdfe3c92e5d35c406f87f2c354637a2f8b am: ↵Sadaf Ebrahimi
8bac876145 am: c5a0c8e46e am: e6b2e13bd8 am: 0b812164b7 Original change: https://android-review.googlesource.com/c/platform/external/google-breakpad/+/2720095 Change-Id: Icb909bbcdeef107bbd066ac2c0282c9cd9e20f68 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-22Upgrade google-breakpad to 922d49bdfe3c92e5d35c406f87f2c354637a2f8b am: ↵Sadaf Ebrahimi
8bac876145 am: c5a0c8e46e am: e6b2e13bd8 Original change: https://android-review.googlesource.com/c/platform/external/google-breakpad/+/2720095 Change-Id: Ibc3068a8228d3a6fd4523acb7702858b46c005af Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-22Upgrade google-breakpad to 922d49bdfe3c92e5d35c406f87f2c354637a2f8b am: ↵Sadaf Ebrahimi
8bac876145 am: c5a0c8e46e Original change: https://android-review.googlesource.com/c/platform/external/google-breakpad/+/2720095 Change-Id: I0bcbd98f00c005033be551a7b6b5e8ed329fb3b8 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-21Upgrade google-breakpad to 922d49bdfe3c92e5d35c406f87f2c354637a2f8b am: ↵Sadaf Ebrahimi
8bac876145 Original change: https://android-review.googlesource.com/c/platform/external/google-breakpad/+/2720095 Change-Id: I69c3445e9e5d81f196a8d2ab5bb581cd31f758a8 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-21Upgrade google-breakpad to 922d49bdfe3c92e5d35c406f87f2c354637a2f8bSadaf Ebrahimi
This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update google-breakpad For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md Test: TreeHugger Change-Id: I12c929f9fd858788c537c10308112d8b61a1f553
2023-08-11Upgrade google-breakpad to v2023.01.27 am: 332a4371ed am: c3c25b3748 am: ↵Elliott Hughes
4e7c6460d7 am: c9c160dbfd am: 1317aa6421 Original change: https://android-review.googlesource.com/c/platform/external/google-breakpad/+/2704174 Change-Id: I1cb5f0b860fff4523f331cce12735979ae56fd20 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-11Upgrade google-breakpad to v2023.01.27 am: 332a4371ed am: c3c25b3748 am: ↵Elliott Hughes
4e7c6460d7 am: c9c160dbfd Original change: https://android-review.googlesource.com/c/platform/external/google-breakpad/+/2704174 Change-Id: I95bc0a6692c028156ded7502fadc728415e92f38 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-11Upgrade google-breakpad to v2023.01.27 am: 332a4371ed am: c3c25b3748 am: ↵Elliott Hughes
4e7c6460d7 Original change: https://android-review.googlesource.com/c/platform/external/google-breakpad/+/2704174 Change-Id: I2d2b4a054618219b535cae768882f677ca986b75 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-11Upgrade google-breakpad to v2023.01.27 am: 332a4371ed am: c3c25b3748Elliott Hughes
Original change: https://android-review.googlesource.com/c/platform/external/google-breakpad/+/2704174 Change-Id: Id4cbd71ede58b445f8d99dbad585207ef2b97bef Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-10Upgrade google-breakpad to v2023.01.27 am: 332a4371edElliott Hughes
Original change: https://android-review.googlesource.com/c/platform/external/google-breakpad/+/2704174 Change-Id: I2b9d3aeb0d60cce168eaa83dbf2e3225f26fe34e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-10Upgrade google-breakpad to v2023.01.27Elliott Hughes
This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update google-breakpad For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md enh@ also reverted various bits of local vandalism, so that the source matches what's actually upstream at this tag exactly. Bug: http://b/295251968 Test: TreeHugger Change-Id: I594a518c720e1d86c46ac18313e8ba90dffd91ad
2023-08-06Update scripts to Python 3Petr Hosek
Python 2 is deprecated and have now been removed from CI builders. Change-Id: Ic838714502e16136bd8ed345a47a00b71ff889aa Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4754416 Reviewed-by: Mike Frysinger <vapier@chromium.org>
2023-08-02Add support for new SEGV_* constants to minidump_stackwalk.Peter Collingbourne
Bug: chromium:1137393 Change-Id: I1a6a5f2013e6a08e189958b89415183ffb6fe345 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4722972 Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-08-02linux_dumper: Always map ELF file from offset 0Marc Gonzalez
Functions such as FindElfSection and FindElfSegments that inspect the ELF header expect a pointer to the first byte of the file. IsValidElf() checks for the ELF magic number at offset 0. Thus, we must map ELF object files from offset 0. Change-Id: Icebfb46229a04019f57a7ec07844257b98ceb278 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4674337 Reviewed-by: Mike Frysinger <vapier@chromium.org>
2023-08-02libdisasm: Widen STRNCATF temp bufferMarc Gonzalez
The _tmp buffer used in STRNCATF is too small for several callers, which might lead to truncated output in some situations. For example, GCC 11 warns: src/third_party/libdisasm/x86_format.c:899:40: warning: ‘%s’ directive output may be truncated writing up to 63 bytes into a region of size 32 [-Wformat-truncation=] 899 | STRNCATF( buf, "%s:", str, len ); | ^~~~~ ~~~ src/third_party/libdisasm/x86_format.c:34:38: note: in definition of macro ‘STRNCATF’ 34 | snprintf( _tmp, sizeof _tmp, fmt, data ); \ | ^~~ src/third_party/libdisasm/x86_format.c:899:41: note: format string is defined here 899 | STRNCATF( buf, "%s:", str, len ); | ^~ In file included from /usr/include/stdio.h:894, from src/third_party/libdisasm/x86_format.c:1: /usr/include/x86_64-linux-gnu/bits/stdio2.h:71:10: note: ‘__builtin___snprintf_chk’ output between 2 and 65 bytes into a destination of size 32 71 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 72 | __glibc_objsize (__s), __fmt, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 | __va_arg_pack ()); | ~~~~~~~~~~~~~~~~~ Change-Id: Ia876e288bf9629f2c72db3faf2287c7940924ea0 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4668735 Reviewed-by: Mike Frysinger <vapier@chromium.org>
2023-07-27Add support for zstd compressed sections to dump_symsIan McKellar
Support for zstd must be enabled by passing --enable-zstd to configure. Change-Id: I57d0196552284de86575d979d673ac20a3fc4d64 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4722191 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-07-06Fix warnings in configure.acMarc Gonzalez
Fix warnings on Ubuntu 22.04 Change-Id: I2f64988706e72838b4e2cec50d0bde9eb90929ad Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4668734 Reviewed-by: Mike Frysinger <vapier@chromium.org>
2023-06-01Fix bug when ranges_data is index 0 in DW_AT_ranges.Zequan Wu
Bug: chromium:1448979 Change-Id: Ib174ab1592d189e0f05e6baa6a96af2742d00eda Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4580929 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-05-31Share .debug_line and .debug_line_str among dwp file and main binary file.Zequan Wu
The debug info in the dwp file needs to refer to the .debug_line and .debug_line_str sections in the main binary. This fixes dump_syms not generating LINE records for dwp in split dwarf. Bug: chromium:1448979 Change-Id: I71923f12cea72caae081c1406e2cbca55e95859e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4576346 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-05-26[Breakpad] Fix hex formatting for MinidumpCrashpadInfo::Print()Ben Hamilton
The hex formatting in MinidumpCrashpadInfo::Print() was missing the leading 0, so byte values < 128 were not possible to decode. Change-Id: Ib355bcdaf86e91d644045df645fb4fa75332aa4b Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4571100 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-05-25Fix reading DW_AT_ranges in split dwarf.Zequan Wu
Bug: b/280290608, chromium:1448979 Change-Id: I3f9e4c3d62b4c858238ccbbda0366926c306e27f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4568824 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-05-23Properly initialize enable_objdump_for_exploitability_Mark Brand
Change-Id: I30fab42e2a1e7d0abf970b825e66a0db8b6a0fd5 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4557444 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-05-23Modify RISCV minidump context to match CrashpadThomas Gales
- RISCV32 will only include support for 32 bit floating point registers - RISCV64 will only include support for 64 bit floating point registers - RISCV 32/64 context will include a "version" field to account for future extensions Fixed: 1447862 Tested: `make check` on x86 host Tested: `minidump_stackwalk` for RISCV64 minidump on x86 host Change-Id: I605d5b2c35e627a5dc986aaf818a9c9898f6ae0b Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4553281 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-05-19Fix minidump generation on arm softfp targets.Richard Nichols
Test: arm softfp build, crashed program intentionally with kill -4 and observed successful minidump generation. Bug: b/283473162 Change-Id: Id71f92653ced04575ffbb87e309d4139ca34d843 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4545508 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-05-19Fix inline_origin_map key collision when split dwarf is enabled.Zequan Wu
It fixes following two problems: 1. When we have skeleton compilation unit (DW_TAG_skeleton_unit) in a binary file refers to the complete unit in a split dwarf file (.dwo/.dwp file), we should use the split dwarf file's path in warning reporting. Right now, it uses the original file (binary file) path in warning report, which is incorrect. For example, if we have chrome.debug which is the binary with skeleton debug info and chrome.dwp which is the complete debug info and the debug info in chrome.dwp has some incorrect reference, it will warn on chrome.debug rather than chrome.dwp 2. When split dwarf is enabled, the global inline_origin_map will likely encounter key collision because the offsets as keys are now relative to each CU's offset which is relative to .debug_info section. Also offsets from different files might collide. This change makes a inline_origin_map for each debug file and use offsets only relative to .debug_info section as keys. Bug: b/280290608 Change-Id: If70e2e1bfcbeeeef2d425c918796d351a0e9ab3b Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4544694 Reviewed-by: Joshua Peraza <jperaza@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-05-18Mac: shorten sym file names in upload_system_symbolsLeonard Grey
macOS caps filenames at 255 characters. When upload_system_symbols runs `dump_syms`, the resulting filename is based on a mangled version of the file's full path. In some circumstances (for example, the dumped file itself lives in a temp directory), this name can exceed the max. This change replaces the current mangling by mapping each path component but the last to its first initial, greatly shortening the resulting filename. Bug: 1400770 Change-Id: I68203a98eda2912893c5d8f7c676faee17e39e91 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4519231 Reviewed-by: Robert Sesek <rsesek@chromium.org>
2023-05-12Modernize codeLei Zhang
- Replace DISALLOW_COPY_AND_ASSIGN with =delete. - Replace some NULLs with nullptrs; - Use the override keyword when appropriate. - Use =default when appropriate. Change-Id: I99e1d7f349dd4c32aa5d05e2ebdce7a86e47f551 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4527718 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
2023-05-10Add new flag to allow granular control over the use of objdump.Mark Brand
This adds a new flag `enable_objdump_for_exploitability_` to the MinidumpProcessor, which allows enabling objdump separately for crash address fixups and for exploitability analysis, as the performance cost of the exploitability analysis is significantly higher. Change-Id: I667ffdce7cc0a970793f91413c3d2e3af93f4247 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4507067 Reviewed-by: Ivan Penkov <ivanpe@google.com> Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
2023-05-08[dump_syms][riscv] Update unittest.Mark Brand
Change 4505156 changed the RISCV register names, this change adjusts the unittest to match the new names. Bug: 1432426 Change-Id: I0887d8fc11eec63ab6953ea1a136873591e49286 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4507066 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-05-05[dump_syms][riscv] Fix register name mismatchThomas Gales
dump_syms was using x0...x31 notation, while the rest of Breakpad was using the ABI names. This mismatch was causing stackwalking to not fully succeed. Fixed: 1432426 Change-Id: I0713e76e65ff6dad492b51bc3607e94e25dc2c3a Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4505156 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-05-03Fix MDRawCrashpadAnnotationList::objects typeBen Wagner
MDRawCrashpadAnnotationList::objects is a flexible array of MDRawCrashpadAnnotation and not MDLocationDescriptor. Breakpad does not currently use the MDRawCrashpadAnnotationList type, but its definition should be updated to reflect the correct type to avoid confusion. Change-Id: I58b5b0e4f7f95bc003b103e2750e3759c3e31292 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4503630 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-05-03Fix MDRawModuleCrashpadInfoList::modules typeBen Wagner
MDRawModuleCrashpadInfoList::modules is a flexible array of MDRawModuleCrashpadInfoLink and not MDLocationDescriptor. Breakpad does not currently use the MDRawModuleCrashpadInfoList type, but its definition should be updated to reflect the correct type to avoid confusion. Change-Id: If97f490db8d41529b59a225a275a37116746c2b7 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4504150 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-05-03Include iOS in availability checks for mach-o/util.h callsLeonard Grey
Bug: chromium:1420654 Change-Id: Id0281089962147040b6332223bf4593bf4fc60cd Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4500259 Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-05-02Fix dump_syms help typo on LinuxPeter Boström
Bug: None Change-Id: I0409a0c2ab8e60b1f84f72b50a1fd400b5a41cbd Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4500379 Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-05-01Reimport architecture/byte_order.h from canonical repoLeonard Grey
Bug: b/257505171 Change-Id: I210b6689683ff2cf561997584924fd9b568943cb Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4494631 Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-04-28minidump-2-core: Use exception context for crashed threadBen Wagner
Use the exception record's context for the crashed thread instead of the thread's own context. For the crashed thread the thread's own context is the state inside the exception handler. Using it would not result in the expected stack trace from the time of the crash. This change aligns the behavior of minidump-2-core with the behavior of minidump_stackwalk. Bug: google-breakpad:885 Change-Id: I5cd3e9d39807308491b64fcd335f5f85b1dcd084 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4473128 Reviewed-by: Joshua Peraza <jperaza@google.com> Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-04-28Fix AMD64/X86 typo in MD_CONTEXT_AMD64_ALLBen Wagner
Use MD_CONTEXT_AMD64_DEBUG_REGISTERS instead of MD_CONTEXT_AMD64_DEBUG_REGISTERS in the definition of MD_CONTEXT_AMD64_ALL. This previously happened to work because the two flags happened to have the same values and every includer of minidump_cpu_amd64.h also happened to previously include minidump_cpu_x86.h. Change-Id: If8b422d3623936f4a0b57a4cf6dac4f348daa024 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4480251 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-04-27Mac: update arch_utilities for macOS 13Leonard Grey
The NXArch* family is deprecated in macOS 13. This change: - Uses the replacements where available - Silences deprecation warnings otherwise - Removes the Linux cross-compile shims in favor of having completely separate implementations for Mac and non-Mac. The logic of the Linux versions uses the same prepopulated data as before, but they no longer use NXArchInfo. clang diagnostic disables are necessary due to https://crbug.com/1406057 Bug: chromium:1420654, google-breakpad:880, b/257505171 Change-Id: Iad777915a5a058551cfb3a7d3cf681cce180dfea Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4437109 Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-04-27Update Mac HeadersLeonard Grey
These are reimported from Apple's Github source drops, see exact provenance in README. Most were imported as is, some were edited to match previous versions, and as noted below - Added arm headers where needed - Removed (now) unused `/mach/i386/vm_param.h` - Removed availability annotations - Removed `__kernel_ptr_semantics` - Added `defined(__aarch64__)` to all arm64 define guards Bug: chromium:1420654, google-breakpad:880, b/257505171 Change-Id: I17bd03fa871a8f1dc4285daafa3d7b26c2186e2b Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4482294 Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-04-26Replace unsigned int with size_t for ModuleSerializerPeter Boström
This is a speculative fix for a memory bug where our symbol files are looking like they've grown enough that serializing them will outgrow UINT_MAX. Before this change a size_t is implicitly cast to a size_t in unsigned int, allocate a buffer of that size and then continue to write module data out of bounds. I have not been able to reproduce the OOB write locally as the original uploaded symbol data is gone, but I have been able to reproduce builds where, if we enable inline frames and CFI dumping, the size grows to 3.6GB when serializing it, which is close enough to 4.2GB that the wrapping theory seems reasonable on another board or build. No effort is made here to prevent wrapping behavior on 32-bit systems. Bug: b/237242489, chromium:1410232 Change-Id: I3d7ec03c51c298f10df3d5b1e5306433875c7919 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4477821 Reviewed-by: Leonard Grey <lgrey@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org>
2023-04-24[dump_syms] Relax name matching for marking symbols as multipleBen Hamilton
Previously, the logic to mark a symbol as "multiple" would always fire for C++ symbols for Apple `.dSYM`s built with `-gmlt`. This was because for a C++ symbol like `void foo::bar::Baz()`, the DWARF data would contain the truncated function name `Baz`, but the STABS would contain the fully-qualified name `void foo::bar::Baz()`. This CL relaxes the name matching to not mark as multiple: 1) Symbols which were missing names entirely in the DWARF (e.g, "<name omitted">)` 2) Symbols whose fully-qualified name includes the truncated name as a substring Bug: https://bugs.chromium.org/p/google-breakpad/issues/detail?id=883 Change-Id: I26ded7ca84d964aa4a73da19e4bdd7e686e2c998 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4470047 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-04-24[dump_syms/Mac] New -x option to prefer extern names when there's a mismatchBen Hamilton
When built with -gmlt, .dSYMs are (by design) missing the `DW_AT_linkage_name` which Breakpad uses to fill out the (name-mangled) function names. Thankfully, the .dSYM contains both the old-school LC_SYMTAB command containing the STABS-format symbols (which include the fully-qualified C++ symbol names we want, but no actual compilation unit data), as well as the LC_SEGMENT_64 containing the __DWARF segment with the minimal -gmlt debug information (which excludes the name-mangled C++ symbols). Unfortunately, since the .dSYM's STABS does not define compilation units, the usual path in `StabsReader` ignores all the fully-qualified C++ symbol names for the functions: https://chromium.googlesource.com/breakpad/breakpad/+/bd9d94c70843620adeebcd73c243001237c6d426/src/common/stabs_reader.cc#100 Fortunately, when built for macOS platforms (`HAVE_MACH_O_NLIST_H`), `StabsReader` supports storing all the STABS-format symbols as `Extern`s, regardless of whether or not they're in a compilation unit: https://chromium.googlesource.com/breakpad/breakpad/+/bd9d94c70843620adeebcd73c243001237c6d426/src/common/stabs_reader.cc#119 Currently, when there's both a `Function` and an `Extern` with the same address, `Module` discards the `Extern`: https://chromium.googlesource.com/breakpad/breakpad/+/bd9d94c70843620adeebcd73c243001237c6d426/src/common/module.cc#161 This CL adds a new `-x` option to the Mac `dump_syms` which prefers the Extern function name if there's a mismatch. Bug: https://bugs.chromium.org/p/google-breakpad/issues/detail?id=883 Change-Id: I0d32adc64fbf567600b0a5ca63c71c422b7f0f8c Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4453650 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-04-24Fix alignment of the brief output of minidump_stackwalkZiad Youssef
Bug: 1435239 Change-Id: I4ea6cbe89d5ef0907f7e07c454e4533995996521 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4459351 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-04-17Set O_NONBLOCK for opening file to prevent hanging when file unavailable.Yuki Wang
Bug: 277976345 Change-Id: Iddf55d8e172f98c76ae7167f609fb53c4c60fa48 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4437089 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-04-11Convert RISC-V numeric identifiers to stringsThomas Gales
Printing the register values as part of the stack trace relies on the CPU architecture being "riscv" or "riscv64" rather than the numeric identifiers (0x8005 and 0x8006, respectively). Fixed: 1432306 Test: Run `minidump_stackwalk` on a RISC-V minidump Change-Id: I0009da687438d51047e2ee39ffa1c50d78798caa Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4416399 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2023-04-01Add maxsize for xstate areasAlex Gough
Breakpad skips the xstate area in x64 contexts but allowed this area to be of unconstrained size. This hits problems if the size is greater than Chrome's maximum allocation size, so we change to skipping a maximum size. The maximum is chosen to allow the full set of states today, plus some slack for the future: Based on Intel x64 manual 13.5 XSAVE-MANAGED STATE * => further bytes might be reserved | Size | Region | | 576 | Legacy + header | | 384 | AVX State | | 80 | MPX State | | 1600 | AVX-512 State | | 72*| PT State | | 8 | pkru state | | 8 | pasid state | | 16 | CET state | | 8 | HDC State | | 96?| uintr state | | 808*| lbr state | | 8 | hwp state | | 16 | amx state | == 3680 so jump up a bit for the future to 2**12. Bug:1425631 Change-Id: Ie08555651977cdbfa1c351c661118f13238213c4 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4379497 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
2023-03-29Add RISC-V register namesThomas Gales
RISC-V register names are needed in order to load DWARF call frame information. Bug: fuchsia:124084 Change-Id: I2791b3a38ea35ddc2bb293f60f75dcc86338e354 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4376827 Reviewed-by: Mike Frysinger <vapier@chromium.org>
2023-03-28Add EM_RISCV as recognized value for ELF e_machineThomas Gales
`dump_syms` fails to write symbol file without knowing how to convert the ELF `e_machine` field to a string. Use "riscv" as the value because ELF `e_machine` does not distinguish between 32 bit and 64 bit RISC-V. Test: run `dump_syms` on the libc++ that's shipped with the Clang toolchain, or any other riscv binary: `./dump_syms -r -n libc++.so -o Fuchsia <clang_path>/lib/riscv64-unknown-fuchsia/libc++.so.2.0` Bug: fuchsia:124084 Change-Id: Ic04db96ec3d3d484350bdd0b90c9dfb70d7f7eb2 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4376828 Reviewed-by: Mike Frysinger <vapier@chromium.org>
2023-03-27Mac: don't call NXFindBestFatArchLeonard Grey
`NXFindBestFatArch` is deprecated in macOS 13. We use this when an architecture is passed in via the `-a` flag. Unfortunately, neither of the potential replacements can help with this use case: - `macho_for_each_slice` as suggested in a reply to FB11955188 just enumerates slices, without the logic for inexact matches (for example, x86_64h -> x86_64 or arm64e -> arm64). - `macho_best_slice` as recommended by the deprecation notice only supports finding a suitable slice to run on the local machine. We could adapt the logic in `NXFindBestFatArch` but it gets quite complex for some architectures. Instead, this change adapts the `NXFindBestFatArch` polyfill used in `dump_syms_mac` for Linux, which returns an exact match if possible, and the first slice that matches the requested CPU type otherwise. I think this is probably Good Enough for most cases; if not, we can try porting the x86_64 and ARM logic and falling back to this for the rest. Change-Id: I3b269dab7246eced768cecd994e915debd95721a Bug: chromium:14206541420654 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4335477 Reviewed-by: Mark Mentovai <mark@chromium.org>