[Lldb-commits] [lldb] r105899 - in /lldb/trunk: include/lldb/Target/Thread.h include/lldb/Target/ThreadPlanStepInRange.h include/lldb/Target/ThreadPlanStepOverRange.h include/lldb/lldb-types.h lldb.xcodeproj/project.pbxproj source/API/SBThread.cpp source/Commands/CommandObjectThread.cpp source/Target/Thread.cpp

Greg Clayton gclayton at apple.com
Sat Jun 12 11:59:55 PDT 2010


Author: gclayton
Date: Sat Jun 12 13:59:55 2010
New Revision: 105899

URL: http://llvm.org/viewvc/llvm-project?rev=105899&view=rev
Log:
I have eliminated RTTI from LLDB!

Also added a shell script build phase that fixes the headers in 
LLDB.framework.



Modified:
    lldb/trunk/include/lldb/Target/Thread.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepInRange.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepOverRange.h
    lldb/trunk/include/lldb/lldb-types.h
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/API/SBThread.cpp
    lldb/trunk/source/Commands/CommandObjectThread.cpp
    lldb/trunk/source/Target/Thread.cpp

Modified: lldb/trunk/include/lldb/Target/Thread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Thread.h?rev=105899&r1=105898&r2=105899&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Thread.h (original)
+++ lldb/trunk/include/lldb/Target/Thread.h Sat Jun 12 13:59:55 2010
@@ -420,7 +420,8 @@
                                  lldb::StepType type,
                                  const AddressRange &range,
                                  const SymbolContext &addr_context,
-                                 lldb::RunMode stop_other_threads);
+                                 lldb::RunMode stop_other_threads,
+                                 bool avoid_code_without_debug_info);
 
     //------------------------------------------------------------------
     /// Queue the plan used to step out of the function at the current PC of

Modified: lldb/trunk/include/lldb/Target/ThreadPlanStepInRange.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanStepInRange.h?rev=105899&r1=105898&r2=105899&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanStepInRange.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanStepInRange.h Sat Jun 12 13:59:55 2010
@@ -59,7 +59,8 @@
                                          lldb::StepType type,
                                          const AddressRange &range,
                                          const SymbolContext &addr_context,
-                                         lldb::RunMode stop_others);
+                                         lldb::RunMode stop_others,
+                                         bool avoid_code_without_debug_info);
 
 
     // Need an appropriate marker for the current stack so we can tell step out

Modified: lldb/trunk/include/lldb/Target/ThreadPlanStepOverRange.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanStepOverRange.h?rev=105899&r1=105898&r2=105899&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/ThreadPlanStepOverRange.h (original)
+++ lldb/trunk/include/lldb/Target/ThreadPlanStepOverRange.h Sat Jun 12 13:59:55 2010
@@ -45,7 +45,8 @@
                                          lldb::StepType type,
                                          const AddressRange &range,
                                          const SymbolContext &addr_context,
-                                         lldb::RunMode stop_others);
+                                         lldb::RunMode stop_others,
+                                         bool avoid_code_without_debug_info);
 
     DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepOverRange);
 

Modified: lldb/trunk/include/lldb/lldb-types.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-types.h?rev=105899&r1=105898&r2=105899&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-types.h (original)
+++ lldb/trunk/include/lldb/lldb-types.h Sat Jun 12 13:59:55 2010
@@ -12,6 +12,7 @@
 
 #include "lldb/lldb-enumerations.h"
 #include "lldb/lldb-forward.h"
+#include "lldb/Utility/SharingPtr.h"
 
 //----------------------------------------------------------------------
 //----------------------------------------------------------------------
@@ -26,8 +27,6 @@
 #include <stdbool.h>
 #include <unistd.h>
 
