[Lldb-commits] [lldb] r106377 - in /lldb/trunk/source/Commands: CommandObjectBreakpoint.cpp CommandObjectBreakpoint.h

Jim Ingham jingham at apple.com
Fri Jun 18 21:35:20 PDT 2010


Author: jingham
Date: Fri Jun 18 23:35:20 2010
New Revision: 106377

URL: http://llvm.org/viewvc/llvm-project?rev=106377&view=rev
Log:
Remember whether a queue or thread name were passed into "breakpoint modify" so we can recognize an empty argument as unsetting the option.

Modified:
    lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
    lldb/trunk/source/Commands/CommandObjectBreakpoint.h

Modified: lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp?rev=106377&r1=106376&r2=106377&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp Fri Jun 18 23:35:20 2010
@@ -1095,10 +1095,18 @@
         }
         break;
         case 'T':
-            m_thread_name = option_arg;
+            if (option_arg != NULL)
+                m_thread_name = option_arg;
+            else
+                m_thread_name.clear();
+            m_name_passed = true;
             break;
         case 'q':
-            m_queue_name = option_arg;
+            if (option_arg != NULL)
+                m_queue_name = option_arg;
+            else
+                m_queue_name.clear();
+            m_queue_passed = true;
             break;
         case 'x':
         {
@@ -1127,6 +1135,8 @@
     m_thread_name.clear();
     m_queue_name.clear();
     m_enable_passed = false;
+    m_queue_passed = false;
+    m_name_passed = false;
 }
 
 //-------------------------------------------------------------------------
@@ -1201,10 +1211,10 @@
                         if (m_options.m_thread_index != -1)
                             location->GetLocationOptions()->GetThreadSpec()->SetIndex(m_options.m_thread_index);
                         
-                        if (!m_options.m_thread_name.empty())
+                        if (m_options.m_name_passed)
                             location->GetLocationOptions()->GetThreadSpec()->SetName(m_options.m_thread_name.c_str());
                         
-                        if (!m_options.m_queue_name.empty())
+                        if (m_options.m_queue_passed)
                             location->GetLocationOptions()->GetThreadSpec()->SetQueueName(m_options.m_queue_name.c_str());
                             
                         if (m_options.m_ignore_count != -1)
@@ -1222,10 +1232,10 @@
                     if (m_options.m_thread_index != -1)
                         bp->GetOptions()->GetThreadSpec()->SetIndex(m_options.m_thread_index);
                     
-                    if (!m_options.m_thread_name.empty())
+                    if (m_options.m_name_passed)
                         bp->GetOptions()->GetThreadSpec()->SetName(m_options.m_thread_name.c_str());
                     
-                    if (!m_options.m_queue_name.empty())
+                    if (m_options.m_queue_passed)
                         bp->GetOptions()->GetThreadSpec()->SetQueueName(m_options.m_queue_name.c_str());
                         
                     if (m_options.m_ignore_count != -1)

Modified: lldb/trunk/source/Commands/CommandObjectBreakpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpoint.h?rev=106377&r1=106376&r2=106377&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectBreakpoint.h (original)
+++ lldb/trunk/source/Commands/CommandObjectBreakpoint.h Fri Jun 18 23:35:20 2010
@@ -172,6 +172,8 @@
         std::string m_queue_name;
         bool m_enable_passed;
         bool m_enable_value;
+        bool m_name_passed;
+        bool m_queue_passed;
 
     };
 





More information about the lldb-commits mailing list