Commit graph

1927 commits

Author SHA1 Message Date
Joshua Peraza
415b54ab8c Account for string offsets table header size
Section 7.26 of the DWARF 5 spec describes a header of
either 8 or 16 bytes before the offsets begin.

Bug: b/187205051
Change-Id: I1ba01008dcd7a533f59d3865762ca09b9d43032b
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3016609
Reviewed-by: Sterling Augustine <saugustine@google.com>
2021-07-08 23:22:17 +00:00
Zequan Wu
68735f74e7 NFC: use enum SymbolData as flags
To make it easier to add flags when adding new options in SymbolData.

Example:
I want to add a flag to disable inline record for https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2915828.
Change-Id: Ifc5da27c01efa0b0bc21cfcf769d4e6d604a63c6
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2984198
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-07-07 18:29:13 +00:00
Peter Kasting
04a9ffbe59 Fix -Wunreachable-code-aggressive.
Bug: chromium:1066980
Change-Id: Iddd276bb884076591399433c6191425b3a131d0d
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2995406
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2021-07-02 01:25:51 +00:00
Peter Kasting
b95c4868b1 Fix a -Wdeprecated-copy warning.
Bug: chromium:1221591
Change-Id: I52968a535f126b854f8e860b9632ffe00c55b6be
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2973213
Reviewed-by: Lei Zhang <thestig@chromium.org>
2021-06-18 17:48:13 +00:00
Darren Mo
7ba29f4a36 Mitigate upload failure when app is backgrounded.
iOS closes an app’s network connections when the app is backgrounded. This can cause an in-progress upload request to fail. We can mitigate this by requesting additional background execution time using the `UIApplication` background task APIs.

BUG=b:130302235

Change-Id: Ifd8e14ca82c736ad7dd60dcdd0d4bbcabb76f5ad
Signed-off-by: Darren Mo <darrenmo@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2251020
Reviewed-by: Mark Mentovai <mark@chromium.org>
2021-06-16 22:10:20 +00:00
Zequan Wu
dbbdf05740 Load .symtab and .strtab sections before .debug_info to deduplicate
PUBLIC records.

For chrome, the symbol file size dropped from 661 MB to 577 MB.
The number of PUBLIC records dropped from 559416 to 91930.

Change-Id: I7f703d619f2acc7c83f002e6f588f6a6569e5c87
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2916731
Reviewed-by: Lei Zhang <thestig@chromium.org>
2021-06-11 23:07:32 +00:00
Zequan Wu
a524a1e24b Fix dangling pointer in forward_ref_die_to_func
Bug: google-breakpad:843
Change-Id: I14358b239604e1faeb5a8c4c4734102571dbed09
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2951787
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2021-06-11 17:25:51 +00:00
Mike Frysinger
322eb2b4c6 Roll src/src/third_party/lss/ fd00dbbd0..e1e7b0ad8 (11 commits)
https://chromium.googlesource.com/linux-syscall-support/+log/fd00dbbd0c06..e1e7b0ad8ee9

$ git log fd00dbbd0..e1e7b0ad8 --date=short --no-merges --format='%ad %ae %s'
2021-04-12 safinaskar fix incorrect closing parenthesis
2021-04-01 mpdenton Add support for lstat
2021-03-20 mcgrathr Add separate LICENSE file
2021-02-05 vapier add OWNERS & DIR_METADATA
2021-01-27 tomskside Add support for Elbrus 2000 (e2k)
2020-11-24 xwafish [MIPS64] Fix '__NT_getrandom' definition
2020-11-11 vapier README: update Chromium DEPS link
2020-08-12 palmer Add support for `getrandom`.
2020-05-21 palmer Revert "Add support for `getrandom`."
2020-05-20 palmer Add support for `getrandom`.
2020-04-15 jperaza Don't clobber esp

Created with:
  roll-dep src/src/third_party/lss

Change-Id: Ifd62b0d44545fd3142de6a6d1f2cc8ed1424f802
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2945148
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-06-07 16:02:39 +00:00
Mike Frysinger
e21ebdacfa refresh minidump test output
When I extended the output for these fields, I missed updating the
test baselines.

Change-Id: Ic793dbc9f42771e6fafff343ee2563bb37272c3f
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2945147
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-06-07 16:00:01 +00:00
Mike Frysinger
c4b0806f48 add OWNERS settings
Since the entire Chromium GoB host is moving to enforce owners, make
sure we have settings in place ahead of time.

