summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
authorTatyana Krasnukha <tatyana@synopsys.com>2018-08-07 16:46:11 +0000
committerTatyana Krasnukha <tatyana@synopsys.com>2018-08-07 16:46:11 +0000
commitf174259ec2b210a9961f54ab18fd218155c48885 (patch)
tree0fbd25d710f042e751827af6288c2f0028fafa7f /lldb/source/Commands/CommandObjectTarget.cpp
parentbf8fe71b91ae4f2f223c6a7aa7e51c6aa4d6f329 (diff)
downloadbcm5719-llvm-f174259ec2b210a9961f54ab18fd218155c48885.tar.gz
bcm5719-llvm-f174259ec2b210a9961f54ab18fd218155c48885.zip
Check result after setting PC value.
llvm-svn: 339153
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 4ef3fdd545a..60c80904ad7 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -2740,10 +2740,15 @@ protected:
}
if (set_pc) {
ThreadList &thread_list = process->GetThreadList();
- ThreadSP curr_thread(thread_list.GetSelectedThread());
RegisterContextSP reg_context(
- curr_thread->GetRegisterContext());
- reg_context->SetPC(file_entry.GetLoadAddress(target));
+ thread_list.GetSelectedThread()->GetRegisterContext());
+ addr_t file_entry_addr = file_entry.GetLoadAddress(target);
+ if (!reg_context->SetPC(file_entry_addr)) {
+ result.AppendErrorWithFormat("failed to set PC value to "
+ "0x%" PRIx64 "\n",
+ file_entry_addr);
+ result.SetStatus(eReturnStatusFailed);
+ }
}
}
} else {
OpenPOWER on IntegriCloud