aboutsummaryrefslogtreecommitdiff
path: root/src/common/linux
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Refactor rangelist handling to prepare for dwarf5 .debug_rngslist"HEADmasterSterling Augustine2020-10-021-8/+16
| | | | | | | | | | | | This reverts commit 2b936b06c12657b684f6c7276d6ae5a24cb48ab5. After getting deep into the dwarf5 range reader, I realized that this should be done a somewhat different way. So reverting in favor or a better design, coming in a few minutes. Change-Id: Ie0b2846e70b3df1e637831e96ea69fe093f4e712 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2446011 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Refactor rangelist handling to prepare for dwarf5 .debug_rngslistSterling Augustine2020-09-281-16/+8
| | | | | | | | | | | | | | | | | | | | | | Dwarf5 introduces a new .debug_rngslist section, to take the place of the Dwarf4 .debug_ranges. However, the dwarf version is CU-based, and not file-based, so there can be both sections, and which section the CU needs isn't known until the dwarf parser encounters either DW_AT_ranges (dwarf 4 and lower) or DW_AT_rnglists_base (dwarf 5). This change refactors the code around range lists and range list readers to defer the decision of what section to parse until the relevant attribute is found. It moves the range list section reader from the range-list handler itself (which doesn't know which section it will use) to the CU context, and then lets the handler know when it encounters DW_AT_ranges. I will add a reader for the new dwarf5 section, along with the code to interpret the new section, and its forms and such in a subsequent patch. Change-Id: Ie92e4c9daa3f0acb98d7ef74f6b9c2065db849b1 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2433684 Reviewed-by: Mark Mentovai <mark@chromium.org>
* file_id_unittest: avoid system()Mike Frysinger2020-09-081-7/+16
| | | | | | | | | | | | We have API's for copying files & changing file modes, so there's no sense in using system() to run programs to do that. For the strip call, do the minimal spawn+wait dance. This avoids weird quoting string issues at least. Change-Id: Ibda117f243e886c0c7fcf8076fb8602b8d3ba42d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2396558 Reviewed-by: Mark Mentovai <mark@chromium.org>
* linux: Fix leak when the offset of memory_mapped_file is greater than 0Sim Sun2020-09-051-2/+3
| | | | | | | | | | Breakpad should only map the file content after the offset instead of the whole file. Mapping the whole file while only unmap 'file_len - offset' would leak 'offset' bytes of mapping in virtual memory. Change-Id: I10be4f929d969703a6a02c1f709d2a4ca86a6e9e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2393468 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* linux: Fix segfault when there is no section header in ELF fileSim Sun2020-08-151-0/+6
| | | | | | | | | | | | | Some vendor library doesn't contain the section header. It causes segmentation fault in `FindElfClassSection`. > e_shoff: > This member holds the section header table's file offset in bytes. > If the file has no section header table this member holds zero. Change-Id: Id98d6ff3bd16af4541deb5a55a8fad2fa74eda23 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2354427 Reviewed-by: Mark Mentovai <mark@chromium.org>
* fix pointer style to match the style guideMike Frysinger2020-07-1521-138/+138
| | | | | | | | | | We do this in a lot of places, but we're inconsistent. Normalize the code to the Google C++ style guide. Change-Id: Ic2aceab661ce8f6b993dda21b1cdf5d2198dcbbf Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2262932 Reviewed-by: Sterling Augustine <saugustine@google.com> Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add support for dwarf5 line tables.Sterling Augustine2020-07-141-2/+10
| | | | | | Change-Id: I2c0cd0e7163502e52fbf0745b611befb2e219071 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2276193 Reviewed-by: Sterling Augustine <saugustine@google.com>
* Use stdint.h numeric typesJoshua Peraza2020-04-091-8/+8
| | | | | | Change-Id: Ib815b0757539145c005d828080b92cbfa971a21b Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2141226 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Use breakpad_getcontext on all Linux platforms missing getcontextMichael Forney2020-03-164-0/+889
| | | | | | | | | | | | | | | | | | | | getcontext is also not available on musl libc, so generalize breakpad_getcontext so it can be used as a fallback for non-Android platforms as well. On x86_64 and i386, ucontext_t uses an Android-specific offset for storage of FP registers, since its sigset_t differs in size. So, make the definition of MCONTEXT_FPREGS_MEM and UCONTEXT_FPREGS_MEM_OFFSET conditional on whether we are building for Android. On glibc and musl, signal.h and asm/sigcontext.h can't be included together, so in breakpad_context_unittest.cc, only compare the libc and kernel _fpstate when on Android. Bug: google-breakpad:631 Change-Id: If81d73c4101bae946e9a3655b8d1c40a34ab6c38 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2102135 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Use ULONG_MAX instead of __WORDSIZE to determine ELF classMichael Forney2020-03-101-4/+5
| | | | | | | | | | | __WORDSIZE is an internal libc definition. Instead, we can use ULONG_MAX from limits.h, whose value corresponds to the machine's native word size. Bug: google-breakpad:631 Change-Id: If69caf578286d678585d1510c01562b969b5061f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2097352 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Use sched_yield instead of pthread_yieldMichael Forney2020-03-101-1/+2
| | | | | | | | | | | | | | | | | | | | | pthread_yield is not a standard POSIX function, and is not available in musl libc. The man page says to "Use the standardized sched_yield(2) instead"[0]. On glibc, pthread_yield is exactly equivalent to sched_yield[1]. On bionic, pthread_yield is also not available, so on Android, the tests define a wrapper that just calls sched_yield. This wrapper is no longer necessary if we just use sched_yield in the first place. [0] http://man7.org/linux/man-pages/man3/pthread_yield.3.html [1] https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_yield.c Bug: google-breakpad:631 Change-Id: Ie4c6be8c17cdc2f5396a7fe972fa51a97573b049 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2097340 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Add "type" option to sym_upload sym-upload-v2 mode.Nelson Billing2020-02-274-23/+51
| | | | | | | | | | | | | | | | - "sym-upload-v2" protocol now supports specifying a symbol file "type". - Known types are "breakpad" (default option, previously this was only effectively the only option), "elf", "pe", "macho", "debug_only", "dwp", "pdb", and "dsym". - When type other than breakpad is specified, sym_upload tool requires the code_file and debug_id value (that it otherwise would have gotten from the text of the Breakpad symbol file). - This ultimately means that sym_upload can be used to upload native symbol files now, in addition to Breakpad symbol files. Change-Id: I3a331ba16f199d1d0025df735716ba5de298f522 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2078670 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Make LibcurlWrapper support static linking.Nelson Billing2020-02-221-1/+13
| | | | | | | | | | - Didn't used to support statically linked libcurl, now it does (like HttpUpload does). Change-Id: Ic014548225b129f0c1c9ffe6a671f5bd2352b6e6 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2068947 Reviewed-by: Ivan Penkov <ivanpe@chromium.org> Reviewed-by: Joshua Peraza <jperaza@chromium.org>
* linux: fix symupload build failuresJoshua Peraza2020-02-212-6/+11
| | | | | | Change-Id: I58612eb70173d79c2aeb755d8c7f5677cb3a8fb8 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2067608 Reviewed-by: Nelson Billing <nbilling@google.com>
* Add optional new symbol upload API to sym_upload.Nelson Billing2020-02-206-89/+601
| | | | | | | | Change-Id: I6a49e9f4a699fa6f5f8e9f0fc86afb4cb342a442 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1422400 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Ivan Penkov <ivanpe@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* linux, client: set module name from DT_SONAMEJoshua Peraza2019-10-301-7/+5
| | | | | | | | | | | | | | | | | | 3e56ef9d changed dump_syms to set the module name from DT_SONAME expecting that clients were already using DT_SONAME when it was present. The Breakpad client previously only used DT_SONAME as the name for a module if it detected that it was likely mapped from a zip file. This patch updates the Breakpad Linux client to always use the DT_SONAME in minidumps if it's present. Also included are changes to address comments that were missed from that review. Bug: 1016924 Change-Id: I4aae8c05e6793d4b0598049a8964ddd4cb0c6194 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1889231 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* linux, dump_syms: Filter module entries outside specified rangesChristopher Grant2019-10-291-0/+25
| | | | | | | | | | | | | | | | | | | | Partitioned libraries generated with lld and llvm-objcopy currently contain a superset of debug information, beyond what applies to the library itself. This is because objcopy cannot split up debug information by partition - instead, it places a copy of all debug information into each partition. In lieu of potential future support for lld or objcopy becoming able to split up debug information, let dump_syms do the next best thing: - Find the address ranges of all PT_LOAD segments in the lib. - Supply these to the Module being generated. - Filter additions to the Module based on these ranges. Bug: 990190 Change-Id: Ib5f279f42e3f6ea79eed9665efbcc23c3c5d25dc Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1884699 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
* Add options to set OS and filenameJake Ehrlich2019-10-243-20/+43
| | | | | | | | | This allows Fuchsia to use dump_syms directly without a postprocessing step. Change-Id: I84507f8bedddfcdcdb237119457c8ddf8ac354d5 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1850718 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* linux, dump_syms: set module name from DT_SONAMEJoshua Peraza2019-10-243-1/+78
| | | | | | | | | | | | | The Breakpad and Crashpad clients will use an object's DT_SONAME as the name for a module if it exists. Previously, linux dump_syms would assume the basename of an input elf file matches that value, causing symbol lookups to fail if they were mismatched. This patch updates dump_syms to use DT_SONAME as the module name, if present. Bug: 1016924 Change-Id: I5eff0cf06c703841df3fb552cb5a8e1e50a20c64 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1876763 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* guid_creater: include string.h for memcpyMike Frysinger2019-08-041-0/+1
| | | | | | | Bug: google-breakpad:779 Change-Id: If0cfb036ee924178033c89d4dc3e2ce75ddd46f2 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1732887 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Linux breakpad_unittests: fix ThreadSanitizer problemsMark Mentovai2019-04-261-2/+11
| | | | | | | | | | | | | | | | Some tests were failing because they had expectations about the number of threads in a process, but TSan, and in some cases, ASan, introduce their own threads. Where a sanitizer affects this, the expectations are now used as minimum thread counts, not exact thread counts. See https://www.brooklinen.com/blogs/brookliving/best-thread-count-for-sheets. These problems were detected by ThreadSanitizer at https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8915151099544583616/+/steps/breakpad_unittests__with_patch_/0/stdout Bug: chromium:949098 Change-Id: Ie40f1766bea27e9bcb112bf9e0b8b846fb343012 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1585948 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* Make breakpad_unittests work with Chrome's test runner instead of gtest'sMark Mentovai2019-04-191-0/+6
| | | | | | | | | | | | | | | | | | | Chrome's test runner on Linux installs its own StackDumpSignalHandler which swallows signals and doesn't re-raise them. This is sloppy, but apparently there are reasons (https://crbug.com/551681). For breakpad_unittests, it causes problems where a test process expects (via waitpid()) to observe a child crash. Deal with those cases by explicitly restoring the default signal handler. In another case, Chrome's test runner seems to have been arriving at the conclusion that it was to expect output from a child. Transitioning from exit() to _exit() fixes this problem, and it's not necessarily a bad idea to do this in post-fork() children without an execve() anyway. Bug: chromium:949098 Change-Id: I5a6af0c2a09cd8eac9998358f6d5ea665288236f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1575670 Reviewed-by: Mark Mentovai <mark@chromium.org>
* linux_core_dumper: add a fallback definition for NT_SIGINFOMike Frysinger2019-03-071-0/+5
| | | | | | | | | | When building on an old system with outdated headers, this define might not be available. Add a fallback to our existing elf header. Bug: google-breakpad:790 Change-Id: I4dfe7a5cebd414cca3582a1a9cfc983503d5a779 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1507073 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Replace TYPED_TEST_CASE with TYPED_TEST_SUITE.Lei Zhang2019-02-283-3/+3
| | | | | | | | | | TYPED_TEST_CASE is deprecated in modern googletest. BUG=chromium:936654 Change-Id: I08004ffbb26089ebe17302934ed6d3268220d151 Reviewed-on: https://chromium-review.googlesource.com/c/1493423 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add support for parsing the DW_AT_ranges attributesGabriele Svelto2018-08-131-1/+40
| | | | | | | | | | | | | | | | This enables the DWARF reader to properly parse DW_AT_ranges attributes in compilation units and functions. Code covered by a function is now represented by a vector of ranges instead of a single contiguous range and DW_AT_ranges entries are used to populate it. All the code and tests that assumed functions to be contiguous entities has been updated to reflect the change. DW_AT_ranges attributes found in compilation units are parsed but no data is generated for them as it is not currently needed. BUG=754 Change-Id: I310391b525aaba0dd329f1e3187486f2e0c6d442 Reviewed-on: https://chromium-review.googlesource.com/1124721 Reviewed-by: Ted Mielczarek <ted.mielczarek@gmail.com>
* dump_symbols: Stop rejecting files with Android packed relocation sections.Peter Collingbourne2017-11-071-31/+0
| | | | | | | | | | | | The lld linker has native support for creating packed relocation sections, and as a result we can expect files with these sections to have symbols. Bug: chromium:742655 Change-Id: I48a50bff041146f51b3a8b730d7a778f832787f6 Reviewed-on: https://chromium-review.googlesource.com/754239 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org>
* Provide helper wrappers for basename(3) and dirname(3)Tobias Sargeant2017-10-181-11/+2
| | | | | | | | | | This hides the need to provide mutable C strings, and unifies existing basename calls and variations in a single location. Change-Id: Idfb449c47b1421f1a751efc3d7404f15f8b369ca Reviewed-on: https://chromium-review.googlesource.com/725731 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Rename src/common/memory.h to memory_allocator.h.Ted Mielczarek2017-10-173-3/+3
| | | | | | | | | | | | memory.h shadows a system header which normally isn't a problem because of the include paths in Breakpad, but the Firefox build system winds up with src/common in the include path so we've had a workaround for this for years. Renaming the file lets us get rid of that workaround and shouldn't hurt anything. Change-Id: I3b7c4239dc77f3b2b7cf2b572a0cad88cd7e8522 Reviewed-on: https://chromium-review.googlesource.com/723261 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Teach the ELF parser to handle multiple PT_NOTE phdrs.Peter Collingbourne2017-05-264-38/+76
| | | | | | | | | | | | | | | It is legal for an ELF to contain multiple PT_NOTEs, and that is in fact what lld's output looks like. Testing: "make check" and breakpad_unittests when patched into chromium. Bug: chromium:716484 Change-Id: I01d3f8679961e2cb7e789d4007de8914c6af357d Reviewed-on: https://chromium-review.googlesource.com/513512 Reviewed-by: Primiano Tucci <primiano@chromium.org> Reviewed-by: Ted Mielczarek <ted@mielczarek.org> Reviewed-by: Mark Mentovai <mark@chromium.org>
* Simplify ELF parser code.Peter Collingbourne2017-05-253-35/+13
| | | | | | | | | | | | | The layout of Elf32_Nhdr and Elf64_Nhdr is the same, so remove templating and code that extracts the elfclass from the ELF file. Testing: "make check" and breakpad_unittests when patched into chromium. Bug: chromium:716484 Change-Id: I41442cfff48afc6ae1a5b604d22b67550a910376 Reviewed-on: https://chromium-review.googlesource.com/514450 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Wrap config.h include in HAVE_CONFIG_H.John Budorick2017-05-241-1/+4
| | | | | | | | Bug: breakpad:730 Change-Id: I5a24b96258e1114378061512239d3e18f3f753f0 Reviewed-on: https://chromium-review.googlesource.com/514283 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Only use O_CLOEXEC on platforms that support itLars Volker2017-05-101-0/+1
| | | | | | | | | | | | | | Change a9fca58 made use of the O_CLOEXEC flag, which is not supported on older Linux kernels. This change makes the use contingent on kernel support. Testing: I manually compiled breakpad on CentOS 5.8 running kernel 2.6.18-308.8.2.el5.centos.plusxen. Bug: 730 Change-Id: I21dff928cfba3c156a56708913f65a0c7b5396a6 Reviewed-on: https://chromium-review.googlesource.com/498528 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Make minidump name generation on Linux as random as possibleGabriele Svelto2017-04-121-7/+87
| | | | | | | | | | | | | | | This patch ensures that two crashes taken within the same second have different minidump names. The random characters used in the minidump filename are now read from /dev/urandom where possible or generated via arc4random(). If neither is available we fall back to regular rand() but mixing the address of an object to the current time when generating the random seed to make it slightly less predictable. BUG=681 Change-Id: I2e97454859ed386e199b2628d6b7e87e16481b75 Reviewed-on: https://chromium-review.googlesource.com/445784 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Remove unused typedefGordana Cmiljanovic2017-03-241-1/+0
| | | | | | | | | | | This removes unused typedef left in change: https://chromium-review.googlesource.com/c/447697/ and fixes error: dump_symbols.cc:613:35: error: unused typedef 'Word' [-Werror,-Wunused-local-typedef] Change-Id: Ib5a82cd8af9a58ebf173b0f338fa9ad341819ef3 Reviewed-on: https://chromium-review.googlesource.com/459518 Reviewed-by: Mark Mentovai <mark@chromium.org>
* [MIPS]: Relax dwarf section loading to accept both PROGBITS and MIPS_DWARF ↵Dragan Mladjenovic2017-03-071-4/+22
| | | | | | | | section types Change-Id: I0862d930d92687dee47daa8d4dc3a21524c1c893 Reviewed-on: https://chromium-review.googlesource.com/447697 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
* Update linksOrgad Shaneh2016-11-181-1/+1
| | | | | | | | | | code.google.com is obsolete. Fix all broken markdown links while at it. Change-Id: I6a337bf4b84eacd5f5c749a4ee61331553279009 Reviewed-on: https://chromium-review.googlesource.com/411800 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Allow compiling the google-breakpad code using a global ::string class ↵Ivan Penkov2016-11-081-3/+4
| | | | | | | | | | | | instead of std::string. For more details take a look at common/using_std_string.h BUG= Change-Id: Ifebfc57f691ef3a3bef8cfed7106c567985edffc Reviewed-on: https://chromium-review.googlesource.com/399738 Reviewed-by: Mark Mentovai <mark@chromium.org>
* This change allows compiling the google-breakpad code using a global ↵Ivan Penkov2016-08-301-2/+1
| | | | | | | | | | | | ::string class instead of std::string. For more details take a look at common/using_std_string.h BUG= Change-Id: I11f1ce697be23e13f12ea8f0468bbe02fa63c967 Reviewed-on: https://chromium-review.googlesource.com/378159 Reviewed-by: Mark Mentovai <mark@chromium.org>
* linux-syscall-support: pull in latest versionMike Frysinger2016-06-141-11/+0
| | | | | | | | | The sys_mmap/sys_mmap2 weirdness has been cleaned up in lss now and there is only one API now for everyone -- sys_mmap. R=mseaborn@chromium.org Review URL: https://codereview.chromium.org/2065493006 .
* Dump INFO CODE_ID containing Build ID in Linux dump_symsTed Mielczarek2016-06-106-31/+104
| | | | | | | | | | | | | I'd like to have the Build ID available for our symbol server uploading, and this will make it easy. Most of this change is me rewriting dump_symbols_unittest to be typed tests so I could add a new test there. R=mark@chromium.org BUG= Review URL: https://codereview.chromium.org/2052263002 .
* Add debug fission support.Yunlian Jiang2016-05-041-1/+2
| | | | | | | | | | | | | | | | | | | | | This added debug fission support. It tries to find the dwp file from the debug dir /usr/lib/debug/*/debug and read symbols from them. Most of this patch comes from https://critique.corp.google.com/#review/52048295 and some fixes after that. The elf_reader.cc comes from TOT google code. I just removed some google dependency. Current problems from this patch 1: Some type mismatch: from uint8_t * to char *. 2: Some hack to find the .dwp file. (replace .debug with .dwp) BUG=chromium:604440 R=dehao@google.com, ivanpe@chromium.org Review URL: https://codereview.chromium.org/1884283002 .
* tweak IGNORE_RET behavior a bitMike Frysinger2016-04-111-1/+1
| | | | | | | | | | GCC will still warn about unused return value with the form: if (write(...)); Instead, change the semi-colon to an empty set of braces. BUG=chromium:428478 TEST=build+test still works
* Added an option (-i) to have dump_syms output header information only.David Yen2016-04-082-18/+77
| | | | | | | | | | | | | | | | | It is often helpful to check if a particular symbol file dumped by dump_syms actually matches a version of a binary file we have. The symbol output contains an ID which can be used to see if it matches the binary file. Unfortunately, this ID is internally calculated and not a standard hash of the binary file. Being able to output the header information only will allow users to determine whether their symbol file is up to date or not. R=jochen@chromium.org BUG=561447 Review URL: https://codereview.chromium.org/1864823002 . Patch from David Yen <dyen@chromium.org>.
* Switch the Linux minidump writer to use MDCVInfoELF for CV data.Ted Mielczarek2016-04-054-129/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | This preserves full build ids in minidumps, which are useful for tracking down the right version of system libraries from Linux distributions. The default build id produced by GNU binutils' ld is a 160-bit SHA-1 hash of some parts of the binary, which is exactly 20 bytes: https://sourceware.org/binutils/docs-2.26/ld/Options.html#index-g_t_002d_002dbuild_002did-292 The bulk of the changes here are to change the signatures of the FileID methods to use a wasteful_vector instead of raw pointers, since build ids can be of arbitrary length. The previous change that added support for this in the processor code preserved the return value of `Minidump::debug_identifier()` as the current `GUID+age` treatment for backwards-compatibility, and exposed the full build id from `Minidump::code_identifier()`, which was previously stubbed out for Linux dumps. This change keeps the debug ID in the `dump_syms` output the same to match. R=mark@chromium.org, thestig@chromium.org BUG= Review URL: https://codereview.chromium.org/1688743002 .
* Refactor sym_upload in tools to extract code into common/linux, and minor fixesLi Yan2016-03-304-1/+231
| | | | | | | | | | | | to code calling libcurl. This change may be used to build a tool to dump and upload symbols with multi-thread. BUG= R=mmandlis@chromium.org CC=google-breakpad-dev@googlegroups.com Review URL: https://codereview.chromium.org/1842113002 .
* Have dump_syms output the full symbol table.David Yen2016-03-231-18/+47
| | | | | | | | | | | | | | | | | | Some of the symbols in the stack trace are not found in the .dynsym section but were located in the full symbol table .symtab section instead. This was causing some of our stack traces to be incomplete or point to incorrect function names. Since we only output function names, there are actually not that many more symbols located in .symtab that aren't in .dynsym. It is better to simply output all symbols found so our stack traces are complete. R=mark@chromium.org, thestig@chromium.org BUG=561447 Review URL: https://codereview.chromium.org/1824063002 . Patch from David Yen <dyen@chromium.org>.
* convert to uint8_t* for binary data to fix -Wnarrowing build errorsMike Frysinger2016-01-261-12/+15
| | | | | | | | | | | | | | | Newer gcc versions default to -Werror=narrowing when using newer C++ standards (which we do). This causes issues when we try to stuff a value like 0xea into a char -- the value is out of range for signed char bytes. That's when gcc throws an error: .../bytereader_unittest.cc: In member function 'virtual void Reader_DW_EH_PE_absptr4_Test::TestBody()': .../bytereader_unittest.cc:400:55: error: narrowing conversion of '234' from 'int' to 'char' inside { } [-Wnarrowing] BUG=chromium:579384 TEST=`make check` passes R=mark@chromium.org Review URL: https://codereview.chromium.org/1605153004 .
* Let breakpad build with -Wall on OS X and Linux.Lei Zhang2015-12-294-3/+6
| | | | | | | | | A=thakis@chromium.org Original Review: https://codereview.chromium.org/1550933002/ R=thakis@chromium.org Review URL: https://codereview.chromium.org/1554613002 .
* Support for multiple upload files in CrashReportSender/HTTPUploadDavid Major2015-10-062-12/+12
| | | | | | | | A=David Major <dmajor@mozilla.com> BUG=https://bugzilla.mozilla.org/show_bug.cgi?id=1048091 R=ted@mielczarek.org Review URL: https://bugzilla.mozilla.org/show_bug.cgi?id=1048091 .
* Update breakpad for Android packed relocations.rmcilroy@chromium.org2015-06-191-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | Shared libraries containing Android packed relocations have a load bias that differs from the start address in /proc/$$/maps. Current breakpad assumes that the load bias and mapping start address are the same. Fixed by changing the client to detect the presence of Android packed relocations in the address space of a loaded library, and adjusting the stored mapping start address of any that are packed so that it contains the linker's load bias. For this to work properly, it is important that the non-packed library is symbolized for breakpad. Either packed or non-packed libraries may be run on the device; the client detects which has been loaded by the linker. BUG=499747 R=primiano@chromium.org, rmcilroy@chromium.org Review URL: https://codereview.chromium.org/1189823002. Patch from Simon Baldwin <simonb@chromium.org>. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1459 4c0a9323-5329-0410-9bdc-e9ce6186880e