aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-02-17 11:48:34 +0000
committerPavel Labath <labath@google.com>2017-02-17 11:48:34 +0000
commita37bbbd43203eb383172e216ce7a979fe7f6e9e8 (patch)
tree9123810b91492c45baa7c5b28fd62debf1309877 /lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp
parent7cab0786bdcca1300cf9150788d3b1f5abd9923c (diff)
downloadllvm-a37bbbd43203eb383172e216ce7a979fe7f6e9e8.tar.gz
llvm-a37bbbd43203eb383172e216ce7a979fe7f6e9e8.tar.bz2
llvm-a37bbbd43203eb383172e216ce7a979fe7f6e9e8.zip
NPL: Fix one more bug in the single step workaround
In the case we are stepping over the thread creation instruction, we will end up calling Thread::SingleStep back-to-back twice (because of the intermediate PTRACE_EVENT_CLONE stop). This will cause the cpu mask to be set inappropriately (because the old SingleStepCheck object will be destroyed after we create the new one), and the single-step will fail. Before the refactor the code was still incorrect in this case, but in a different way (the thread was left with the incorrect mask after the stepping was complete), so this was not easy to spot. This fixes TestCreateDuringInstructionStep on the affected devices. llvm-svn: 295440
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp b/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp
index 48943d6ac936..4e979bd45532 100644
--- a/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp
+++ b/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp
@@ -172,8 +172,9 @@ std::unique_ptr<SingleStepWorkaround> SingleStepWorkaround::Get(::pid_t tid) {
}
SingleStepWorkaround::~SingleStepWorkaround() {
+ Log *log = ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_THREAD);
+ LLDB_LOG(log, "Removing workaround");
if (sched_setaffinity(m_tid, sizeof m_original_set, &m_original_set) != 0) {
- Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
LLDB_LOG(log, "Unable to reset cpu affinity for thread {0}: {1}", m_tid,
Error(errno, eErrorTypePOSIX));
}