summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2017-04-12 00:19:54 +0000
committerJim Ingham <jingham@apple.com>2017-04-12 00:19:54 +0000
commitbdbdd229375f1b7c112bb5ecef8aeb603ad8d07f (patch)
treee926f3476911b1b39db27364a4c9df1fc41b0056 /lldb/source/API
parenta76349bffe3ad01cfffbc14f8077ab2df65314aa (diff)
downloadbcm5719-llvm-bdbdd229375f1b7c112bb5ecef8aeb603ad8d07f.tar.gz
bcm5719-llvm-bdbdd229375f1b7c112bb5ecef8aeb603ad8d07f.zip
Teach SBFrame how to guess its language.
<rdar://problem/31411646> llvm-svn: 300012
Diffstat (limited to 'lldb/source/API')
-rw-r--r--lldb/source/API/SBFrame.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp
index d31527450c7..d52bbe8069f 100644
--- a/lldb/source/API/SBFrame.cpp
+++ b/lldb/source/API/SBFrame.cpp
@@ -1370,6 +1370,25 @@ const char *SBFrame::GetFunctionName() {
return static_cast<const SBFrame *>(this)->GetFunctionName();
}
+lldb::LanguageType SBFrame::GuessLanguage() const {
+ std::unique_lock<std::recursive_mutex> lock;
+ ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
+
+ StackFrame *frame = nullptr;
+ Target *target = exe_ctx.GetTargetPtr();
+ Process *process = exe_ctx.GetProcessPtr();
+ if (target && process) {
+ Process::StopLocker stop_locker;
+ if (stop_locker.TryLock(&process->GetRunLock())) {
+ frame = exe_ctx.GetFramePtr();
+ if (frame) {
+ return frame->GuessLanguage();
+ }
+ }
+ }
+ return eLanguageTypeUnknown;
+}
+
const char *SBFrame::GetFunctionName() const {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const char *name = nullptr;
OpenPOWER on IntegriCloud