Change-Id: Ia8a52ff587a0b8f11f2b56caf9e283d05e2a822c
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2920608
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Sterling Augustine <saugustine@google.com>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2021-06-03 16:26:13 +00:00
Tyrel Russell
472541827e Fix Clang Tidy error and fix ambiguous use of Endianess
Bug: b/189249305
Change-Id: I2b2e891dae5d632d965869c916c386cf3cd3c678
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2920513
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-05-26 20:14:52 +00:00
Tyrel Russell
a83110d6ba Remove last remaining use of dwarf2reader.
Bug: b/189249305
Change-Id: Id417a853928d7b17dc14dfc175c4dd236882f874
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2920512
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-05-26 19:22:38 +00:00
Tyrel Russell
0622f68827 Move the dwarf2reader objects into google_breakpad namespace to make it consistent with cfi_assembler.cc
Bug: b/189249305
Change-Id: I3433ff5c41d2f66ab292fbecb969f2cd08d24b29
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2920506
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-05-26 17:46:49 +00:00
Chingjun Lau
f7428bc397 Fix macos_dump_syms when __eh_frame is included in the dSYM file.
macho_reader assumes that every section in a segment exists, or none of the
sections exist in the file (for dSYM files).

https://reviews.llvm.org/D94460?id=315965 added __eh_frame section to the
__TEXT segments in dSYM files. All the other sections are removed, but still
have non-zero size in the header. macho_reader only looks at `fileoff` and
`filesize` fields to determine the size of the segment, but it looks at `addr`
and `size` to determine the size of the section, therefore it determines that
the sections would not fit in the segment and refused to parse the file.

In this case the removed sections all have offset == 0. Ignore such cases.

Change-Id: Ife771f7b302c1bc81c673b1103492c41321b5e3e
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2911204
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-05-21 18:56:41 +00:00
Joshua Peraza
b7ce678aec fix includes and remove tr1::unordered_map
_LIBCPP_VERSION doesn't reliably detect c++11.

Change-Id: I1adb4303269885e4a08648f049e14b244a2fde50
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2911693
Reviewed-by: Nelson Billing <nbilling@google.com>
2021-05-20 22:47:28 +00:00
Joshua Peraza
0e86eebc5a mac: fix xcode project
Change-Id: Ia8d1a6a7249cdadfd6790da34194376b3f6dbd51
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2466325
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
2021-05-19 21:03:25 +00:00
Zequan Wu
275e6d46a4 Make forward reference DIEs cross compilation units.
Before this change, forward_ref_die_to_func is always empty.
Because forward reference DIEs could cross compilation units,
forward_ref_die_to_func is moved into FilePrivate.
By using "grep "name omitted" sym | wc -l", the number of functions
with no name is reduced from 26951 to 203 if forward reference only is
allowed within CU. It's reduced from 203 to 6 if crossing compilation
units is allowed.

Change-Id: Ie2a457abfc0c4d8e68fe0fa595a27ea4abf33a76
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2904093
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2021-05-18 22:17:51 +00:00
Zequan Wu
6842fa5aa8 Set addr_base_ before parsing attributes.
If there is an address index reference to .debug_addr section before
DW_AT_addr_base, addr_base_ will be 0. It will retrieve wrong address.
An example could be DW_AT_loc_pc occurs before DW_AT_addr_base.

Change-Id: Id2b337f5235470cc9beaf05a62efebbde797dacf
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2900806
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-05-17 23:03:02 +00:00
Zequan Wu
13ba5a1549 Fix parsing .debug_rnglists section
Change-Id: I1bab1517c04684b8251984498eb0d43e1505fd30
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2888265
Reviewed-by: Sterling Augustine <saugustine@google.com>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-05-13 21:05:04 +00:00
Kristofer Spinka
5c4b5d89e4 Support building with C++20
std::allocator<T>::pointer and related are removed in C++20, so moving to
std::allocator_traits which is available since C++11.
Change-Id: Ie67b5c24b27e59edf5595a3575f2794748c3817f
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2894004
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2021-05-13 15:08:00 +00:00
Lei Zhang
c484031f1f Consistently call BaseName() in various Usage() functions.
Make various tools print just their names as part of the usage
instructions, rather than the full path. Also fix a missing space in the
dump_syms usage output.

Change-Id: I2b796678cd47e7dbabcc03df2b57cdc3420c008c
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2787678
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2021-04-07 20:37:52 +00:00
Michael Bai
3bea2815bf Add option to dump crash thread only
Add minidump_stackwalk option to dump the crash thread only

