pkgsrc-WIP-changes archive

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

lldb-netbsd: Cut down more functions to tread thread like process



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Sat Dec 24 01:17:43 2016 +0100
Changeset:	f4564b21eefeb0a520de92a11a21d836ece1e2b1

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

Log Message:
lldb-netbsd: Cut down more functions to tread thread like process

In NetBSD there is no need to track per-thread status of de-facto process like
in Linux.

Obsolete:
 - NativeThreadNetBSD::SetStoppedBySignal
 - NativeThreadNetBSD::IsStopped
 - NativeThreadNetBSD::SetStopped
 - NativeThreadNetBSD::SetStoppedByExec
 - NativeThreadNetBSD::SetStoppedByBreakpoint
 - NativeThreadNetBSD::SetStoppedByTrace
 - NativeThreadNetBSD::SetStoppedWithNoReason
 - NativeThreadNetBSD::SetExited

Drop prototypes for:
 - NativeThreadNetBSD::MaybePrepareSingleStepWorkaround
 - NativeThreadNetBSD::MaybeCleanupSingleStepWorkaround

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=f4564b21eefeb0a520de92a11a21d836ece1e2b1

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

diffstat:
 lldb-netbsd/distinfo                               |   6 +-
 ..._Plugins_Process_NetBSD_NativeProcessNetBSD.cpp |   6 +-
 ...e_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp | 100 +--------------------
 ...rce_Plugins_Process_NetBSD_NativeThreadNetBSD.h |  29 +-----
 4 files changed, 11 insertions(+), 130 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index 5664772..bbf32fd 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -27,10 +27,10 @@ SHA1 (patch-source_Plugins_Platform_NetBSD_PlatformNetBSD.cpp) = 129e853c1f93f06
 SHA1 (patch-source_Plugins_Platform_NetBSD_PlatformNetBSD.h) = 4327a21e79378b8f35adb07614adb41c37bbaf61
 SHA1 (patch-source_Plugins_Process_CMakeLists.txt) = c0168f81da56d9896eb414e6b8bb7262de04ac33
 SHA1 (patch-source_Plugins_Process_NetBSD_CMakeLists.txt) = df17afdf71c29d945c887e318718904793cd48ad
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = e4e8cbfa5f3ade0dcb7b9b578777386257db2e12
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = da1bc0677701ad844aa39c6d6a1f4ab79eef656f
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = f31a6c671d648f49a67e515706492420dcd75027
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = 255cb19bad19d38e1015b5bd8748ed0fb2c839ed
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = b2c04646c1a871e6c3cd1b539ef7298cf228dd19
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = 05b1accced8403da0a70114c0f4b01faf570340c
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = f6217d48ba65babe63a56b2def14cc8099ca7c5d
 SHA1 (patch-tools_lldb-mi_MICmnBase.cpp) = 851c82ac61e1241018755fbd7236af00379ac986
 SHA1 (patch-tools_lldb-mi_MICmnBase.h) = f550d5e10bcf02fb46472733acdbb820791f22e5
 SHA1 (patch-tools_lldb-mi_MIDriver.cpp) = bf1b5399e82bcfe54d6d852f64ed155328f2064d
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 3b166d5..74c00fc 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
@@ -1,8 +1,8 @@
 $NetBSD$
 
---- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2016-12-21 17:21:58.154060411 +0000
+--- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2016-12-23 23:19:01.279655164 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
-@@ -0,0 +1,1654 @@
+@@ -0,0 +1,1656 @@
 +//===-- NativeProcessNetBSD.cpp -------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -364,12 +364,14 @@ $NetBSD$
 +                uint64_t(pid));
 +
 +  ResolveProcessArchitecture(m_pid, m_arch);
++#if 0
 +  NativeThreadNetBSDSP thread_sp = AddThread(pid);
 +  assert(thread_sp && "AddThread() returned a nullptr thread");
 +  thread_sp->SetStoppedBySignal(SIGSTOP);
 +
 +  // Let our process instance know the thread has stopped.
 +  SetCurrentThreadID(thread_sp->GetID());
++#endif
 +  SetState(StateType::eStateStopped);
 +
 +  if (log) {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
index 7413b4b..4edc9c0 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
@@ -1,8 +1,8 @@
 $NetBSD$
 
---- source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp.orig	2016-12-21 17:21:58.167664787 +0000
+--- source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp.orig	2016-12-23 23:19:01.292866969 +0000
 +++ source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
-@@ -0,0 +1,286 @@
+@@ -0,0 +1,190 @@
 +//===-- NativeThreadNetBSD.cpp --------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -165,102 +165,6 @@ $NetBSD$
 +  return NativeProcessNetBSD::PtraceWrapper(PT_STEP, GetID(), (void *)1, data);
 +}
 +
