[Lldb-commits] [lldb] ceccbb8 - Revert "[lldb] [gdb-remote client] Remove breakpoints throughout vfork"

Michał Górny via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 31 23:53:40 PDT 2021


Author: Michał Górny
Date: 2021-09-01T08:53:35+02:00
New Revision: ceccbb8145c87d62c4a796d7b2a380083cf32331

URL: https://github.com/llvm/llvm-project/commit/ceccbb8145c87d62c4a796d7b2a380083cf32331
DIFF: https://github.com/llvm/llvm-project/commit/ceccbb8145c87d62c4a796d7b2a380083cf32331.diff

LOG: Revert "[lldb] [gdb-remote client] Remove breakpoints throughout vfork"

This reverts commit 199344d832c1bed1d75b1db2c1493e5a3e5c5544.
It caused regressions on arm, as reported by lldb-arm-ubuntu buildbot.

Added: 
    

Modified: 
    lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h

Removed: 
    lldb/test/Shell/Subprocess/vfork-follow-parent-softbp.test


################################################################################
diff  --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index aa5b67633df64..f81e2acf3e17a 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -265,8 +265,7 @@ ProcessGDBRemote::ProcessGDBRemote(lldb::TargetSP target_sp,
       m_waiting_for_attach(false), m_destroy_tried_resuming(false),
       m_command_sp(), m_breakpoint_pc_offset(0),
       m_initial_tid(LLDB_INVALID_THREAD_ID), m_replay_mode(false),
-      m_allow_flash_writes(false), m_erased_flash_ranges(),
-      m_vfork_in_progress(false) {
+      m_allow_flash_writes(false), m_erased_flash_ranges() {
   m_async_broadcaster.SetEventName(eBroadcastBitAsyncThreadShouldExit,
                                    "async thread should exit");
   m_async_broadcaster.SetEventName(eBroadcastBitAsyncContinue,
@@ -5535,13 +5534,6 @@ void ProcessGDBRemote::DidFork(lldb::pid_t child_pid, lldb::tid_t child_tid) {
 void ProcessGDBRemote::DidVFork(lldb::pid_t child_pid, lldb::tid_t child_tid) {
   Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
 
-  assert(!m_vfork_in_progress);
-  m_vfork_in_progress = true;
-
-  // Disable all software breakpoints for the duration of vfork.
-  if (m_gdb_comm.SupportsGDBStoppointPacket(eBreakpointSoftware))
-    DidForkSwitchSoftwareBreakpoints(false);
-
   LLDB_LOG(log, "Detaching forked child {0}", child_pid);
   Status error = m_gdb_comm.Detach(false, child_pid);
   if (error.Fail()) {
@@ -5551,12 +5543,3 @@ void ProcessGDBRemote::DidVFork(lldb::pid_t child_pid, lldb::tid_t child_tid) {
       return;
   }
 }
-
-void ProcessGDBRemote::DidVForkDone() {
-  assert(m_vfork_in_progress);
-  m_vfork_in_progress = false;
-
-  // Reenable all software breakpoints that were enabled before vfork.
-  if (m_gdb_comm.SupportsGDBStoppointPacket(eBreakpointSoftware))
-    DidForkSwitchSoftwareBreakpoints(true);
-}

diff  --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
index ae5fce1c8370b..70b3ca1ca3a22 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -232,7 +232,6 @@ class ProcessGDBRemote : public Process,
 
   void DidFork(lldb::pid_t child_pid, lldb::tid_t child_tid) override;
   void DidVFork(lldb::pid_t child_pid, lldb::tid_t child_tid) override;
-  void DidVForkDone() override;
 
 protected:
   friend class ThreadGDBRemote;
@@ -297,8 +296,6 @@ class ProcessGDBRemote : public Process,
   using FlashRange = FlashRangeVector::Entry;
   FlashRangeVector m_erased_flash_ranges;
 
-  bool m_vfork_in_progress;
-
   // Accessors
   bool IsRunning(lldb::StateType state) {
     return state == lldb::eStateRunning || IsStepping(state);

diff  --git a/lldb/test/Shell/Subprocess/vfork-follow-parent-softbp.test b/lldb/test/Shell/Subprocess/vfork-follow-parent-softbp.test
deleted file mode 100644
index f158d1a9c904e..0000000000000
--- a/lldb/test/Shell/Subprocess/vfork-follow-parent-softbp.test
+++ /dev/null
@@ -1,13 +0,0 @@
-# REQUIRES: native
-# UNSUPPORTED: system-darwin
-# UNSUPPORTED: system-windows
-# RUN: %clangxx_host %p/Inputs/fork.cpp -DTEST_FORK=vfork -o %t
-# RUN: %lldb -b -s %s %t | FileCheck %s
-b parent_func
-b child_func
-process launch
-# CHECK-NOT: function run in parent
-# CHECK: stop reason = breakpoint
-continue
-# CHECK: function run in parent
-# CHECK: child exited: 0


        


More information about the lldb-commits mailing list