Bug: 1129202

Change-Id: I1370b4dc972f76ba1d57fca083da7d486774e65a
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2762072
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-04-01 17:42:21 +00:00
Brian Sheedy
dff7d5afd5 Revert "arm: Allow the first function to use linked register as return pc"
This reverts commit f2b3ab5e0a.

Reason for revert: Causes symbolization errors on ARM ChromeOS
devices crbug.com/1182948.

Original change's description:
> arm: Allow the first function to use linked register as return pc
>
> For a crash at the function entry with corrupted PC, the caller's PC
> could be lying in the link register. Using the PC from link register
> would be more effective than blindly scanning the stack immediately.
>
> Change-Id: I51673b7298e70faeeab2bfa97075e3c4793f94bc
> Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2678992
> Reviewed-by: Mike Frysinger <vapier@chromium.org>
> Reviewed-by: Joshua Peraza <jperaza@chromium.org>

Bug: 1182948
Change-Id: I2818b35ab1fb99012919cccc0fb80368e456ca15
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2765164
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-03-16 18:00:35 +00:00
Mike Frysinger
8b22babdf8 minidump-2-core: check platform_id for Linux
We have an enum for the OS, so check that instead.

Change-Id: I4bb38145553e3f5a2aa9baab330d588fef09a07e
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2757679
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-03-13 00:16:24 +00:00
Mike Frysinger
344b0ebf57 minidump_dump: decode cpu & os fields
We already have helper functions for this, so use them.

Change-Id: I6f77c9e138c461837cfb93adafce639ed8b836bb
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2753492
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-03-12 03:10:37 +00:00
Hans Wennborg
d6a6f52606 Strip LLVM-generated symbol suffixes when demangling Windows symbols
LLVM, especially in ThinLTO builds, sometimes puts a suffix on symbols
to give them a unique name. For example:

   ?foo@@YAXXZ$5520c83448162c04f2b239db4b5a2c61
   ?foo@@YAXXZ.llvm.1304071520971994875

Strip such suffixes in order to demangle the names.

Bug: chromium:1179132
Change-Id: Ibc8da0c605b95c6b9fc51802a56b89f6e7cfb7e1
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2739612
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
2021-03-08 20:26:34 +00:00
Justin Cohen
7279404aea Correct native symbol upload and UUID.
The auto-detection of the UUID was missing the extra "0" added for
compatibility reasons.  The native upload also was sending malformed
HTTP.

Change-Id: I8c261fc525f0f0086f269f2dee02941dd55488cb
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2739320
Reviewed-by: Nelson Billing <nbilling@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2021-03-08 17:38:32 +00:00
Justin Cohen
46f4b593ee Automatically capture debugID in Mac OS symupload tool.
There's no need to pass in debug ID to symupload for native symbol
uploads, as breakpad can extra the ID itself for dsym and macho types.

Change-Id: Ib0b7703eac85bc84fe1f095e678d75b347bd872a
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2724731
Reviewed-by: Nelson Billing <nbilling@google.com>
Reviewed-by: Mark Mentovai <mark@chromium.org>
2021-03-02 19:22:16 +00:00
Mike Frysinger
778bd12f22 switch repo manifest to track the main branch
Change-Id: Ibb74f3c06e821ba386dd286e730fce4f9344ac75
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2718528
Reviewed-by: Ian Barkley-Yeung <iby@chromium.org>
2021-02-25 01:23:04 +00:00
Mike Frysinger
fe5025b7f1 restore gtest updates
The recent dwarf5 work in here incorrectly reverted the gtest macros.

Change-Id: I8eca7c1c85e26f5ad6ff461e4ef26d2859c08625
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2691092
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-02-11 21:12:39 +00:00
Sim Sun
f2b3ab5e0a arm: Allow the first function to use linked register as return pc
For a crash at the function entry with corrupted PC, the caller's PC
could be lying in the link register. Using the PC from link register
would be more effective than blindly scanning the stack immediately.

Change-Id: I51673b7298e70faeeab2bfa97075e3c4793f94bc
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2678992
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-02-09 01:00:32 +00:00
Sim Sun
2d3e030fdb readme: Change default branch from master to main
The current default branch migrated to main, change the default branch in readme.

Change-Id: Ief1963f84419c094d79d5af8ec5bc21346b9e2b1
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2680719
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2021-02-07 02:10:38 +00:00
Sim Sun
f195f0a55e Add core_handler and pid2md into git ignore
`core_handler` and `pid2md` are always untracked after `make`. They are
the output of build. We should ignore them.

