pkgsrc-WIP-changes archive

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

lldb-netbsd: Rip out more dead code or not appropriate now for NetBSD



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Sun Dec 18 03:04:41 2016 +0100
Changeset:	e1e364a563cb7c6a54c4fc649f993eabf0e00321

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

Log Message:
lldb-netbsd: Rip out more dead code or not appropriate now for NetBSD

Kill remnant code for:
  -  ThreadWasCreated
  -  MonitorTrace
  -  MonitorBreakpoint
  -  MonitorWatchpoint
  -  StopRunningThreads
  -  RequestStop

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

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

diffstat:
 lldb-netbsd/distinfo                               |   8 +-
 ..._Plugins_Process_NetBSD_NativeProcessNetBSD.cpp | 101 +--------------------
 ...ce_Plugins_Process_NetBSD_NativeProcessNetBSD.h |  33 +------
 ...e_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp |  28 +-----
 ...rce_Plugins_Process_NetBSD_NativeThreadNetBSD.h |   4 +-
 5 files changed, 8 insertions(+), 166 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index 995d794..09159c4 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -18,14 +18,14 @@ SHA1 (patch-include_lldb_Host_netbsd_Ptrace.h) = 3ef61ded004c2acb81e132dc0e46d0a
 SHA1 (patch-source_CMakeLists.txt) = 5dacabc3f39c23bdfd432b5a4895866157b97aa0
 SHA1 (patch-source_Plugins_Process_CMakeLists.txt) = c0168f81da56d9896eb414e6b8bb7262de04ac33
 SHA1 (patch-source_Plugins_Process_NetBSD_CMakeLists.txt) = 8c1d8274523f6ef4bce90caa6c981160ef930cb9
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = fc7a9b974719ed107025d6c248b7c68843f39624
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = 11641e9c3a5fdf4d9feb098c9c0bb2d9e05aa274
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = 8721193630aba8972204998b535fdb2cd64c7fb9
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = 201c4e5fcc7ac28f4c6d236d60935c0ee91f9259
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.cpp) = 61512fb22cc5d1f4747a6af09d34723809fa8943
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD.h) = 2c45e7cd731a9c41fe14d866f9cd5ef5f838019b
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.cpp) = 601b30ba2a3af18b6a6e8045d5a00415990c0fb1
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeRegisterContextNetBSD__x86__64.h) = b92d756199555c2ba890afa383808ec094266cf1
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = b524655c71f19fe579b68d0fe4802d727518b57b
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = 9ed9cd17600e661c7fc0e53a3ecb4db91fb62566
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = a0b092dfd8f20e692dd0f73866e2f72a9bfe68af
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = 500758493f60ff6c3394f686e3f9affb85fb023e
 SHA1 (patch-source_Plugins_Process_NetBSD_ProcFileReader.cpp) = dff1193e16aa79d8a577a3db4a9056521911d6f1
 SHA1 (patch-source_Plugins_Process_NetBSD_ProcFileReader.h) = c8393049c7303b466d3ce98ec5581a3155b71aff
 SHA1 (patch-source_Plugins_Process_NetBSD_Procfs.h) = 5994fa837260136b78cd0b4988dafc6f96ca1e3d
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 ba22c24..f667e6b 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	2016-12-17 13:23:23.782610208 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
-@@ -0,0 +1,1949 @@
+@@ -0,0 +1,1850 @@
 +//===-- NativeProcessNetBSD.cpp -------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -368,7 +368,6 @@ $NetBSD$
 +  NativeThreadNetBSDSP thread_sp = AddThread(pid);
 +  assert(thread_sp && "AddThread() returned a nullptr thread");
 +  thread_sp->SetStoppedBySignal(SIGSTOP);
-+  ThreadWasCreated(*thread_sp);
 +
 +  // Let our process instance know the thread has stopped.
 +  SetCurrentThreadID(thread_sp->GetID());
@@ -564,61 +563,6 @@ $NetBSD$
 +
 +  new_thread_sp = AddThread(tid);
 +  ResumeThread(*new_thread_sp, eStateRunning, LLDB_INVALID_SIGNAL_NUMBER);
