[Lldb-commits] [lldb] r189058 - add error checking and messages to 'target modules show-unwind' command

Michael Sartain mikesart at valvesoftware.com
Thu Aug 22 13:42:30 PDT 2013


Author: mikesart
Date: Thu Aug 22 15:42:30 2013
New Revision: 189058

URL: http://llvm.org/viewvc/llvm-project?rev=189058&view=rev
Log:
add error checking and messages to 'target modules show-unwind' command

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

Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=189058&r1=189057&r2=189058&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Thu Aug 22 15:42:30 2013
@@ -3468,6 +3468,7 @@ public:
                 case 'a':
                 {
                     ExecutionContext exe_ctx (m_interpreter.GetExecutionContext());
+                    m_str = option_arg;
                     m_type = eLookupTypeAddress;
                     m_addr = Args::StringToAddress(&exe_ctx, option_arg, LLDB_INVALID_ADDRESS, &error);
                     if (m_addr == LLDB_INVALID_ADDRESS)
@@ -3481,6 +3482,10 @@ public:
                     m_type = eLookupTypeFunctionOrSymbol;
                     break;
                 }
+
+                default:
+                    error.SetErrorStringWithFormat ("unrecognized option %c.", short_option);
+                    break;
             }
 
             return error;
@@ -3591,8 +3596,21 @@ protected:
                 }
             }
         }
+        else
+        {
+            result.AppendError ("address-expression or function name option must be specified.");
+            result.SetStatus (eReturnStatusFailed);
+            return false;
+        }
 
         size_t num_matches = sc_list.GetSize();
+        if (num_matches == 0)
+        {
+            result.AppendErrorWithFormat ("no unwind data found that matches '%s'.", m_options.m_str.c_str());
+            result.SetStatus (eReturnStatusFailed);
+            return false;
+        }
+
         for (uint32_t idx = 0; idx < num_matches; idx++)
         {
             SymbolContext sc;





More information about the lldb-commits mailing list