summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadPlanPython.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/ThreadPlanPython.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/ThreadPlanPython.cpp')
-rw-r--r--lldb/source/Target/ThreadPlanPython.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/lldb/source/Target/ThreadPlanPython.cpp b/lldb/source/Target/ThreadPlanPython.cpp
index 8db443b95b2..84b93bdc658 100644
--- a/lldb/source/Target/ThreadPlanPython.cpp
+++ b/lldb/source/Target/ThreadPlanPython.cpp
@@ -31,7 +31,7 @@ using namespace lldb_private;
ThreadPlanPython::ThreadPlanPython(Thread &thread, const char *class_name)
: ThreadPlan(ThreadPlan::eKindPython, "Python based Thread Plan", thread,
eVoteNoOpinion, eVoteNoOpinion),
- m_class_name(class_name) {
+ m_class_name(class_name), m_did_push(false) {
SetIsMasterPlan(true);
SetOkayToDiscard(true);
SetPrivate(false);
@@ -43,20 +43,22 @@ ThreadPlanPython::~ThreadPlanPython() {
}
bool ThreadPlanPython::ValidatePlan(Stream *error) {
- // I have to postpone setting up the implementation till after the constructor
- // because I need to call
- // shared_from_this, which you can't do in the constructor. So I'll do it
- // here.
- if (m_implementation_sp)
+ if (!m_did_push)
return true;
- else
+
+ if (!m_implementation_sp) {
+ if (error)
+ error->Printf("Python thread plan does not have an implementation");
return false;
+ }
+
+ return true;
}
void ThreadPlanPython::DidPush() {
// We set up the script side in DidPush, so that it can push other plans in
// the constructor, and doesn't have to care about the details of DidPush.
-
+ m_did_push = true;
if (!m_class_name.empty()) {
ScriptInterpreter *script_interp = m_thread.GetProcess()
->GetTarget()
OpenPOWER on IntegriCloud