aboutsummaryrefslogtreecommitdiff
path: root/src/common/module.h
Commit message (Collapse)AuthorAgeFilesLines
* dump_syms: handle forward reference DWARF attributesMark Mentovai2019-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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>
* linux, dump_syms: Filter module entries outside specified rangesChristopher Grant2019-10-291-0/+16
| | | | | | | | | | | | | | | | | | | | 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 support for parsing the DW_AT_ranges attributesGabriele Svelto2018-08-131-3/+12
| | | | | | | | | | | | | | | | This enables the DWARF reader to properly parse DW_AT_ranges attributes in compilation units and functions. Code covered by a function is now represented by a vector of ranges instead of a single contiguous range and DW_AT_ranges entries are used to populate it. All the code and tests that assumed functions to be contiguous entities has been updated to reflect the change. DW_AT_ranges attributes found in compilation units are parsed but no data is generated for them as it is not currently needed. BUG=754 Change-Id: I310391b525aaba0dd329f1e3187486f2e0c6d442 Reviewed-on: https://chromium-review.googlesource.com/1124721 Reviewed-by: Ted Mielczarek <ted.mielczarek@gmail.com>
* Dump INFO CODE_ID containing Build ID in Linux dump_symsTed Mielczarek2016-06-101-2/+3
| | | | | | | | | | | | | I'd like to have the Build ID available for our symbol server uploading, and this will make it easy. Most of this change is me rewriting dump_symbols_unittest to be typed tests so I could add a new test there. R=mark@chromium.org BUG= Review URL: https://codereview.chromium.org/2052263002 .
* Fix some fragile code that is likely to cause future memory corruptionerikchen@chromium.org2015-01-271-4/+11
| | | | | | | | | | | | | | | | | | 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
* In Mac dump_syms, allow reading debug data out of both the Mach-O file and ↵rsesek@chromium.org2014-07-251-1/+6
| | | | | | | | | | | | | | | | | | | | | | | the dSYM. This adds a new |-g <dSYM path>| flag to dump_syms, to specify the dSYM path for the target Mach-O argument. The UUIDs and architectures of the two paths must match in order to dump symbols for this "split module." This reason for this is that for x86_64 binaries on OS X, the CFI data is stored in the __TEXT,__eh_frame segment of the Mach-O file, and the data is not copied into the dSYM by dsymutil. Therefore, just dumping the dSYM doesn't yield CFI data for x86_64 files, and both the dSYM and the Mach-O file must be dumped in order to produce a complete Breakpad symbol file. For i386 binaries, the CFI data is stored in the __DWARF,__debug_frame segment, which is part of the dSYM, so this isn't necessary. BUG=https://code.google.com/p/chromium/issues/detail?id=393594 R=mark@chromium.org Review URL: https://breakpad.appspot.com/6704002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1359 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Allow reading just CFI data when reading symbolsted.mielczarek@gmail.com2013-03-061-2/+5
| | | | | | R=thestig at https://breakpad.appspot.com/517002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1124 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Use stdint types everywhereted.mielczarek@gmail.com2013-03-061-1/+1
| | | | | | R=mark at https://breakpad.appspot.com/535002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1121 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Make CompareStringPtrs::operator() a const methodted.mielczarek@gmail.com2013-02-281-1/+1
| | | | | | Patch by Julian Seward <jseward@acm.org>, R=ted git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1118 4c0a9323-5329-0410-9bdc-e9ce6186880e
* This change allows compiling the google-breakpad code using a global ↵ivan.penkov@gmail.com2012-06-281-1/+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
* Linux/Mac: Add option to omit the CFI section in dump_syms.thestig@chromium.org2011-09-141-6/+7
| | | | | | Review URL: http://breakpad.appspot.com/304001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@835 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add some unit tests for Linux WriteSymbolFileted.mielczarek2011-07-061-4/+3
| | | | | | | | | | | This patch adds synth_elf::{StringTable,SymbolTable,ELF} classes to produce in-memory ELF files to properly test the Linux symbol dumping code. It also uses those classes to add some basic tests for the WriteSymbolFile function. R=jimb at http://breakpad.appspot.com/277001/show git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@794 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Google Breakpad Issue 417: Handle DWARF that omits function names.jimblandy2011-03-111-1/+1
| | | | | | | | | | | | | | | 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
* Put PUBLIC lines in Mac symbol files.ted.mielczarek2011-03-041-1/+35
| | | | | | | | Exported symbols on Mach-O binaries are defined in a STABS section. This patch makes stabs_reader handle them, adds support for Extern symbols in the Module class (which are output as PUBLIC lines in symbol files), and the proper processing in stabs_to_module to hook it all up. A=mark R=jimb at http://breakpad.appspot.com/163001 and http://breakpad.appspot.com/267001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@778 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fixes up some style nits, and gets us compiling on Leopard again.dmaclach2010-07-271-2/+2
| | | | | | | | | | Review: http://breakpad.appspot.com/133001 BUG:none TEST:Compile on Leopard git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@631 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Clean up build for 64 bit.dmaclach2010-07-191-1/+2
| | | | | | | | | | | Fix up some broken mac projects. Consolidate project settings in xcconfig files. http://breakpad.appspot.com/130001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@627 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Remove duplicate FUNC entries from dump_syms output.thestig@chromium.org2010-07-131-7/+18
| | | | | | Review URL: http://breakpad.appspot.com/128001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@623 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad: Avoid using the C++ <cfoo> headers.ted.mielczarek2010-06-251-1/+2
| | | | | | | | | | | | This patch avoids unnecessary use of the <cfoo> headers in files that don't actually use the identifiers they declare in the std:: namespace. It also changes some files to better conform with the "Names and Order of Includes" rules in the Google C++ Style Guide. A=jimb R=mark git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@619 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad symbol dumper: Promise that Module::SetLoadAddress can be called at ↵jimblandy2010-05-051-3/+9
| | | | | | | | | | | | | | | | | | any time. It's possible to imagine an implementation of google_breakpad::Module in which calling SetLoadAddress at different times as the Module is populated would produce different output. For the Mac dumper, we'd like to depend on its current behavior --- that the load address is subtracted off only when writing the symbol file, and can be set at any time prior to that. This patch makes that promise part of Module's contract, and adjusts the test suite to verify that that promise is met. a=jimblandy, r=thestig git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@588 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad symbol dumper: Move Linux dumping classes into src/common.jimblandy2010-04-051-0/+268
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