aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* convert_UTF: try to update xcode filesMike Frysinger2020-03-141-4/+4
| | | | | | | Bug: google-breakpad:725 Change-Id: I8c5f9a828e1bb6a2a5603fbfaa127f6dfe64a4b4 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1803770 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Fix some bugs in CheckMicrodumpContentsMichael Forney2020-03-131-2/+2
| | | | | | | | | | | | | | The crash address from the microdump was never checked against anything. Instead, the test was checking the value of a constant. On 32-bit systems, an intptr_t cannot represent kCrashAddress (0xDEADDEAD), causing a failure when the crash address is parsed from the microdump. Instead, use uintptr_t, which matches the type of kCrashAddress. Change-Id: Ib5612743803609f7801dcfb98deaa8779e362025 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2100816 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 public fpregset_t type to define fpstate_tMichael Forney2020-03-103-4/+6
| | | | | | | | | | | | | | | The _libc_fpstate struct tag is an implementation detail of glibc, and musl uses a different struct tag, _fpstate. Unfortunately, the public type fpregset_t is a pointer type, so is not suitable for allocating storage, or referring to constant storage. Instead, we can use std::remove_pointer<fpregset_t>::type to refer to the pointed-to type, regardless of the struct tag. Bug: google-breakpad:631 Change-Id: Iaf47f15b2d834dd8de839431f65a481e9b0c7f9e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2096171 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 standard header locations for poll.h and signal.hMichael Forney2020-03-104-4/+3
| | | | | | | | | | | | | | | | sys/poll.h and sys/signal.h just redirect to the standardized location for these headers, poll.h and signal.h. On musl libc, including the incorrect header path results in a warning, and since breakpad is built with -Werror, this is an error. In exception_handler.cc, signal.h is already included earlier, so we can drop the sys/signal.h include. Bug: google-breakpad:631 Change-Id: If36d326453e3267d38a5b92ed1301f828e46befe Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2097344 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-275-28/+119
| | | | | | | | | | | | | | | | - "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-213-7/+12
| | | | | | Change-Id: I58612eb70173d79c2aeb755d8c7f5677cb3a8fb8 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2067608 Reviewed-by: Nelson Billing <nbilling@google.com>
* android: truncate lower of two overlapping modulesJoshua Peraza2020-02-211-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | Previously, the processor truncated the upper of two overlapping module ranges to compensate for incorrect reporting of module ranges by the Breakpad client. Crashpad correctly reports module load ranges, so this truncation strategy is no longer necessary. However, when partitioned libraries are used, the base library may have a range which encompasses the other partitions. When this is combined with the truncate upper merge strategy, the base library's executable segment is truncated causing symbolization failures. This patch changes Android's merge strategy to truncate the lower range (which is still the base library, but this strategy truncates from the high end of the library's range, instead of its base). Bug: b/149845120 Change-Id: Ic75ecd3e919432690740eb21ebd4265fc0bbaa86 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2067952 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add optional new symbol upload API to sym_upload.Nelson Billing2020-02-208-94/+643
| | | | | | | | 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>
* Update Xcode project files to fix build errors.Ivan Penkov2020-01-292-23/+28
| | | | | | | | | | | * Renamed convert_UTF.c to convert_UTF.cc * Enabled to use C++17 for [[clang::fallthrough]] defined in src/common/macros.h Patch by Hiro Komatsu Change-Id: I5de7f7dd4c8bf231a004144a5c82828c59ddcfd6 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2026761 Reviewed-by: Mark Mentovai <mark@chromium.org>
* arm64: recover register X30(LR) when fallback to frame pointer unwinderSim Sun2020-01-212-0/+46
| | | | | | | | | | | | | Stackwalk can't recover caller's register X30($LR) value by STACK CFI info. This will lead unwinding stop immediately when fallback to frame pointer unwinder. This PR will use try to use second last frame to recover register X30($LR) by frame pointer. And we will give up correction if STACK CFI info doesn't agree with frame pointer info. Bug: https://bugs.chromium.org/p/google-breakpad/issues/detail?id=808 Change-Id: I50649e3398e268b02ff297e83db21d05705c2a2d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1992641 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
* Extract the exception record from the minidumpJoshua Peraza2020-01-033-0/+148
| | | | | | Change-Id: Ia622560960513e24b21184532f2272a09b9cdc95 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1986339 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* ios: build for arm64eJoshua Peraza2020-01-032-3/+20
| | | | | | | | | | | | | | When __DARWIN_OPAQUE_ARM_THREAD_STATE64 is set (by default when building for arm64e), fp, lr, sp, pc, and flags (but not x or cpsr) in thread state are prepended with "__opaque" and intended to be accessed via supplied getters which may also authenticate pointers. We don't want to authenticate those pointers (since we expect they may be invalid and want to recover those invalid values) so access them directly. Bug: b/140375065 Change-Id: Ibe6c1dbfb5d68a9d350614445fa06d48873f8549 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1986868 Reviewed-by: Mark Mentovai <mark@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>
* mac processor: Add mapping for EXC_BAD_ACCESS/KERN_CODESIGN_ERRORMark Mentovai2019-11-222-0/+5
| | | | | | | | | | This code indicates termination under “kill” semantics due to a module’s code signature becoming invalid. Bug: chromium:1023239 Change-Id: I3d453af9ef6c6925edcf9c08dbd78e563877522f Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1930177 Reviewed-by: Robert Sesek <rsesek@chromium.org>
* Remove dependency of uploader.mm on GTMLoggerSylvain Defresne2019-11-121-12/+12
| | | | | | | | | | | | | | | The file GTMLogger shipped with breakpad is a copy of the version from google_toolbox_for_mac. Having uploader.mm depend on GTMLogger causes pain to iOS projects that want to integrate both breakpad and google_toolbox_for_mac. Since the file uploader.mm mixed uses of fprintf and GTMLogger to log errors and warning, convert it to only use fprintf to stderr. Bug: none Change-Id: I68313ccf6951676a2859f44225281813722096ba Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1911755 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add fallthrough annotations on new C++ switchesChristopher Grant2019-11-053-41/+100
| | | | | | | | | | | | 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>
* Revert "Remove use of "register" keyword, deprecated in C++17"Mark Mentovai2019-11-011-1/+1
| | | | | | | | | | | | | | This reverts commit 07411862eaa9a9a38e84caed2e97e836e456656f. We were a bit overzealous in removing “register” here. Both clang and GCC correctly disallow “register” as a storage class specifier in C++17 mode by producing an error in ordinary use. However, they require “register” to be specified for explicit register variables, and do not produce an error in this case. Change-Id: I223f2652c6da4215d6e8788d902e767c94b8c29d Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1894875 Reviewed-by: Mark Mentovai <mark@chromium.org>
* linux, client: set module name from DT_SONAMEJoshua Peraza2019-10-302-24/+32
| | | | | | | | | | | | | | | | | | 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-244-26/+73
| | | | | | | | | 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-244-44/+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-045-22/+31
| | | | | | | | | 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>
* Remove use of "register" keyword, deprecated in C++17Mark Mentovai2019-08-121-1/+1
| | | | | | | | | | "register" as a storage class specifier has been deprecated since C++11, and has been removed from C++17 while remaining a reserved word. See C++17 5.11 and C.4.3. Change-Id: I2dbab8a7061cb680d902644d39ea1a7fbc930e5c Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1749329 Reviewed-by: Mike Frysinger <vapier@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>
* minidump_processor: fix typo in BUS_ADRALNMike Frysinger2019-08-041-1/+1
| | | | | | | Bug: google-breakpad:787 Change-Id: I9f7144b3456abb750142eae9f989133bf4f27885 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1734586 Reviewed-by: Mark Mentovai <mark@chromium.org>
* arm64: strip PACs from link register valuesJoshua Peraza2019-07-232-1/+33
| | | | | | | | | | | | | | | | | | | | | | Pointer authentication codes are used to validate pointers against accidental or malicious modification by storing a hash of the address and a secret value in the pointer's unused, upper bits. The exact bits used may vary by implementation and depend on the size of the virtual address space of the target system, and whether other tagged pointer features are in use. Apple has implemented PACs in the Apple A12. https://developer.apple.com/documentation/security/preparing_your_app_to_work_with_pointer_authentication The documented method of stripping PACs from a pointer is to call ptrauth_strip(), which ultimately emits an `xpaci` instruction, but this option isn't available to the Breakpad processor not running on the device. Instead, this patch selects likely address bits from link register values by examining the address range of loaded modules. Change-Id: I054bd1a03605719937fc85dcc8d8b9fe927f44be Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1713650 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Improving the support for Fuchsia in Breakpad Processor.Ivan Penkov2019-07-125-7/+124
| | | | | | | | Now decoding the OS name and exception codes for Fuchsia. Still not decoding exception flags (can be added later, if needed). Change-Id: If66cb000828be18f0c1b35d1b1f52b3ca3e1fd67 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1699049 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Remove base_logging::LogMessageMark Mentovai2019-07-121-13/+1
| | | | | | | | | | | This is deprecated in the downstream consumer that it was introduced to support. This undoes b41ad66e93562. Change-Id: I3e0fa068b134014700128d1d75cae6a20d591d12 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1687125 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Fix Windows symupload after PE-only MD refactor.Nelson Billing2019-07-011-1/+1
| | | | | | | | | - I think I previously fixed this for dump_syms, but must have missed the symupload one because it didn't have a gn target. Change-Id: Ibf4daa0dc874f329c2ee7c7b3d4de1ee6bc68d13 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1682717 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Explicitly LoadLibrary dbghelp.dll in symbol converter.Nelson Billing2019-06-281-0/+54
| | | | | | | | | | | | | | | | | | - This is a workaround to an issue with gn/clang build of Windows symbol converter where dbghelp.dll is loaded from system32/syswow64 instead of alongside the process exe. - Why do we care where dbghelp.dll is loaded from? Two considerations: 1. dbghelp.dll will only load symsrv.dll from the directory where it resides. 2. symsrv.dll requires a file called "symsrv.yes" to be in the directory where it resides in order to work with MS symbol stores. Therefore if we load dbghelp.dll from syswow64, then we must also ensure there is a symsrv.dll and symsrv.yes file in syswow64. Change-Id: Ia283a2c11e276c855a48157aa7be77897af4b02e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1680670 Reviewed-by: Mark Mentovai <mark@chromium.org> Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Fix clang build warnings/errors for windows symbol converter.Nelson Billing2019-06-274-26/+25
| | | | | | Change-Id: Ib7f6e37af1466b5bed3e7d2921e0d9774394ad1e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1680056 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Fix windows symbol converter blacklisting.Nelson Billing2019-06-251-2/+3
| | | | | | | | - Was attempting "full match" when we meant to do "partial match". Change-Id: Ia748a7fc8707e11f44c205e57f218f5f4bbc5612 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1676936 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Fix dump_syms clang Windows build.Nelson Billing2019-06-253-23/+13
| | | | | | | | | - 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>
* Fix breakpad client build.Nelson Billing2019-06-241-1/+1
| | | | | | | | - Was broken by a rename in http upload util code. Change-Id: I72c275fe45638c83e535901e79817893b00ee62e Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1673138 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Add PE-only MD support to Windows symbol converter.Nelson Billing2019-06-2412-56/+314
| | | | | | | | | | | | | | | | - 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-193-15/+29
| | | | | | | | | | | - 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>