[Lldb-commits] [lldb] r118824 - in /lldb/trunk: include/lldb/ include/lldb/Target/ lldb.xcodeproj/ source/Core/ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/ source/Target/

Jim Ingham jingham at apple.com
Thu Nov 11 11:26:09 PST 2010


Author: jingham
Date: Thu Nov 11 13:26:09 2010
New Revision: 118824

URL: http://llvm.org/viewvc/llvm-project?rev=118824&view=rev
Log:
Add ThreadPlanTracer class to allow instruction step tracing of execution.
Also changed eSetVarTypeBool to eSetVarTypeBoolean to make it consistent with eArgTypeBoolean.

Added:
    lldb/trunk/include/lldb/Target/ThreadPlanTracer.h
    lldb/trunk/source/Target/ThreadPlanTracer.cpp
Modified:
    lldb/trunk/include/lldb/Target/Thread.h
    lldb/trunk/include/lldb/Target/ThreadPlan.h
    lldb/trunk/include/lldb/Target/ThreadPlanBase.h
    lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h
    lldb/trunk/include/lldb/Target/ThreadPlanRunToAddress.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepOut.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepRange.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepThrough.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepUntil.h
    lldb/trunk/include/lldb/Target/ThreadPlanTestCondition.h
    lldb/trunk/include/lldb/lldb-enumerations.h
    lldb/trunk/include/lldb/lldb-forward-rtti.h
    lldb/trunk/include/lldb/lldb-forward.h
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/Core/Debugger.cpp
    lldb/trunk/source/Core/UserSettingsController.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
    lldb/trunk/source/Target/Process.cpp
    lldb/trunk/source/Target/Thread.cpp
    lldb/trunk/source/Target/ThreadPlan.cpp
    lldb/trunk/source/Target/ThreadPlanBase.cpp
    lldb/trunk/source/Target/ThreadPlanCallFunction.cpp
    lldb/trunk/source/Target/ThreadPlanRunToAddress.cpp
    lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp
    lldb/trunk/source/Target/ThreadPlanStepOut.cpp
    lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp
    lldb/trunk/source/Target/ThreadPlanStepRange.cpp
    lldb/trunk/source/Target/ThreadPlanStepThrough.cpp
    lldb/trunk/source/Target/ThreadPlanStepUntil.cpp
    lldb/trunk/source/Target/ThreadPlanTestCondition.cpp

Modified: lldb/trunk/include/lldb/Target/Thread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Thread.h (original)
+++ lldb/trunk/include/lldb/Target/Thread.h Thu Nov 11 13:26:09 2010
@@ -20,9 +20,6 @@
 
 #define LLDB_THREAD_MAX_STOP_EXC_DATA 8
 
-// I forward declare these here so I don't have to #include ThreadPlan, so in turn I
-// can use Thread.h in ThreadPlan.h.
-
 namespace lldb_private {
 
 class ThreadInstanceSettings : public InstanceSettings
@@ -64,6 +61,14 @@
 
     static const ConstString &
     StepAvoidRegexpVarName ();
+    
+    bool
+    GetTraceEnabledState()
+    {
+        return m_trace_enabled;
+    }
+    static const ConstString &
+    GetTraceThreadVarName ();
 
 protected:
 
@@ -77,6 +82,7 @@
 private:
 
     std::auto_ptr<RegularExpression> m_avoid_regexp_ap;
+    bool m_trace_enabled;
 };
 
 class Thread :
@@ -590,6 +596,12 @@
     void
     DumpThreadPlans (Stream *s) const;
     
+    void
+    EnableTracer (bool value, bool single_step);
+    
+    void
+    SetTracer (lldb::ThreadPlanTracerSP &tracer_sp);
+    
     //------------------------------------------------------------------
     /// The regular expression returned determines symbols that this
     /// thread won't stop in during "step-in" operations.

Modified: lldb/trunk/include/lldb/Target/ThreadPlan.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlan.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlan.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlan.h Thu Nov 11 13:26:09 2010
@@ -19,6 +19,8 @@
 #include "lldb/Core/UserID.h"
 #include "lldb/Host/Mutex.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Target/ThreadPlanTracer.h"
