summaryrefslogtreecommitdiff
path: root/indra/llcommon/llstacktrace.cpp
diff options
context:
space:
mode:
authorsimon <none@none>2015-04-15 15:07:13 -0700
committersimon <none@none>2015-04-15 15:07:13 -0700
commita219cf1c98527faa0e7addeb9660f679208bb0e7 (patch)
tree78a14774f7ff79dd92c022caa2d9d68ec85fba85 /indra/llcommon/llstacktrace.cpp
parentb5324afb6f2e45deefb9b79e7e2192bc686b181a (diff)
parenta647b8f1cbab13f07ea889c80df28414bc906129 (diff)
Merge viewer-release
Diffstat (limited to 'indra/llcommon/llstacktrace.cpp')
-rwxr-xr-xindra/llcommon/llstacktrace.cpp29
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