diff options
author | ted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2013-08-19 18:31:51 +0000 |
---|---|---|
committer | ted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2013-08-19 18:31:51 +0000 |
commit | 0510e34cbfe1b920b968c33e83101bed49c47aeb (patch) | |
tree | 3cc4bfb4e3c4bcd5a90599c7534116fef0c89426 /src/google_breakpad/processor | |
parent | Enable the SIGABRT handler on desktop OS X (diff) | |
download | breakpad-0510e34cbfe1b920b968c33e83101bed49c47aeb.tar.xz |
Allow setting a limit on the number of frames to be recovered by stack scanning.
Patch by Julian Seward <jseward@acm.org> R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=894264
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1206 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/google_breakpad/processor')
-rw-r--r-- | src/google_breakpad/processor/stackwalker.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/google_breakpad/processor/stackwalker.h b/src/google_breakpad/processor/stackwalker.h index 9229237c..81ef6557 100644 --- a/src/google_breakpad/processor/stackwalker.h +++ b/src/google_breakpad/processor/stackwalker.h @@ -97,6 +97,10 @@ class Stackwalker { } static uint32_t max_frames() { return max_frames_; } + static void set_max_frames_scanned(uint32_t max_frames_scanned) { + max_frames_scanned_ = max_frames_scanned; + } + protected: // system_info identifies the operating system, NULL or empty if unknown. // memory identifies a MemoryRegion that provides the stack memory @@ -203,8 +207,11 @@ class Stackwalker { // return NULL on failure or when there are no more caller frames (when // the end of the stack has been reached). GetCallerFrame allocates a new // StackFrame (or StackFrame subclass), ownership of which is taken by - // the caller. - virtual StackFrame* GetCallerFrame(const CallStack* stack) = 0; + // the caller. |stack_scan_allowed| controls whether stack scanning is + // an allowable frame-recovery method, since it is desirable to be able to + // disable stack scanning in performance-critical use cases. + virtual StackFrame* GetCallerFrame(const CallStack* stack, + bool stack_scan_allowed) = 0; // The maximum number of frames Stackwalker will walk through. // This defaults to 1024 to prevent infinite loops. @@ -214,6 +221,12 @@ class Stackwalker { // it affects whether or not an error message is printed in the case // where an unwind got stopped by the limit. static bool max_frames_set_; + + // The maximum number of stack-scanned and otherwise untrustworthy + // frames allowed. Stack-scanning can be expensive, so the option to + // disable or limit it is helpful in cases where unwind performance is + // important. This defaults to 1024, the same as max_frames_. + static uint32_t max_frames_scanned_; }; } // namespace google_breakpad |