pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lldb-netbsd: Correct stopped reason on thread reinitialization



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Tue Apr 11 16:35:27 2017 +0200
Changeset:	1dad4750c8e415014c05e36bdb4862e307ca0624

Modified Files:
	lldb-netbsd/distinfo
	lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp

Log Message:
lldb-netbsd: Correct stopped reason on thread reinitialization

Previously wrongly all threads were marked in such scenarios as stopped on exec.

Sponsored by <The NetBSD Foundation>

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=1dad4750c8e415014c05e36bdb4862e307ca0624

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 lldb-netbsd/distinfo                               |  2 +-
 ..._Plugins_Process_NetBSD_NativeProcessNetBSD.cpp | 45 +++++++++++++++++++---
 2 files changed, 40 insertions(+), 7 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index e0a0a8cbee..0407c4f699 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -12,7 +12,7 @@ Size (libcxx-3.6.2.src.tar.xz) = 944020 bytes
 SHA1 (llvm-3.6.2.src.tar.xz) = 7a00257eb2bc9431e4c77c3a36b033072c54bc7e
 RMD160 (llvm-3.6.2.src.tar.xz) = 521cbc5fe2925ea3c6e90c7a31f752a04045c972
 Size (llvm-3.6.2.src.tar.xz) = 12802380 bytes
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = f20a1520d282f40c92408d3106a3bba1027e3069
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = 007a39df150ccb8eaf081e1628487326c5af004d
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.cpp) = abeb0ceb532831404f692f2e25532f81f2a83163
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h) = 30ef94fb108271313ec61cf4d293fe5d9709948b
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp) = f1db97759b1e32cf328ba4573b314f7a823d5c52
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
index ecbac05671..940c000d56 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2017-03-30 22:14:30.000000000 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
-@@ -224,36 +224,75 @@ void NativeProcessNetBSD::MonitorSIGTRAP
+@@ -224,36 +224,78 @@ void NativeProcessNetBSD::MonitorSIGTRAP
        PtraceWrapper(PT_GET_SIGINFO, pid, &info, sizeof(info));
  
    // Get details on the signal raised.
@@ -39,6 +39,9 @@ $NetBSD$
 +    // Let our delegate know we have just exec'd.
 +    NotifyDidExec();
 +
++    for (const auto &thread_sp : m_threads) {
++      static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedByExec();
++    }
 +    SetState(StateType::eStateStopped, true);
 +  } break;
 +  case TRAP_DBREG: {
@@ -98,7 +101,7 @@ $NetBSD$
    }
  }
  
-@@ -328,8 +367,8 @@ Error NativeProcessNetBSD::FixupBreakpoi
+@@ -328,8 +370,8 @@ Error NativeProcessNetBSD::FixupBreakpoi
      return error;
    } else
      LLDB_LOG(log, "breakpoint size: {0}", breakpoint_size);
@@ -109,7 +112,7 @@ $NetBSD$
    const lldb::addr_t initial_pc_addr =
        context_sp->GetPCfromBreakpointLocation();
    lldb::addr_t breakpoint_addr = initial_pc_addr;
-@@ -439,7 +478,7 @@ Error NativeProcessNetBSD::Resume(const 
+@@ -439,7 +481,7 @@ Error NativeProcessNetBSD::Resume(const 
      llvm_unreachable("Unexpected state");
  
    default:
@@ -118,7 +121,7 @@ $NetBSD$
                   "for pid %" PRIu64 ", tid %" PRIu64,
                   __FUNCTION__, StateAsCString(action->state), GetID(),
                   thread_sp->GetID());
-@@ -540,8 +579,8 @@ Error NativeProcessNetBSD::GetMemoryRegi
+@@ -540,8 +582,8 @@ Error NativeProcessNetBSD::GetMemoryRegi
             "descending memory map entries detected, unexpected");
      prev_base_address = proc_entry_info.GetRange().GetRangeBase();
      UNUSED_IF_ASSERT_DISABLED(prev_base_address);
@@ -129,7 +132,7 @@ $NetBSD$
      if (load_addr < proc_entry_info.GetRange().GetRangeBase()) {
        range_info.GetRange().SetRangeBase(load_addr);
        range_info.GetRange().SetByteSize(
-@@ -561,9 +600,8 @@ Error NativeProcessNetBSD::GetMemoryRegi
+@@ -561,9 +603,8 @@ Error NativeProcessNetBSD::GetMemoryRegi
    }
    // If we made it here, we didn't find an entry that contained the given
    // address. Return the
@@ -141,7 +144,7 @@ $NetBSD$
    range_info.GetRange().SetRangeBase(load_addr);
    range_info.GetRange().SetRangeEnd(LLDB_INVALID_ADDRESS);
    range_info.SetReadable(MemoryRegionInfo::OptionalBool::eNo);
-@@ -722,8 +760,8 @@ Error NativeProcessNetBSD::LaunchInferio
+@@ -722,8 +763,8 @@ Error NativeProcessNetBSD::LaunchInferio
      LLDB_LOG(log, "waitpid for inferior failed with %s", error);
  
      // Mark the inferior as invalid.
@@ -152,3 +155,33 @@ $NetBSD$
      SetState(StateType::eStateInvalid);
  
      return error;
+@@ -766,6 +807,10 @@ Error NativeProcessNetBSD::LaunchInferio
+     return error;
+   }
+ 
++  for (const auto &thread_sp : m_threads) {
++    static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(SIGSTOP);
++  }
++
+   /* Set process stopped */
+   SetState(StateType::eStateStopped);
+ 
+@@ -894,6 +939,10 @@ NativeThreadNetBSDSP NativeProcessNetBSD
+     return -1;
+   }
+ 
++  for (const auto &thread_sp : m_threads) {  
++    static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(SIGSTOP);
++  }
++
+   // Let our process instance know the thread has stopped.
+   SetState(StateType::eStateStopped);
+ 
+@@ -1007,7 +1056,6 @@ Error NativeProcessNetBSD::ReinitializeT
+   // Reinitialize from scratch threads and register them in process
+   while (info.pl_lwpid != 0) {
+     NativeThreadNetBSDSP thread_sp = AddThread(info.pl_lwpid);
+-    thread_sp->SetStoppedByExec();
+     error = PtraceWrapper(PT_LWPINFO, GetID(), &info, sizeof(info));
+     if (error.Fail()) {
+       return error;


Home | Main Index | Thread Index | Old Index