+#include "lldb/Target/StopInfo.h"
 
 namespace lldb_private {
 
@@ -155,7 +157,7 @@
 //
 //------------------------------------------------------------------
 
-class ThreadPlan:
+class ThreadPlan :
     public UserID
 {
 public:
@@ -247,10 +249,19 @@
 
     virtual bool
     PlanExplainsStop () = 0;
+    
+    bool
+    TracerExplainsStop ()
+    {
+        if (!m_tracer_sp)
+            return false;
+        else
+            return m_tracer_sp->TracerExplainsStop();
+    }
 
 
-    virtual lldb::StateType
-    RunState () = 0;
+    lldb::StateType
+    RunState ();
 
     virtual bool
     ShouldStop (Event *event_ptr) = 0;
@@ -325,6 +336,25 @@
     
     void
     SetPlanComplete ();
+    
+    lldb::ThreadPlanTracerSP &
+    GetThreadPlanTracer()
+    {
+        return m_tracer_sp;
+    }
+    
+    void
+    SetThreadPlanTracer (lldb::ThreadPlanTracerSP new_tracer_sp)
+    {
+        m_tracer_sp = new_tracer_sp;
+    }
+    
+    void
+    DoTraceLog ()
+    {
+        if (m_tracer_sp && m_tracer_sp->TracingEnabled())
+            m_tracer_sp->Log();
+    }
 
 protected:
     //------------------------------------------------------------------
@@ -352,6 +382,10 @@
     {
         m_thread.SetStopInfo (stop_reason_sp);
     }
+    
+    virtual lldb::StateType
+    GetPlanRunState () = 0;
+
 
     Thread &m_thread;
     lldb::Vote m_stop_vote;
@@ -369,6 +403,8 @@
     bool m_plan_complete;
     bool m_plan_private;
     bool m_okay_to_discard;
+    
+    lldb::ThreadPlanTracerSP m_tracer_sp;
 
 private:
     DISALLOW_COPY_AND_ASSIGN(ThreadPlan);

Modified: lldb/trunk/include/lldb/Target/ThreadPlanBase.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanBase.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanBase.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanBase.h Thu Nov 11 13:26:09 2010
@@ -36,7 +36,7 @@
     virtual bool PlanExplainsStop ();
     virtual bool ShouldStop (Event *event_ptr);
     virtual bool StopOthers ();
-    virtual lldb::StateType RunState ();
+    virtual lldb::StateType GetPlanRunState ();
     virtual bool WillStop ();
     virtual bool MischiefManaged ();
 

Modified: lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h Thu Nov 11 13:26:09 2010
@@ -58,7 +58,7 @@
     SetStopOthers (bool new_value);
 
     virtual lldb::StateType
-    RunState ();
+    GetPlanRunState ();
 
     virtual void
     DidPush ();

Modified: lldb/trunk/include/lldb/Target/ThreadPlanRunToAddress.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanRunToAddress.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanRunToAddress.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanRunToAddress.h Thu Nov 11 13:26:09 2010
@@ -59,7 +59,7 @@
     SetStopOthers (bool new_value);
     
     virtual lldb::StateType
-    RunState ();
+    GetPlanRunState ();
 
     virtual bool
     WillStop ();

Modified: lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h Thu Nov 11 13:26:09 2010
@@ -30,7 +30,7 @@
     virtual bool PlanExplainsStop ();
     virtual bool ShouldStop (Event *event_ptr);
     virtual bool StopOthers ();
-    virtual lldb::StateType RunState ();
+    virtual lldb::StateType GetPlanRunState ();
     virtual bool WillStop ();
     virtual bool MischiefManaged ();
 

Modified: lldb/trunk/include/lldb/Target/ThreadPlanStepOut.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanStepOut.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanStepOut.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanStepOut.h Thu Nov 11 13:26:09 2010
@@ -30,7 +30,7 @@
     virtual bool PlanExplainsStop ();
     virtual bool ShouldStop (Event *event_ptr);
     virtual bool StopOthers ();
-    virtual lldb::StateType RunState ();
+    virtual lldb::StateType GetPlanRunState ();
     virtual bool WillResume (lldb::StateType resume_state, bool current_plan);
     virtual bool WillStop ();
     virtual bool MischiefManaged ();

Modified: lldb/trunk/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanStepOverBreakpoint.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanStepOverBreakpoint.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanStepOverBreakpoint.h Thu Nov 11 13:26:09 2010
@@ -30,7 +30,7 @@
     virtual bool PlanExplainsStop ();
     virtual bool ShouldStop (Event *event_ptr);
     virtual bool StopOthers ();
-    virtual lldb::StateType RunState ();
+    virtual lldb::StateType GetPlanRunState ();
     virtual bool WillResume (lldb::StateType resume_state, bool current_plan);
     virtual bool WillStop ();
     virtual bool MischiefManaged ();

Modified: lldb/trunk/include/lldb/Target/ThreadPlanStepRange.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanStepRange.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanStepRange.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanStepRange.h Thu Nov 11 13:26:09 2010
@@ -33,7 +33,7 @@
     virtual bool ShouldStop (Event *event_ptr) = 0;
     virtual lldb::Vote ShouldReportStop (Event *event_ptr);
     virtual bool StopOthers ();
-    virtual lldb::StateType RunState ();
+    virtual lldb::StateType GetPlanRunState ();
     virtual bool WillStop ();
     virtual bool MischiefManaged ();
 

Modified: lldb/trunk/include/lldb/Target/ThreadPlanStepThrough.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanStepThrough.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanStepThrough.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanStepThrough.h Thu Nov 11 13:26:09 2010
@@ -29,7 +29,7 @@
     virtual bool PlanExplainsStop ();
     virtual bool ShouldStop (Event *event_ptr);
     virtual bool StopOthers ();
-    virtual lldb::StateType RunState ();
+    virtual lldb::StateType GetPlanRunState ();
     virtual bool WillResume (lldb::StateType resume_state, bool current_plan);
     virtual bool WillStop ();
     virtual bool MischiefManaged ();

Modified: lldb/trunk/include/lldb/Target/ThreadPlanStepUntil.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanStepUntil.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanStepUntil.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanStepUntil.h Thu Nov 11 13:26:09 2010
@@ -30,7 +30,7 @@
     virtual bool PlanExplainsStop ();
     virtual bool ShouldStop (Event *event_ptr);
     virtual bool StopOthers ();
-    virtual lldb::StateType RunState ();
+    virtual lldb::StateType GetPlanRunState ();
     virtual bool WillResume (lldb::StateType resume_state, bool current_plan);
     virtual bool WillStop ();
     virtual bool MischiefManaged ();

Modified: lldb/trunk/include/lldb/Target/ThreadPlanTestCondition.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanTestCondition.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanTestCondition.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanTestCondition.h Thu Nov 11 13:26:09 2010
@@ -41,7 +41,7 @@
     virtual bool ShouldStop (Event *event_ptr);
     virtual lldb::Vote ShouldReportStop (Event *event_ptr);
     virtual bool StopOthers ();
-    virtual lldb::StateType RunState ();
+    virtual lldb::StateType GetPlanRunState ();
     virtual bool WillStop ();
     virtual bool MischiefManaged ();
     virtual void DidPush ();

Added: lldb/trunk/include/lldb/Target/ThreadPlanTracer.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanTracer.h?rev=118824&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanTracer.h (added)
+++ lldb/trunk/include/lldb/Target/ThreadPlanTracer.h Thu Nov 11 13:26:09 2010
@@ -0,0 +1,81 @@
+//===-- ThreadPlanTracer.h --------------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_ThreadPlanTracer_h_
+#define liblldb_ThreadPlanTracer_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/lldb-private.h"
+#include "lldb/Target/Thread.h"
+
+namespace lldb_private {
+
+class ThreadPlanTracer
+{
+friend class ThreadPlan;
+
+public:
+    ThreadPlanTracer (Thread &thread, lldb::StreamSP &stream_sp);    
+    ThreadPlanTracer (Thread &thread);
+        
+    virtual ~ThreadPlanTracer()
+    {
+    }
+    
+    bool
+    EnableTracing(bool value)
+    {
+        bool old_value = m_enabled;
+        m_enabled = value;
+        return old_value;
+    }
+    
+    bool
+    TracingEnabled()
+    {
+        return m_enabled;
+    }
+    
+    bool
+    EnableSingleStep (bool value)
+    {
+        bool old_value = m_single_step;
+        m_single_step = value;
+        return old_value;
+    }
+    
+    bool 
+    SingleStepEnabled ()
+    {
+        return m_single_step;
+    }
+
+protected:
+    Thread &m_thread;
+
+    Stream *
+    GetLogStream ();
+    
+    virtual void Log();
+    
+private:
+    bool
+    TracerExplainsStop ();
+        
+    bool m_single_step;
+    bool m_enabled;
+    lldb::StreamSP m_stream_sp;
+};
+
+} // namespace lldb_private
+
+#endif  // liblldb_ThreadPlanTracer_h_

Modified: lldb/trunk/include/lldb/lldb-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-enumerations.h Thu Nov 11 13:26:09 2010
@@ -486,7 +486,7 @@
 typedef enum SettableVariableType
 {
     eSetVarTypeInt,
-    eSetVarTypeBool,
+    eSetVarTypeBoolean,
     eSetVarTypeString,
     eSetVarTypeArray,
     eSetVarTypeDictionary,

Modified: lldb/trunk/include/lldb/lldb-forward-rtti.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward-rtti.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-forward-rtti.h (original)
+++ lldb/trunk/include/lldb/lldb-forward-rtti.h Thu Nov 11 13:26:09 2010
@@ -61,6 +61,7 @@
     typedef SharedPtr<lldb_private::Target>::Type TargetSP;
     typedef SharedPtr<lldb_private::Thread>::Type ThreadSP;
     typedef SharedPtr<lldb_private::ThreadPlan>::Type ThreadPlanSP;
+    typedef SharedPtr<lldb_private::ThreadPlanTracer>::Type ThreadPlanTracerSP;
     typedef SharedPtr<lldb_private::Type>::Type TypeSP;
     typedef SharedPtr<lldb_private::FuncUnwinders>::Type FuncUnwindersSP;
     typedef SharedPtr<lldb_private::UserSettingsController>::Type UserSettingsControllerSP;

Modified: lldb/trunk/include/lldb/lldb-forward.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-forward.h (original)
+++ lldb/trunk/include/lldb/lldb-forward.h Thu Nov 11 13:26:09 2010
@@ -135,6 +135,7 @@
 class   ThreadPlanStepOverBreakpoint;
 class   ThreadPlanStepRange;
 class   ThreadPlanStepThrough;
+class   ThreadPlanTracer;
 class   ThreadSpec;
 class   TimeValue;
 class   Type;

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Nov 11 13:26:09 2010
@@ -344,6 +344,8 @@
 		4CB4436C124944B000C13DC2 /* ItaniumABILanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB4436A124944B000C13DC2 /* ItaniumABILanguageRuntime.cpp */; };
 		4CB443BE1249920C00C13DC2 /* CPPLanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB443BC1249920C00C13DC2 /* CPPLanguageRuntime.cpp */; };
 		4CB443F312499B5000C13DC2 /* ObjCLanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB443F212499B5000C13DC2 /* ObjCLanguageRuntime.cpp */; };
