summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadPlanStepInstruction.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-11-15 01:18:15 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-11-15 01:18:15 +0000
commite103ae92ef2336854587778bd3ae88a87e409a5e (patch)
treea474b4d1db388480dd129f0ab61a690a4f504ca5 /lldb/source/Target/ThreadPlanStepInstruction.cpp
parentdf14b94243e9e8ade2747e6adb8a3d9d2cfa71ae (diff)
downloadbcm5719-llvm-e103ae92ef2336854587778bd3ae88a87e409a5e.tar.gz
bcm5719-llvm-e103ae92ef2336854587778bd3ae88a87e409a5e.zip
Add setting to require hardware breakpoints.
When debugging read-only memory we cannot use software breakpoint. We already have support for hardware breakpoints and users can specify them with `-H`. However, there's no option to force LLDB to use hardware breakpoints internally, for example while stepping. This patch adds a setting target.require-hardware-breakpoint that forces LLDB to always use hardware breakpoints. Because hardware breakpoints are a limited resource and can fail to resolve, this patch also extends error handling in thread plans, where breakpoints are used for stepping. Differential revision: https://reviews.llvm.org/D54221 llvm-svn: 346920
Diffstat (limited to 'lldb/source/Target/ThreadPlanStepInstruction.cpp')
-rw-r--r--lldb/source/Target/ThreadPlanStepInstruction.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/lldb/source/Target/ThreadPlanStepInstruction.cpp b/lldb/source/Target/ThreadPlanStepInstruction.cpp
index b2cecf3a121..7707454c979 100644
--- a/lldb/source/Target/ThreadPlanStepInstruction.cpp
+++ b/lldb/source/Target/ThreadPlanStepInstruction.cpp
@@ -53,11 +53,19 @@ void ThreadPlanStepInstruction::SetUpState() {
void ThreadPlanStepInstruction::GetDescription(Stream *s,
lldb::DescriptionLevel level) {
+ auto PrintFailureIfAny = [&]() {
+ if (m_status.Success())
+ return;
+ s->Printf(" failed (%s)", m_status.AsCString());
+ };
+
if (level == lldb::eDescriptionLevelBrief) {
if (m_step_over)
s->Printf("instruction step over");
else
s->Printf("instruction step into");
+
+ PrintFailureIfAny();
} else {
s->Printf("Stepping one instruction past ");
s->Address(m_instruction_addr, sizeof(addr_t));
@@ -68,6 +76,8 @@ void ThreadPlanStepInstruction::GetDescription(Stream *s,
s->Printf(" stepping over calls");
else
s->Printf(" stepping into calls");
+
+ PrintFailureIfAny();
}
}
@@ -188,7 +198,8 @@ bool ThreadPlanStepInstruction::ShouldStop(Event *event_ptr) {
// for now it is safer to run others.
const bool stop_others = false;
m_thread.QueueThreadPlanForStepOutNoShouldStop(
- false, nullptr, true, stop_others, eVoteNo, eVoteNoOpinion, 0);
+ false, nullptr, true, stop_others, eVoteNo, eVoteNoOpinion, 0,
+ m_status);
return false;
} else {
if (log) {
OpenPOWER on IntegriCloud