aboutsummaryrefslogtreecommitdiff
path: root/src/common
Commit message (Collapse)AuthorAgeFilesLines
* fix pointer style to match the style guideMike Frysinger2020-07-1597-1393/+1391
| | | | | | | | | | 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-1410-65/+510
| | | | | | Change-Id: I2c0cd0e7163502e52fbf0745b611befb2e219071 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2276193 Reviewed-by: Sterling Augustine <saugustine@google.com>
* Move GetSectionByName out of CompilationUnit.Sterling Augustine2020-06-264-26/+30
| | | | | | | | | | For the upcoming Dwarf5 LineInfo changes, we will need to get several additional sections by name, but without a the Compilation Unit. This change prepares for that. Change-Id: I566855abb339a856110a2f7d243d3848fe2b3c18 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2268861 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Read dwarf5 compilation unit headers.Sterling Augustine2020-06-255-20/+119
| | | | | | | Change-Id: Ia85b2fb7b3cb821ad353a0003223d8b8465e792d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2265259 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add and handle various dwarf5 addrx forms.Sterling Augustine2020-06-246-10/+66
| | | | | | | | | | | | | Given the almost nonexistent direct dwarfreader tests, I think the best way to test these dwarf5 additions will be to add a full dwarf5 compilation unit similar to the ones used incidentally in the other tests. But I can't do that until enough dwarf5 is correctly implemented. Change-Id: I3418bda7212ae85c4b67232a2ab8fea9b9ca5d42 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2258838 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Add and handle new dwarf5 string-related forms.Sterling Augustine2020-06-223-31/+119
| | | | | | | | | | | | | | | | Adding the new forms by type and processing should avoid the problems with 0c0e24f709288a129d665ec27d6f089189318385, where new forms weren't handled in switch statements, breaking the build. Testing this should follow the testing for DW_FORM_GNU_str_index, very closely, but there doesn't appear to be any tests for that, or even DW_FORM_strp. Change-Id: I609d56b1dc879971bfef1070f063f8457fec6017 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2233839 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org>
* Avoid calling demangler for non-C++ symbols on LinuxMikhail Borisov2020-05-261-6/+16
| | | | | | | | | | Bogus demangler warnings should be suppressed on both Mac and Linux platforms, so there is no reason to keep this filter behind __APPLE__ gate. Bug: chromium:1062556 Change-Id: Idf28db0b527c3cd6dd91510fcf7d9040aaa64694 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2210684 Reviewed-by: Mark Mentovai <mark@chromium.org>
* mac: Don’t try to demangle non-C++ symbols with the C++ demanglerYngve N. Pettersen2020-05-051-0/+12
| | | | | | | | | | | On Mac a C++ symbol has 1-4 underscore characters followed by a 'Z'. Symbols that do not have this format (such as plain C symbols) causes a lot of warnings to be printed. Bug: chromium:1062556 Change-Id: I55977f756c7e20cc5e7b1cb8e38316d7bf1f748c Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2179482 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Use stdint.h numeric types in testsJoshua Peraza2020-04-163-29/+32
| | | | | | Change-Id: Iaa79c5c7c70ca953256cd39cc9f6f4f139c696af Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2153567 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Use portable format macrosJoshua Peraza2020-04-162-35/+37
| | | | | | | Bug: 1071277 Change-Id: Ic65704a20c55fea83b5633650ee2c769ac227a56 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2153333 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Use stdint.h numeric typesJoshua Peraza2020-04-0927-629/+624
| | | | | | Change-Id: Ib815b0757539145c005d828080b92cbfa971a21b Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2141226 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Remove true/false defines in convert_UTF.ccMichael Forney2020-03-191-7/+0
| | | | | | | | | | | | These are left over from when this file was written in C. In C++, true and false are keywords, so this is no longer necessary. In fact, redefining a keyword is not actually permitted in ISO C++ (https://eel.is/c++draft/macro.names#2), and is rejected by MSVC. Change-Id: I2f4a6eae7f8dd4d91b8ee6588c7ae5e8f20bd0d0 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2105831 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Use ULONG_MAX instead of __WORDSIZE to determine native ELF architectureMichael Forney2020-03-172-19/+9
| | | | | | | | | | | | | | __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. This allows us to remove the fallback definition of __WORDSIZE in the Android compatibility headers. Bug: google-breakpad:631 Change-Id: I7b9e6f3b2121f78ccad9e32bf26acac518aefd8f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2107100 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Use breakpad_getcontext on all Linux platforms missing getcontextMichael Forney2020-03-165-25/+48
| | | | | | | | | | | | | | | | | | | | 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>
* Remove sys/signal.h compatibility headerMichael Forney2020-03-112-36/+0
| | | | | | | | Since a03ad96dbd, sys/signal.h is no longer required. Change-Id: I64e6235e1bffb3728d6050389bad6e7a99389741 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2097666 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-102-6/+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>
* Revert "Add new dwarf 5 enums, plus some dwarf4 enums."Mike Frysinger2020-03-101-221/+0
| | | | | | | | | | | | This reverts commit 0c0e24f709288a129d665ec27d6f089189318385. Reason for revert: This is causing breakage on CrOS due to unhandled enums and dwarf5 support is in limbo, so pull this back out for now. Bug: google-breakpad:812 Change-Id: I22dd5d87efb8bc83596d51d15a6808c41afb3fd2 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2095872 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Revert "Add dwarf5 compilation-unit header handling."Mike Frysinger2020-03-105-105/+18
| | | | | | | | | | | | This reverts commit dbd454dbe47e584571388fc3533193416bdce67f. Reason for revert: The parent CL is causing breakage on CrOS due to unhandled enums. Before we can revert that, we need to revert this. Bug: google-breakpad:812 Change-Id: I7c2446f3cd8ed9f6411e90dbdd2434bc463b2f6c Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2095798 Reviewed-by: Mark Mentovai <mark@chromium.org>
* dump_syms: Reintroduce warnings inadvertently removed by 47cd498384fdMark Mentovai2020-03-061-14/+24
| | | | | | | | | | | | | | | | | Previously, dump_syms produced warnings whenever a DW_AT_specification or DW_AT_abstract_origin attribute was a forward reference. 47cd498384fd allowed those attributes to carry forward references, removing the warnings altogether. It was not correct to remove the warnings entirely. References that do not point to valid DIEs should still produce warnings, whether a back reference or a forward reference. This reintroduces those warnings as appropriate. Bug: google-breakpad:813 Test: dumper_unittest SimpleCU.UnknownAbstractOrigin,Specifications.BadOffset Change-Id: Ie7222c7a1886bab31423f27e2fbcce93e69625b3 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2090103 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-207-91/+605
| | | | | | | | 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>
* Add dwarf5 compilation-unit header handling.Sterling Augustine2019-12-195-18/+105
| | | | | | | | Fix a small typo in DW_LANG__Python. Change-Id: I1fe54e501a5e8da5057ecc9ac00c7e7259a9bb3f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1967975 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add new dwarf 5 enums, plus some dwarf4 enums.Sterling Augustine2019-12-121-0/+221
| | | | | | Change-Id: Ibe0b529664dd48a423cb453b786d08c5b7abec19 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1965462 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Enable reading DWARF4 CIEs with 32 bit addresses.Nelson Billing2019-12-053-18/+53
| | | | | | | | | | | | | - Reading DWARF4 CIEs was added in https://chromium-review.googlesource.com/c/breakpad/breakpad/+/406012 but it was only enabled for 64bit builds, since it would error out if the CIE address size was not 8 bytes. - Added a unit test to ensure that 32bit continues to work. Change-Id: I824bb40cdf12056d39da335adb55ed315970fb88 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1941034 Reviewed-by: Ivan Penkov <ivanpe@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org>
* dump_syms: handle forward reference DWARF attributesMark Mentovai2019-12-022-13/+35
| | | | | | | | | | | | | | | | | | | | | | | DW_AT_specification and DW_AT_abstract_origin attributes carry references to other DIEs. Nothing prevents the DIEs referred to from appearing later in .debug_info than the DIE containing the referring attribute, but dump_syms incompletly implemented its handling of these references, and was only able to resolve them when they were back-references. This will fix the chronic warnings produced by dump_syms of the form: dump_syms: the DIE at offset <offset> has a {DW_AT_specification, DW_AT_abstract_origin} attribute referring to the die at offset <offset>, which either was not marked as {a declaration, an inline}, or comes later in the file Patch by Greg Clayton Bug: breakpad:441 Change-Id: I98957d64a234c22afb6d0153f1bdc09e6a600b1d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1946706 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Fix compilation of http_upload.cc with Windows gccJon Turney2019-11-221-34/+34
| | | | | | | | | | | | | Fix compilation of http_upload.cc with Windows gcc after 548ca6e3, by moving the definition of GetFileContents(), so it comes after the definition of WideToMBCP(), which it uses (under !_MSC_VER). common/windows/http_upload.cc: In function ‘bool {anonymous}::GetFileContents(const wstring&, std::vector<char>*)’: common/windows/http_upload.cc:80:19: error: ‘WideToMBCP’ was not declared in this scope Change-Id: I1646b39263e97bbf3bd8cb1ae209be238023110f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1928929 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Add fallthrough annotations on new C++ switchesChristopher Grant2019-11-052-25/+99
| | | | | | | | | | | | A recent commit converted some source from C to C++. Chrome has checks against unannotated switch case fallthroughs in C++ code, so the converted source needs annotations. Bug: 990190 Change-Id: Ib92435b4877be936f837928a70b552ec4975d42a Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1898429 Reviewed-by: Mark Mentovai <mark@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: Make style consistent in module unittestChristopher Grant2019-10-291-63/+63
| | | | | | | | | | | | | | | Make the following consistent within the file: - 0x...ULL for unsigned literals. - On pointers, put the asterisk with the type. Context: Made a previous change and saw a mix of styles. Make it consistent for the sake of visual consistency. Bug: None Change-Id: I0f80aedc0ca0295be3c70bd88822cbb82d0415ba Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1888434 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
* linux, dump_syms: Filter module entries outside specified rangesChristopher Grant2019-10-294-0/+120
| | | | | | | | | | | | | | | | | | | | 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>
* convert_UTF: rewrite in C++Mike Frysinger2019-09-043-17/+27
| | | | | | | | | This allows us to namespace the symbols properly. Bug: google-breakpad:725 Change-Id: Iea8052547eef6c0acb299c1995781735c6d8994f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1769236 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Mac dump_syms: accept __DWARF segment without __debug_info sectionMark Mentovai2019-08-072-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | A .dSYM may validly contain a __DWARF segment without any __debug_info section. This can occur for Chromium Framework in a component build of Chromium, because in that case, all of the code is in other libraries that Chromium Framework depends on. This was previously tested by an assertion, but the assertion did not trigger in NDEBUG (release) builds. In NDEBUG builds, this condition would lead to an out-of-bounds read, detected by AddressSanitizer. Instead of an assertion, the check is now always done at runtime. Instead of being fatal, it's now just a warning, because it's been established that __DWARF without __debug_info can occur. (In the Chromium case, it remains pointless to run dump_syms via the "chrome_dump_syms" target on a component build, as it'll only attempt to symbolize Chromium Framework, and not any of the libraries that Chromium Framework depends on that actually contain the code.) Bug: chromium:991206 Change-Id: I6c9c75f0be7901813e3eaae54aff38c1afe73ca9 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1741610 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* string_conversion: fix pointer mathMike Frysinger2019-08-053-2/+67
| | | | | | | | | | | | | | | | | | | | | | | Since target_ptr is of type uint16_t* already, we don't need to scale the byte count as the language does that for us. If it were void*, we would need this code, but it's not. In practice it's probably not a big deal due to how we preallocated memory: when converting UTF8->UTF16, we'd reserve the same number of code units, and UTF8 takes more code units per codepoint than UTF16, so the UTF16 vector is always oversized. When converting UTF32->UTF16, we also reserve the same number of code units, but since one UTF32 code unit could require two UTF16 code units (for U+10000 codepoints and higher), we would probably corrupt memory in the process. The APIs in this module don't seem to take into account that range in general, so for now I'm only fixing the memory corruption. Bug: google-breakpad:768 Change-Id: Ibfaea4e866733ff8d99b505e72c500bd40d11a74 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1732888 Reviewed-by: Mark Mentovai <mark@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>
* Fix dump_syms clang Windows build.Nelson Billing2019-06-252-22/+12
| | | | | | | | | - Put FileHeaderMachineToCpuString definition in header. - Remove extra semi-colon. Change-Id: I726ad0f73c57908576414fd828052dff09f5c51f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1673142 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add PE-only MD support to Windows symbol converter.Nelson Billing2019-06-241-4/+0
| | | | | | | | | | | | | | | | - Only 64-bit PEs supported. - Re-add some scripts that were missed in initial move of code. - Change msdia120.dll dependency to msdia140.dll. - Add tests for Intel, AMD, and NVidia Microsoft Symbol Stores. - Windows symbol converter now attempts to fall back to PE-only metadata when it fails to locate a PDB. - Remove the 'binary' folder under converter_exe. Need to think more about how a deployment should look and what tool(s) to use in creating one. Change-Id: I52e42cbe5e759874a25114c2483e8b50d73fdf77 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1670098 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Fix 'debug_file' in PESourceLineWriter.Nelson Billing2019-06-191-10/+24
| | | | | | | | | | | - Add a #define to testing.gyp to avoid warnings about TR1 deprecation. - PESourceLineWriter now reads debug_file from CodeView record instead of using code_file value. - Updated PE-only MD reading unit test. Change-Id: Ib4e6201df3e3fd651e160f310584b5a67b16c842 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1668347 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Fix common_windows.gyp.Nelson Billing2019-06-183-1/+1
| | | | | | | | | - Rename two files from '.cpp' to '.cc' and insert missing comma in between lines in source files list. Change-Id: I169a738b565f52292cb0292b34c4397e9dc05370 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1666351 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Enable PE-only metadata dumping for 64bit (aka. PE32+ format) PEs files.Nelson Billing2019-06-128-302/+730
| | | | | | | | | | | | | | | | | - Implement in common_windows_lib-- added class "PESourceLineWriter". - Add command-line switch to tell dump_syms to use PESourceLineWriter. Symbol data created this way will contain information to correlate the module with ones found in minidumps, along with frame info that allows much higher quality stack-walking in those minidumps. - Significant refactor of PDBSourceLineWriter-- all code concerned with extracting metadata from PE files has been moved into utility functions. This is to allow sharing of this functionality with newly- added PESourceLineWriter. - Added a unit test to dump_syms for the PE-only scenario. Change-Id: If0855f05d424d32d23f484995be5f34232179a37 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1525325 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Port new symbol upload API to Windows symupload tool.Nelson Billing2019-06-125-349/+682
| | | | | | | | | - CL for Linux change, including new documentation for API, at: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1422400/3 Change-Id: I579744fec74c64757b8bc31de63d7a07ef9a0f1f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1487982 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Increase timeout of HTTPMultipartUpload from 10s to 60s.John Z Wu2019-05-131-1/+1
| | | | | | | | | | | | | | | This, hopefully, will reduce occurrences of UnfinishedReportUploads. It will not eliminate it completely because uploads are never retried if they fail. 60s is actually the default value. Before iOS6, 240s was the default and minimum applied to requests with a body. Reference: https://developer.apple.com/documentation/foundation/nsmutableurlrequest/1414063-timeoutinterval?language=objc Bug:850379 Change-Id: I2f16fda7d7e8cbb8b8a6fc917111d9f646fbdad0 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1609876 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>
* mac dump_syms: remove unused vars to fix -Werror build failuresMike Frysinger2019-04-051-1/+0
| | | | | | | Bug: chromium:940823, chromium:946404 Change-Id: Ib8af7f0845b0488f36cd1b91326aba11bf283b0a Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1546779 Reviewed-by: Mark Mentovai <mark@chromium.org>
* mac dump_syms: Support .dSYMs > 4GB (partially)Mark Mentovai2019-03-282-10/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even 64-bit Mach-O (MH_MAGIC_64 = 0xfeedfacf) is not a fully 64-bit file format. File offsets in sections are stored in 32-bit fields, with Mach-O writers typically truncating offsets too large to fit to just their low 32 bits. When a section begins at a file offset >= 4GB, dump_syms would produce an error such as: Google Chrome Framework.dSYM/Contents/Resources/DWARF/Google Chrome Framework: the section '__apple_names' in segment '__DWARF' claims its contents lie outside the segment's contents As a workaround, this implements the strategy I first described in https://crbug.com/940823#c22. Segment file offsets are stored in 64-bit fields. Because segments contain sections and must load contiguously, it’s possible to infer a section’s actual offset by computing its load address relative to its containing segment’s load address, and treating this as an offset into the containing segment’s file offset. For safety, this is only done for 64-bit segments (LC_SEGMENT_64) where the 32-bit section offset stored in the Mach-O file is equal to the low (truncated) 32 bits of the section offset recomputed per the above strategy. Beware that this does not provide full “large file” support for 64-bit Mach-O files. There are other file offsets within Mach-O files aside from section file offsets that are stored in 32-bit fields even in the 64-bit format, including offsets to symbol table data (LC_SYMTAB and LC_DYSYMTAB). No attempt is made to recover correct file offsets for such data because, at present, such data is always stored by dsymutil near the beginning of .dSYM files, within the first 4GB. If it becomes necessary to address these other offsets, it should be possible to recover these offsets by reference to the __LINKEDIT segment that normally contains them, provided that __LINKEDIT doesn’t span more than 4GB, according to the strategy discussed at the bottom of https://crbug.com/940823#c22. Although this is sufficient to allow dump_syms to interpret Chromium .dSYM files that exceed 4GB, be warned that these Mach-O files are still technically malformed, and most other tools that consume Mach-O files will continue to have difficulties interpreting these large files. As further warning, note that should any individual DWARF section exceed 4GB, internal section offsets will be truncated irrecoverably, unless and until the toolchain implements support for DWARF64. https://bugs.llvm.org/show_bug.cgi?id=14969 With this change, dump_syms is able to correctly recover file offsets from and continue processing a .dSYM file with length 4530593528 (4321MB), whose largest section (__DWARF,__debug_info = .debug_info) has size 0x8d64c0b8 (2262MB), and which contains four sections (starting with __DWARF,__apple_names) beginning at file offsets >= 4GB. Bug: chromium:940823, chromium:946404 Change-Id: I23f5f3b07773fa2f010204d5bb53b6fb1d4926f7 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1541830 Reviewed-by: Robert Sesek <rsesek@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>