diff options
author | Merov Linden <merov@lindenlab.com> | 2015-04-14 13:46:01 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2015-04-14 13:46:01 -0700 |
commit | d631f2fd4daed5e3b10fc6dc290aa16f3d0591f0 (patch) | |
tree | afc5139a2d530bdca9233308d2b6d6d4532bc6c4 /indra/llcommon/llstacktrace.cpp | |
parent | 5411f349e5ed8835d5c99dbfb19a0934a6e5e28f (diff) | |
parent | a49e11efd9e249cc6d3cf5bcffaafe1e831f2fa9 (diff) |
Pull merge from lindenlab/viewer-tools-update (includes 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 |