aboutsummaryrefslogtreecommitdiff
path: root/src/processor/basic_source_line_resolver_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* fix pointer style to match the style guideMike Frysinger2020-07-151-16/+16
| | | | | | | | | | 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-44/+105
| | | | | | | | | | | | | | | | | | 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>
* Populate stack frames with unloaded module info.Joshua Peraza2017-01-191-0/+1
| | | | | | | | | | | | | | | | | | | This CL hits lots of source files because: 1. An update to the CodeModule virtual class. I added an is_loaded method to specify whether the module is loaded. There were several mocks/test classes that needed to be updated with an implementation. An alternative to this route would be to modify MinidumpUnloadedModule::code_file to prepend "Unloaded_" to the module name. 2. Added an unloaded_modules parameter to StackFrameSymbolizer::FillSourceLineInfo. BUG= Change-Id: Ic9c7f7c7b7e932a154a5d4ccf292c1527d8da09f Reviewed-on: https://chromium-review.googlesource.com/430241 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
* Server-side workaround to handle overlapping modules.Ivan Penkov2016-06-201-1/+3
| | | | | | | | | | | | | | This change is resolving an issue that was caused by the combination of: - Android system libraries being relro packed in N+. - Breakpad dealing with relro packed libraries in a hack way. This is a fix for http://crbug/611824. I also found an use-after-free issue (bug in Minidump::SeekToStreamType). I disallowed the MinidumpStreamInfo copy and assign constructors and the compiler detected another similar issue in Minidump::Print. Then I disabled the copy and assign constructors for most classes in minidump.h (just in case). There are a couple of classes where I couldn't disallow them (since assign is used). This will require a small refactor so I left it out of this CL. R=mark@chromium.org Review URL: https://codereview.chromium.org/2060663002 .
* Refactoring in preparation for microdump processingmmandlis@chromium.org2014-09-081-0/+4
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1370 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Adding stricter validation checks to various symbol parser functions.ivan.penkov@gmail.com2013-09-251-0/+263
| | | | | | | | | | | | | 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
* Detect corrupt symbol files during minidump processing. Recover from the ↵ivan.penkov@gmail.com2013-07-111-4/+6
| | | | | | | | | | | | | | | | | | | | | 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
* Use stdint types everywhereted.mielczarek@gmail.com2013-03-061-21/+21
| | | | | | R=mark at https://breakpad.appspot.com/535002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1121 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Move scoped_ptr.h to commonted.mielczarek@gmail.com2013-01-171-1/+1
| | | | | | R=mark at https://breakpad.appspot.com/509002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1096 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Cleaning up google-breakpad source code of signed-unsigned comparison warningsivan.penkov@gmail.com2012-11-211-7/+7
| | | | | | | | http://breakpad.appspot.com/488002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1083 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
* This is a fix for a stackwalker_x86 issue which has toivan.penkov@gmail.com2012-06-121-0/+4
| | | | | | | | | | do with FPO (frame-pointer-omission) optimized context frames where the context frame represents a Windows System call stub. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@971 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
* provide a network source line resolver + server. r=mark,jimb at ↵ted.mielczarek2010-04-081-44/+60
| | | | | | 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/+164
| | | | | | | | | | | | | | | | | | | | | | | | 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: Give Windows stack data Windows-specific names.jimblandy2010-02-051-20/+20
| | | | | | | | | | | | | | | | | | | | | 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-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Issue 49013: Breakpad Processor: Use a separate API to retrieve Windows ↵jimblandy2010-01-111-13/+15
| | | | | | | | | | | | | | | | | | | | 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-4/+4
| | | | | | | | | | | | | | | '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
* Fix memory leak in test case when calling into basic source line resolver.nealsid2009-05-141-2/+6
| | | | | | | | | R=brdevmn A=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@338 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Provide for logging initialization routines (#179). r=brynermmentovai2007-05-251-0/+3
| | | | | | | http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/4b196ca0b6d7f9a6 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@177 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Ignore functions that have invalid addresses or sizes, instead of aborting thebryner2007-03-221-1/+8
| | | | | | | 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-9/+9
| | | | 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/+202
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