summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common
diff options
context:
space:
mode:
authorJulian Lettner <jlettner@apple.com>2019-03-01 22:10:49 +0000
committerJulian Lettner <jlettner@apple.com>2019-03-01 22:10:49 +0000
commit9fe3b4906f351292691cd594b30fe6cf7230b94d (patch)
treea4ca213e0adbed5feb188084d7709ed93f85385f /compiler-rt/lib/sanitizer_common
parentddc4b7c1d6d4d4ffd8538b40c00c3fb16b1b1ab0 (diff)
downloadbcm5719-llvm-9fe3b4906f351292691cd594b30fe6cf7230b94d.tar.gz
bcm5719-llvm-9fe3b4906f351292691cd594b30fe6cf7230b94d.zip
[NFC][Sanitizer] Make GetStackTrace a private method of BufferedStackTrace
GetStackTrace is a implementation detail of BufferedStackTrace. Make it a private method. Reviewed By: vitalybuka Differential-Revision: https://reviews.llvm.org/D58753 llvm-svn: 355232
Diffstat (limited to 'compiler-rt/lib/sanitizer_common')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
index b62d21385f5..a3a9a418a47 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
@@ -17,11 +17,6 @@
namespace __sanitizer {
struct BufferedStackTrace;
-// Get the stack trace with the given pc and bp.
-// The pc will be in the position 0 of the resulting stack trace.
-// The bp may refer to the current frame or to the caller's frame.
-void GetStackTrace(BufferedStackTrace *stack, uptr max_depth, uptr pc, uptr bp,
- void *context, bool request_fast_unwind);
static const u32 kStackTraceMax = 256;
@@ -104,6 +99,9 @@ struct BufferedStackTrace : public StackTrace {
void Init(const uptr *pcs, uptr cnt, uptr extra_top_pc = 0);
+ // Get the stack trace with the given pc and bp.
+ // The pc will be in the position 0 of the resulting stack trace.
+ // The bp may refer to the current frame or to the caller's frame.
void Unwind(uptr pc, uptr bp, void *context, bool request_fast,
u32 max_depth = kStackTraceMax) {
top_frame_bp = (max_depth > 0) ? bp : 0;
@@ -114,7 +112,7 @@ struct BufferedStackTrace : public StackTrace {
size = max_depth;
return;
}
- GetStackTrace(this, max_depth, pc, bp, context, request_fast);
+ UnwindImpl(pc, bp, context, request_fast, max_depth);
}
void Unwind(u32 max_depth, uptr pc, uptr bp, void *context, uptr stack_top,
@@ -126,10 +124,16 @@ struct BufferedStackTrace : public StackTrace {
}
private:
+ // Every runtime defines its own implementation of this method
+ void UnwindImpl(uptr pc, uptr bp, void *context, bool request_fast,
+ u32 max_depth);
+
+ // UnwindFast/Slow have platform-specific implementations
void UnwindFast(uptr pc, uptr bp, uptr stack_top, uptr stack_bottom,
u32 max_depth);
void UnwindSlow(uptr pc, u32 max_depth);
void UnwindSlow(uptr pc, void *context, u32 max_depth);
+
void PopStackFrames(uptr count);
uptr LocatePcInTrace(uptr pc);
OpenPOWER on IntegriCloud