[Lldb-commits] [lldb] r154686 - in /lldb/branches/lldb-platform-work: ./ source/API/SBValue.cpp source/Target/ThreadPlanCallFunction.cpp
Johnny Chen
johnny.chen at apple.com
Fri Apr 13 11:48:07 PDT 2012
Author: johnny
Date: Fri Apr 13 13:48:06 2012
New Revision: 154686
URL: http://llvm.org/viewvc/llvm-project?rev=154686&view=rev
Log:
Merge changes from ToT:
svn merge -r 154671:154683 https://johnny@llvm.org/svn/llvm-project/lldb/trunk .
Modified:
lldb/branches/lldb-platform-work/ (props changed)
lldb/branches/lldb-platform-work/source/API/SBValue.cpp
lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallFunction.cpp
Propchange: lldb/branches/lldb-platform-work/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Apr 13 13:48:06 2012
@@ -1 +1 @@
-/lldb/trunk:154224-154671
+/lldb/trunk:154224-154683
Modified: lldb/branches/lldb-platform-work/source/API/SBValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBValue.cpp?rev=154686&r1=154685&r2=154686&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBValue.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBValue.cpp Fri Apr 13 13:48:06 2012
@@ -293,15 +293,30 @@
SBType
SBValue::GetType()
{
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
SBType sb_type;
lldb::ValueObjectSP value_sp(GetSP());
TypeImplSP type_sp;
if (value_sp)
{
- type_sp.reset (new TypeImpl(ClangASTType (value_sp->GetClangAST(), value_sp->GetClangType())));
- sb_type.SetSP(type_sp);
+ ProcessSP process_sp(value_sp->GetProcessSP());
+ Process::StopLocker stop_locker;
+ if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock()))
+ {
+ if (log)
+ log->Printf ("SBValue(%p)::GetValueDidChange() => error: process is running", value_sp.get());
+ }
+ else
+ {
+ TargetSP target_sp(value_sp->GetTargetSP());
+ if (target_sp)
+ {
+ Mutex::Locker api_locker (target_sp->GetAPIMutex());
+ type_sp.reset (new TypeImpl(ClangASTType (value_sp->GetClangAST(), value_sp->GetClangType())));
+ sb_type.SetSP(type_sp);
+ }
+ }
}
- LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
if (log)
{
if (type_sp)
@@ -453,15 +468,26 @@
lldb::ValueObjectSP value_sp(GetSP());
if (value_sp)
{
- TargetSP target_sp(value_sp->GetTargetSP());
- if (target_sp)
+ ProcessSP process_sp(value_sp->GetProcessSP());
+ Process::StopLocker stop_locker;
+ if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock()))
{
- Mutex::Locker api_locker (target_sp->GetAPIMutex());
- if (value_sp->UpdateValueIfNeeded(true))
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+ if (log)
+ log->Printf ("SBValue(%p)::GetTypeSummary() => error: process is running", value_sp.get());
+ }
+ else
+ {
+ TargetSP target_sp(value_sp->GetTargetSP());
+ if (target_sp)
{
- lldb::TypeFormatImplSP format_sp = value_sp->GetValueFormat();
- if (format_sp)
- format.SetSP(format_sp);
+ Mutex::Locker api_locker (target_sp->GetAPIMutex());
+ if (value_sp->UpdateValueIfNeeded(true))
+ {
+ lldb::TypeFormatImplSP format_sp = value_sp->GetValueFormat();
+ if (format_sp)
+ format.SetSP(format_sp);
+ }
}
}
}
@@ -587,13 +613,29 @@
lldb::ValueObjectSP new_value_sp;
if (value_sp)
{
- TypeImplSP type_sp (type.GetSP());
- if (type.IsValid())
+ ProcessSP process_sp(value_sp->GetProcessSP());
+ Process::StopLocker stop_locker;
+ if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock()))
{
- sb_value = SBValue(value_sp->GetSyntheticChildAtOffset(offset, type_sp->GetClangASTType(), true));
- new_value_sp = sb_value.GetSP();
- if (new_value_sp)
- new_value_sp->SetName(ConstString(name));
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+ if (log)
+ log->Printf ("SBValue(%p)::GetTypeSynthetic() => error: process is running", value_sp.get());
+ }
+ else
+ {
+ TargetSP target_sp(value_sp->GetTargetSP());
+ if (target_sp)
+ {
+ Mutex::Locker api_locker (target_sp->GetAPIMutex());
+ TypeImplSP type_sp (type.GetSP());
+ if (type.IsValid())
+ {
+ sb_value = SBValue(value_sp->GetSyntheticChildAtOffset(offset, type_sp->GetClangASTType(), true));
+ new_value_sp = sb_value.GetSP();
+ if (new_value_sp)
+ new_value_sp->SetName(ConstString(name));
+ }
+ }
}
}
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
Modified: lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallFunction.cpp?rev=154686&r1=154685&r2=154686&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallFunction.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallFunction.cpp Fri Apr 13 13:48:06 2012
@@ -263,6 +263,7 @@
ThreadPlanCallFunction::~ThreadPlanCallFunction ()
{
+ DoTakedown();
}
void
More information about the lldb-commits
mailing list