-+  ThreadWasCreated(*new_thread_sp);
-+}
-+
-+void NativeProcessNetBSD::MonitorTrace(NativeThreadNetBSD &thread) {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
-+  if (log)
-+    log->Printf("NativeProcessNetBSD::%s() received trace event, pid = %" PRIu64
-+                " (single stepping)",
-+                __FUNCTION__, thread.GetID());
-+
-+  // This thread is currently stopped.
-+  thread.SetStoppedByTrace();
-+
-+  StopRunningThreads(thread.GetID());
-+}
-+
-+void NativeProcessNetBSD::MonitorBreakpoint(NativeThreadNetBSD &thread) {
-+  Log *log(
-+      GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_BREAKPOINTS));
-+  if (log)
-+    log->Printf(
-+        "NativeProcessNetBSD::%s() received breakpoint event, pid = %" PRIu64,
-+        __FUNCTION__, thread.GetID());
-+
-+  // Mark the thread as stopped at breakpoint.
-+  thread.SetStoppedByBreakpoint();
-+  Error error = FixupBreakpointPCAsNeeded(thread);
-+  if (error.Fail())
-+    if (log)
-+      log->Printf("NativeProcessNetBSD::%s() pid = %" PRIu64 " fixup: %s",
-+                  __FUNCTION__, thread.GetID(), error.AsCString());
-+
-+  if (m_threads_stepping_with_breakpoint.find(thread.GetID()) !=
-+      m_threads_stepping_with_breakpoint.end())
-+    thread.SetStoppedByTrace();
-+
-+  StopRunningThreads(thread.GetID());
-+}
-+
-+void NativeProcessNetBSD::MonitorWatchpoint(NativeThreadNetBSD &thread,
-+                                           uint32_t wp_index) {
-+  Log *log(
-+      GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_WATCHPOINTS));
-+  if (log)
-+    log->Printf("NativeProcessNetBSD::%s() received watchpoint event, "
-+                "pid = %" PRIu64 ", wp_index = %" PRIu32,
-+                __FUNCTION__, thread.GetID(), wp_index);
-+
-+  // Mark the thread as stopped at watchpoint.
-+  // The address is at (lldb::addr_t)info->si_addr if we need it.
-+  thread.SetStoppedByWatchpoint(wp_index);
-+
-+  // We need to tell all other running threads before we notify the delegate
-+  // about this stop.
-+  StopRunningThreads(thread.GetID());
 +}
 +
 +namespace {
@@ -959,8 +903,6 @@ $NetBSD$
 +                running_thread_sp ? "running" : "stopped",
 +                deferred_signal_thread_sp->GetID());
 +
-+  StopRunningThreads(deferred_signal_thread_sp->GetID());
-+
 +  return Error();
 +}
 +
@@ -1777,31 +1719,6 @@ $NetBSD$
 +
 +//===----------------------------------------------------------------------===//
 +
-+void NativeProcessNetBSD::StopRunningThreads(const lldb::tid_t triggering_tid) {
-+  Log *const log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD);
-+
-+  if (log) {
-+    log->Printf("NativeProcessNetBSD::%s about to process event: "
-+                "(triggering_tid: %" PRIu64 ")",
-+                __FUNCTION__, triggering_tid);
-+  }
-+
-+  m_pending_notification_tid = triggering_tid;
-+
-+  // Request a stop for all the thread stops that need to be stopped
-+  // and are not already known to be stopped.
-+  for (const auto &thread_sp : m_threads) {
-+    if (StateIsRunningState(thread_sp->GetState()))
-+      static_pointer_cast<NativeThreadNetBSD>(thread_sp)->RequestStop();
-+  }
-+
-+  SignalIfAllThreadsStopped();
-+
-+  if (log) {
-+    log->Printf("NativeProcessNetBSD::%s event processing done", __FUNCTION__);
-+  }
-+}
-+
 +void NativeProcessNetBSD::SignalIfAllThreadsStopped() {
 +  if (m_pending_notification_tid == LLDB_INVALID_THREAD_ID)
 +    return; // No pending notification. Nothing to do.
@@ -1833,22 +1750,6 @@ $NetBSD$
 +  m_pending_notification_tid = LLDB_INVALID_THREAD_ID;
 +}
 +
