pkgsrc-WIP-changes archive

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

lldb-netbsd: Abandon currently NativeThreadNetBSD::Resume()



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Wed Dec 21 18:56:59 2016 +0100
Changeset:	6f4441e65f15f7fc96befbd71642397cc26913db

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: Abandon currently NativeThreadNetBSD::Resume()

Resume/Suspend tracee can work per-process, not per-thread.
In Linux it's differently -- thread=process.

Feature to lock/unlock LWPs is a different concept and currently not planned
for the minimal functional core.

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=6f4441e65f15f7fc96befbd71642397cc26913db

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 | 101 ++-------------------
 ...e_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp |  21 +----
 ...rce_Plugins_Process_NetBSD_NativeThreadNetBSD.h |   8 +-
 4 files changed, 15 insertions(+), 121 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index aa1f818..19569ad 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) = 9b8b88ee302646cd8bf2008e9be7b818bc1933f7
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = e421cd8134e4fbf735661bc1d92139571d173c59
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = 3b15e8b5c4240846dbe1a5ef38b02da0c1299a85
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = a36d09154a2f1d795700aaa56c78120fc91794c0
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = a2510080812c538a2c65a7237bfe029d4e55b77d
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = 255cb19bad19d38e1015b5bd8748ed0fb2c839ed
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = b2c04646c1a871e6c3cd1b539ef7298cf228dd19
 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 fe0aabf..c4b96e2 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 15:47:29.499519618 +0000
+--- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2016-12-21 17:21:58.154060411 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
-@@ -0,0 +1,1766 @@
+@@ -0,0 +1,1681 @@
 +//===-- NativeProcessNetBSD.cpp -------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -541,7 +541,7 @@ $NetBSD$
 +                __FUNCTION__, GetID(), tid);
 +
 +  new_thread_sp = AddThread(tid);
-+  ResumeThread(*new_thread_sp, eStateRunning, LLDB_INVALID_SIGNAL_NUMBER);
++  /* XXX: ResumeThread */
 +}
 +
 +namespace {
@@ -714,54 +714,14 @@ $NetBSD$
 +Error NativeProcessNetBSD::Resume(const ResumeActionList &resume_actions) {
 +  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_THREAD));
 +  if (log)
-+    log->Printf("NativeProcessNetBSD::%s called: pid %" PRIu64, __FUNCTION__,
++    log->Printf("NativeProcessNetBSD::%s called: pid %d", __FUNCTION__,
 +                GetID());
 +
-+  for (auto thread_sp : m_threads) {
-+    assert(thread_sp && "thread list should not contain NULL threads");
-+
-+    const ResumeAction *const action =
-+        resume_actions.GetActionForThread(thread_sp->GetID(), true);
-+
-+    if (action == nullptr) {
-+      if (log)
-+        log->Printf(
-+            "NativeProcessNetBSD::%s no action specified for pid %" PRIu64
-+            " tid %" PRIu64,
-+            __FUNCTION__, GetID(), thread_sp->GetID());
-+      continue;
-+    }
-+
-+    if (log) {
-+      log->Printf("NativeProcessNetBSD::%s processing resume action state %s "
-+                  "for pid %" PRIu64 " tid %" PRIu64,
-+                  __FUNCTION__, StateAsCString(action->state), GetID(),
-+                  thread_sp->GetID());
-+    }
-+
-+    switch (action->state) {
-+    case eStateRunning:
-+    case eStateStepping: {
-+      // Run the thread, possibly feeding it the signal.
-+      const int signo = action->signal;
-+      ResumeThread(static_cast<NativeThreadNetBSD &>(*thread_sp), action->state,
-+                   signo);
-+      break;
-+    }
++  /* XXX: resume_actions unused */
++  /* XXX: Pass signal to ptrace(2) */
 +
-+    case eStateSuspended:
-+    case eStateStopped:
-+      lldbassert(0 && "Unexpected state");
-+
-+    default:
-+      return Error("NativeProcessNetBSD::%s (): unexpected state %s specified "
-+                   "for pid %" PRIu64 ", tid %" PRIu64,
-+                   __FUNCTION__, StateAsCString(action->state), GetID(),
-+                   thread_sp->GetID());
-+    }
-+  }
-+
-+  return Error();
++  return NativeProcessNetBSD::PtraceWrapper(PT_CONTINUE, GetID(),(void *)1,
++                                            0);
 +}
 +
 +Error NativeProcessNetBSD::Halt() {
@@ -1592,51 +1552,6 @@ $NetBSD$
 +      NativeProcessProtocol::GetThreadByID(tid));
 +}
 +