+		4CC2A149128C73ED001531C4 /* ThreadPlanTracer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CC2A148128C73ED001531C4 /* ThreadPlanTracer.cpp */; };
+		4CC2A14D128C7409001531C4 /* ThreadPlanTracer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CC2A14C128C7409001531C4 /* ThreadPlanTracer.h */; };
 		69A01E211236C5D400C660B5 /* Condition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69A01E1B1236C5D400C660B5 /* Condition.cpp */; };
 		69A01E221236C5D400C660B5 /* Host.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69A01E1C1236C5D400C660B5 /* Host.cpp */; };
 		69A01E241236C5D400C660B5 /* Mutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69A01E1E1236C5D400C660B5 /* Mutex.cpp */; };
@@ -993,6 +995,8 @@
 		4CB443BC1249920C00C13DC2 /* CPPLanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CPPLanguageRuntime.cpp; path = source/Target/CPPLanguageRuntime.cpp; sourceTree = "<group>"; };
 		4CB443F212499B5000C13DC2 /* ObjCLanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ObjCLanguageRuntime.cpp; path = source/Target/ObjCLanguageRuntime.cpp; sourceTree = "<group>"; };
 		4CB443F612499B6E00C13DC2 /* ObjCLanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjCLanguageRuntime.h; path = include/lldb/Target/ObjCLanguageRuntime.h; sourceTree = "<group>"; };
+		4CC2A148128C73ED001531C4 /* ThreadPlanTracer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanTracer.cpp; path = source/Target/ThreadPlanTracer.cpp; sourceTree = "<group>"; };
+		4CC2A14C128C7409001531C4 /* ThreadPlanTracer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanTracer.h; path = include/lldb/Target/ThreadPlanTracer.h; sourceTree = "<group>"; };
 		4CEDAED311754F5E00E875A6 /* ThreadPlanStepUntil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepUntil.h; path = include/lldb/Target/ThreadPlanStepUntil.h; sourceTree = "<group>"; };
 		4CEE62FA1145F2130064CF93 /* ProcessGDBRemote.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProcessGDBRemote.cpp; path = "source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp"; sourceTree = "<group>"; };
 		4CEE62FB1145F2130064CF93 /* ProcessGDBRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProcessGDBRemote.h; path = "source/Plugins/Process/gdb-remote/ProcessGDBRemote.h"; sourceTree = "<group>"; };
@@ -2073,6 +2077,8 @@
 				2660D9FE11922A7F00958FBD /* ThreadPlanStepUntil.cpp */,
 				4C1AB23E1263E61100D0F04A /* ThreadPlanTestCondition.h */,
 				4C1AB23A1263E5F400D0F04A /* ThreadPlanTestCondition.cpp */,
