[all-commits] [llvm/llvm-project] 3b43f0: [lldb] Check if thread was suspended during previo...

Ilya Bukonkin via All-commits all-commits at lists.llvm.org
Thu Jun 11 15:03:04 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3b43f006294971b8049d4807110032169780e5b8
      https://github.com/llvm/llvm-project/commit/3b43f006294971b8049d4807110032169780e5b8
  Author: Ilya Bukonkin <fallkrum at yahoo.com>
  Date:   2020-06-11 (Thu, 11 Jun 2020)

  Changed paths:
    M lldb/include/lldb/Target/Process.h
    M lldb/source/Target/Process.cpp
    A lldb/test/API/functionalities/thread/ignore_suspended/Makefile
    A lldb/test/API/functionalities/thread/ignore_suspended/TestIgnoreSuspendedThread.py
    A lldb/test/API/functionalities/thread/ignore_suspended/main.cpp
    M lldb/unittests/CMakeLists.txt
    M lldb/unittests/Process/CMakeLists.txt
    A lldb/unittests/Process/ProcessEventDataTest.cpp
    A lldb/unittests/Thread/CMakeLists.txt
    A lldb/unittests/Thread/ThreadTest.cpp

  Log Message:
  -----------
  [lldb] Check if thread was suspended during previous stop added.

Encountered the following situation: Let we started thread T1 and it hit
breakpoint on B1 location. We suspended T1 and continued the process.
Then we started thread T2 which hit for example the same location B1.
This time in a breakpoint callback we decided not to stop returning
false.

Expected result: process continues (as if T2 did not hit breakpoint) its
workflow with T1 still suspended. Actual result: process do stops (as if
T2 callback returned true).

Solution: We need invalidate StopInfo for threads that was previously
suspended just because something that is already inactive can not be the
reason of stop. Thread::GetPrivateStopInfo() may be appropriate place to
do it, because it gets called (through Thread::GetStopInfo()) every time
before process reports stop and user gets chance to change
m_resume_state again i.e if we see m_resume_state == eStateSuspended
it definitely means it was set during previous stop and it also means
this thread can not be stopped again (cos' it was frozen during
previous stop).

Differential revision: https://reviews.llvm.org/D80112




More information about the All-commits mailing list