diff options
3 files changed, 10 insertions, 6 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py b/lldb/packages/Python/lldbsuite/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py index 82ed362ff60..06859470150 100644 --- a/lldb/packages/Python/lldbsuite/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py +++ b/lldb/packages/Python/lldbsuite/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py @@ -16,10 +16,7 @@ from lldbsuite.test import lldbutil class CreateDuringInstructionStepTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - - def setUp(self): - # Call super's setUp(). - TestBase.setUp(self) + NO_DEBUG_INFO_TESTCASE = True @skipUnlessPlatform(['linux']) @expectedFailureAndroid('llvm.org/pr24737', archs=['arm']) diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp index c2e1214b6ca..a50ea7e3d0a 100644 --- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp @@ -225,7 +225,13 @@ Error NativeThreadLinux::SingleStep(uint32_t signo) { MaybeLogStateChange(new_state); m_state = new_state; m_stop_info.reason = StopReason::eStopReasonNone; - m_step_workaround = SingleStepWorkaround::Get(m_tid); + + if(!m_step_workaround) { + // If we already hava a workaround inplace, don't reset it. Otherwise, the + // destructor of the existing instance will run after the new instance has + // fetched the cpu mask, and the thread will end up with the wrong mask. + m_step_workaround = SingleStepWorkaround::Get(m_tid); + } intptr_t data = 0; if (signo != LLDB_INVALID_SIGNAL_NUMBER) diff --git a/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp b/lldb/source/Plugins/Process/Linux/SingleStepCheck.cpp index 48943d6ac93..4e979bd4553 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)); } |

