[Lldb-commits] [lldb] r218181 - Have CommandObject::CheckRequirements() report the largest missing

Jason Molenda jmolenda at apple.com
Sat Sep 20 02:14:37 PDT 2014


Author: jmolenda
Date: Sat Sep 20 04:14:31 2014
New Revision: 218181

URL: http://llvm.org/viewvc/llvm-project?rev=218181&view=rev
Log:
Have CommandObject::CheckRequirements() report the largest missing
requirement for a command instead of the smallest.  e.g. if a command
requires a Target, Process, Thread, and Frame, and none of those
are available, report the largest -- Target -- as being missing
instead of the smallest -- Frame.

Patch by Paul Osmialowski.

Modified:
    lldb/trunk/source/Interpreter/CommandObject.cpp

Modified: lldb/trunk/source/Interpreter/CommandObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandObject.cpp?rev=218181&r1=218180&r2=218181&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandObject.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandObject.cpp Sat Sep 20 04:14:31 2014
@@ -236,19 +236,34 @@ CommandObject::CheckRequirements (Comman
 
         if ((flags & eFlagRequiresProcess) && !m_exe_ctx.HasProcessScope())
         {
-            result.AppendError (GetInvalidProcessDescription());
+            if (!m_exe_ctx.HasTargetScope())
+                result.AppendError (GetInvalidTargetDescription());
+            else
+                result.AppendError (GetInvalidProcessDescription());
             return false;
         }
         
         if ((flags & eFlagRequiresThread) && !m_exe_ctx.HasThreadScope())
         {
-            result.AppendError (GetInvalidThreadDescription());
+            if (!m_exe_ctx.HasTargetScope())
+                result.AppendError (GetInvalidTargetDescription());
+            else if (!m_exe_ctx.HasProcessScope())
+                result.AppendError (GetInvalidProcessDescription());
+            else 
+                result.AppendError (GetInvalidThreadDescription());
             return false;
         }
         
         if ((flags & eFlagRequiresFrame) && !m_exe_ctx.HasFrameScope())
         {
-            result.AppendError (GetInvalidFrameDescription());
+            if (!m_exe_ctx.HasTargetScope())
+                result.AppendError (GetInvalidTargetDescription());
+            else if (!m_exe_ctx.HasProcessScope())
+                result.AppendError (GetInvalidProcessDescription());
+            else if (!m_exe_ctx.HasThreadScope())
+                result.AppendError (GetInvalidThreadDescription());
+            else
+                result.AppendError (GetInvalidFrameDescription());
             return false;
         }
         





More information about the lldb-commits mailing list