[Lldb-commits] [lldb] r128064 - in /lldb/trunk/source/Commands: CommandObjectBreakpoint.cpp CommandObjectFile.cpp CommandObjectTarget.cpp

Jim Ingham jingham at apple.com
Mon Mar 21 18:53:33 PDT 2011


Author: jingham
Date: Mon Mar 21 20:53:33 2011
New Revision: 128064

URL: http://llvm.org/viewvc/llvm-project?rev=128064&view=rev
Log:
Clean up a few places where SetOptionValue was using the global optarg, rather than the option_arg value that was passed in.

Modified:
    lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
    lldb/trunk/source/Commands/CommandObjectFile.cpp
    lldb/trunk/source/Commands/CommandObjectTarget.cpp

Modified: lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp?rev=128064&r1=128063&r2=128064&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp Mon Mar 21 20:53:33 2011
@@ -142,12 +142,12 @@
     switch (short_option)
     {
         case 'a':
-            m_load_addr = Args::StringToUInt64(optarg, LLDB_INVALID_ADDRESS, 0);
+            m_load_addr = Args::StringToUInt64(option_arg, LLDB_INVALID_ADDRESS, 0);
             if (m_load_addr == LLDB_INVALID_ADDRESS)
-                m_load_addr = Args::StringToUInt64(optarg, LLDB_INVALID_ADDRESS, 16);
+                m_load_addr = Args::StringToUInt64(option_arg, LLDB_INVALID_ADDRESS, 16);
 
             if (m_load_addr == LLDB_INVALID_ADDRESS)
-                error.SetErrorStringWithFormat ("Invalid address string '%s'.\n", optarg);
+                error.SetErrorStringWithFormat ("Invalid address string '%s'.\n", option_arg);
             break;
 
         case 'c':
@@ -198,16 +198,16 @@
             }
         case 'i':
         {
-            m_ignore_count = Args::StringToUInt32(optarg, UINT32_MAX, 0);
+            m_ignore_count = Args::StringToUInt32(option_arg, UINT32_MAX, 0);
             if (m_ignore_count == UINT32_MAX)
-               error.SetErrorStringWithFormat ("Invalid ignore count '%s'.\n", optarg);
+               error.SetErrorStringWithFormat ("Invalid ignore count '%s'.\n", option_arg);
         }
         break;
         case 't' :
         {
-            m_thread_id = Args::StringToUInt64(optarg, LLDB_INVALID_THREAD_ID, 0);
+            m_thread_id = Args::StringToUInt64(option_arg, LLDB_INVALID_THREAD_ID, 0);
             if (m_thread_id == LLDB_INVALID_THREAD_ID)
-               error.SetErrorStringWithFormat ("Invalid thread id string '%s'.\n", optarg);
+               error.SetErrorStringWithFormat ("Invalid thread id string '%s'.\n", option_arg);
         }
         break;
         case 'T':
@@ -218,9 +218,9 @@
             break;
         case 'x':
         {
-            m_thread_index = Args::StringToUInt32(optarg, UINT32_MAX, 0);
+            m_thread_index = Args::StringToUInt32(option_arg, UINT32_MAX, 0);
             if (m_thread_id == UINT32_MAX)
-               error.SetErrorStringWithFormat ("Invalid thread index string '%s'.\n", optarg);
+               error.SetErrorStringWithFormat ("Invalid thread index string '%s'.\n", option_arg);
             
         }
         break;
@@ -1421,23 +1421,23 @@
             break;
         case 'i':
         {
-            m_ignore_count = Args::StringToUInt32(optarg, UINT32_MAX, 0);
+            m_ignore_count = Args::StringToUInt32(option_arg, UINT32_MAX, 0);
             if (m_ignore_count == UINT32_MAX)
-               error.SetErrorStringWithFormat ("Invalid ignore count '%s'.\n", optarg);
+               error.SetErrorStringWithFormat ("Invalid ignore count '%s'.\n", option_arg);
         }
         break;
         case 't' :
         {
-            if (optarg[0] == '\0')
+            if (option_arg[0] == '\0')
             {
                 m_thread_id = LLDB_INVALID_THREAD_ID;
                 m_thread_id_passed = true;
             }
             else
             {
-                m_thread_id = Args::StringToUInt64(optarg, LLDB_INVALID_THREAD_ID, 0);
+                m_thread_id = Args::StringToUInt64(option_arg, LLDB_INVALID_THREAD_ID, 0);
                 if (m_thread_id == LLDB_INVALID_THREAD_ID)
-                   error.SetErrorStringWithFormat ("Invalid thread id string '%s'.\n", optarg);
+                   error.SetErrorStringWithFormat ("Invalid thread id string '%s'.\n", option_arg);
                 else
                     m_thread_id_passed = true;
             }
@@ -1459,16 +1459,16 @@
             break;
         case 'x':
         {
-            if (optarg[0] == '\n')
+            if (option_arg[0] == '\n')
             {
                 m_thread_index = UINT32_MAX;
                 m_thread_index_passed = true;
             }
             else
             {
-                m_thread_index = Args::StringToUInt32 (optarg, UINT32_MAX, 0);
+                m_thread_index = Args::StringToUInt32 (option_arg, UINT32_MAX, 0);
                 if (m_thread_id == UINT32_MAX)
-                   error.SetErrorStringWithFormat ("Invalid thread index string '%s'.\n", optarg);
+                   error.SetErrorStringWithFormat ("Invalid thread index string '%s'.\n", option_arg);
                 else
                     m_thread_index_passed = true;
             }

Modified: lldb/trunk/source/Commands/CommandObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFile.cpp?rev=128064&r1=128063&r2=128064&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectFile.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectFile.cpp Mon Mar 21 20:53:33 2011
@@ -62,7 +62,7 @@
                 if (option_arch.IsValid())
                     m_arch = option_arch;
                 else
-                    error.SetErrorStringWithFormat ("Invalid arch string '%s'.\n", optarg);
+                    error.SetErrorStringWithFormat ("Invalid arch string '%s'.\n", option_arg);
             }
             break;
 

Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=128064&r1=128063&r2=128064&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Mon Mar 21 20:53:33 2011
@@ -557,9 +557,9 @@
                 break;
                 case 't' :
                 {
-                    m_thread_id = Args::StringToUInt64(optarg, LLDB_INVALID_THREAD_ID, 0);
+                    m_thread_id = Args::StringToUInt64(option_arg, LLDB_INVALID_THREAD_ID, 0);
                     if (m_thread_id == LLDB_INVALID_THREAD_ID)
-                       error.SetErrorStringWithFormat ("Invalid thread id string '%s'.\n", optarg);
+                       error.SetErrorStringWithFormat ("Invalid thread id string '%s'.\n", option_arg);
                     m_thread_specified = true;
                 }
                 break;
@@ -573,9 +573,9 @@
                     break;
                 case 'x':
                 {
-                    m_thread_index = Args::StringToUInt32(optarg, UINT32_MAX, 0);
+                    m_thread_index = Args::StringToUInt32(option_arg, UINT32_MAX, 0);
                     if (m_thread_id == UINT32_MAX)
-                       error.SetErrorStringWithFormat ("Invalid thread index string '%s'.\n", optarg);
+                       error.SetErrorStringWithFormat ("Invalid thread index string '%s'.\n", option_arg);
                     m_thread_specified = true;
                 }
                 break;





More information about the lldb-commits mailing list