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) 

llvm-svn: 143260
This commit is contained in:
Johnny Chen 2011-10-29 00:21:50 +00:00
parent 4610ea2bcf
commit 51ea0ad7ca
1 changed files with 4 additions and 0 deletions

View File

@ -1070,6 +1070,10 @@ CommandInterpreter::PreprocessCommand (std::string &command)
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;