summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2012-08-03 22:24:48 +0000
committerEnrico Granata <egranata@apple.com>2012-08-03 22:24:48 +0000
commite2e091bd596cd3b079815dbb82a6919c04f55aa5 (patch)
tree929f705554f1a4f0b5a3c7b5d54559e2c2478d9e
parent1c465892908158b9fe05f873d940996469858307 (diff)
downloadbcm5719-llvm-e2e091bd596cd3b079815dbb82a6919c04f55aa5.tar.gz
bcm5719-llvm-e2e091bd596cd3b079815dbb82a6919c04f55aa5.zip
<rdar://problem/12027563> Making sure that some class of stop-hook commands that involve po'ing objects do not cause an endless recursion
llvm-svn: 161271
-rw-r--r--lldb/include/lldb/Target/Process.h6
-rw-r--r--lldb/source/Expression/ClangFunction.cpp24
-rw-r--r--lldb/source/Target/Target.cpp7
3 files changed, 29 insertions, 8 deletions
diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index 8a1b4c51083..5651521f959 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -1212,6 +1212,12 @@ public:
return m_stop_id != UINT32_MAX;
}
+ bool
+ IsLastResumeForUserExpression () const
+ {
+ return m_resume_id == m_last_user_expression_resume;
+ }
+
void
SetRunningUserExpression (bool on)
{
diff --git a/lldb/source/Expression/ClangFunction.cpp b/lldb/source/Expression/ClangFunction.cpp
index d75f5eb32b9..f716f6731db 100644
--- a/lldb/source/Expression/ClangFunction.cpp
+++ b/lldb/source/Expression/ClangFunction.cpp
@@ -504,13 +504,23 @@ ClangFunction::ExecuteFunction (
call_plan_sp->SetPrivate(true);
- return exe_ctx.GetProcessRef().RunThreadPlan (exe_ctx, call_plan_sp,
- stop_others,
- try_all_threads,
- discard_on_error,
- single_thread_timeout_usec,
- errors);
-}
+ // <rdar://problem/12027563> we need to make sure we record the fact that we are running an expression here
+ // otherwise this fact will fail to be recorded when fetching an Objective-C object description
+ if (exe_ctx.GetProcessPtr())
+ exe_ctx.GetProcessPtr()->SetRunningUserExpression(true);
+
+ ExecutionResults results = exe_ctx.GetProcessRef().RunThreadPlan (exe_ctx, call_plan_sp,
+ stop_others,
+ try_all_threads,
+ discard_on_error,
+ single_thread_timeout_usec,
+ errors);
+
+ if (exe_ctx.GetProcessPtr())
+ exe_ctx.GetProcessPtr()->SetRunningUserExpression(false);
+
+ return results;
+}
ExecutionResults
ClangFunction::ExecuteFunction(
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 81601749a3d..95a13cfe6ae 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -1935,7 +1935,12 @@ Target::RunStopHooks ()
if (!m_process_sp)
return;
-
+
+ // <rdar://problem/12027563> make sure we check that we are not stopped because of us running a user expression
+ // since in that case we do not want to run the stop-hooks
+ if (m_process_sp->GetModIDRef().IsLastResumeForUserExpression())
+ return;
+
if (m_stop_hooks.empty())
return;
OpenPOWER on IntegriCloud