```
Untracked files:
  (use "git add <file>..." to include in what will be committed)
    src/tools/linux/core_handler/core_handler
    src/tools/linux/pid2md/pid2md
```

Change-Id: Ib20fdaf6b902f4de0b336ab22423c7271f8dc26c
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2678993
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2021-02-06 15:06:11 +00:00
Ryo Hashimoto
a5d7afb38b Add src/processor/stackwalk_common.{cc,h} to src_libbreakpad_a_SOURCES
To generate the out directory before compiling stackwalk_common.cc.

Makefile.in and aclocal.m4 were generated by running `aclocal &&
automake`.

BUG=chromium:1167503
BUG=b:177451284
TEST=./configure && make

Change-Id: I7a7674aa5f81cf0016eb2f5170ea3676ccfe3bbb
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2659000
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2021-01-29 12:43:57 +00:00
Caroline Tice
558bfc31e1 breakpad: Fix typo in unit test.
'uint64' -> 'unit64_t'

Change-Id: I49071328366d7a4f90dea84985ad9744de9ec46a
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2643078
Reviewed-by: Sterling Augustine <saugustine@google.com>
2021-01-21 16:59:08 +00:00
Caroline Tice
3b3469e9ed breakpad: Eliminate 'unused variable' warnings.
When built with -Werror, dwar2reader.cc fails to build with three
-Wunused-variable warnings.  This CL fixes that.

Change-Id: I10487644377d623d850acc258a94bbacb368ffae
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2638927
Reviewed-by: Sterling Augustine <saugustine@google.com>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2021-01-20 20:33:59 +00:00
Caroline Tice
f794d083dc Dwarf5 fixes [5 of 5]: Recognize dwp version 5.
Fifth of 5 small patches to fix various breakpad issues found
while testing dump_syms of DWARF v5 in ChromeOS.

DWARF v5 introduces a new dwp version, version 5. The current
dwp reader only recognizes versions 1 & 2 as valid dwp versions. This
CL fixes that.

Change-Id: I5ac43b318b59e406ca1f6749232709aaef59a67b
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2634550
Reviewed-by: Sterling Augustine <saugustine@google.com>
2021-01-19 20:21:24 +00:00
Caroline Tice
3c528da94c Dwarf5 fixes [4 of 5]: Skip processing Dwarf5 type units.
Fourth of 5 small patches to fix various breakpad issues found
while testing dump_syms on DWARF v5 in ChromeOS.

Dwarfv5 adds many new Type Unit sections to debug information. Since
these only contain type information, they are of no interest to
dump_syms.  This CL gets dump_syms to skip trying to process the
type unit sections.  Without this CL, dump_syms takes ~ 3 hours to
process the DWARF v5 Chrome binary.  With this CL, dump_syms takes
~ 8 minutes to process the DWARF v5 Chrome binary (about the same
time as it takes for DWARF v4).

This CL also adds a test case to verify that type units are being
skipped.

Change-Id: Ie0bb2d675718f7041b8e9b3186ed44f80a3ad39c
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2634549
Reviewed-by: Sterling Augustine <saugustine@google.com>
2021-01-19 20:20:49 +00:00
Caroline Tice
646f0f4920 Dwarf5 fixes [3 of 5]: Fix bugs reading .debug_line_str.
Third of 5 small patches to fix various breakpad issues found
while testing dump_syms on DWARF v5 in ChromeOS.

The offset into the line table was being incorrectly added to the
.debug_string and debug_line_str sections in the code for reading
the line table.  It was also skipping trying to read the line table
if the .debug_line_str section was present.  This CL fixes these
issues.

Change-Id: If14543731016bcee201b8c33dca53e9520007222
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2634548
Reviewed-by: Sterling Augustine <saugustine@google.com>
2021-01-19 20:20:04 +00:00
Caroline Tice
ac9712d9b4 Dwarf5 fixes [2 of 5]: Handle .debug_str_offsets properly.
Second of 5 small patches to fix various breakpad issues found
while testing dump_syms on DWARF v5 in ChromeOS.

This patch adds code to properly find & parse the
DW_AT_str_offsets_base attribute, and use it to handle strings
of the forms DW_FORM_strx, DW_FORM_strx1..DW_FORM_strx4 This is the
largest of the DWARF5 fixes.  It also includes a unittest to test
using a string offset.