-#include "lldb/Utility/SharingPtr.h"
-
 //----------------------------------------------------------------------
 // All host systems must define:
 //  liblldb::condition_t       The native condition type (or a substitute class) for conditions on the host system.

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=105899&r1=105898&r2=105899&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Sat Jun 12 13:59:55 2010
@@ -500,7 +500,7 @@
 		261744771168585B005ADD65 /* SBType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBType.cpp; path = source/API/SBType.cpp; sourceTree = "<group>"; };
 		2617447911685869005ADD65 /* SBType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBType.h; path = include/lldb/API/SBType.h; sourceTree = "<group>"; };
 		261B5A5211C3F2AD00AABD0A /* SharingPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SharingPtr.cpp; path = source/Utility/SharingPtr.cpp; sourceTree = "<group>"; };
-		261B5A5311C3F2AD00AABD0A /* SharingPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharingPtr.h; path = source/Utility/SharingPtr.h; sourceTree = "<group>"; };
+		261B5A5311C3F2AD00AABD0A /* SharingPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharingPtr.h; path = include/lldb/Utility/SharingPtr.h; sourceTree = "<group>"; };
 		261E18CC1148966100BADCD3 /* GDBRemoteRegisterContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GDBRemoteRegisterContext.h; path = "source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h"; sourceTree = "<group>"; };
 		261E18CD1148966100BADCD3 /* GDBRemoteRegisterContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GDBRemoteRegisterContext.cpp; path = "source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp"; sourceTree = "<group>"; };
 		263664921140A4930075843B /* Debugger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Debugger.cpp; path = source/Core/Debugger.cpp; sourceTree = "<group>"; };
@@ -2296,7 +2296,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "cd \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\"\nfor file in *.h\ndo\n\tsed -i '' 's/\\(#include[ ]*\\)\"lldb\\/\\(API\\/\\)\\{0,1\\}\\(.*\\)\"/\\1 <LLDB\\/\\3>/1' \"$file\"\ndone\n";
+			shellScript = "cd \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\"\nfor file in *.h\ndo\n\tsed -i '' 's/\\(#include\\)[ ]*\"lldb\\/\\(API\\/\\)\\{0,1\\}\\(.*\\)\"/\\1 <LLDB\\/\\3>/1' \"$file\"\n\tsed -i '' 's|<LLDB/Utility|<LLDB|' \"$file\"\ndone\n";
 		};
 		26D5B06111B07468009A862E /* Build llvm and clang */ = {
 			isa = PBXShellScriptBuildPhase;
@@ -2755,6 +2755,7 @@
 					"-DSUPPORT_REMOTE_UNWINDING",
 				);
 				OTHER_CPLUSPLUSFLAGS = (
+					"-fno-rtti",
 					"-Wglobal-constructors",
 					"$(OTHER_CFLAGS)",
 				);
@@ -2806,6 +2807,7 @@
 					"-DSUPPORT_REMOTE_UNWINDING",
 				);
 				OTHER_CPLUSPLUSFLAGS = (
+					"-fno-rtti",
 					"-Wglobal-constructors",
 					"$(OTHER_CFLAGS)",
 				);
@@ -2912,6 +2914,7 @@
 					"-DSUPPORT_REMOTE_UNWINDING",
 				);
 				OTHER_CPLUSPLUSFLAGS = (
+					"-fno-rtti",
 					"-Wglobal-constructors",
 					"$(OTHER_CFLAGS)",
 				);

Modified: lldb/trunk/source/API/SBThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBThread.cpp?rev=105899&r1=105898&r2=105899&view=diff
==============================================================================
--- lldb/trunk/source/API/SBThread.cpp (original)
+++ lldb/trunk/source/API/SBThread.cpp Sat Jun 12 13:59:55 2010
@@ -325,7 +325,8 @@
                                                                eStepTypeOver,
                                                                sc.line_entry.range, 
                                                                sc,
-                                                               stop_other_threads);
+                                                               stop_other_threads,
+                                                               false);
                 
             }
             else
