Author: tkrasnukha
Date: Tue Aug 7 09:46:11 2018
New Revision: 339153
URL: http://llvm.org/viewvc/llvm-project?rev=339153&view=rev
Log:
Check result after setting PC value.
Modified:
lldb/trunk/source/Commands/CommandObjectTarget.cpp
Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL:
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=339153&r1=339152&r2=339153&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Tue Aug 7 09:46:11 2018
@@ -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 {
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits