[Lldb-commits] [lldb] r143260 - /lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Johnny Chen johnny.chen at apple.com
Fri Oct 28 17:21:50 PDT 2011


Author: johnny
Date: Fri Oct 28 19:21:50 2011
New Revision: 143260

URL: http://llvm.org/viewvc/llvm-project?rev=143260&view=rev
Log:
Get a dummy target to allow for calculator mode while processing backticks.
This also helps break the infinite loop caused when target is null.

So that we can have:

$ /Volumes/data/lldb/svn/trunk/build/Debug/lldb
(lldb) itob `0x123 - 0x321` 32 v
 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
 [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0]
(lldb) 

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=143260&r1=143259&r2=143260&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Fri Oct 28 19:21:50 2011
@@ -1070,6 +1070,10 @@
                 std::string expr_str (command, expr_content_start, end_backtick - expr_content_start);
                 
                 Target *target = m_exe_ctx.GetTargetPtr();
+                // Get a dummy target to allow for calculator mode while processing backticks.
+                // This also helps break the infinite loop caused when target is null.
+                if (!target)
+                    target = Host::GetDummyTarget(GetDebugger()).get();
                 if (target)
                 {
                     const bool unwind_on_error = true;





More information about the lldb-commits mailing list