aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix HandleInvalidParameter to provide a locally created exception record for ↵siggi@chromium.org2010-03-261-3/+23
| | | | | | | | | | | the minidump. Having an exception of interest makes the resultant minidumps look just like crash dumps, in that the processor can identify the "crashing" tread. This means such minidumps can be classified by the stack signature, in contrast to the current state of things, in which all such dumps get lumped on a single pile. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@557 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add omitted newline to warning message in StabsReader::SymbolString.jimblandy2010-03-181-1/+1
| | | | | | | a=jimblandy, no reviewer git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@555 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad processor: Support AMD64 stack unwinding driven by DWARF CFI.jimblandy2010-03-167-55/+633
| | | | | | | | | | | This adds support for 'STACK CFI' records (DWARF CFI) to the AMD64 stack walker. This is necessary for the stack trace to include any frames other than the youngest. Unit tests are included. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@554 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad: Support DWARF CFI-driven stack walking on ARM.jimblandy2010-03-169-34/+782
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows the Breakpad minidump processor to use data from STACK CFI records to generate stack traces for the ARM processor. In the symbol dumper, we need a table mapping DWARF CFI register numbers to their names: STACK CFI records refer to registers by name. In the processor, we expand StackwalkerARM::GetCallerFrame to see if there are STACK CFI records covering the callee, and then use those to recover the caller's register values. There's no good reason the ARM walker couldn't use the SimpleCFIWalker interface declared in cfi_frame_info.h. Unfortunately, that interface assumes that one can map register names to member pointers of the raw context type, while MDRawContextARM uses an array to hold the registers' values: C++ pointer-to-member types can't refer to elements of member arrays. So we have to write out SimpleCFIWalker::FindCallerRegisters in StackwalkerARM::GetCallerFrame. We define enum MDARMRegisterNumbers in minidump_cpu_arm.h, for convenience in referring to certain ARM registers with dedicated purposes, like the stack pointer and the PC. We define validity flags in StackFrameARM for all the registers, since CFI could theoretically recover any of them. In the same vein, we expand minidump_stackwalk.cc to print the values of all valid callee-saves registers in the context --- and use the proper names for special-purpose registers. We provide unit tests that give full code and branch coverage (with minor exceptions). We add a testing interface to StackwalkerARM that allows us to create context frames that lack some register values. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@553 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux dumper: Parse the .eh_frame section.jimblandy2010-03-1611-143/+1336
| | | | | | | | | | | | | | | | | | | | | | | | 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-166-5/+1014
| | | | | | | | | | | | 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-1614-11/+4935
| | | | | | | | | | | | | | | | | | | | | | | 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: Add minidump processor support for DWARF Call Frame Information.jimblandy2010-03-1616-46/+1850
| | | | | | | | | | | | | | | | | | | | | | | | Add a CFIFrameInfo class (named for symmetry with WindowsFrameInfo) to represent the set of STACK CFI rules in effect at a given instruction, and apply them to a set of register values. Provide a SimpleCFIWalker class template, to allow the essential CFI code to be shared amongst the different architectures. Teach BasicSourceLineResolver to partially parse 'STACK CFI' records, and produce the set of rules in effect at a given instruction on demand, by combining the initial rule set and the appropriate rule deltas in a CFIFrameInfo object. Adapt StackwalkerX86 and StackFrameX86 to retrieve, store, and apply CFI stack walking information. Add validity flags for all the general-purpose registers to StackFrameX86::ContextValidity. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@549 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad processor: Unit tests for StackwalkerX86.jimblandy2010-03-164-0/+1020
| | | | | | | | | | | | | Issue 53001 (http://breakpad.appspot.com/53001) defines the TestAssembler classes; those, along with a new set of mock classes defined in stackwalker_unittest_utils.h, make it possible for us to actually do proper unit testing of a stack walker. These tests get us full code coverage for stackwalker_x86.cc. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@548 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Processor: Add new unit tests for google_breakpad::Minidumpjimblandy2010-03-1610-12/+4472
| | | | | | | | | | | | | | This also adds two new test utility class groups, TestAssembler and SynthMinidump. These are overkill for what I'm doing with them here (and may simply be overkill, period), but they make it easy to write unit tests for code that works on binary files or raw memory contents in a cross-platform way. I'm planning to use them for the DWARF CFI unwinding tests and the DWARF CFI parser tests. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@547 4c0a9323-5329-0410-9bdc-e9ce6186880e
* add missing <string> include from r541ted.mielczarek2010-03-031-0/+1
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@544 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix to cache NOT_FOUND results from symbol supplier on a per-minidump basis nealsid2010-03-033-2/+68
| | | | | | | | | | | http://breakpad.appspot.com/64001 R=ted.mielczarek, brdevmn A=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@543 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux dumper: Tolerate STABS data from code linked with --gc-sections.jimblandy2010-03-023-2/+26
| | | | | | | | | | | | | Programs compiled with -ffunction-sections -Wl,--gc-sections may have SO entries for the start of the compilation unit whose addresses are zero, even when the compilation unit contains non-omitted functions at non-zero addresses. The breakpad dumper should not assume that the compilation unit starting address is always non-zero. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@542 4c0a9323-5329-0410-9bdc-e9ce6186880e
* ARM support, with some build system changes to support x86-64, arm, and i386 ↵nealsid2010-03-0218-158/+1768
| | | | | | | | | | | in an autoconf style build in Linux. The O2 build for the unit tests is still broken but I'm checking this in to unblock people A=nealsid R=ajwong, hannahtang, ted.mielczarek git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@541 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux symbol dumper: Handle programs linked with --gc-sections.jimblandy2010-02-243-0/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As explained in the code: Given the right options, the GNU toolchain will omit unreferenced functions from the final executable. Unfortunately, when it does so, it does not remove the associated portions of the line number program; instead, it lets the symbol references in the DW_LNE_set_address instructions pointing to the now-deleted code resolve to zero. Given this input, the DWARF line parser will call AddLine with a series of lines starting at address zero. Rather than collecting series of lines describing code that is not there, we should drop them. Since the linker doesn't explicitly distinguish references to dropped sections from genuine references to zero, we must use a heuristic. We have chosen: - If a line starts at address zero, omit it. (On the platforms breakpad targets, it is extremely unlikely that there will be code at address zero.) - If a line starts immediately after an omitted line, omit it too. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@538 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad processor: Support negative literals in the postfix evaluator.jimblandy2010-02-241-4/+18
| | | | | | | | | | | | | Some versions of the libstdc++, the GNU standard C++ library, have stream extractors for unsigned integer values that permit a leading '-' sign (6.0.13); others do not (6.0.9). Regardless of the behavior of the extractors, Breakpad postfix expressions should support negative literals. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@537 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux dumper: Add missing newlines to error messages.jimblandy2010-02-231-2/+2
| | | | | | | | | | Some of the error messages that could be generated in the process of parsing DWARF debugging information lack terminating newlines. a=jimblandly, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@536 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux dumper: Record AbstractOrigin entries for all DIEs that need ↵jimblandy2010-02-202-20/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | them. Any DIE with an DW_AT_inline attribute can be cited by DW_AT_abstract_origin attributes --- even if the value of the DW_AT_inline attribute is DW_INL_not_inlined. Thus, we need to set the inline_ flag on all such DIEs, regardless of the attribute's value. This allows us to find names in situations like this: <1><30cf>: Abbrev Number: 57 (DW_TAG_subprogram) <30d0> DW_AT_specification: <0x3013> <30d4> DW_AT_decl_file : 1 <30d5> DW_AT_decl_line : 92 <30d6> DW_AT_inline : 0 (not inlined) <30d7> DW_AT_sibling : <0x30f0> ... <1><30f5>: Abbrev Number: 59 (DW_TAG_subprogram) <30f6> DW_AT_abstract_origin: <0x30cf> <30fa> DW_AT_low_pc : 0x13bc <30fe> DW_AT_high_pc : 0x13ec <3102> DW_AT_frame_base : 0x2c (location list) <3106> DW_AT_sibling : <0x3113> a=jimblandy, r=nealsid,dmuir git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@526 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux dumper: Compare section names correctly.jimblandy2010-02-181-1/+7
| | | | | | | | | | | | | | | | | | | FindSectionByName will return the first section whose name starts with NAME, because strncmp stops the comparison once NAME's characters have been found to match. The comparison stops before the terminating '\0'. For example, if we search for the section named ".eh_frame", we may get the section named ".eh_frame_hdr". Instead, check that the section name section has enough space to store the complete name with its terminating '\0', and then use strcmp, which will never examine more than strlen(NAME) + 1 bytes from the section name section, regardless of its contents, and will require the terminating '\0' to match as well. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@525 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
* Breakpad: Require Automake 1.11.1.jimblandy2010-02-112-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Change configure.ac to note that Breakpad requires automake version 1.11.1 or later. This will cause older versions of automake to refuse to process the Makefile.am file. Earlier versions of automake generate 'make dist' rules that have a security flaw; see: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2009-4029 However, note that that notice itself has a flaw: the bug is *fixed in* automake 1.11.1, not present. See: http://lists.gnu.org/archive/html/automake/2009-12/msg00012.html (The change to Makefile.in is a consequence of my having neglected to rebuild Makefile.in after landing r517.) a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@521 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux DWARF reader: Follow DW_AT_abstract_origin links to find function names.jimblandy2010-02-105-3/+267
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: Don't be silly about global functions.jimblandy2010-02-093-12/+11
| | | | | | | | | | | | Yes, classes are useful. But that doesn't mean that every function has to gratuitously become a member function. The Google C++ Style Guide does not require this silliness, since the function is in the google_breakpad namespace anyway. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@519 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux dumper: Add file comments as required by the style guide.jimblandy2010-02-0923-17/+116
| | | | | | | | | | | | | | | | | | | | | | 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-0967-67/+67
| | | | | | | | | | 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
* Print ARM register values in minidump_stackwalk. r=nealsid at ↵ted.mielczarek2010-02-091-0/+11
| | | | | | http://breakpad.appspot.com/57002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@516 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Refactor Chrome's out-of-process Linux code into ↵ted.mielczarek2010-02-0511-40/+925
| | | | | | CrashGeneration{Server,Client} classes. Upstreamed from the Mozilla repository. Patch by Chris Jones <jones.chris.g@gmail.com> r=me at https://bugzilla.mozilla.org/show_bug.cgi?id=516759 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@515 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad processor: Move STACK WIN record parsing into its own function.jimblandy2010-02-051-29/+39
| | | | | | | | | | | This looks a little odd right now, since ParseStackInfo has only one alternative to handle, but I think breaking this out should make the subsequent addition of STACK CFI record support easier to review. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@514 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad processor: Give Windows stack data Windows-specific names.jimblandy2010-02-052-46/+50
| | | | | | | | | | | | | | | | | | | | | Rename BasicSourceLineResolver::Module::StackInfoTypes to WindowsFrameInfoTypes. This enum really describes the forms of Windows-specific stack unwinding data (STACK WIN records), and its name should reflect that, especially since we'll be adding support for other kinds of stack walking information. The 'stack' -> 'frame' shift matches the naming of the WindowsFrameInfo type. Similarly, rename BasicSourceLineResolver::Module::stack_info_ to windows_frame_info_. Do similar renamings in basic_source_line_resolver_unittest.cc. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@513 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad processor: Segregate STACK WIN vs. traditional stack walking.jimblandy2010-02-052-170/+246
| | | | | | | | | | | | | This patch moves the code for finding caller frames using STACK WIN data and the code to do so using the traditional frame layout (%ebp points at saved %ebp, pushed just after return address) into their own functions. In addition to making things a little clearer, this is preparation for adding support for STACK CFI records into the mix. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@512 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad processor: Support evaluating a postfix expression to produce a value.jimblandy2010-02-053-14/+151
| | | | | | | | | | This adds an EvaluateForValue member function to PostfixEvaluator, and along with appropriate unit tests. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@511 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad x86 Stack Walker: Pass "out" parameters by address, not reference.jimblandy2010-02-052-8/+8
| | | | | | | | | | | | The Google C++ Style Guide requires all parameters passed by reference to be labeled 'const', and says that pointers should be used for output arguments. This patch brings google_breakpad::StackwalkerX86 into line. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@510 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad processor: Make PostfixEvaluator treat the MemoryRegion as const.jimblandy2010-02-055-35/+35
| | | | | | | | | | | | | | | | In order to be able to treat any MemoryRegion as const, the accessor functions need to be declared this-const, which means annotations on all the subclasses, etc. etc. Since MinidumpMemoryRegion fills its memory_ member on demand, that member needs to be marked 'mutable', but this is exactly the sort of situation the 'mutable' keyword was intended for, so that seems all right. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@509 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad processor: Save Windows unwinding data earlier in x86 walker.jimblandy2010-02-051-3/+4
| | | | | | | | | | | | | | | | | | | At the moment, StackwalkerX86::GetCallerFrame doesn't save the WindowsFrameInfo that it finds for a frame unless it successfully constructs the caller frame. This means that the windows_frame_info field of the last frame on the stack is left unset, even when that frame does have windows unwinding information. This is not user-visible behavior, so it doesn't matter, but it is a blemish on the interface, and unit tests (added in a later patch) expect it. This patch saves the information in the frame as soon as we find it. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@508 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux dumper: Recognize more processor architectures.jimblandy2010-02-021-12/+35
| | | | | | | | | | | | | | This extends the ElfArchitecture function to recognize the architectures it seemed to me that breakpad was most likely to see. Also: the dumper has historically not provided very helpful error messages. This patch adds a few that were convenient, but we should do an audit for this. a=jimblandy, r=ted.mielczarek git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@507 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Regenerate using automake-1.11.1, autoconf 2.65, and libtool 2.2.6b,jimblandy2010-02-024-196/+171
| | | | | | | | | to provide a fix for Breakpad issue 365: http://code.google.com/p/google-breakpad/issues/detail?id=365 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@506 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux Dumper: Rename structure members to follow the Google C++ ↵jimblandy2010-01-289-217/+217
| | | | | | | | | | | | | Style Guide. The Google C++ Style Guide says that members of structures needn't have names ending in underscores. The structure types in google_breakpad::Module don't follow this rule. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@505 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
* Breakpad processor: Fix function and public symbol lookup.jimblandy2010-01-283-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In r480, I botched the change to make the comparisons that decide whether an address falls within a function's range safe from overflow. The original code said: address >= function_base && address < function_base + function_size which is fine unless the function abuts the end of the address space, in which case the addition overflows and you get a false negative. My change subtracted function_size from both sides of the latter comparison, which is meaning-preserving in true math, and gets you: address >= function_base && address - function_size < function_base This not only reads strangely, but also still overflows if function_size is greater than address. That's rare, but I've added a case to the unit tests that checks it. My intent had been to replace the addition which could overflow with a subtraction that was known not to overflow, namely: address >= function_base && address - function_base < function_size This is equivalent to the original in true math, and because of the first comparison, we know the subtraction won't underflow in MemAddr math. The patch includes similar fixes to the public symbol lookup code, and to FindWindowsFrameInfo, which was the only other function affected by r480. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@503 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux symbol dumper: Don't disable asserts.jimblandy2010-01-271-1/+0
| | | | | | | | | | | Having NDEBUG be the default has wasted my time more often than I'm proud to admit. There are no expensive asserts in the Linux symbol dumper. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@502 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad processor: Have RetrieveNearestRange correctly return range extent.jimblandy2010-01-272-2/+19
| | | | | | | | | | RangeMaps use the range's upper end as the key in the underlying map, but RetrieveNearestRange was treating the key as the lower end. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@501 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux Dumper: Add DWARF support.jimblandy2010-01-2311-28/+3996
| | | | | | | | | | | | | | | | | | | | | | | | This adds DWARF support to the Breakpad Linux dumper. This is implemented as two handler classes: google_breakpad::DwarfCUToModule accepts data from dwarf2reader::CompilationUnit, and google_breakpad::DwarfLineToModule accepts data from a dwarf2reader::LineInfo, each populating a google_breakpad::Module with the results. Behaviors specific to particular source languages are handled by instances of a new class, google_breakpad::Language. An input executable may contain both STABS and DWARF debugging information: the dumper automatically recognizes what sorts of information are available, and integrates the data into a single output file. All classes have unit tests, providing line and branch coverage of all interesting code. Unit tests are written using the Google C++ Testing Framework, and the Google C++ Mocking Framework where appropriate. a=jimblandy, r=ccoutant git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@497 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-234-0/+1106
| | | | | | | | | | | | | | | | | | 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
* Add new file missed in r490.jimblandy2010-01-141-0/+8
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@492 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad processor: Don't pass Windows stack walking information to all walkers.jimblandy2010-01-1413-69/+51
| | | | | | | | | | | | | | | | | | | | | At the moment, the StackWalker GetCallerFrame member function expects a vector of WindowsFrameInfo structures, even though WindowsFrameInfo is only used or useful on one one implementation (StackWalkerX86). This patch changes StackWalker::GetCallerFrame to no longer expect the WindowsFrameInfo structures, and changes all implementations to match. In particular, StackWalkerX86 is changed to find the WindowsFrameInfo data itself, and store a pointer to whatever it got in the StackFrame object itself (which is really a StackFrameX86). To allow GetCallerFrame implementations to look up stack walking data, StackWalker::resolver_ needs to be made protected, not private. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@491 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad Linux dumper: STABS reader incorrectly assumes a single compilation ↵jimblandy2010-01-143-35/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | unit The stabs reading code in google-breakpad incorrectly assumes that the stabs data is a single compilation unit. Specifically, it ignores N_UNDF stabs and assumes that all string indices are relative to the beginning of the .stabstr section. This is true when linking with the GNU linker by default, because the GNU linker optimizes stabs debug info. The gold linker does not do this optimization. It can be disabled when using the GNU linker with the --traditional-format command line option. For more details of the problem, see: http://sourceware.org/bugzilla/show_bug.cgi?id=10338 http://code.google.com/p/google-breakpad/issues/detail?id=359 This patch adds unit tests that reproduce the failure, and fixes the stabs parser. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@490 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Linux Breakpad Dumper: support running unit tests under valgrind or other ↵jimblandy2010-01-131-16/+28
| | | | | | | | | | | | | | | wrapper programs. This adds a new variable, TEST_WRAPPER, to src/tools/linux/dump_syms. Comments in the patch provide details. This patch also moves the public variable section to sit after the public phony targets. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@486 4c0a9323-5329-0410-9bdc-e9ce6186880e