diff options
author | Aliaksey Kandratsenka <alk@tut.by> | 2014-02-08 15:30:36 -0800 |
---|---|---|
committer | Aliaksey Kandratsenka <alk@tut.by> | 2014-02-16 19:22:06 -0800 |
commit | 90ba15d1f2f6704af96f62ce1e8c5f214697bab1 (patch) | |
tree | 52c0481abd9ad93aa9ee7dd603335cc2b7dd966d /src/stacktrace_win32-inl.h | |
parent | 33f6781d64af88ea23698a084188d8c2ab94ecb1 (diff) | |
download | gperftools-90ba15d1f2f6704af96f62ce1e8c5f214697bab1.tar.gz |
issue-604: implement runtime-selectable stacktrace capturing
We're now building all supported stacktrace capturing methods. And
there's now a way to select at runtime which method is used.
Diffstat (limited to 'src/stacktrace_win32-inl.h')
-rw-r--r-- | src/stacktrace_win32-inl.h | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/src/stacktrace_win32-inl.h b/src/stacktrace_win32-inl.h index 6c473fa..663e9a5 100644 --- a/src/stacktrace_win32-inl.h +++ b/src/stacktrace_win32-inl.h @@ -71,22 +71,37 @@ static RtlCaptureStackBackTrace_Function* const RtlCaptureStackBackTrace_fn = (RtlCaptureStackBackTrace_Function*) GetProcAddress(GetModuleHandleA("ntdll.dll"), "RtlCaptureStackBackTrace"); -PERFTOOLS_DLL_DECL int GetStackTrace(void** result, int max_depth, - int skip_count) { +static int GetStackTrace_win32(void** result, int max_depth, + int skip_count) { if (!RtlCaptureStackBackTrace_fn) { // TODO(csilvers): should we log an error here? return 0; // can't find a stacktrace with no function to call } - return (int)RtlCaptureStackBackTrace_fn(skip_count + 2, max_depth, + return (int)RtlCaptureStackBackTrace_fn(skip_count + 3, max_depth, result, 0); } -PERFTOOLS_DLL_DECL int GetStackFrames(void** /* pcs */, - int* /* sizes */, - int /* max_depth */, - int /* skip_count */) { +static int not_implemented(void) { assert(0 == "Not yet implemented"); return 0; } +static int GetStackFrames_win32(void** /* pcs */, + int* /* sizes */, + int /* max_depth */, + int /* skip_count */) { + return not_implemented(); +} + +static int GetStackFramesWithContext_win32(void** result, int* sizes, int max_depth, + int skip_count, const void *uc) { + return not_implemented(); +} + +static int GetStackTraceWithContext_win32(void** result, int max_depth, + int skip_count, const void *uc) { + return not_implemented(); +} + + #endif // BASE_STACKTRACE_WIN32_INL_H_ |