@@ -354,24 +355,14 @@
 
         if (frame_sp && frame_sp->HasDebugInformation ())
         {
+            bool avoid_code_without_debug_info = true;
             SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
-            ThreadPlan *new_plan = m_lldb_object_sp->QueueThreadPlanForStepRange (abort_other_plans, 
-                                                                                  eStepTypeInto, 
-                                                                                  sc.line_entry.range, 
-                                                                                  sc, 
-                                                                                  stop_other_threads);
-            if (new_plan)
-            {
-                ThreadPlanStepInRange *real_plan = dynamic_cast<ThreadPlanStepInRange *> (new_plan);
-                if (real_plan)
-                {
-                    bool avoid_no_debug = true;
-                    if (avoid_no_debug)
-                        real_plan->GetFlags().Set (ThreadPlanShouldStopHere::eAvoidNoDebug);
-                    else
-                        real_plan->GetFlags().Clear (ThreadPlanShouldStopHere::eAvoidNoDebug);
-                }
-            }
+            m_lldb_object_sp->QueueThreadPlanForStepRange (abort_other_plans, 
+                                                           eStepTypeInto, 
+                                                           sc.line_entry.range, 
+                                                           sc, 
+                                                           stop_other_threads,
+                                                           avoid_code_without_debug_info);
         }
         else
         {

Modified: lldb/trunk/source/Commands/CommandObjectThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectThread.cpp?rev=105899&r1=105898&r2=105899&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectThread.cpp Sat Jun 12 13:59:55 2010
@@ -512,22 +512,8 @@
                     new_plan = thread->QueueThreadPlanForStepRange (abort_other_plans, m_step_type, 
                                                                     frame->GetSymbolContext(eSymbolContextEverything).line_entry.range, 
                                                                     frame->GetSymbolContext(eSymbolContextEverything), 
-                                                                    stop_other_threads);
-                    if (new_plan)
-                    {
-                        ThreadPlanStepInRange *real_plan = dynamic_cast<ThreadPlanStepInRange *> (new_plan);
-                        if (real_plan)
-                        {
-                            if (m_options.m_avoid_no_debug)
-                            {
-                                real_plan->GetFlags().Set (ThreadPlanShouldStopHere::eAvoidNoDebug);
-                            }
-                            else
-                            {
-                                real_plan->GetFlags().Clear (ThreadPlanShouldStopHere::eAvoidNoDebug);
-                            }
-                        }
-                    }
+                                                                    stop_other_threads,
+                                                                    m_options.m_avoid_no_debug);
                 }
                 else
                     new_plan = thread->QueueThreadPlanForStepSingleInstruction (false, abort_other_plans, bool_stop_other_threads);
@@ -545,7 +531,8 @@
                                                                     m_step_type, 
                                                                     frame->GetSymbolContext(eSymbolContextEverything).line_entry.range, 
                                                                     frame->GetSymbolContext(eSymbolContextEverything), 
-                                                                    stop_other_threads);
+                                                                    stop_other_threads,
+                                                                    false);
                 else
                     new_plan = thread->QueueThreadPlanForStepSingleInstruction (true, 
                                                                                 abort_other_plans, 

Modified: lldb/trunk/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=105899&r1=105898&r2=105899&view=diff
==============================================================================
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Sat Jun 12 13:59:55 2010
@@ -419,9 +419,15 @@
             // Note, don't assume there's a ThreadPlanStepOverBreakpoint, the target may not require anything
             // special to step over a breakpoint.
             
-            ThreadPlan *cur_plan = GetCurrentPlan();
-            ThreadPlanStepOverBreakpoint *step_over_bp = dynamic_cast<ThreadPlanStepOverBreakpoint *> (cur_plan);
-            if (step_over_bp == NULL)
+            // TODO: Jim Ingham -- this is the only place left that does RTTI in
+            // all of LLDB. I am adding a hack right now to let us compile 
+            // without RTTI, but we will need to look at and fix this. Right
+            // now it will always push the breakpoint thread plan which is 
+            // probably wrong. We will need to work around this.
+    
+//            ThreadPlan *cur_plan = GetCurrentPlan();
+//            ThreadPlanStepOverBreakpoint *step_over_bp = dynamic_cast<ThreadPlanStepOverBreakpoint *> (cur_plan);
+//            if (step_over_bp == NULL)
             {
 
                 ThreadPlanSP step_bp_plan_sp (new ThreadPlanStepOverBreakpoint (*this));
@@ -861,11 +867,26 @@
 }
 
 ThreadPlan *
-Thread::QueueThreadPlanForStepRange (bool abort_other_plans, StepType type, const AddressRange &range, const SymbolContext &addr_context, lldb::RunMode stop_other_threads)
+Thread::QueueThreadPlanForStepRange 
+(
+    bool abort_other_plans, 
+    StepType type, 
+    const AddressRange &range, 
+    const SymbolContext &addr_context, 
+    lldb::RunMode stop_other_threads,
+    bool avoid_code_without_debug_info
+)
 {
     ThreadPlanSP thread_plan_sp;
     if (type == eStepTypeInto)
-        thread_plan_sp.reset (new ThreadPlanStepInRange (*this, range, addr_context, stop_other_threads));
+    {
+        ThreadPlanStepInRange *plan = new ThreadPlanStepInRange (*this, range, addr_context, stop_other_threads);
+        if (avoid_code_without_debug_info)
+            plan->GetFlags().Set (ThreadPlanShouldStopHere::eAvoidNoDebug);
+        else
+            plan->GetFlags().Clear (ThreadPlanShouldStopHere::eAvoidNoDebug);
+        thread_plan_sp.reset (plan);
+    }
     else
         thread_plan_sp.reset (new ThreadPlanStepOverRange (*this, range, addr_context, stop_other_threads));
 





More information about the lldb-commits mailing list