diff --git a/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp b/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp index d08e99f4844de..698ba0f0f720f 100644 --- a/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp +++ b/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp @@ -780,13 +780,8 @@ StopInfoSP StopInfoMachException::CreateStopReasonWithMachException( // but if it is for another thread, we can just report no reason. We // don't need to worry about stepping over the breakpoint here, that // will be taken care of when the thread resumes and notices that - // there's a breakpoint under the pc. If we have an operating system - // plug-in, we might have set a thread specific breakpoint using the - // operating system thread ID, so we can't make any assumptions about - // the thread ID so we must always report the breakpoint regardless - // of the thread. - if (bp_site_sp->ValidForThisThread(thread) || - thread.GetProcess()->GetOperatingSystem() != nullptr) + // there's a breakpoint under the pc. + if (bp_site_sp->ValidForThisThread(thread)) return StopInfo::CreateStopReasonWithBreakpointSiteID( thread, bp_site_sp->GetID()); else if (is_trace_if_actual_breakpoint_missing) diff --git a/lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py b/lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py index 479c94c231540..3ad7539018d5d 100644 --- a/lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py +++ b/lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py @@ -219,3 +219,12 @@ def run_python_os_step(self): 6, "Make sure we stepped from line 5 to line 6 in main.c", ) + + thread_bp_number = lldbutil.run_break_set_by_source_regexp( + self, "Set tid-specific breakpoint here", num_expected_locations=1 + ) + breakpoint = target.FindBreakpointByID(thread_bp_number) + # This breakpoint should not be hit. + breakpoint.SetThreadID(123) + process.Continue() + self.assertState(process.GetState(), lldb.eStateExited) diff --git a/lldb/test/API/functionalities/plugins/python_os_plugin/main.c b/lldb/test/API/functionalities/plugins/python_os_plugin/main.c index faa6dd58ecd62..deb80027c5e6c 100644 --- a/lldb/test/API/functionalities/plugins/python_os_plugin/main.c +++ b/lldb/test/API/functionalities/plugins/python_os_plugin/main.c @@ -3,5 +3,7 @@ int main (int argc, char const *argv[], char const *envp[]) { puts("stop here"); // Set breakpoint here + puts("hello"); + puts("Set tid-specific breakpoint here"); return 0; }