+				4CC2A14C128C7409001531C4 /* ThreadPlanTracer.h */,
+				4CC2A148128C73ED001531C4 /* ThreadPlanTracer.cpp */,
 				4C08CDEB11C81F1E001610A8 /* ThreadSpec.h */,
 				4C08CDE711C81EF8001610A8 /* ThreadSpec.cpp */,
 				4C00986F11500B4300F316B0 /* UnixSignals.h */,
@@ -2367,6 +2373,7 @@
 				2635DA87127D0D0400675BC1 /* SharingPtr.h in Headers */,
 				4C61978D12823D4300FAFFCC /* AppleObjCRuntime.h in Headers */,
 				4C61978F12823D4300FAFFCC /* AppleObjCRuntimeV1.h in Headers */,
+				4CC2A14D128C7409001531C4 /* ThreadPlanTracer.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -2438,7 +2445,6 @@
 			isa = PBXProject;
 			buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "lldb" */;
 			compatibilityVersion = "Xcode 3.1";
-			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
 				en,
@@ -2869,6 +2875,7 @@
 				4C1AB23B1263E5F400D0F04A /* ThreadPlanTestCondition.cpp in Sources */,
 				4C61978C12823D4300FAFFCC /* AppleObjCRuntime.cpp in Sources */,
 				4C61978E12823D4300FAFFCC /* AppleObjCRuntimeV1.cpp in Sources */,
