diff options
author | simon <none@none> | 2015-04-15 15:07:13 -0700 |
---|---|---|
committer | simon <none@none> | 2015-04-15 15:07:13 -0700 |
commit | a219cf1c98527faa0e7addeb9660f679208bb0e7 (patch) | |
tree | 78a14774f7ff79dd92c022caa2d9d68ec85fba85 /indra/llcommon/llstacktrace.cpp | |
parent | b5324afb6f2e45deefb9b79e7e2192bc686b181a (diff) | |
parent | a647b8f1cbab13f07ea889c80df28414bc906129 (diff) |
Merge viewer-release
Diffstat (limited to 'indra/llcommon/llstacktrace.cpp')
-rwxr-xr-x | indra/llcommon/llstacktrace.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/indra/llcommon/llstacktrace.cpp b/indra/llcommon/llstacktrace.cpp index e0e9056380..bbf0e1e141 100755 --- a/indra/llcommon/llstacktrace.cpp +++ b/indra/llcommon/llstacktrace.cpp @@ -125,6 +125,30 @@ bool ll_get_stack_trace(std::vector<std::string>& lines) return false; } +void ll_get_stack_trace_internal(std::vector<std::string>& lines) +{ + const S32 MAX_STACK_DEPTH = 100; + const S32 STRING_NAME_LENGTH = 256; + + HANDLE process = GetCurrentProcess(); + SymInitialize( process, NULL, TRUE ); + + void *stack[MAX_STACK_DEPTH]; + + unsigned short frames = RtlCaptureStackBackTrace_fn( 0, MAX_STACK_DEPTH, stack, NULL ); + SYMBOL_INFO *symbol = (SYMBOL_INFO*)calloc(sizeof(SYMBOL_INFO) + STRING_NAME_LENGTH * sizeof(char), 1); + symbol->MaxNameLen = STRING_NAME_LENGTH-1; + symbol->SizeOfStruct = sizeof(SYMBOL_INFO); + + for(unsigned int i = 0; i < frames; i++) + { + SymFromAddr(process, (DWORD64)(stack[i]), 0, symbol); + lines.push_back(symbol->Name); + } + + free( symbol ); +} + #else bool ll_get_stack_trace(std::vector<std::string>& lines) @@ -132,5 +156,10 @@ bool ll_get_stack_trace(std::vector<std::string>& lines) return false; } +void ll_get_stack_trace_internal(std::vector<std::string>& lines) +{ + +} + #endif |