summaryrefslogtreecommitdiff
path: root/indra/llcommon/llstacktrace.cpp
diff options
context:
space:
mode:
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