aboutsummaryrefslogtreecommitdiff
path: root/src/processor/basic_source_line_resolver.cc
Commit message (Collapse)AuthorAgeFilesLines
* fix pointer style to match the style guideMike Frysinger2020-07-151-50/+50
| | | | | | | | | | 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 optional field indicating multiple symbols at an addressMike Wittman2017-11-291-20/+65
| | | | | | | | | | | | | | | | | | 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>
* Fix a trivial parsing bug caught by static analysisNicholas Nethercote2016-06-101-1/+1
| | | | R=ted
* Adding support for overlapping ranges to RangeMap.Ivan Penkov2016-06-051-8/+9
| | | | | | | | | | When enabled, adding of a new range that overlaps with an existing one can be a successful operation. The range which ends at the higher address will be shrunk down by moving its start position to a higher address so that it does not overlap anymore. This change is required to fix http://crbug/611824. The actual fix will come in a separate CL. R=mmandlis@chromium.org Review URL: https://codereview.chromium.org/2029953003 .
* Don't use strtok_s for mingw buildsted.mielczarek@gmail.com2015-08-201-0/+2
| | | | | | | R=ivanpe at https://codereview.chromium.org/1292503005/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1496 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Adding stricter validation checks to various symbol parser functions.ivan.penkov@gmail.com2013-09-251-79/+190
| | | | | | | | | | | | | More specifically, the validation of the following record types is improved: - FILE records - FUNC records - Line record - PUBLIC records Adding unittests. Review URL: https://breakpad.appspot.com/632003 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1217 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Handle block helper functions in Breakpad symbol parser. Block helper ↵ivan.penkov@gmail.com2013-09-191-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | functions are associated with a source file but not associated with any line number. For such functions, the Breakpad symbol file contains 0 for the line numbers. Hence, 0 should be threated as valid line number. For more information on block helper functions, please, take a look at http://clang.llvm.org/docs/Block-ABI-Apple.html. Here is the symbol parser output: E0906 11:27:06.051507 22535 basic_source_line_resolver.cc:76] Line 380187: ParseLine failed E0906 11:27:06.051614 22535 basic_source_line_resolver.cc:76] Line 380188: ParseLine failed E0906 11:27:06.051648 22535 basic_source_line_resolver.cc:76] Line 380190: ParseLine failed E0906 11:27:06.051679 22535 basic_source_line_resolver.cc:76] Line 380191: ParseLine failed E0906 11:27:06.200814 22535 basic_source_line_resolver.cc:76] Line 446729: ParseLine failed Here are the contents of the Breakpad symbol file: FUNC 440d60 49 0 __copy_helper_block_ 440d60 b 0 3160 <<<----------- the third number is the line number 440d6b 3e 0 3160 <<<---------------------------- same here FUNC 440db0 36 0 __destroy_helper_block_ 440db0 a 0 3160 <<<---------------------------- same here 440dba 2c 0 3160 <<<---------------------------- same here Review URL: https://breakpad.appspot.com/629002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1214 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Detect corrupt symbol files during minidump processing. Recover from the ↵ivan.penkov@gmail.com2013-07-111-32/+68
| | | | | | | | | | | | | | | | | | | | | errors and use the good data if possible. More specifically: - Detect corrupt symbols during minidump processing and provide the list of modules with corrupt symbols in the ProcessState. This will allow listing the corrupt symbol files in the final crash report. - Skip and recover from symbol data parse errors - don't give up until 100 parse errors are seen. - In order to recover from '\0' (null terminator) in the middle of a symbol file, a couple of methods have to be updated to require both buffer pointer and length. Previously they required only a buffer pointer (char *) and the size of the buffer was evaluated using strlen which is not reliable when the data is corrupt. Most of the changes are due to these signature updates. - Added and updated unittests. Also, updated minidump_stackwalk to show a WARNING for corrupt symbols. Output looks like this: ... Loaded modules: 0x000da000 - 0x000dafff Google Chrome Canary ??? (main) 0x000e0000 - 0x0417dfff Google Chrome Framework 0.1500.0.3 (WARNING: Corrupt symbols, Google Chrome Framework, 4682A6B4136436C4BFECEB62D498020E0) 0x044a8000 - 0x04571fff IOBluetooth 0.1.0.0 ... Review URL: https://breakpad.appspot.com/613002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1200 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix some more Win32 compat issues in processor codeted.mielczarek@gmail.com2013-03-061-0/+5
| | | | | | R=mark at https://breakpad.appspot.com/535003/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1122 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Use stdint types everywhereted.mielczarek@gmail.com2013-03-061-6/+6
| | | | | | R=mark at https://breakpad.appspot.com/535002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1121 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Remove unnecessary #include unistd.hted.mielczarek@gmail.com2013-03-011-1/+0
| | | | | | (no review, trivial change) git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1119 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Restrict ownership of symbol data buffers to symbol supplier.SiyangXie@gmail.com2010-11-011-5/+0
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@721 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Refactor source line resolver, add interface in supplier and resolver.SiyangXie@gmail.com2010-10-071-360/+24
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@711 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Make dump_syms output an INFO CODE_ID line that includes the code file and ↵ted.mielczarek2010-10-051-0/+4
| | | | | | | | code identifier. (Currently disabled to give Breakpad users time to update their processor code.) R=mark at http://breakpad.appspot.com/180001/show git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@710 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix memory leak in BasicSourceLineResolver::UnloadModuleted.mielczarek2010-08-271-0/+2
| | | | | | R=nealsid at http://breakpad.appspot.com/179001/show git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@674 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix for uninitialized variable in basic_source_line_resolver.ccnealsid2010-05-131-1/+1
| | | | | | | | | R=TBR A=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@598 4c0a9323-5329-0410-9bdc-e9ce6186880e
* provide a network source line resolver + server. r=mark,jimb at ↵ted.mielczarek2010-04-081-166/+99
| | | | | | http://breakpad.appspot.com/36001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@569 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad: Add minidump processor support for DWARF Call Frame Information.jimblandy2010-03-161-2/+126
| | | | | | | | | | | | | | | | | | | | | | | | 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: Update copyright notice years on all files changed in 2010.jimblandy2010-02-091-1/+1
| | | | | | | | | | 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 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-051-26/+30
| | | | | | | | | | | | | | | | | | | | | 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: Fix function and public symbol lookup.jimblandy2010-01-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 processor: Opening a map file is not an error.jimblandy2010-01-131-1/+1
| | | | | | | a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@485 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 49013: Breakpad Processor: Use a separate API to retrieve Windows ↵jimblandy2010-01-111-60/+72
| | | | | | | | | | | | | | | | | | | | stack debugging info. At the moment, FillSourceLineInfo returns Windows DIA-based stack walking data. In addition to being ugly, this makes it difficult to provide access to DWARF CFI-based stack walking data in a symmetrical way. This patch changes FillSourceLineInfo to do the single job its name suggests, and adds a second member function to SourceLineResolverInterface to retrieve Windows DIA stack walking information. A sibling member function will provide access to DWARF CFI stack walking data. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@480 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Issue 49012: Breakpad Processor: Rename 'StackFrameInfo' structure to ↵jimblandy2009-12-231-13/+13
| | | | | | | | | | | | | | | 'WindowsFrameInfo'. Also, rename stack_frame_info.h to windows_frame_info.h. If it seems odd to have functions like FillSourceLineInfo returning Windows-specific data structures... well, it is! This patch just makes it more obvious what's going on. a=jimblandy, r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@471 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad: Don't use the deprecated __gnu_cxx::hash_map container.jimblandy@gmail.com2009-09-031-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Modern GNU compilers warn about the #inclusion of <ext/hash_map>; that container is deprecated, and code should use <tr1/unordered_map> instead. However, to stay within the boundaries of C++ '98, it's probably fine just to use plain old std::map. Breakpad uses hash_map in three cases: o The DWARF reader's SectionMap type maps object file section names to data. This map is consulted once per section kind per DWARF compilation unit; it is not performance-critical. o The Mac dump_syms tool uses it to map machine architectures to section maps in Universal binaries. It's hard to imagine there ever being more than two entries in such a map. o The processor's BasicSourceLineResolver uses a hash_map to map file numbers to file names. This is the map that will probably have the most entries, but it's only accessed once per frame, after we've found the frame's line entry. a=jimblandy r=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@393 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix memory leak when using the basic source line resolver, plus the ↵nealsid2009-04-221-9/+11
| | | | | | | | | | | optimization to load using in-memory buffers. Moved from manually allocating/deallocating memory to using a scoped_array A=nealsid R=tiger feng git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@329 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Modify symbol supplier interface to support an overload that takes a symbol ↵nealsid2009-02-191-24/+124
| | | | | | | | | | data buffer, to get around an extraneous read/write of symbol data R=doshimun git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@311 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Allow Breakpad processor library to build on Solaris with the native Sunmmentovai2007-09-261-0/+13
| | | | | | | toolchain (#142). Patch by Alfred Peng. r=me. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@213 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add logging to minidump processor (#82). Part 2: add messages to the rest ofmmentovai2007-05-211-8/+48
| | | | | | | | | the processor. r=ted.mielczarek http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/cf56b767383a5d4b git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@172 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Ignore functions that have invalid addresses or sizes, instead of aborting thebryner2007-03-221-9/+9
| | | | | | | symbol file load (#137). r=mmentovai. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@130 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Rename Airbag to Breakpad.mmentovai2007-02-141-5/+5
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@122 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add an abstract interface to SourceLineResolver, and allow any implementationbryner2006-12-111-0/+561
to be used with MinidumpProcessor. The basic SourceLineResolver is now a public interface (#89) git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@83 4c0a9323-5329-0410-9bdc-e9ce6186880e