Change-Id: I5d1def862d9d91cae4b2853578441e04ea85449d
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2634547
Reviewed-by: Sterling Augustine <saugustine@google.com>
2021-01-19 20:18:42 +00:00
Caroline Tice
f4115fad24 Dwarf5 fixes [1 of 5]: Add & use missing enums, fix typo.
First of 5 small patches to fix various breakpad issues found
while testing dump_syms on DWARF v5 in ChromeOS.

This patch adds some missing DWARF enums, and their uses, and fixes
one small typo (was updating 'lineptr' instead of '*lineptr').

Change-Id: Ic674d5db29f29a69a3f6e370d0553eb4139c91de
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2634546
Reviewed-by: Sterling Augustine <saugustine@google.com>
2021-01-19 18:51:06 +00:00
Mike Frysinger
f469cab97b update to newer googletest
This matches the version used in Chromium.

Change-Id: I1b697c7f79a4e628cecf96f6abc3e5dacac0888a
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2605357
Reviewed-by: Mark Mentovai <mark@chromium.org>
2021-01-04 22:49:21 +00:00
Eric Astor
86c090b77f Do not build core_handler unless memfd_create is available
Restores build compatibility with glibc < 2.27.

Change-Id: I1e58ab5e15d7691ad076769a52260fa01c9cfd06
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2597562
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2020-12-21 22:07:02 +00:00
Snehasish Kumar
83203748ae Add a test to check debug information for split functions.
With optimizations such as -fsplit-machine-functions (clang) and
-freorder-blocks-and-partition (gcc), the function body may be
discontiguous in the binary. Control flow between the parts are routed
using jumps. This test ensures that breakpad consumes debuginfo
generated by the -fsplit-machine-functions optimization and the line
table for the cold function part is correct.

Change-Id: I44d59704864ee940dd429c5249d5d793fe081d6a
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2591951
Reviewed-by: Sterling Augustine <saugustine@google.com>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2020-12-15 17:14:09 +00:00
Snehasish Kumar
57ce4032f5 Add dwarf2reader unit test to run with make check.
This change updates Makefile.am to include the dwarf2reader lineinfo
unittest to the suite of tests run when make check is invoked. All the
manual changes are limited to the Makefile.am file. The remaining files
contain changes generated by automake.

Change-Id: Ib078391b44235ce430a224713512637ce8e90a36
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2587266
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2020-12-11 21:39:03 +00:00
Snehasish Kumar
ebc5567370 Fix a typo in lineinfo unittest.cc
When initializing the LineReader, the size passed should be the sizeof
the dwarf4 line program.

Change-Id: I67e6fa404d4fa8851e4958013a35a061fe169156
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2585345
Reviewed-by: Sterling Augustine <saugustine@google.com>
2020-12-10 19:58:43 +00:00
Ludovic Guegan
78f7ae495b pid2md: generate a minidump from a running process
On Linux, this tool generates a minidump for given process. It requires
the permission to trace the process and access its /proc directory. This
is useful when a defective behavior of a process does not lead to a
crash. For example, it can be used by a watchdog or if a process does
not correctly respond to a termination request.

Change-Id: Iab501e42c064a537aea62831c471e395ff697186
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2539920
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2020-11-24 08:18:56 +00:00
Ludovic Guegan
bd4a28c08b core_handler: coredump handler to produce minidump
On Linux, it is possible to register a core handler via
/proc/sys/kernel/core_pattern. Doing so invokes the core handler when
a process crash. The core_handler uses /proc/<pid>/mem to access the
process memory. This way it is not necessary to process the full
coredump which takes time and consumes memory.

In order to profit from this core handler, for example, one can
integrate dump_syms into Yocto and generate an archive with the
breakpad symbols of all the binaries in the rootfs. Minidumps are
especially useful on embedded systems since they are lightweight and
provide contextual information.

Change-Id: I9298d81159029cefb81c915831db54884310ad05
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2536917
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2020-11-23 23:15:15 +00:00
Ludovic Guegan
e3d485f73f Dwarf5ReadRangeList: remove duplicated declaration
Bug: Test Dwarf5ReadRangeList does not compile with GCC 10 because of
Change-Id: Ibeea82084bbf4c1d0e760a7bba14109401cf3639
duplicated declaration.
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2536913
Reviewed-by: Sterling Augustine <saugustine@google.com>
2020-11-13 17:15:14 +00:00
Sterling Augustine
78180df608 Use size_t to fix the build on mac.
Change-Id: Id145bdb711eea9ee33bcd9f258ff3befd6e7e86b
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2465487
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
2020-10-12 18:09:01 +00:00