pkgsrc-WIP-changes archive

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

lldb-netbsd: Next step towards rebase to new SVN revision



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Wed May 24 05:23:15 2017 +0200
Changeset:	ad2f9d6eb8abd316ed6a89155b3c1602684c77f7

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

Log Message:
lldb-netbsd: Next step towards rebase to new SVN revision

Fix build. Rebase remaining files.

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

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 | 88 +++++++++++-----------
 2 files changed, 44 insertions(+), 46 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index 4e12b29587..774bed0dac 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -13,7 +13,7 @@ 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_ObjectFile_ELF_ObjectFileELF.cpp) = 76d47d654951d36dc493611dfa636c1dcff0c3af
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = 3daf2df890e4a4098eadc18261ac9b2a0840acd4
+SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = 93b16ab0ab61b2134074c449271e645cedb58140
 SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = da6c430a4932f0c3feee389082fad4ef34360b9e
 SHA1 (patch-source_Plugins_Process_elf-core_ProcessElfCore.cpp) = cdfb65a14116c3bd3d3ad977328e2b0c4ae4f9aa
 SHA1 (patch-source_Plugins_Process_elf-core_ProcessElfCore.h) = 902ce5e0187aa2649986db08c79af7291b852727
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 4f8d7d79b9..855147641d 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2017-04-19 03:59:21.000000000 +0000
+--- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2017-05-24 03:07:34.773664273 +0000
 +++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
 @@ -207,7 +207,8 @@ void NativeProcessNetBSD::MonitorSIGSTOP
      // Handle SIGSTOP from LLGS (LLDB GDB Server)