+				4CC2A149128C73ED001531C4 /* ThreadPlanTracer.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Thu Nov 11 13:26:09 2010
@@ -1681,7 +1681,7 @@
 {   "script-lang",          eSetVarTypeString,      "python",               NULL, false, false, "The script language to be used for evaluating user-written scripts." },
 {   "term-width",           eSetVarTypeInt,         "80"    ,               NULL, false, false, "The maximum number of columns to use for displaying text." },
 {   "thread-format",        eSetVarTypeString,      DEFAULT_THREAD_FORMAT,  NULL, false, false, "The default thread format string to use when displaying thread information." },
-{   "use-external-editor",  eSetVarTypeBool,        "false",                NULL, false, false, "Whether to use an external editor or not." },
-{   "auto-confirm",         eSetVarTypeBool,        "false",                NULL, false, false, "If true all confirmation prompts will receive their default reply." },
+{   "use-external-editor",  eSetVarTypeBoolean,        "false",                NULL, false, false, "Whether to use an external editor or not." },
+{   "auto-confirm",         eSetVarTypeBoolean,        "false",                NULL, false, false, "If true all confirmation prompts will receive their default reply." },
 {   NULL,                   eSetVarTypeNone,        NULL,                   NULL, false, false, NULL }
 };

Modified: lldb/trunk/source/Core/UserSettingsController.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/UserSettingsController.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Core/UserSettingsController.cpp (original)
+++ lldb/trunk/source/Core/UserSettingsController.cpp Thu Nov 11 13:26:09 2010
@@ -1010,7 +1010,7 @@
     {
         case lldb::eSetVarTypeInt:
             return "int";
-        case lldb::eSetVarTypeBool:
+        case lldb::eSetVarTypeBoolean:
             return "boolean";
         case lldb::eSetVarTypeString:
             return "string";
@@ -1520,7 +1520,7 @@
     if (entry == NULL)
         return 0;
 
-    if (entry->var_type == lldb::eSetVarTypeBool)
+    if (entry->var_type == lldb::eSetVarTypeBoolean)
         return UserSettingsController::BooleanMatches (partial_value, word_complete, matches);
     else if (entry->var_type == lldb::eSetVarTypeEnum)
         return UserSettingsController::EnumMatches (partial_value, entry->enum_values, word_complete, matches);

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp Thu Nov 11 13:26:09 2010
@@ -94,7 +94,7 @@
 }
 
 lldb::StateType
-AppleThreadPlanStepThroughObjCTrampoline::RunState ()
+AppleThreadPlanStepThroughObjCTrampoline::GetPlanRunState ()
 {
     return eStateRunning;
 }

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h Thu Nov 11 13:26:09 2010
@@ -50,7 +50,7 @@
 
 
     virtual lldb::StateType
-    RunState ();
+    GetPlanRunState ();
 
     virtual bool
     ShouldStop (Event *event_ptr);

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Thu Nov 11 13:26:09 2010
@@ -2374,7 +2374,7 @@
     { "output-path", eSetVarTypeString,      "/dev/stdout", NULL,       false,  false,  "The file/path to be used by the executable program for writing its output." },
     { "error-path",  eSetVarTypeString,      "/dev/stderr", NULL,       false,  false,  "The file/path to be used by the executable program for writings its error messages." },
     { "plugin",      eSetVarTypeEnum,        NULL         , g_plugins,  false,  false,  "The plugin to be used to run the process." },
-    { "disable-aslr", eSetVarTypeBool,       "true",        NULL,       false,  false, "Disable Address Space Layout Randomization (ASLR)" },
+    { "disable-aslr", eSetVarTypeBoolean,       "true",        NULL,       false,  false, "Disable Address Space Layout Randomization (ASLR)" },
     {  NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
 };
 

Modified: lldb/trunk/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Thu Nov 11 13:26:09 2010
@@ -227,6 +227,9 @@
         DumpThreadPlans(&s);
         log->PutCString (s.GetData());
     }
+    
+    // The top most plan always gets to do the trace log...
+    current_plan->DoTraceLog ();
 
     if (current_plan->PlanExplainsStop())
     {
@@ -268,6 +271,10 @@
         if (over_ride_stop)
             should_stop = false;
     }
+    else if (current_plan->TracerExplainsStop())
+    {
+        return false;
+    }
     else
     {
         // If the current plan doesn't explain the stop, then, find one that
@@ -346,8 +353,11 @@
 {
     if (thread_plan_sp)
     {
+        // If the thread plan doesn't already have a tracer, give it its parent's tracer:
+        if (!thread_plan_sp->GetThreadPlanTracer())
+            thread_plan_sp->SetThreadPlanTracer(m_plan_stack.back()->GetThreadPlanTracer());
         m_plan_stack.push_back (thread_plan_sp);
-
+            
         thread_plan_sp->DidPush();
 
         LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
@@ -489,6 +499,29 @@
     PushPlan (thread_plan_sp);
 }
 
+
+void
+Thread::EnableTracer (bool value, bool single_stepping)
+{
+    int stack_size = m_plan_stack.size();
+    for (int i = 0; i < stack_size; i++)
+    {
+        if (m_plan_stack[i]->GetThreadPlanTracer())
+        {
+            m_plan_stack[i]->GetThreadPlanTracer()->EnableTracing(value);
+            m_plan_stack[i]->GetThreadPlanTracer()->EnableSingleStep(single_stepping);
+        }
+    }
+}
+
+void
+Thread::SetTracer (lldb::ThreadPlanTracerSP &tracer_sp)
+{
+    int stack_size = m_plan_stack.size();
+    for (int i = 0; i < stack_size; i++)
+        m_plan_stack[i]->SetThreadPlanTracer(tracer_sp);
+}
+
 void
 Thread::DiscardThreadPlansUpToPlan (lldb::ThreadPlanSP &up_to_plan_sp)
 {
@@ -936,6 +969,49 @@
 	Thread::GetSettingsController()->RenameInstanceSettings (GetInstanceName().AsCString(), sstr.GetData());
 }
 
+lldb::StackFrameSP
+Thread::GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr)
+{
+    return GetStackFrameList().GetStackFrameSPForStackFramePtr (stack_frame_ptr);
+}
+
+const char *
+Thread::StopReasonAsCString (lldb::StopReason reason)
+{
+    switch (reason)
+    {
+    case eStopReasonInvalid:      return "invalid";
+    case eStopReasonNone:         return "none";
+    case eStopReasonTrace:        return "trace";
+    case eStopReasonBreakpoint:   return "breakpoint";
+    case eStopReasonWatchpoint:   return "watchpoint";
+    case eStopReasonSignal:       return "signal";
+    case eStopReasonException:    return "exception";
+    case eStopReasonPlanComplete: return "plan complete";
+    }
+
+
+    static char unknown_state_string[64];
+    snprintf(unknown_state_string, sizeof (unknown_state_string), "StopReason = %i", reason);
+    return unknown_state_string;
+}
+
+const char *
+Thread::RunModeAsCString (lldb::RunMode mode)
+{
+    switch (mode)
+    {
+    case eOnlyThisThread:     return "only this thread";
+    case eAllThreads:         return "all threads";
+    case eOnlyDuringStepping: return "only during stepping";
+    }
+
+    static char unknown_state_string[64];
+    snprintf(unknown_state_string, sizeof (unknown_state_string), "RunMode = %i", mode);
+    return unknown_state_string;
+}
+
+#pragma mark "Thread::ThreadSettingsController"
 //--------------------------------------------------------------
 // class Thread::ThreadSettingsController
 //--------------------------------------------------------------
@@ -960,13 +1036,15 @@
     return new_settings_sp;
 }
 
+#pragma mark "ThreadInstanceSettings"
 //--------------------------------------------------------------
 // class ThreadInstanceSettings
 //--------------------------------------------------------------
 
 ThreadInstanceSettings::ThreadInstanceSettings (UserSettingsController &owner, bool live_instance, const char *name) :
     InstanceSettings (owner, (name == NULL ? InstanceSettings::InvalidName().AsCString() : name), live_instance), 
-    m_avoid_regexp_ap ()
+    m_avoid_regexp_ap (),
+    m_trace_enabled (false)
 {
     // CopyInstanceSettings is a pure virtual function in InstanceSettings; it therefore cannot be called
     // until the vtables for ThreadInstanceSettings are properly set up, i.e. AFTER all the initializers.
@@ -989,7 +1067,8 @@
 
 ThreadInstanceSettings::ThreadInstanceSettings (const ThreadInstanceSettings &rhs) :
     InstanceSettings (*(Thread::GetSettingsController().get()), CreateInstanceName().AsCString()),
-    m_avoid_regexp_ap ()
+    m_avoid_regexp_ap (),
+    m_trace_enabled (rhs.m_trace_enabled)
 {
     if (m_instance_name != InstanceSettings::GetDefaultName())
     {
@@ -1015,7 +1094,7 @@
         else
             m_avoid_regexp_ap.reset(NULL);
     }
-    
+    m_trace_enabled = rhs.m_trace_enabled;
     return *this;
 }
 
@@ -1044,6 +1123,26 @@
             
         }
     }
+    else if (var_name == GetTraceThreadVarName())
+    {
+        bool success;
+        bool result = Args::StringToBoolean(value, false, &success);
+
+        if (success)
+        {
+            m_trace_enabled = result;
+            if (!pending)
+            {
+                Thread *myself = static_cast<Thread *> (this);
+                myself->EnableTracer(m_trace_enabled, true);
+            }
+        }
+        else
+        {
+            err.SetErrorStringWithFormat ("Bad value \"%s\" for trace-thread, should be Boolean.", value);
+        }
+
+    }
 }
 
 void
@@ -1077,6 +1176,10 @@
         }
 
     }
+    else if (var_name == GetTraceThreadVarName())
+    {
+        value.AppendString(m_trace_enabled ? "true" : "false");
+    }
     else
     {
         if (err)
@@ -1102,9 +1205,17 @@
 const ConstString &
 ThreadInstanceSettings::StepAvoidRegexpVarName ()
 {
-    static ConstString run_args_var_name ("step-avoid-regexp");
+    static ConstString step_avoid_var_name ("step-avoid-regexp");
 
-    return run_args_var_name;
+    return step_avoid_var_name;
+}
+
+const ConstString &
+ThreadInstanceSettings::GetTraceThreadVarName ()
+{
+    static ConstString trace_thread_var_name ("trace-thread");
+
+    return trace_thread_var_name;
 }
 
 //--------------------------------------------------
@@ -1124,47 +1235,6 @@
 {
   //{ "var-name",    var-type,              "default",      enum-table, init'd, hidden, "help-text"},
     { "step-avoid-regexp",  eSetVarTypeString,      "",  NULL,       false,  false,  "A regular expression defining functions step-in won't stop in." },
+    { "trace-thread",  eSetVarTypeBoolean,      "false",  NULL,       false,  false,  "If true, this thread will single-step and log execution." },
     {  NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
 };
-
-lldb::StackFrameSP
-Thread::GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr)
-{
-    return GetStackFrameList().GetStackFrameSPForStackFramePtr (stack_frame_ptr);
-}
-
-const char *
-Thread::StopReasonAsCString (lldb::StopReason reason)
-{
-    switch (reason)
-    {
-    case eStopReasonInvalid:      return "invalid";
-    case eStopReasonNone:         return "none";
-    case eStopReasonTrace:        return "trace";
-    case eStopReasonBreakpoint:   return "breakpoint";
-    case eStopReasonWatchpoint:   return "watchpoint";
-    case eStopReasonSignal:       return "signal";
-    case eStopReasonException:    return "exception";
-    case eStopReasonPlanComplete: return "plan complete";
-    }
-
-
-    static char unknown_state_string[64];
-    snprintf(unknown_state_string, sizeof (unknown_state_string), "StopReason = %i", reason);
-    return unknown_state_string;
-}
-
-const char *
-Thread::RunModeAsCString (lldb::RunMode mode)
-{
-    switch (mode)
-    {
-    case eOnlyThisThread:     return "only this thread";
-    case eAllThreads:         return "all threads";
-    case eOnlyDuringStepping: return "only during stepping";
-    }
-
-    static char unknown_state_string[64];
-    snprintf(unknown_state_string, sizeof (unknown_state_string), "RunMode = %i", mode);
-    return unknown_state_string;
-}

Modified: lldb/trunk/source/Target/ThreadPlan.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlan.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlan.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlan.cpp Thu Nov 11 13:26:09 2010
@@ -13,10 +13,13 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
+#include "lldb/Core/Debugger.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/State.h"
 #include "lldb/Target/RegisterContext.h"
 #include "lldb/Target/Thread.h"
+#include "lldb/Target/Process.h"
+#include "lldb/Target/Target.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -208,3 +211,11 @@
         return m_okay_to_discard;
 }
 
+lldb::StateType
+ThreadPlan::RunState ()
+{
+    if (m_tracer_sp && m_tracer_sp->TracingEnabled() && m_tracer_sp->SingleStepEnabled())
+        return eStateStepping;
+    else
+        return GetPlanRunState();
+}

Modified: lldb/trunk/source/Target/ThreadPlanBase.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanBase.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanBase.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanBase.cpp Thu Nov 11 13:26:09 2010
@@ -35,7 +35,10 @@
 ThreadPlanBase::ThreadPlanBase (Thread &thread) :
     ThreadPlan(ThreadPlan::eKindBase, "base plan", thread, eVoteYes, eVoteNoOpinion)
 {
-
+    // Set the tracer to a default tracer.
+    ThreadPlanTracerSP new_tracer_sp (new ThreadPlanTracer (m_thread));
+    new_tracer_sp->EnableTracing (m_thread.GetTraceEnabledState());
+    SetThreadPlanTracer(new_tracer_sp);
 }
 
 ThreadPlanBase::~ThreadPlanBase ()
@@ -58,7 +61,12 @@
 bool
 ThreadPlanBase::PlanExplainsStop ()
 {
-    return true;
+    // The base plan should defer to its tracer, since by default it
+    // always handles the stop.
+    if (TracerExplainsStop())
+        return false;
+    else
+        return true;
 }
 
 bool
@@ -153,7 +161,7 @@
 }
 
 StateType
-ThreadPlanBase::RunState ()
+ThreadPlanBase::GetPlanRunState ()
 {
     return eStateRunning;
 }

Modified: lldb/trunk/source/Target/ThreadPlanCallFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanCallFunction.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanCallFunction.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanCallFunction.cpp Thu Nov 11 13:26:09 2010
@@ -330,7 +330,7 @@
 }
 
 StateType
-ThreadPlanCallFunction::RunState ()
+ThreadPlanCallFunction::GetPlanRunState ()
 {
     return eStateRunning;
 }

Modified: lldb/trunk/source/Target/ThreadPlanRunToAddress.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanRunToAddress.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanRunToAddress.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanRunToAddress.cpp Thu Nov 11 13:26:09 2010
@@ -201,7 +201,7 @@
 }
 
 StateType
-ThreadPlanRunToAddress::RunState ()
+ThreadPlanRunToAddress::GetPlanRunState ()
 {
     return eStateRunning;
 }

Modified: lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp Thu Nov 11 13:26:09 2010
@@ -162,7 +162,7 @@
 }
 
 StateType
-ThreadPlanStepInstruction::RunState ()
+ThreadPlanStepInstruction::GetPlanRunState ()
 {
     return eStateStepping;
 }

Modified: lldb/trunk/source/Target/ThreadPlanStepOut.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOut.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepOut.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOut.cpp Thu Nov 11 13:26:09 2010
@@ -161,7 +161,7 @@
 }
 
 StateType
-ThreadPlanStepOut::RunState ()
+ThreadPlanStepOut::GetPlanRunState ()
 {
     return eStateRunning;
 }

Modified: lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp Thu Nov 11 13:26:09 2010
@@ -77,7 +77,7 @@
 }
 
 StateType
-ThreadPlanStepOverBreakpoint::RunState ()
+ThreadPlanStepOverBreakpoint::GetPlanRunState ()
 {
     return eStateStepping;
 }

Modified: lldb/trunk/source/Target/ThreadPlanStepRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepRange.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepRange.cpp Thu Nov 11 13:26:09 2010
@@ -226,7 +226,7 @@
 }
 
 StateType
-ThreadPlanStepRange::RunState ()
+ThreadPlanStepRange::GetPlanRunState ()
 {
     return eStateStepping;
 }

Modified: lldb/trunk/source/Target/ThreadPlanStepThrough.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepThrough.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepThrough.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepThrough.cpp Thu Nov 11 13:26:09 2010
@@ -82,7 +82,7 @@
 }
 
 StateType
-ThreadPlanStepThrough::RunState ()
+ThreadPlanStepThrough::GetPlanRunState ()
 {
     return eStateStepping;
 }

Modified: lldb/trunk/source/Target/ThreadPlanStepUntil.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepUntil.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepUntil.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepUntil.cpp Thu Nov 11 13:26:09 2010
@@ -290,7 +290,7 @@
 }
 
 StateType
-ThreadPlanStepUntil::RunState ()
+ThreadPlanStepUntil::GetPlanRunState ()
 {
     return eStateRunning;
 }

Modified: lldb/trunk/source/Target/ThreadPlanTestCondition.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanTestCondition.cpp?rev=118824&r1=118823&r2=118824&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanTestCondition.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanTestCondition.cpp Thu Nov 11 13:26:09 2010
@@ -168,7 +168,7 @@
 }
 
 StateType
-ThreadPlanTestCondition::RunState ()
+ThreadPlanTestCondition::GetPlanRunState ()
 {
     return eStateRunning;
 }

Added: lldb/trunk/source/Target/ThreadPlanTracer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanTracer.cpp?rev=118824&view=auto
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanTracer.cpp (added)
+++ lldb/trunk/source/Target/ThreadPlanTracer.cpp Thu Nov 11 13:26:09 2010
@@ -0,0 +1,77 @@
+//===-- ThreadPlan.cpp ------------------------------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Target/ThreadPlan.h"
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/Debugger.h"
+#include "lldb/Core/Log.h"
+#include "lldb/Core/State.h"
+#include "lldb/Target/RegisterContext.h"
+#include "lldb/Target/Thread.h"
+#include "lldb/Target/Process.h"
+#include "lldb/Target/Target.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+ThreadPlanTracer::ThreadPlanTracer (Thread &thread, lldb::StreamSP &stream_sp) :
+    m_single_step(true),
+    m_enabled (false),
+    m_thread (thread),
+    m_stream_sp (stream_sp)
+{
+}
+
+ThreadPlanTracer::ThreadPlanTracer (Thread &thread) :
+    m_single_step(true),
+    m_enabled (false),
+    m_thread (thread),
+    m_stream_sp ()
+{
+}
+
+Stream *
+ThreadPlanTracer::GetLogStream ()
+{
+    
+    if (m_stream_sp.get())
+        return m_stream_sp.get();
+    else
+        return &(m_thread.GetProcess().GetTarget().GetDebugger().GetOutputStream());
+}
+
+void 
+ThreadPlanTracer::Log()
+{
+    SymbolContext sc;
+    bool show_frame_index = false;
+    bool show_fullpaths = false;
+    
+    m_thread.GetStackFrameAtIndex(0)->Dump (GetLogStream(), show_frame_index, show_fullpaths);
+    GetLogStream()->Printf("\n");
+}
+
+bool
+ThreadPlanTracer::TracerExplainsStop ()
+{
+    if (m_enabled && m_single_step)
+    {
+        lldb::StopInfoSP stop_info = m_thread.GetStopInfo();
+        if (stop_info->GetStopReason() == eStopReasonTrace)
+            return true;
+        else 
+            return false;
+    }
+    else
+        return false;
+}





More information about the lldb-commits mailing list