-+Error NativeProcessNetBSD::ResumeThread(NativeThreadNetBSD &thread,
-+                                       lldb::StateType state, int signo) {
-+  Log *const log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD);
-+
-+  if (log)
-+    log->Printf("NativeProcessNetBSD::%s (tid: %" PRIu64 ")", __FUNCTION__,
-+                thread.GetID());
-+
-+  // Before we do the resume below, first check if we have a pending
-+  // stop notification that is currently waiting for
-+  // all threads to stop.  This is potentially a buggy situation since
-+  // we're ostensibly waiting for threads to stop before we send out the
-+  // pending notification, and here we are resuming one before we send
-+  // out the pending stop notification.
-+  if (m_pending_notification_tid != LLDB_INVALID_THREAD_ID && log) {
-+    log->Printf("NativeProcessNetBSD::%s about to resume tid %" PRIu64
-+                " per explicit request but we have a pending stop notification "
-+                "(tid %" PRIu64 ") that is actively waiting for this thread to "
-+                                "stop. Valid sequence of events?",
-+                __FUNCTION__, thread.GetID(), m_pending_notification_tid);
-+  }
-+
-+  // Request a resume.  We expect this to be synchronous and the system
-+  // to reflect it is running after this completes.
-+  switch (state) {
-+  case eStateRunning: {
-+    const auto resume_result = thread.Resume(signo);
-+    if (resume_result.Success())
-+      SetState(eStateRunning, true);
-+    return resume_result;
-+  }
-+  case eStateStepping: {
-+    const auto step_result = thread.SingleStep(signo);
-+    if (step_result.Success())
-+      SetState(eStateRunning, true);
-+    return step_result;
-+  }
-+  default:
-+    if (log)
-+      log->Printf("NativeProcessNetBSD::%s Unhandled state %s.", __FUNCTION__,
-+                  StateAsCString(state));
-+    llvm_unreachable("Unhandled state for resume");
-+  }
-+}
-+
 +//===----------------------------------------------------------------------===//
 +
 +void NativeProcessNetBSD::SignalIfAllThreadsStopped() {
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 3e6ed36..7413b4b 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 15:47:29.514533040 +0000
+--- source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp.orig	2016-12-21 17:21:58.167664787 +0000
 +++ source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
-@@ -0,0 +1,303 @@
+@@ -0,0 +1,286 @@
 +//===-- NativeThreadNetBSD.cpp --------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -149,23 +149,6 @@ $NetBSD$
 +  return Error();
 +}
 +
-+Error NativeThreadNetBSD::Resume(uint32_t signo) {
-+  const StateType new_state = StateType::eStateRunning;
-+  MaybeLogStateChange(new_state);
-+  m_state = new_state;
-+
-+  m_stop_info.reason = StopReason::eStopReasonNone;
-+  m_stop_description.clear();
-+
-+  int data = 0;
-+
-+  if (signo != LLDB_INVALID_SIGNAL_NUMBER)
-+    data = signo;
-+
-+  return NativeProcessNetBSD::PtraceWrapper(PT_CONTINUE, GetID(), (void *)1,
-+                                           data);
-+}
-+
 +Error NativeThreadNetBSD::SingleStep(uint32_t signo) {
 +  const StateType new_state = StateType::eStateStepping;
 +  MaybeLogStateChange(new_state);
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 31d9caf..718847a 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-19 01:22:58.099098436 +0000
+--- source/Plugins/Process/NetBSD/NativeThreadNetBSD.h.orig	2016-12-21 17:21:58.174128330 +0000
 +++ source/Plugins/Process/NetBSD/NativeThreadNetBSD.h
-@@ -0,0 +1,108 @@
+@@ -0,0 +1,104 @@
 +//===-- NativeThreadNetBSD.h ----------------------------------- -*- C++ -*-===//
 +//
 +//                     The LLVM Compiler Infrastructure
@@ -57,10 +57,6 @@ $NetBSD$
 +  // Interface for friend classes
 +  // ---------------------------------------------------------------------
 +
-+  /// Resumes the thread.  If @p signo is anything but
-+  /// LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread.
-+  Error Resume(uint32_t signo);
-+
 +  /// Single steps the thread.  If @p signo is anything but
 +  /// LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread.
 +  Error SingleStep(uint32_t signo);


Home | Main Index | Thread Index | Old Index