aboutsummaryrefslogtreecommitdiff
path: root/src/common/dwarf
Commit message (Collapse)AuthorAgeFilesLines
...
* Add includes for unittests that appear to need them.jessicag.feedback@gmail.com2011-10-172-0/+8
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@870 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Additional fixes following r862.mark@chromium.org2011-10-112-31/+34
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@864 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Remove "using namespace std" from dwarf2reader.h. Using-directives aremark@chromium.org2011-10-114-36/+36
| | | | | | | | | | | | | forbidden by the style guide, and are bad practice in headers even under style rules that tolerate this construct. This fixes warnings such as: In file included from dwarf2reader.cc:34: dwarf2reader.h:53:17: warning: using namespace directive in global context in header [-Wheader-hygiene] Review URL: http://breakpad.appspot.com/312002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@862 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad DWARF Reader: Ignore padding at the end of the compilation unit.jimblandy2010-08-251-1/+5
| | | | | | | | | | | | | | | | | After the final DIE in a compilation unit, there may be any number of zero bytes present. This is meant to allow producers to align compilation unit starting points when necessary. This patch changes the dwarf2reader::CompilationUnit class to skip those zero bytes, rather than interpreting them as 'end of children' markers for DIEs that do not exist. Without this change, the padding bytes will cause the reader to attempt to pop an offset from an empty stack, and call EndDIE with a garbage offset. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@667 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad DWARF parser: Don't use auto_ptr<stack<uint64> > where ↵jimblandy2010-08-251-9/+5
| | | | | | | | | | | | stack<uint64> would do. Perhaps there once was some reason one needed the DIE offset stack to have an unusual lifetime, but there is none now. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@666 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad DWARF reader: Use uint64, not uint64_t in DWARF reader code.jimblandy2010-08-252-4/+4
| | | | | | | | | | | | The 64-bit cleanups made last month (http://breakpad.appspot.com/133001/show) introduced unit test suite failures when built for a 32-bit architecture. The fix for those test suite failures (http://breakpad.appspot.com/140001/show) introduce build failures on Linux. a=jimblandy git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@665 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Commit issue 140001: fixes for 64-bit build cleanups.jimblandy2010-08-252-7/+7
| | | | | | | a=dmaclach, r=jimb git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@664 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add missing stdint.h include to fix compilation on newer GCC.ted.mielczarek2010-08-161-0/+1
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@652 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fixes up some style nits, and gets us compiling on Leopard again.dmaclach2010-07-272-4/+4
| | | | | | | | | | 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-194-22/+21
| | | | | | | | | | | 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
* Fix a couple of tiny things for GCC pedantryted.mielczarek@gmail.com2010-07-081-1/+1
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@622 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad: Avoid using the C++ <cfoo> headers.ted.mielczarek2010-06-255-15/+18
| | | | | | | | | | | | 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 DWARF CFI support: Cleanups requested by Nealted.mielczarek2010-06-252-8/+23
| | | | | | | | I came across a bunch of comments Neal had made on issue 55011 that I hadn't addressed. This patch takes care of them. A=jimb R=thestig git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@618 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad DWARF CFI parser: Use the proper type for offsets in ↵ted.mielczarek2010-06-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | CallFrameInfo::Rule subclasses. The subclasses of CallFrameInfo::Rule store the rule currently in force for recovering a register or computing the canonical frame address. Their sole responsibility is to accurately convey rules from the parser, which creates them, to a CallFrameInfo::Handler member function, which consumes them. So, the types of their data members should match those of the corresponding arguments of the corresponding Handler member function. CallFrameInfo::OffsetRule and CallFrameInfo::ValOffsetRule use an 'int' to store the rule's offset value, but CallFrameInfo::Handler::OffsetRule and ...::ValOffsetRule expect a 'long'. On ABIs where 'long' is larger than 'int', this can cause values to be truncated or sign-extended unexpectedly. This patch changes those members to 'long'. Fortunately, offsets appearing in real DWARF call frame information never even come close to the limits of a 32-bit int, so this bug is unlikely to cause any practical problems. A=jimb R=thestig git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@615 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Mac symbol dumper: Add new Mach-O reader class.ted.mielczarek2010-06-253-12/+12
| | | | | | | | | | | | | | | | This patch adds files defining new classes in the google_breakpad::Mach_O namespace for parsing fat binaries and Mach-O files. These are used in the new dumper to handle STABS debugging information, DWARF call frame information, and .eh_frame exception handling stack walking information. These new classes are independent of endianness and word size, and therefore can be used on binaries of all the relevant architectures: x86, x86_64, ppc, and ARM. The patch adds a complete set of unit tests for the new classes. A=jimb R=mark (http://breakpad.appspot.com/93001/show, http://breakpad.appspot.com/115001/show) git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@610 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad test support: Move test_assembler.{h,cc} from src/processor to ↵jimblandy2010-04-271-1/+1
| | | | | | | | | | | | | | src/common. The google_breakpad::TestAssembler classes are used in both the processor's and the Linux dumper's test suites, and will soon be used in the Mac dumper's tests as well. This patch moves their source files from src/processor to src/common. a=jimblandy, r=thestig git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@574 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Include what you use.mmentovai2010-04-051-0/+3
| | | | | | | Patch by Adam Langley <agl@chromium.org>. r=me git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@568 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad DWARF parser: correct comments regarding dynamic_cast.jimblandy2010-03-301-7/+14
| | | | | | | | | | | | | | | | The comments don't accurately describe what the style guide says. Regardless of what the style guide says, RTTI seems to make trouble in practice, because so many people build with it disabled. Since only the symbol dumper uses RTTI, not the client library, it may be practical for people to simply enable RTTI for the dumper. Failing that, it may be best in the long run to violate the style guide and make the code work sans RTTI. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@561 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux dumper: Make changes requested by Neal Sidhwaney in issue 59002.jimblandy2010-03-293-21/+53
| | | | | | | | | | - Use manifest constants for 'z' augmentation letters. - Fix typos and rearrange some code for legibility. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@560 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux dumper: Parse the .eh_frame section.jimblandy2010-03-168-120/+1299
| | | | | | | | | | | | | | | | | | | | | | | | Extend google_breakpad::CFISection with the ability to produce .eh_frame data. Entry headers have a different format, and pointers can be encoded in new and fascinating ways. Extend dwarf2reader::CallFrameInfo to be able to parse either DWARF CFI or .eh_frame data, as determined by an argument to the constructor. Cope with variations in header formats, encoded pointers, and additional data in 'z' augmentation data blocks. Extend the unit tests appropriately. Extend dump_syms to look for a .eh_frame section, and if it is present, find the necessary base addresess and parse its contents. There's no need for DwarfCFIToModule to check the version numbers; if CallFrameInfo can parse it, DwarfCFIToModule should be able to handle it. Adjust tests accordingly. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@552 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad DWARF parser: Add support for parsing .eh_frame encoded pointers.jimblandy2010-03-165-5/+993
| | | | | | | | | | | | The Linux C++ exception handling data format (.eh_frame) can specify a number of different encodings for the addresses it contains. This patch extends dwarf2reader::ByteReader to read pointers encoded in these ways. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@551 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux dumper: Add support for dumping DWARF CFI as STACK CFI records.jimblandy2010-03-166-2/+3918
| | | | | | | | | | | | | | | | | | | | | | | Define a new DWARF parser class, dwarf2reader::CallFrameInfo. Extend google_breakpad::Module to store and write out 'STACK CFI' records. Define a new google_breakpad::DwarfCFIToModule class, to accept DWARF CFI data from the parser and populate a Module with the equivalent STACK CFI records. Extend the Linux symbol dumping tool, dump_syms, to use dwarf2reader::CallFrameInfo, google_breakpad::DwarfCFIToModule, and google_breakpad::Module to extract DWARF CFI from the executable or shared library files and write it to the Breakpad symbol file. Define CFISection, a new class derived from TestAssembler::Section, for use in creating DWARF CFI data for test cases. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@550 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad DWARF parser: Expand comments for ByteReader class.jimblandy2010-02-111-43/+122
| | | | | | | | | | | | This is preparation for adding support for reading Linux C++ exception handling data's encoded pointers. The change should have no user-visible effect; it simply expands the comments for dwarf2reader::ByteReader, and regroups the member functions. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@522 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux DWARF reader: Follow DW_AT_abstract_origin links to find function names.jimblandy2010-02-101-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, debugging information like the following will produce FUNC records with no names, because the dumper (correctly) ignores the DW_TAG_subprogram DIEs that lack DW_AT_low_pc/DW_AT_high_pc attributes, but won't follow the DW_AT_abstract_origin link from the DIE that does have code addresses to find its name. <1><168>: Abbrev Number: 5 (DW_TAG_class_type) <169> DW_AT_name : Foo <2><183>: Abbrev Number: 7 (DW_TAG_subprogram) <185> DW_AT_name : Foo <18b> DW_AT_declaration : 1 <1><1b7>: Abbrev Number: 12 (DW_TAG_subprogram) <1b8> DW_AT_specification: <0x183> <1bc> DW_AT_inline : 2 (declared as inline but ignored) <1><1dc>: Abbrev Number: 16 (DW_TAG_subprogram) <1dd> DW_AT_abstract_origin: <0x1b7> <1e1> DW_AT_low_pc : 0x8048578 <1e5> DW_AT_high_pc : 0x8048588 a=dmuir, r=jimblandy git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@520 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux dumper: Add file comments as required by the style guide.jimblandy2010-02-094-2/+25
| | | | | | | | | | | | | | | | | | | | | | This also includes some comments I promised Cary Coutant I'd write about the appropriateness of processing attributes in EndAttributes calls. The Google C++ Style Guide requires each file to have an author notice and a comment explaining the file's general purpose. For the record, I don't think putting an author notice on the files is a good idea; it's odd to have the original author retain prominence even if the file has been heavily edited by others; the version control system answers this question more accurately. This is only for Style Guide compliance. The Apache group decided to discourage author annotations, partially for these reasons: http://mail-archives.apache.org/mod_mbox/jakarta-jmeter-dev/200402.mbox/%3C4039F65E.7020406@atg.com%3E a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@518 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad: Update copyright notice years on all files changed in 2010.jimblandy2010-02-0910-10/+10
| | | | | | | | | | We've gotten mixed advice from the lawyery types about whether this matters. But it's easy enough to do. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@517 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad DWARF parser: Add method to read DWARF "Initial length".jimblandy2010-01-283-27/+31
| | | | | | | | | | | This patch moves the ReadInitialFunction from dwarf2reader.cc, where it was a static function, to being a member function of google_breakpad::ByteReader. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@504 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Typo: "An" -> "A".jimblandy2010-01-231-1/+1
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@496 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad DWARF Parser: Improved DWARF-processing interface.jimblandy2010-01-233-0/+1084
| | | | | | | | | | | | | | | | | | dwarf2reader::CompilationUnit is a simple and direct parser for DWARF data, but its handler interface is not convenient to use. In particular, the same handler object receives data about all DIEs processed. One can't use distinct classes to separate the information needed to handle different kinds of data. This patch defines a new adapter type, dwarf2reader::DIEHandler, which implements the existing DWARF parser's handler interface, given a handler written to a more comfortable, object-orient interface. The comments in dwarf2diehandler.h provide more detail. a=jimblandy, r=ccoutant git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@495 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad DWARF Reader: Change LineInfoHandler::AddLine to provide the line's ↵jimblandy2010-01-224-28/+50
| | | | | | | | | | | | | | | | | | | | length. Breakpad's DWARF line number info parser provides a code address, file, and line number for each code/source pairing, but doesn't provide the length of the machine code. This makes that change, as discussed in the following thread: http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/ed8d2fde79319368p This patch also makes the corresponding changes to the functioninfo.cc module, used by the Mac dumper. This patch has no effect on the Mac dumper's output. a=jimblandy, r=ccoutant git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@494 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad DWARF Reader: Also look for DWARF in sections with the proper names.jimblandy2010-01-221-6/+18
| | | | | | | | | | | | The DWARF specification specifices which names the sections containing DWARF information should have. OSX uses slightly different names. This patch changes the DWARF reader to look for the sections under both sets of names. a=jimblandy, r=ccoutant git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@493 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Google Breakpad DWARF reader: Add a handler function for DIE references.jimblandy2010-01-124-31/+70
| | | | | | | | | | | | | | | Add a new member function to dwarf2reader::Dwarf2Handler, ProcessAttributeReference, for reporting attribute values that are references to other DIEs. This handler member function always receives an absolute offset (that is, relative to the start of the .debug_info section, not to the start of the compilation unit), regardless of the form the attribute uses. (Some forms are CU-relative, some are absolute.) a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@482 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad DWARF Reader: Add DWARF language enumeration values.jimblandy2010-01-111-0/+36
| | | | | | | a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@479 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad DWARF parser: Fix up documentation for DWARF reader classes.jimblandy@gmail.com2009-12-182-33/+34
| | | | | | | | | | | | | | | | | | | | | | | Fix typos. For CompilationUnit::Start, I was confused by the '-' in the original comment, taking it for a parenthetic clause marker, assuming an implicit "of the next compilation unit" at the end of the sentence. The comments should refer to the ".debug_info" section, not the "debug_info" section. The latter is not the section name actually used on any system (ELF or Mach-O), and the former is the name prescribed by the DWARF spec. Some of the comments for ProcessAttribute* member functions claim that OFFSET is from the start of the compilation unit, but that's not so: the code has always passed an offset relative to the start of the .debug_info section. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@453 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 41004: Breakpad DWARF parser: fixes to compile without warnings under ↵jimblandy@gmail.com2009-12-152-1/+7
| | | | | | | | | GNU C++ 4.3.3. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@450 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 41003: Breakpad DWARF parser: Include <cstdio>, since we use itjimblandy@gmail.com2009-12-151-2/+2
| | | | | | | | | | | | | | | | src/common/dwarf/dwarf2reader.cc uses the old-fashioned <stdio.h> facilities to report errors. Ideally, we would add a 'Warning' message to the handler and make the client responsible for dealing with the errors, but this at least allows us to compile. Ubuntu 9.10 uses GCC 4.4.1; under older versions of GCC, this wasn't a problem, probably because stdio.h was being brought in inadvertently somewhere else. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@449 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 42002: Breakpad DWARF parser: avoid using <stdint.h> typejimblandy@gmail.com2009-12-153-3/+11
| | | | | | | | | | | | | | | | | | | | | It seems that a use of the <stdint.h> type uintptr_t has crept into the DWARF parser. This defines a workaround for the GNU compilers (tested on both Mac and Linux) which will raise an error if it doesn't work. My personal preference would be just to assume that the <stdint.h> header is available and use the standard types everywhere, but 1) that would be a large change, likely to make merges with the other branches of the DWARF parser more difficult, and 2) it would make it quite difficult to build under Microsoft Visual Studio, which doesn't have the <stdint.h> header; Microsoft has said they have no plans to provide it, as they would rather "focus their efforts" on C++ and .NET. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@448 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 39002: Breakpad DWARF parser: Move DWARF parser to ↵jimblandy@gmail.com2009-12-1510-0/+2560
platform-independent directory. Move the DWARF parser, and the functioninfo.cc DWARF consumer, from src/common/mac/dwarf to src/commmon/dwarf, so that it can be shared between the Mac and Linux dumpers. Fix up #include directives, multiple inclusion protection macros, and Xcode build files. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@446 4c0a9323-5329-0410-9bdc-e9ce6186880e