diff options
author | Jason Molenda <jmolenda@apple.com> | 2013-11-05 11:00:35 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2013-11-05 11:00:35 +0000 |
commit | 8c71337abcc4cb3bf0aa1001e4a7b3ed98ad79d6 (patch) | |
tree | 991767950479311b3794f403271e3f2f075f466d /lldb/source/API/SBProcess.cpp | |
parent | 64582671af2441582c69a0bce264bf70ed00e866 (diff) | |
download | bcm5719-llvm-8c71337abcc4cb3bf0aa1001e4a7b3ed98ad79d6.tar.gz bcm5719-llvm-8c71337abcc4cb3bf0aa1001e4a7b3ed98ad79d6.zip |
Add the GetNumThreadOriginExtendedBacktraceTypes and
GetThreadOriginExtendedBacktraceTypeAtIndex methods to
SBProcess.
Add documentation for the GetQueueName and GetQueueID methods
to SBThread.
<rdar://problem/15314369>
llvm-svn: 194063
Diffstat (limited to 'lldb/source/API/SBProcess.cpp')
-rw-r--r-- | lldb/source/API/SBProcess.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp index 8f6f1f13183..15b677d5c7b 100644 --- a/lldb/source/API/SBProcess.cpp +++ b/lldb/source/API/SBProcess.cpp @@ -26,6 +26,7 @@ #include "lldb/Core/StreamFile.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" +#include "lldb/Target/SystemRuntime.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" @@ -1257,3 +1258,37 @@ SBProcess::UnloadImage (uint32_t image_token) sb_error.SetErrorString("invalid process"); return sb_error; } + +uint32_t +SBProcess::GetNumThreadOriginExtendedBacktraceTypes () +{ + ProcessSP process_sp(GetSP()); + if (process_sp && process_sp->GetSystemRuntime()) + { + SystemRuntime *runtime = process_sp->GetSystemRuntime(); + return runtime->GetThreadOriginExtendedBacktraceTypes().size(); + } + return 0; +} + +const char * +SBProcess::GetThreadOriginExtendedBacktraceTypeAtIndex (uint32_t idx) +{ + ProcessSP process_sp(GetSP()); + if (process_sp && process_sp->GetSystemRuntime()) + { + SystemRuntime *runtime = process_sp->GetSystemRuntime(); + std::vector<ConstString> names = runtime->GetThreadOriginExtendedBacktraceTypes(); + if (idx < names.size()) + { + return names[idx].AsCString(); + } + else + { + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + if (log) + log->Printf("SBProcess(%p)::GetThreadOriginExtendedBacktraceTypeAtIndex() => error: requested extended backtrace name out of bounds", process_sp.get()); + } + } + return NULL; +} |