-+void NativeProcessNetBSD::ThreadWasCreated(NativeThreadNetBSD &thread) {
-+  Log *const log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD);
-+
-+  if (log)
-+    log->Printf("NativeProcessNetBSD::%s (tid: %" PRIu64 ")", __FUNCTION__,
-+                thread.GetID());
-+
-+  if (m_pending_notification_tid != LLDB_INVALID_THREAD_ID &&
-+      StateIsRunningState(thread.GetState())) {
-+    // We will need to wait for this new thread to stop as well before firing
-+    // the
-+    // notification.
-+    thread.RequestStop();
-+  }
-+}
-+
 +void NativeProcessNetBSD::SigchldHandler() {
 +  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
 +  // Process all pending waitpid notifications.
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
index c3d097f..c504095 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Process/NetBSD/NativeProcessNetBSD.h.orig	2016-12-17 13:23:23.783483302 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
-@@ -0,0 +1,223 @@
+@@ -0,0 +1,192 @@
 +//===-- NativeProcessNetBSD.h ---------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -153,30 +153,8 @@ $NetBSD$
 +
 +  void MonitorSIGTRAP(const siginfo_t &info, NativeThreadNetBSD &thread);
 +
-+  void MonitorTrace(NativeThreadNetBSD &thread);
-+
-+  void MonitorBreakpoint(NativeThreadNetBSD &thread);
-+
-+  void MonitorWatchpoint(NativeThreadNetBSD &thread, uint32_t wp_index);
-+
-+  void MonitorSignal(const siginfo_t &info, NativeThreadNetBSD &thread,
-+                     bool exited);
-+
 +  Error SetupSoftwareSingleStepping(NativeThreadNetBSD &thread);
 +
-+#if 0
-+        static ::ProcessMessage::CrashReason
-+        GetCrashReasonForSIGSEGV(const siginfo_t *info);
-+
-+        static ::ProcessMessage::CrashReason
-+        GetCrashReasonForSIGILL(const siginfo_t *info);
-+
-+        static ::ProcessMessage::CrashReason
-+        GetCrashReasonForSIGFPE(const siginfo_t *info);
-+
-+        static ::ProcessMessage::CrashReason
-+        GetCrashReasonForSIGBUS(const siginfo_t *info);
-+#endif
 +
 +  bool HasThreadNoLock(lldb::tid_t thread_id);
 +
@@ -201,13 +179,6 @@ $NetBSD$
 +
 +  Error Detach(lldb::tid_t tid);
 +
-+  // This method is requests a stop on all threads which are still running. It
-+  // sets up a
-+  // deferred delegate notification, which will fire once threads report as
-+  // stopped. The
-+  // triggerring_tid will be set as the current thread (main stop reason).
-+  void StopRunningThreads(lldb::tid_t triggering_tid);
-+
 +  // Notify the delegate if all threads have stopped.
 +  void SignalIfAllThreadsStopped();
 +
@@ -217,8 +188,6 @@ $NetBSD$
 +  Error ResumeThread(NativeThreadNetBSD &thread, lldb::StateType state,
 +                     int signo);
 +
-+  void ThreadWasCreated(NativeThreadNetBSD &thread);
-+
 +  void SigchldHandler();
 +};
 +
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 d270853..bdae333 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp.orig	2016-12-17 13:23:23.784878149 +0000
 +++ source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
-@@ -0,0 +1,423 @@
+@@ -0,0 +1,397 @@
 +//===-- NativeThreadNetBSD.cpp --------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -372,32 +372,6 @@ $NetBSD$
 +  m_stop_info.reason = StopReason::eStopReasonThreadExiting;
 +}
 +
-+Error NativeThreadNetBSD::RequestStop() {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
-+
-+  NativeProcessNetBSD &process = GetProcess();
-+
-+  lldb::pid_t pid = process.GetID();
-+  lldb::tid_t tid = GetID();
-+
-+  if (log)
-+    log->Printf("NativeThreadNetBSD::%s requesting thread stop(pid: %" PRIu64
-+                ", tid: %" PRIu64 ")",
-+                __FUNCTION__, pid, tid);
-+
-+  Error err;
-+  errno = 0;
-+  if (::tgkill(pid, tid, SIGSTOP) != 0) {
-+    err.SetErrorToErrno();
-+    if (log)
-+      log->Printf("NativeThreadNetBSD::%s tgkill(%" PRIu64 ", %" PRIu64
-+                  ", SIGSTOP) failed: %s",
-+                  __FUNCTION__, pid, tid, err.AsCString());
-+  }
-+
-+  return err;
-+}
-+
 +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 d4aff5b..d74cb2e 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Process/NetBSD/NativeThreadNetBSD.h.orig	2016-12-17 13:23:23.784994923 +0000
 +++ source/Plugins/Process/NetBSD/NativeThreadNetBSD.h
-@@ -0,0 +1,116 @@
+@@ -0,0 +1,114 @@
 +//===-- NativeThreadNetBSD.h ----------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -88,8 +88,6 @@ $NetBSD$
 +
 +  void SetExited();
 +
-+  Error RequestStop();
-+
 +  // ---------------------------------------------------------------------
 +  // Private interface
 +  // ---------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index