Enhanced the ObjC DynamicCheckerFunction to test for "object responds to selector" as well as
"object borked"...  Also made the error when the checker fails reflect this fact rather than
report a crash at 0x0.

Also a little cleanup:
- StopInfoMachException had a redundant copy of the description string.
- ThreadPlanCallFunction had a redundant copy of the thread, and had a 
copy of the process that it didn't really need.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@143419 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/ThreadPlanCallFunction.cpp b/source/Target/ThreadPlanCallFunction.cpp
index a5eb4b9..2494c7c 100644
--- a/source/Target/ThreadPlanCallFunction.cpp
+++ b/source/Target/ThreadPlanCallFunction.cpp
@@ -47,9 +47,8 @@
     m_stop_other_threads (stop_other_threads),
     m_function_addr (function),
     m_function_sp (NULL),
-    m_process (thread.GetProcess()),
-    m_thread (thread),
-    m_takedown_done (false)
+    m_takedown_done (false),
+    m_stop_address (LLDB_INVALID_ADDRESS)
 {
     SetOkayToDiscard (discard_on_error);
 
@@ -163,8 +162,6 @@
     m_stop_other_threads (stop_other_threads),
     m_function_addr (function),
     m_function_sp(NULL),
-    m_process (thread.GetProcess()),
-    m_thread (thread),
     m_takedown_done (false)
 {
     SetOkayToDiscard (discard_on_error);
@@ -294,6 +291,7 @@
         if (log)
             log->Printf ("DoTakedown called for thread 0x%4.4llx, m_valid: %d complete: %d.\n", m_thread.GetID(), m_valid, IsPlanComplete());
         m_takedown_done = true;
+        m_stop_address = m_thread.GetStackFrameAtIndex(0)->GetRegisterContext()->GetPC();
         m_real_stop_info_sp = GetPrivateStopReason();
         m_thread.RestoreThreadStateFromCheckpoint(m_stored_thread_state);
         SetPlanComplete();
@@ -324,7 +322,7 @@
     }
     else
     {
-        s->Printf("Thread plan to call 0x%llx", m_function_addr.GetLoadAddress(&m_process.GetTarget()));
+        s->Printf("Thread plan to call 0x%llx", m_function_addr.GetLoadAddress(&m_thread.GetProcess().GetTarget()));
     }
 }
 
@@ -474,8 +472,8 @@
 void
 ThreadPlanCallFunction::SetBreakpoints ()
 {
-    m_cxx_language_runtime = m_process.GetLanguageRuntime(eLanguageTypeC_plus_plus);
-    m_objc_language_runtime = m_process.GetLanguageRuntime(eLanguageTypeObjC);
+    m_cxx_language_runtime = m_thread.GetProcess().GetLanguageRuntime(eLanguageTypeC_plus_plus);
+    m_objc_language_runtime = m_thread.GetProcess().GetLanguageRuntime(eLanguageTypeObjC);
     
     if (m_cxx_language_runtime)
         m_cxx_language_runtime->SetExceptionBreakpoints();