diff options
| author | Jim Ingham <jingham@apple.com> | 2011-12-17 01:35:57 +0000 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2011-12-17 01:35:57 +0000 |
| commit | 73ca05a2a0c6ce957f9679e76b35ee06dc1559d4 (patch) | |
| tree | 20b0f08ba2a6812f994fdea521bf436ea25453ce /lldb/source/Core/Debugger.cpp | |
| parent | 903231bc58b27bbd1b74622b013fa277ceaeb16f (diff) | |
| download | bcm5719-llvm-73ca05a2a0c6ce957f9679e76b35ee06dc1559d4.tar.gz bcm5719-llvm-73ca05a2a0c6ce957f9679e76b35ee06dc1559d4.zip | |
Add the ability to capture the return value in a thread's stop info, and print it
as part of the thread format output.
Currently this is only done for the ThreadPlanStepOut.
Add a convenience API ABI::GetReturnValueObject.
Change the ValueObject::EvaluationPoint to BE an ExecutionContextScope, rather than
trying to hand out one of its subsidiary object's pointers. That way this will always
be good.
llvm-svn: 146806
Diffstat (limited to 'lldb/source/Core/Debugger.cpp')
| -rw-r--r-- | lldb/source/Core/Debugger.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index cd86698661a..e33e9412c91 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -1701,6 +1701,23 @@ Debugger::FormatPrompt } } } + else if (::strncmp (var_name_begin, "return-value}", strlen("return-value}")) == 0) + { + StopInfoSP stop_info_sp = thread->GetStopInfo (); + if (stop_info_sp) + { + ValueObjectSP return_valobj_sp = StopInfo::GetReturnValueObject (stop_info_sp); + if (return_valobj_sp) + { + cstr = return_valobj_sp->GetValueAsCString (); + if (cstr && cstr[0]) + { + s.PutCString(cstr); + var_success = true; + } + } + } + } } } } @@ -2562,6 +2579,7 @@ Debugger::SettingsController::global_settings_table[] = MODULE_WITH_FUNC\ FILE_AND_LINE\ "{, stop reason = ${thread.stop-reason}}"\ + "{, return value = ${thread.return-value}}"\ "\\n" //#define DEFAULT_THREAD_FORMAT "thread #${thread.index}: tid = ${thread.id}"\ |