-+void NativeThreadNetBSD::SetStoppedBySignal(uint32_t signo,
-+                                           const siginfo_t *info) {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
-+  if (log)
-+    log->Printf("NativeThreadNetBSD::%s called with signal 0x%02" PRIx32,
-+                __FUNCTION__, signo);
-+
-+  SetStopped();
-+
-+  m_stop_info.reason = StopReason::eStopReasonSignal;
-+  m_stop_info.details.signal.signo = signo;
-+
-+  m_stop_description.clear();
-+  if (info) {
-+    switch (signo) {
-+    case SIGSEGV:
-+    case SIGBUS:
-+    case SIGFPE:
-+    case SIGILL:
-+      const auto reason =
-+          (info->si_signo == SIGBUS)
-+              ? CrashReason::eInvalidAddress
-+              : GetCrashReason(*info);
-+      m_stop_description = GetCrashReasonString(reason, *info);
-+      break;
-+    }
-+  }
-+}
-+
-+bool NativeThreadNetBSD::IsStopped(int *signo) {
-+  if (!StateIsStoppedState(m_state, false))
-+    return false;
-+
-+  // If we are stopped by a signal, return the signo.
-+  if (signo && m_state == StateType::eStateStopped &&
-+      m_stop_info.reason == StopReason::eStopReasonSignal) {
-+    *signo = m_stop_info.details.signal.signo;
-+  }
-+
-+  // Regardless, we are stopped.
-+  return true;
-+}
-+
-+void NativeThreadNetBSD::SetStopped() {
-+  const StateType new_state = StateType::eStateStopped;
-+  MaybeLogStateChange(new_state);
-+  m_state = new_state;
-+  m_stop_description.clear();
-+}
-+
-+void NativeThreadNetBSD::SetStoppedByExec() {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
-+  if (log)
-+    log->Printf("NativeThreadNetBSD::%s()", __FUNCTION__);
-+
-+  SetStopped();
-+
-+  m_stop_info.reason = StopReason::eStopReasonExec;
-+  m_stop_info.details.signal.signo = SIGSTOP;
-+}
-+
-+void NativeThreadNetBSD::SetStoppedByBreakpoint() {
-+  SetStopped();
-+
-+  m_stop_info.reason = StopReason::eStopReasonBreakpoint;
-+  m_stop_info.details.signal.signo = SIGTRAP;
-+  m_stop_description.clear();
-+}
-+
-+bool NativeThreadNetBSD::IsStoppedAtBreakpoint() {
-+  return GetState() == StateType::eStateStopped &&
-+         m_stop_info.reason == StopReason::eStopReasonBreakpoint;
-+}
-+
-+void NativeThreadNetBSD::SetStoppedByTrace() {
-+  SetStopped();
-+
-+  m_stop_info.reason = StopReason::eStopReasonTrace;
-+  m_stop_info.details.signal.signo = SIGTRAP;
-+}
-+
-+void NativeThreadNetBSD::SetStoppedWithNoReason() {
-+  SetStopped();
-+
-+  m_stop_info.reason = StopReason::eStopReasonNone;
-+  m_stop_info.details.signal.signo = 0;
-+}
-+
-+void NativeThreadNetBSD::SetExited() {
-+  const StateType new_state = StateType::eStateExited;
-+  MaybeLogStateChange(new_state);
-+  m_state = new_state;
-+
-+  m_stop_info.reason = StopReason::eStopReasonThreadExiting;
-+}
-+
 +void NativeThreadNetBSD::MaybeLogStateChange(lldb::StateType new_state) {
 +  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
 +  // If we're not logging, we're done.
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h
index 718847a..640cb14 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h
@@ -1,8 +1,8 @@
 $NetBSD$
 
---- source/Plugins/Process/NetBSD/NativeThreadNetBSD.h.orig	2016-12-21 17:21:58.174128330 +0000
+--- source/Plugins/Process/NetBSD/NativeThreadNetBSD.h.orig	2016-12-23 23:19:01.299120836 +0000
 +++ source/Plugins/Process/NetBSD/NativeThreadNetBSD.h
-@@ -0,0 +1,104 @@
+@@ -0,0 +1,79 @@
 +//===-- NativeThreadNetBSD.h ----------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -61,25 +61,6 @@ $NetBSD$
 +  /// LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread.
 +  Error SingleStep(uint32_t signo);
 +
-+  void SetStoppedBySignal(uint32_t signo, const siginfo_t *info = nullptr);
-+
-+  /// Return true if the thread is stopped.
-+  /// If stopped by a signal, indicate the signo in the signo argument.
-+  /// Otherwise, return LLDB_INVALID_SIGNAL_NUMBER.
-+  bool IsStopped(int *signo);
-+
-+  void SetStoppedByExec();
-+
-+  void SetStoppedByBreakpoint();
-+
-+  bool IsStoppedAtBreakpoint();
-+
-+  void SetStoppedByTrace();
-+
-+  void SetStoppedWithNoReason();
-+
-+  void SetExited();
-+
 +  // ---------------------------------------------------------------------
 +  // Private interface
 +  // ---------------------------------------------------------------------
@@ -87,12 +68,6 @@ $NetBSD$
 +
 +  NativeProcessNetBSD &GetProcess();
 +
-+  void SetStopped();
-+
-+  inline void MaybePrepareSingleStepWorkaround();
-+
-+  inline void MaybeCleanupSingleStepWorkaround();
-+
 +  // ---------------------------------------------------------------------
 +  // Member Variables
 +  // ---------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index