summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/API/SBProcess.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2014-03-19 13:11:35 +0000
committeremaste <emaste@FreeBSD.org>2014-03-19 13:11:35 +0000
commit958843c32b7a29741f2e45996b5b3e89f9e108b0 (patch)
tree95ae4ffabc848a86b94be3ad3cd42471cdb66b06 /contrib/llvm/tools/lldb/source/API/SBProcess.cpp
parent2a9993c246f3a2463ccd6b8786781e5b97a35065 (diff)
downloadFreeBSD-src-958843c32b7a29741f2e45996b5b3e89f9e108b0.zip
FreeBSD-src-958843c32b7a29741f2e45996b5b3e89f9e108b0.tar.gz
MFC r258054: Update LLDB to upstream r194122 snapshot
Inludes minor changes relative to upstream, for compatibility with FreeBSD's in-tree LLVM 3.3: - Reverted LLDB r191806, restoring use of previous API. - Reverted part of LLDB r189317, restoring previous enum names. - Work around missing LLVM r192504, using previous registerEHFrames API (limited functionality). - Removed PlatformWindows header include and init/terminate calls. Sponsored by: DARPA, AFRL
Diffstat (limited to 'contrib/llvm/tools/lldb/source/API/SBProcess.cpp')
-rw-r--r--contrib/llvm/tools/lldb/source/API/SBProcess.cpp40
1 files changed, 39 insertions, 1 deletions
diff --git a/contrib/llvm/tools/lldb/source/API/SBProcess.cpp b/contrib/llvm/tools/lldb/source/API/SBProcess.cpp
index 259eb5e..d690da7 100644
--- a/contrib/llvm/tools/lldb/source/API/SBProcess.cpp
+++ b/contrib/llvm/tools/lldb/source/API/SBProcess.cpp
@@ -11,6 +11,9 @@
#include "lldb/API/SBProcess.h"
+// C Includes
+#include <inttypes.h>
+
#include "lldb/lldb-defines.h"
#include "lldb/lldb-types.h"
@@ -23,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"
@@ -334,7 +338,7 @@ SBProcess::PutSTDIN (const char *src, size_t src_len)
}
if (log)
- log->Printf ("SBProcess(%p)::PutSTDIN (src=\"%s\", src_len=%d) => %lu",
+ log->Printf ("SBProcess(%p)::PutSTDIN (src=\"%s\", src_len=%d) => %zu",
process_sp.get(),
src,
(uint32_t) src_len,
@@ -1254,3 +1258,37 @@ SBProcess::UnloadImage (uint32_t image_token)
sb_error.SetErrorString("invalid process");
return sb_error;
}
+
+uint32_t
+SBProcess::GetNumExtendedBacktraceTypes ()
+{
+ ProcessSP process_sp(GetSP());
+ if (process_sp && process_sp->GetSystemRuntime())
+ {
+ SystemRuntime *runtime = process_sp->GetSystemRuntime();
+ return runtime->GetExtendedBacktraceTypes().size();
+ }
+ return 0;
+}
+
+const char *
+SBProcess::GetExtendedBacktraceTypeAtIndex (uint32_t idx)
+{
+ ProcessSP process_sp(GetSP());
+ if (process_sp && process_sp->GetSystemRuntime())
+ {
+ SystemRuntime *runtime = process_sp->GetSystemRuntime();
+ std::vector<ConstString> names = runtime->GetExtendedBacktraceTypes();
+ if (idx < names.size())
+ {
+ return names[idx].AsCString();
+ }
+ else
+ {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+ if (log)
+ log->Printf("SBProcess(%p)::GetExtendedBacktraceTypeAtIndex() => error: requested extended backtrace name out of bounds", process_sp.get());
+ }
+ }
+ return NULL;
+}
OpenPOWER on IntegriCloud