OSDN Git Service

[lldb-server] Reset stop reason of all threads when resuming
authorJaroslav Sevcik <jarin@google.com>
Wed, 20 May 2020 08:59:57 +0000 (10:59 +0200)
committerPavel Labath <pavel@labath.sk>
Wed, 20 May 2020 09:08:34 +0000 (11:08 +0200)
commit56de738d18e11c86169f0248b97b2854c37e35ce
treee85a79423471c4ef10d7c0b7cb27b2516046e8fa
parent51446c13f6229561db13718555a1b4993caac209
[lldb-server] Reset stop reason of all threads when resuming

Summary:
This patch makes the stop reason reset logic similar to MacOS' debugserver, where exceptions are reset for all threads when resuming process for stepping or continuing (see [[ https://github.com/llvm/llvm-project/blob/96f3ea0d21b48ca088355db10d4d1a2e9bc9f884/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp#L433 | MachThreadList::ProcessWillResume ]] and [[ https://github.com/llvm/llvm-project/blob/96f3ea0d21b48ca088355db10d4d1a2e9bc9f884/lldb/tools/debugserver/source/MacOSX/MachThread.cpp#L363 | MachThread::ThreadWillResume ]]).

Resetting stop reasons on resume fixes problems where LLDB spuriously reports SIGTRAP signal stop reason for deleted breakpoints (both internal and public) and where  LLDB stops on an internal breakpoint while stepping over while a breakpoint is hit in another thread. See [[ https://bugs.llvm.org/show_bug.cgi?id=45642 | PR45642 ]] for details.

Reviewed By: jingham, labath

Differential Revision: https://reviews.llvm.org/D79308
lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
lldb/source/Plugins/Process/Linux/NativeThreadLinux.h
lldb/test/API/functionalities/thread/break_step_other/Makefile [new file with mode: 0644]
lldb/test/API/functionalities/thread/break_step_other/TestThreadBreakStepOther.py [new file with mode: 0644]
lldb/test/API/functionalities/thread/break_step_other/main.cpp [new file with mode: 0644]