diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-10-05 00:42:59 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-10-05 00:42:59 +0000 |
commit | 80fdd7c0b7378c54da3a9fb13248663f54b8b8ec (patch) | |
tree | 415dc47a876850ad984e7632941923b12195db92 /lldb/source/Interpreter/CommandInterpreter.cpp | |
parent | 324be98a3c86da593534b4917d5c1a18967ad55b (diff) | |
download | bcm5719-llvm-80fdd7c0b7378c54da3a9fb13248663f54b8b8ec.tar.gz bcm5719-llvm-80fdd7c0b7378c54da3a9fb13248663f54b8b8ec.zip |
Fix a problem where the stop-hook command 'frame variable g_val' produces nothing
when newly created threads were subsequently stopped due to breakpoint hit.
The stop-hook mechanism delegates to CommandInterpreter::HandleCommands() to
execuet the commands. Make sure the execution context is switched only once
at the beginning of HandleCommands() only and don't update the context while looping
on each individual command to be executed.
rdar://problem/10228156
llvm-svn: 141144
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index b3b1d3050b0..26d3b82d4be 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -952,7 +952,8 @@ CommandInterpreter::HandleCommand (const char *command_line, bool add_to_history, CommandReturnObject &result, ExecutionContext *override_context, - bool repeat_on_empty_command) + bool repeat_on_empty_command, + bool no_context_switching) { @@ -975,7 +976,8 @@ CommandInterpreter::HandleCommand (const char *command_line, Timer scoped_timer (__PRETTY_FUNCTION__, "Handling command: %s.", command_line); - UpdateExecutionContext (override_context); + if (!no_context_switching) + UpdateExecutionContext (override_context); bool empty_command = false; bool comment_command = false; @@ -1911,7 +1913,12 @@ CommandInterpreter::HandleCommands (const StringList &commands, } CommandReturnObject tmp_result; - bool success = HandleCommand(cmd, false, tmp_result, NULL); + // If override_context is not NULL, pass no_context_switching = true for + // HandleCommand() since we updated our context already. + bool success = HandleCommand(cmd, false, tmp_result, + NULL, /* override_context */ + true, /* repeat_on_empty_command */ + override_context != NULL /* no_context_switching */); if (print_results) { |