aboutsummaryrefslogtreecommitdiff
path: root/src/common
Commit message (Collapse)AuthorAgeFilesLines
* Add mac dump_syms support for arm64eJoshua Peraza2018-11-261-4/+37
| | | | | | Change-Id: I6a25b47d4fc5e42ff9fa30107b563dcf1d51c0d1 Reviewed-on: https://chromium-review.googlesource.com/c/1351352 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Skip empty DWARF code range when mapping linesLudovic Guegan2018-11-211-3/+6
| | | | | | | | BUG=777 Change-Id: Ic6d05eee3ff4660b6d087999a8cea04a1ee3e92b Reviewed-on: https://chromium-review.googlesource.com/c/1333507 Reviewed-by: Ted Mielczarek <ted.mielczarek@gmail.com>
* Fix debug build after 16e0852Joshua Peraza2018-08-182-7/+6
| | | | | | | | Also remove ranges_handler_ which is unused. Change-Id: I771bf4b5fc4410f0406bf26e1e405905b55389ab Reviewed-on: https://chromium-review.googlesource.com/1180587 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Make a parameter a const referenceJoshua Peraza2018-08-171-1/+1
| | | | | | Change-Id: I7d232dd9be3a03b5bd9f1d46c307d080fadf9116 Reviewed-on: https://chromium-review.googlesource.com/1179978 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Treat high_pc as an address for DW_FORM_GNU_addr_indexJoshua Peraza2018-08-171-1/+2
| | | | | | | | | | The high_pc is an address and has already been read from .debug_addr before being passed into FuncHandler::ProcessAttributeUnsigned. Bug:870908 Change-Id: I950098e360b5193f26bf767b8fa0a5f9d59e66ce Reviewed-on: https://chromium-review.googlesource.com/1178760 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Fixed a typo introduced in revision 16e08520e6027df4bf1934abbfd5e1a088ffb69cGabriele Svelto2018-08-141-1/+1
| | | | | | | | BUG=769 Change-Id: I1e118fe31b4a4031275b8b49c4c1eb98745ce21a Reviewed-on: https://chromium-review.googlesource.com/1174571 Reviewed-by: Ted Mielczarek <ted.mielczarek@gmail.com>
* Add support for parsing the DW_AT_ranges attributesGabriele Svelto2018-08-1317-111/+577
| | | | | | | | | | | | | | | | 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>
* Use hash_map and hash_set from __gnu_cxxJoshua Peraza2018-07-091-2/+2
| | | | | | Change-Id: Ia8521e5cfd8424c5dec247503532454eb8806c48 Reviewed-on: https://chromium-review.googlesource.com/1129203 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Fall back to the raw symbol name from DW_AT_MIPS_linkage_name when there is ↵Mike Hommey2018-06-191-0/+7
| | | | | | | | | | | | | | | | nothing else When DW_AT_MIPS_linkage_name doesn't demangle, breakpad currently throws the symbol completely, but in some cases, there is no DW_AT_name or DW_AT_abstract_origin to figure out a name, and the raw value from DW_AT_MIPS_linkage_name is still better than nothing. Fall back to that in when there is nothing else. R=ted@mielczarek.org Change-Id: I5cc7580244f2b99f5f1f279d09b904031cae1a37 Reviewed-on: https://chromium-review.googlesource.com/1082176 Reviewed-by: Ted Mielczarek <ted.mielczarek@gmail.com>
* Avoid endl when writing symbol filesAaron Dierking2018-05-301-9/+8
| | | | | | | | | | endl flushes output after each line. Using "\n" instead significantly improves I/O efficiency. Change-Id: If6a5549fc3613ca3a7c9a71838ec36c5b7a20580 Reviewed-on: https://chromium-review.googlesource.com/1077626 Reviewed-by: Ivan Penkov <ivanpe@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
* Add missing header for free functionTakuto Ikuta2018-03-271-0/+1
| | | | | | Change-Id: I8ff2dcb546849493f2883777895341e043e44fb3 Reviewed-on: https://chromium-review.googlesource.com/981965 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add asm and machine headersbsheedy2018-01-035-7/+525
| | | | | | | | | | | Adds asm/ and machine/ directories to src/common/android/include. This is necessary because some required files for MIPS were removed in newer Android NDK versions, which broke Breakpad compilation. Bug: 771171 Change-Id: Ie6a079b6b8130b549ebc6d0bc4aef0e47e7bd6c2 Reviewed-on: https://chromium-review.googlesource.com/835282 Reviewed-by: Mark Mentovai <mark@chromium.org>
* android: drop sgidefs.h hack for LSSMike Frysinger2017-12-232-42/+0
| | | | | | | | | | | Breakpad shouldn't be hacking up headers for LSS. This was eventually fixed in LSS directly in https://codereview.chromium.org/1248033002, so we can drop this hack on our side. Change-Id: Iff29efe7f6af40835e0aab1f6ac3fd8d167045ef Reviewed-on: https://chromium-review.googlesource.com/843124 Reviewed-by: Mark Seaborn <mseaborn@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org>
* Write field indicating multiple symbols at an address in dump_symsMike Wittman2017-12-112-13/+4
| | | | | | | | | | | Updates dump_syms to write the optional 'm' first field in FUNCTION and PUBLIC records to indicate that the address corresponds to more than one symbol. Bug: google-breakpad:751 Change-Id: I850b0122324ed5f9ec747aa92ba354a3126a7ef9 Reviewed-on: https://chromium-review.googlesource.com/820711 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add optional field indicating multiple symbols at an addressMike Wittman2017-11-292-59/+93
| | | | | | | | | | | | | | | | | | Adds an optional 'm' as the first field in FUNCTION and PUBLIC records to indicate that the address corresponds to more than one symbol. Controls this by a command line flag for now to give symbol file users a chance to update. Also reduces the number of IDiaSymbols retained in memory to one per address. This reduces memory consumption by 8% when processing chrome.dll.pdb. Updates the processor to parse the new optional field. Bug: google-breakpad:751 Change-Id: I6503edaf057312d21a1d63d9c84e5a4fa019dc46 Reviewed-on: https://chromium-review.googlesource.com/773418 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Make identical-code-folded symbol output more consistent between runsMike Wittman2017-11-141-37/+43
| | | | | | | | | | | | | | Consistently output the "least" symbol by decorated name when multiple symbols share an address. Testing with chrome.dll.pdb the diffs between the new and old output look sensible, and this is actually ~20% faster than the existing implementation. Bug: 749 Change-Id: Ie638559b63f0eb2dcb80b1ebb579228d62c63bb2 Reviewed-on: https://chromium-review.googlesource.com/758885 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Add index-based set functionality to NonAllocatingMap.Robert Sesek2017-11-072-31/+79
| | | | | | | | | | This enables repeatedly setting a value based on index, which avoids a linear scan of the entry table after the first SetKeyValue(). Bug: chromium:598854 Change-Id: I9964670a09dcd8ff76180d031a373f20990bf4d8 Reviewed-on: https://chromium-review.googlesource.com/757579 Reviewed-by: Mark Mentovai <mark@chromium.org>
* 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>
* Create LongStringDictionary and replace SimpleStringDictionary on iOSYi Wang2017-11-035-2/+573
| | | | | | | | | | | This relands fd0a0d2b7ae9dd3d8a02b6a12e7941f7189fbb6c which was reverted in 5dad29423e62292c6ff468cabfee4422ba55b18b, with a fix for guarding kMaxSuffixLength which only used in assert()s with macros which breaks chromium.mac/ios-device. Change-Id: I5ee21b7f290517d6e7a0ef90b693b97f92392549 Reviewed-on: https://chromium-review.googlesource.com/751922 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Revert "Create LongStringDictionary and replace SimpleStringDictionary ↵Mark Mentovai2017-11-025-570/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | usages in client/ios/Breakpad.mm." This reverts commit fd0a0d2b7ae9dd3d8a02b6a12e7941f7189fbb6c. Reason for revert: Build failures reported at https://chromium-review.googlesource.com/c/chromium/src/+/750591#message-cc4f7dd486fa1da7373ad5d83d56f550d607d429 Failed build on chromium.mac/ios-device: https://build.chromium.org/p/chromium.mac/builders/ios-device/builds/73163, https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.mac%2Fios-device%2F73163%2F%2B%2Frecipes%2Fsteps%2Fcompile%2F0%2Fstdout [637/3593] CXX obj/third_party/breakpad/client/long_string_dictionary.o FAILED: obj/third_party/breakpad/client/long_string_dictionary.o […] ../../third_party/breakpad/breakpad/src/common/long_string_dictionary.cc:46:16: error: unused variable 'kMaxSuffixLength' [-Werror,-Wunused-const-variable] const size_t kMaxSuffixLength = 4; ^ 1 error generated. […] [641/3593] CXX ios_clang_arm64/obj/third_party/breakpad/client/long_string_dictionary.o FAILED: ios_clang_arm64/obj/third_party/breakpad/client/long_string_dictionary.o ../../third_party/breakpad/breakpad/src/common/long_string_dictionary.cc:46:16: error: unused variable 'kMaxSuffixLength' [-Werror,-Wunused-const-variable] const size_t kMaxSuffixLength = 4; ^ 1 error generated. Change-Id: I285eaac6abfcb7d173a0d1e4998b92d5c8dd6ecb Reviewed-on: https://chromium-review.googlesource.com/751723 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Rename an argument named "register" to "reg".Peter Collingbourne2017-11-021-5/+5
| | | | | | | | | | This silences a warning in newer versions of clang that complains about "register" being a deprecated keyword. Bug: chromium:780692 Change-Id: If354b9b18421e3e910849b385c44207e0ce02590 Reviewed-on: https://chromium-review.googlesource.com/750362 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Create LongStringDictionary and replace SimpleStringDictionary usages in ↵Yi Wang2017-10-275-2/+570
| | | | | | | | | client/ios/Breakpad.mm. Bug: Change-Id: I401028f5d90417d79fb109b510aaa9660a039b44 Reviewed-on: https://chromium-review.googlesource.com/688301 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Avoid skipping an initializer with a gotoBruce Dawson2017-10-261-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | C++ doesn't allow skipping initialization with a goto. This means that this code is illegal: void func(bool b) { if(b) goto END; int value = 0; //error C2362 with /permissive- //... value used here END: return; } Adding an extra scope makes the code legal. This problem is only detected with /permissive- but now that compiling with this switch is practical we might as well stay /permissive- clean: https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/ Note that compiling /permissive- clean only works with the 10.0.16299.0 SDK which currently has other issues... Bug: 773476 Change-Id: I54e64aaef46d70a817cf7da272f76d9ae5f6a6f7 Reviewed-on: https://chromium-review.googlesource.com/740287 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Provide helper wrappers for basename(3) and dirname(3)Tobias Sargeant2017-10-184-14/+102
| | | | | | | | | | 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-176-9/+9
| | | | | | | | | | | | 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>
* Android: Use sys/types.h instead of stdint.h for sys/user.hJoshua Peraza2017-10-061-1/+1
| | | | | | | | | | When using traditional headers, sys/types.h is needed to define __u64 for sys/user.h. Previously, we thought this would be provided by stdint.h, but it is not. Change-Id: I0e648712f4ef1e303104a5264d3d2d0b218f5d45 Reviewed-on: https://chromium-review.googlesource.com/705267 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Restore missing #include <stdint.h> to Android <sys/user.h>Mark Mentovai2017-09-201-0/+4
| | | | | | | | | | This was lost in afa9c52715db, but it turns out that it’s still necessary. Bug: google-breakpad:733 Change-Id: I4e0e4e4d2e80c22df1ff6b82e471905773c940a3 Reviewed-on: https://chromium-review.googlesource.com/675732 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
* Fix googletest/googlemock buildMark Mentovai2017-09-191-3/+3
| | | | | | | | | | | | | | 1. testing.gyp is a gyp file, not a gypi file. It is only referenced in “dependencies” sections. The gypi extension is used for files that are included by an “includes” section. 2. Update paths in testing.gyp to reflect the real locations of googletest and googlemock following their merge into a single repository. Change-Id: If9c356d93aa5ffda54af46fbed648baa2274dac6 Reviewed-on: https://chromium-review.googlesource.com/673404 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* android: Don’t compete with NDK API >= 21 over NDK structuresMark Mentovai2017-09-182-39/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Chrome uses API 16 for 32-bit builds and API 21 for 64-bit builds. The NDK’s <link.h> provides r_debug and link_map structure definitions only at API 21 and above. Breakpad used a custom <link.h> to define these structures only during 64-bit builds, which worked for Chrome’s purposes. However, other consumers may wish to build Breakpad at arbitrary API levels without regard to bitness. This alters Breakpad’s custom <link.h> to correctly check the NDK API level rather than target CPU bitness. Likewise for <sys/user.h> on 32-bit x86, which provided a typedef for user_fpxregs_struct to user_fxsr_struct. API 21 and above, as well as the unified headers at any API level, always name the structure user_fpxregs_struct. Definitions for 64-bit ARM’s user_regs_struct and user_fpsimd_struct have been removed from Breakpad’s copy of <sys/user.h>. The header claims that these fallback definitions are only necessary with NDK r10, which should no longer be in use even by Chromium, which now uses NDK r12b. This removes the Chromium-specific ANDROID_NDK_MAJOR_VERSION macro from use entirely. Fixes https://stackoverflow.com/questions/44141159/ and b/65630828. Bug: google-breakpad:733 Change-Id: I5841906297cd15b15ce48b73fd8332fd40afc9a0 Reviewed-on: https://chromium-review.googlesource.com/665740 Reviewed-by: Primiano Tucci <primiano@chromium.org> Reviewed-by: Joshua Peraza <jperaza@chromium.org>
* Parse DWARF 4 line tables correctlyMark Mentovai2017-09-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Breakpad’s DWARF line table reader only understood line tables at the level of DWARF 2. This wasn’t a problem because LLVM only produced line tables at this level, even when generating DWARF 4. But LLVM would like to output DWARF 4 line tables when generating DWARF 4, and Breakpad needs to understand this format. (Meanwhile, it seems that GCC has used DWARF 4 line tables with DWARF 4 output since 4.5.0, 2010-04-14.) DWARF 3 line tables are fully compatible with DWARF 2 (assuming that nothing needs “prologue end,” “epilogue begin,” or “isa”, and opcodes related to these fields are properly skipped). DWARF 4 changes the line number program header slightly to include a “maximum operations per instruction” field. This field must be recognized, but can safely be ignored (and assumed to be always 1) if VLIW architectures are not supported (they aren’t). DWARF 4 also introduces a “discriminator”, whose opcode can also be skipped if these values are not needed (they shouldn’t be). This recognizes the “maximum operations per instruction” field when processing DWARF 4 line tables, but asserts that its value is 1 and otherwise ignores it. This is not compatible with VLIW architectures that set this field to a value other than 1. Such architectures are irrelevant to Breakpad, and mainline GCC and the proposed LLVM patch always set this field to 1. There are other things that could be extracted from DWARF 3 and 4 line tables that aren’t currently extracted (although these are currently irrelevant to Breakpad too). Bug: google-breakpad:745 Change-Id: I5bf9c0b1aa654849c9cce64e60682447d10be8ba Reviewed-on: https://chromium-review.googlesource.com/663441 Reviewed-by: Mike Frysinger <vapier@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>
* Make the cross-compilation glue for dump_syms Mac handle x86_64h.Markus Stange2017-05-261-4/+24
| | | | | | | | | | x86_64h has a different cpusubtype from x86_64. The h is for Haswell. BUG= Change-Id: Icf884e5699fe120c12d13aa57cd62db5b69a2ce6 Reviewed-on: https://chromium-review.googlesource.com/457171 Reviewed-by: Ted Mielczarek <ted@mielczarek.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>
* Use string instead of std::stringJoshua Peraza2017-03-221-1/+1
| | | | | | | | BUG= Change-Id: I06d1a836f8ff59a6abb7e420cd35fe52610ce091 Reviewed-on: https://chromium-review.googlesource.com/457872 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Use NSURLSession if the min version we support is iOS 7+.George Kola2017-03-091-7/+5
| | | | | | | | | | | | | | | Because many apps still support iOS 8, they were defaulting to deprecated NSURLConnection even if the code ran on iOS 10. NSURLConnection requires a run loop and hence the code did not always upload if the queue ran on a thread without a Run Loop. This should improve break pad uploads BUG= Change-Id: I7bff80ea977fd1ab13c8812ed933ef842dab417f Reviewed-on: https://chromium-review.googlesource.com/451880 Reviewed-by: Sylvain Defresne <sdefresne@chromium.org> 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>
* Fix dump_syms clang compilation on WindowsMaciej Pawlowski2017-03-021-8/+8
| | | | | | | | | | | | Clang complains about bad format strings (DWORD is an unsigned long, not unsigned int) and signed/unsigned comparison. This change is necessary for https://codereview.chromium.org/2712423002/ BUG=245456 Change-Id: I58da92d43d90ac535c165fca346ee6866dfce22e Reviewed-on: https://chromium-review.googlesource.com/448037 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Handle ntdll only emitting PUBLIC at func entryScott Graham2017-02-233-1/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This handles a case encountered in ntdll.dll symbols for Windows 7, where a PUBLIC would be emitted only for the entry point to the function. The body of the function, however, is split in a PGO-ish fashion to another remote location in the binary. Because of this, there were large gaps in the RVA space that would be attributed to the "last" function that happened to have an entry point before the gap. In practice, something like this: 0x100 Func1 0x110 Func2 0x120 Func3 0x130 Func4 ... 0x800 LaterFuncs The bodies of Func1/2/3 tend to be implemented as a fast-path check, followed by a jmp to somewhere in the range between 0x130 and 0x800. Because no symbols are emitted for this range, everything is attributed to Func4, causing crash misattribution. In this CL, the change is: after emitting the entry point symbol, also walk in the original OMAP entries through the untranslated binary, and for each block until we resolve to a new symbol (via the same mechanism as we found the entry point) emit another PUBLIC indicating that there's another block that belongs to that symbol. This effectively breaks up the "0x130 - 0x800" range above. R=mark@chromium.org BUG=chromium:678874 Change-Id: Ib3741abab2e7158c81e3e34bca4340ce4d3153a1 Reviewed-on: https://chromium-review.googlesource.com/446717 Reviewed-by: Mark Mentovai <mark@chromium.org>
* macho_reader_unittest: use EXPECT_FALSEMike Frysinger2017-02-121-2/+2
| | | | | | | | | | | | | | | | | | | This avoids compile time errors: In file included from ./src/testing/googletest/include/gtest/gtest.h:1874:0, from ./src/breakpad_googletest_includes.h:33, from src/common/mac/macho_reader_unittest.cc:39: src/common/mac/macho_reader_unittest.cc: In member function 'virtual void LoadCommand_SegmentBE32_Test::TestBody()': ./src/testing/googletest/include/gtest/internal/gtest-internal.h:133:55: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null] (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1) ^ ... src/common/mac/macho_reader_unittest.cc:1117:3: note: in expansion of macro 'EXPECT_EQ' EXPECT_EQ(false, actual_segment.bits_64); Change-Id: I0cf88160dbe17b0feebed3c91ad65491b81023fd Reviewed-on: https://chromium-review.googlesource.com/439004 Reviewed-by: Mark Mentovai <mark@chromium.org>
* windows: update gtest/gmock pathsMike Frysinger2017-02-111-2/+1
| | | | | | | | | The Windows build has rotted a bit with the gtest/gmock updates. Update all of the paths to fix things up again. Change-Id: Id67ce76abfd331c0543aa4bd1138e9cc13a18c75 Reviewed-on: https://chromium-review.googlesource.com/441584 Reviewed-by: Mark Mentovai <mark@chromium.org>
* md5: fix strict aliasing warningsMike Frysinger2017-02-071-2/+2
| | | | | | Change-Id: I64f4570610c625b1325249fd5fa1b9edc3a89ae4 Reviewed-on: https://chromium-review.googlesource.com/438864 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Update linksOrgad Shaneh2016-11-182-2/+2
| | | | | | | | | | 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-087-11/+12
| | | | | | | | | | | | 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>
* Basic handling of CIE version 4 in dwarf readingScott Graham2016-11-025-8/+147
| | | | | | | | | | | | | | | | | CIE looks like it's been emitted by clang since ~May 2015 [1]. This means that we didn't have any CFI because this parse aborted, which meant that all stack walks reverted to stack scanning. Allow expected values for address size and segment descriptor size through so that dump_syms can generate at least somewhat reasonable data. [1]: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150518/277292.html R=mark@chromium.org BUG=chromium:627529 Change-Id: I6dc92f51c4afd25c2adff92c09ccb8bb03bf9112 Reviewed-on: https://chromium-review.googlesource.com/406012 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Fix pointer arithmetic in UTF8ToUTF16CharHans Wennborg2016-10-271-3/+3
| | | | | | | | | | Found by PVS-Studio! BUG=chromium:660198 Change-Id: I2605de2b1499f85c6e01d19e87e9eeb6af8486f3 Reviewed-on: https://chromium-review.googlesource.com/404552 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Don't demangle Rust symbols by default, but allow linking to rust-demangle.Ted Mielczarek2016-10-255-0/+93
| | | | | | | | | | | | | | | | | The Rust compiler uses GCC C++ name mangling, but it has another layer of encoding so abi::cxa_demangle doesn't produce great results. This patch changes dump_syms to dump unmangled names by default so that consumers can demangle them after-the-fact. It also adds a tiny bit of support for linking against a Rust library I wrote that can demangle Rust symbols nicely: https://github.com/luser/rust-demangle-capi BUG= Change-Id: I63a425035ebb7ac516f067fed2aa782849ea9604 Reviewed-on: https://chromium-review.googlesource.com/402308 Reviewed-by: Mark Mentovai <mark@chromium.org>