@@ -24,7 +24,7 @@ $NetBSD$
 -          *static_pointer_cast<NativeThreadNetBSD>(thread_sp));
 +  case TRAP_BRKPT: {
 +    size_t index;
-+    Error error = GetThreadIndexByTid(info.psi_lwpid, index);
++    Status error = GetThreadIndexByTid(info.psi_lwpid, index);
 +    if (error.Fail()) {
 +      LLDB_LOG(log, "failed to find thread by tid: {0}", error);
 +      SetState(StateType::eStateInvalid);
@@ -42,7 +42,7 @@ $NetBSD$
 +  } break;
 +  case TRAP_TRACE: {
 +    size_t index;
-+    Error error = GetThreadIndexByTid(info.psi_lwpid, index);
++    Status error = GetThreadIndexByTid(info.psi_lwpid, index);
 +    if (error.Fail()) {
 +      LLDB_LOG(log, "failed to find thread by tid: {0}", error);
 +      SetState(StateType::eStateInvalid);
@@ -54,7 +54,7 @@ $NetBSD$
 -    break;
 +  } break;
    case TRAP_EXEC: {
-     Error error = ReinitializeThreads();
+     Status error = ReinitializeThreads();
      if (error.Fail()) {
 @@ -254,11 +266,59 @@ void NativeProcessNetBSD::MonitorSIGTRAP
      // Let our delegate know we have just exec'd.
@@ -69,7 +69,7 @@ $NetBSD$
    } break;
 +  case TRAP_LWP: {
 +    ptrace_state_t state;
-+    Error error =
++    Status error =
 +        PtraceWrapper(PT_GET_PROCESS_STATE, GetID(), &state, sizeof(state));
 +    if (error.Fail()) {
 +      LLDB_LOG(log,
@@ -137,7 +137,7 @@ $NetBSD$
 -        static_pointer_cast<NativeThreadNetBSD>(thread_sp)
 -            ->SetStoppedByWatchpoint(wp_index);
 +      size_t index;
-+      Error error = GetThreadIndexByTid(info.psi_lwpid, index);
++      Status error = GetThreadIndexByTid(info.psi_lwpid, index);
 +      if (error.Fail()) {
 +        LLDB_LOG(log, "failed to find thread by tid: {0}", error);
 +        SetState(StateType::eStateInvalid);
@@ -167,7 +167,7 @@ $NetBSD$
 -        static_pointer_cast<NativeThreadNetBSD>(thread_sp)
 -            ->SetStoppedByBreakpoint();
 +      size_t index;
-+      Error error = GetThreadIndexByTid(info.psi_lwpid, index);
++      Status error = GetThreadIndexByTid(info.psi_lwpid, index);
 +      if (error.Fail()) {
 +        LLDB_LOG(log, "failed to find thread by tid: {0}", error);
 +        SetState(StateType::eStateInvalid);
@@ -201,7 +201,7 @@ $NetBSD$
 +    }
 +  } else {
 +    size_t index;
-+    Error error = GetThreadIndexByTid(info.psi_lwpid, index);
++    Status error = GetThreadIndexByTid(info.psi_lwpid, index);
 +    if (error.Fail()) {
 +      LLDB_LOG(log, "failed to find thread by tid: {0}", error);
 +      SetState(StateType::eStateInvalid);
@@ -214,23 +214,19 @@ $NetBSD$
    SetState(StateType::eStateStopped, true);
  }
  
-@@ -444,55 +540,71 @@ Error NativeProcessNetBSD::Resume(const 
-   Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS));
-   LLDB_LOG(log, "pid {0}", GetID());
+@@ -448,51 +544,73 @@ Status NativeProcessNetBSD::Resume(const
+   const ResumeAction *const action =
+       resume_actions.GetActionForThread(thread_sp->GetID(), true);
  
--  const auto &thread_sp = m_threads[0];
--  const ResumeAction *const action =
--      resume_actions.GetActionForThread(thread_sp->GetID(), true);
--
 -  if (action == nullptr) {
 -    LLDB_LOG(log, "no action specified for pid {0} tid {1}", GetID(),
 -             thread_sp->GetID());
--    return Error();
+-    return Status();
 -  }
 +  int sig = 0;
 +  bool step = false;
  
--  Error error;
+-  Status error;
 +  for (auto thread_sp : m_threads) {
 +    assert(thread_sp && "thread list should not contain NULL threads");
  
@@ -242,6 +238,7 @@ $NetBSD$
 -    if (!error.Success())
 -      return error;
 -    for (const auto &thread_sp : m_threads) {
++
 +    const ResumeAction *const action =
 +        resume_actions.GetActionForThread(thread_sp->GetID(), true);
 +
@@ -259,7 +256,7 @@ $NetBSD$
 +    switch (action->state) {
 +    case eStateRunning: {
 +      // Run the thread, possibly feeding it the signal.
-+      Error error = NativeProcessNetBSD::PtraceWrapper(PT_CLEARSTEP, GetID(), 0,
++      Status error = NativeProcessNetBSD::PtraceWrapper(PT_CLEARSTEP, GetID(), 0,
 +                                                       action->tid);
 +      if (!error.Success())
 +        return error;
@@ -267,7 +264,7 @@ $NetBSD$
 +    } break;
 +    case eStateStepping: {
 +      // Run the thread, possibly feeding it the signal.
-+      Error error = NativeProcessNetBSD::PtraceWrapper(PT_SETSTEP, GetID(), 0,
++      Status error = NativeProcessNetBSD::PtraceWrapper(PT_SETSTEP, GetID(), 0,
 +                                                       action->tid);
 +      if (!error.Success())
 +        return error;
@@ -280,7 +277,7 @@ $NetBSD$
 +      llvm_unreachable("Unexpected state");
 +
 +    default:
-+      return Error("NativeProcessNetBSD::%s (): unexpected state %s specified "
++      return Status("NativeProcessNetBSD::%s (): unexpected state %s specified "
 +                   "for pid %" PRIu64 ", tid %" PRIu64,
 +                   __FUNCTION__, StateAsCString(action->state), GetID(),
 +                   thread_sp->GetID());
@@ -294,7 +291,7 @@ $NetBSD$
 -                                               action->signal);
 -    if (!error.Success())
 +
-+    Error error;
++    Status error;
 +
 +    error = NativeProcessNetBSD::PtraceWrapper(PT_CONTINUE, GetID(), (void *)1,
 +                                               sig);
@@ -302,31 +299,32 @@ $NetBSD$
        return error;
 -    for (const auto &thread_sp : m_threads) {
 -      static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStepping();
++
      }
 -    SetState(eStateStepping, true);
 -    break;
- 
--  case eStateSuspended:
--  case eStateStopped:
--    llvm_unreachable("Unexpected state");
 +    if (step)
 +      SetState(eStateStepping, true);
 +    else
 +      SetState(eStateRunning, true);
  
+-  case eStateSuspended:
+-  case eStateStopped:
+-    llvm_unreachable("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 Status("NativeProcessNetBSD::%s (): unexpected state %s specified "
+-                  "for pid %" PRIu64 ", tid %" PRIu64,
+-                  __FUNCTION__, StateAsCString(action->state), GetID(),
+-                  thread_sp->GetID());
++    return Status();
    }
 -
--  return Error();
+-  return Status();
  }
  
- Error NativeProcessNetBSD::Halt() {
-@@ -812,6 +924,18 @@ Error NativeProcessNetBSD::LaunchInferio
+ Status NativeProcessNetBSD::Halt() {
+@@ -812,6 +930,18 @@ Status NativeProcessNetBSD::LaunchInferi
      return error;
    }
  
@@ -345,11 +343,11 @@ $NetBSD$
    for (const auto &thread_sp : m_threads) {
      static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(
          SIGSTOP);
-@@ -898,6 +1022,42 @@ void NativeProcessNetBSD::SigchldHandler
+@@ -898,6 +1028,42 @@ void NativeProcessNetBSD::SigchldHandler
      MonitorCallback(wait_pid, signal);
  }
  
-+Error NativeProcessNetBSD::GetThreadIndexByTid(lldb::tid_t thread_id,
++Status NativeProcessNetBSD::GetThreadIndexByTid(lldb::tid_t thread_id,
 +                                               size_t &index) {
 +
 +  assert(thread_id > 0);
@@ -360,20 +358,20 @@ $NetBSD$
 +
 +    if (thread->GetID() == thread_id) {
 +      index = i;
-+      return Error();
++      return Status();
 +    }
 +  }
 +
-+  return Error("Thread not registered");
++  return Status("Thread not registered");
 +}
 +
-+Error NativeProcessNetBSD::RemoveThread(lldb::tid_t thread_id) {
++Status NativeProcessNetBSD::RemoveThread(lldb::tid_t thread_id) {
 +
 +  Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_THREAD));
 +  LLDB_LOG(log, "pid {0} removing thread with tid {1}", GetID(), thread_id);
 +
 +  size_t index;
-+  Error error = GetThreadIndexByTid(thread_id, index);
++  Status error = GetThreadIndexByTid(thread_id, index);
 +
 +  if (error.Fail()) {
 +    LLDB_LOG(log, "failed to find thread by tid: {0}", error);
@@ -382,13 +380,13 @@ $NetBSD$
 +
 +  m_threads.erase(m_threads.begin() + index);
 +
-+  return Error();
++  return Status();
 +}
 +
  NativeThreadNetBSDSP NativeProcessNetBSD::AddThread(lldb::tid_t thread_id) {
  
    Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_THREAD));
-@@ -912,6 +1072,7 @@ NativeThreadNetBSDSP NativeProcessNetBSD
+@@ -912,6 +1078,7 @@ NativeThreadNetBSDSP NativeProcessNetBSD
  
    auto thread_sp = std::make_shared<NativeThreadNetBSD>(this, thread_id);
    m_threads.push_back(thread_sp);
@@ -396,7 +394,7 @@ $NetBSD$
    return thread_sp;
  }
  
-@@ -945,6 +1106,10 @@ NativeThreadNetBSDSP NativeProcessNetBSD
+@@ -945,6 +1112,10 @@ NativeThreadNetBSDSP NativeProcessNetBSD
      return -1;
    }
  
@@ -407,7 +405,7 @@ $NetBSD$
    for (const auto &thread_sp : m_threads) {
      static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(
          SIGSTOP);
-@@ -1062,7 +1227,7 @@ Error NativeProcessNetBSD::ReinitializeT
+@@ -1062,7 +1233,7 @@ Status NativeProcessNetBSD::Reinitialize
    }
    // Reinitialize from scratch threads and register them in process
    while (info.pl_lwpid != 0) {
@@ -416,12 +414,12 @@ $NetBSD$
      error = PtraceWrapper(PT_LWPINFO, GetID(), &info, sizeof(info));
      if (error.Fail()) {
        return error;
-@@ -1071,3 +1236,13 @@ Error NativeProcessNetBSD::ReinitializeT
+@@ -1071,3 +1242,13 @@ Status NativeProcessNetBSD::Reinitialize
  
    return error;
  }
 +
-+Error NativeProcessNetBSD::SetDefaultPtraceOpts() {
++Status NativeProcessNetBSD::SetDefaultPtraceOpts() {
 +  ptrace_event_t event;
 +
 +  // Trace thread (LWP) creation and termination


Home | Main Index | Thread Index | Old Index