diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-10-29 00:21:50 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-10-29 00:21:50 +0000 |
commit | 51ea0ad7ca5c85ec354116813feb6f75c4b8c918 (patch) | |
tree | 56a39d07db783fadeef24b88f8bc9a83679deaca /lldb/source/Interpreter/CommandInterpreter.cpp | |
parent | 4610ea2bcf1d0d9a23f07caee302fe61a8508c02 (diff) | |
download | bcm5719-llvm-51ea0ad7ca5c85ec354116813feb6f75c4b8c918.tar.gz bcm5719-llvm-51ea0ad7ca5c85ec354116813feb6f75c4b8c918.zip |
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
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index dfb4d5963d7..fb5fc4c9871 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -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; |