[Lldb-commits] [lldb] r175927 - Correct the logic in DumpCommandHistory when the end index is UINT32_MAX.

Jim Ingham jingham at apple.com
Fri Feb 22 15:23:43 PST 2013


Author: jingham
Date: Fri Feb 22 17:23:42 2013
New Revision: 175927

URL: http://llvm.org/viewvc/llvm-project?rev=175927&view=rev
Log:
Correct the logic in DumpCommandHistory when the end index is UINT32_MAX.

<rdar://problem/13270229>

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

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=175927&r1=175926&r2=175927&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Fri Feb 22 17:23:42 2013
@@ -2796,7 +2796,7 @@ CommandInterpreter::DumpHistory (Stream
 void
 CommandInterpreter::DumpHistory (Stream &stream, uint32_t start, uint32_t end) const
 {
-    const size_t last_idx = std::min<size_t>(m_command_history.size(), end + 1);
+    const size_t last_idx = std::min<size_t>(m_command_history.size(), end==UINT32_MAX ? UINT32_MAX : end + 1);
     for (size_t i = start; i < last_idx; i++)
     {
         if (!m_command_history[i].empty())





More information about the lldb-commits mailing list