aboutsummaryrefslogtreecommitdiff
path: root/src/common/dwarf_cu_to_module.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Refactor rangelist handling to prepare for dwarf5 .debug_rngslist"HEADmasterSterling Augustine2020-10-021-20/+5
| | | | | | | | | | | | 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-5/+20
| | | | | | | | | | | | | | | | | | | | | | 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>
* fix pointer style to match the style guideMike Frysinger2020-07-151-18/+18
| | | | | | | | | | 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-1/+5
| | | | | | 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-24/+24
| | | | | | Change-Id: Ib815b0757539145c005d828080b92cbfa971a21b Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2141226 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Fix debug build after 16e0852Joshua Peraza2018-08-181-3/+0
| | | | | | | | 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>
* Add support for parsing the DW_AT_ranges attributesGabriele Svelto2018-08-131-0/+28
| | | | | | | | | | | | | | | | 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>
* Initial support for dumping DWARF corresponding to Swift codeMark Mentovai2016-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The DWARF data for Swift code has a top-level DW_TAG_module DIE as the child of the DW_TAG_compile_unit DIE and the parent of the DW_TAG_subprogram DIEs that dump_syms uses to locate functions. dump_syms needs to process DW_TAG_module DIEs as introducing nested scopes to make it work with Swift. This also reworks demangling to be language-specific, so that the C++ demangler isn't invoked when processing Swift code. The DWARF data for Swift code presents its mangled names in the same form as used for C++ (DW_AT_MIPS_linkage_name or DW_AT_linkage_name) but the mangling is Swift-specific (beginning with _T instead of _Z). There is no programmatic interface to a Swift name demangler as an analogue to C++'s __cxa_demangle(), so mangled Swift names are exposed as-is. Xcode's "xcrun swift-demangle" can be used to post-process these mangled Swift names on macOS. Support for mangled names presented in a DW_AT_linkage_name attribute, as used by DWARF 4, is added. This supersedes the earlier use of DW_AT_MIPS_linkage_name. BUG=google-breakpad:702,google-breakpad:715 R=ted.mielczarek@gmail.com Review URL: https://codereview.chromium.org/2147523005 .
* convert to uint8_t* for binary data to fix -Wnarrowing build errorsMike Frysinger2016-01-261-2/+4
| | | | | | | | | | | | | | | 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 .
* Fix some fragile code that is likely to cause future memory corruptionerikchen@chromium.org2015-01-271-0/+3
| | | | | | | | | | | | | | | | | | problems. - The ordering of keys in stl containers cannot change. Make the relevant members const to guarantee this assumption. - Add handling and logging for demangle errors. - Fix a potential double-delete bug if a function passed to AddFunction() is already present. BUG=chromium:449214 R=mark@chromium.org Review URL: https://breakpad.appspot.com/10704002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1415 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Cleanup: Use scoped_ptr where appropriate in DwarfCUToModule.thestig@chromium.org2013-04-241-3/+4
| | | | | | Review URL: https://breakpad.appspot.com/572002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1164 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add an option to not handle DWARF inter-compilation unit references in Linux ↵thestig@chromium.org2013-04-241-15/+49
| | | | | | | | | | dump_syms. This saves a lot of memory for dump_syms. Review URL: https://breakpad.appspot.com/565002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1163 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Include the compilation directory for FILE entries, making them absolute ↵ted.mielczarek@gmail.com2013-01-231-9/+15
| | | | | | | | instead of relative A=Ryan Sleevi <rsleevi@chromium.org> R=mark,ted at https://breakpad.appspot.com/385001/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1106 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Remove dead code.mark@chromium.org2012-12-121-5/+2
| | | | | | | | | Patch by Rafael Espindola <rafael.espindola@gmail.com> Review URL: http://breakpad.appspot.com/502003/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1091 4c0a9323-5329-0410-9bdc-e9ce6186880e
* This change allows compiling the google-breakpad code using a global ↵ivan.penkov@gmail.com2012-06-281-0/+1
| | | | | | ::string class instead of std::string. For more details take a look at common/using_std_string.h git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@974 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix some comments and parameter names.jimblandy2011-11-231-3/+4
| | | | | | | | Trivial changes; committing for post-facto review. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@890 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Google Breakpad Issue 417: Handle DWARF that omits function names.jimblandy2011-03-111-0/+5
| | | | | | | | | | | | | | | This patch makes sure dump_syms behaves properly when presented with malformed DWARF data that provides no name for a function. We print a warning message to stderr, and subsitute "<name omitted>" for the empty string, so that the "FUNC" record written to the symbol file for the function is still well-formed. (We may have line number data covering the function, so it would be a shame to omit the function altogether.) Unit tests included. a=jimblandy, r=ted.mielczarek git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@779 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad DWARF support: Stop #including unneeded headers.ted.mielczarek2010-06-251-2/+0
| | | | | | | | | The #inclusions of <elf.h> and <link.h> were inherited from older code, but the current code doesn't need anything from them, so they should be removed. A=jimb R=thestig git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@613 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad symbol dumper: Move Linux dumping classes into src/common.jimblandy2010-04-051-0/+272
The Linux symbol dumper's classes are reasonably portable, and should be usable for the Mac dumper as well. Move them to src/common, along with their unit tests. Update #include directives and Makefile. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@567 4c0a9323-5329-0410-9bdc-e9ce6186880e