[Lldb-commits] [lldb] r346100 - Fix NetBSD build after "Move path resolution logic out of FileSpec"

2018-11-04 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Sun Nov  4 08:53:16 2018
New Revision: 346100

URL: http://llvm.org/viewvc/llvm-project?rev=346100&view=rev
Log:
Fix NetBSD build after "Move path resolution logic out of FileSpec"

D53915

Modified:
lldb/trunk/source/Host/netbsd/Host.cpp
lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp

Modified: lldb/trunk/source/Host/netbsd/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/netbsd/Host.cpp?rev=346100&r1=346099&r2=346100&view=diff
==
--- lldb/trunk/source/Host/netbsd/Host.cpp (original)
+++ lldb/trunk/source/Host/netbsd/Host.cpp Sun Nov  4 08:53:16 2018
@@ -70,7 +70,7 @@ static bool GetNetBSDProcessArgs(const P
   if (!cstr)
 return false;
 
-  process_info.GetExecutableFile().SetFile(cstr, false,
+  process_info.GetExecutableFile().SetFile(cstr,
FileSpec::Style::native);
 
   if (!(match_info_ptr == NULL ||

Modified: lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp?rev=346100&r1=346099&r2=346100&view=diff
==
--- lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp (original)
+++ lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp Sun Nov  4 08:53:16 2018
@@ -85,7 +85,7 @@ FileSpec HostInfoNetBSD::GetProgramFileS
 
 len = sizeof(path);
 if (sysctl(name, __arraycount(name), path, &len, NULL, 0) != -1) {
-  g_program_filespec.SetFile(path, false, FileSpec::Style::native);
+  g_program_filespec.SetFile(path, FileSpec::Style::native);
 }
   }
   return g_program_filespec;

Modified: lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp?rev=346100&r1=346099&r2=346100&view=diff
==
--- lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Sun Nov  4 
08:53:16 2018
@@ -542,7 +542,7 @@ Status NativeProcessNetBSD::PopulateMemo
   info.SetName(vm[i].kve_path);
 
 m_mem_region_cache.emplace_back(
-info, FileSpec(info.GetName().GetCString(), true));
+info, FileSpec(info.GetName().GetCString()));
   }
   free(vm);
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r324234 - Fix a crash in *NetBSD::Factory::Launch

2018-02-05 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Mon Feb  5 05:16:22 2018
New Revision: 324234

URL: http://llvm.org/viewvc/llvm-project?rev=324234&view=rev
Log:
Fix a crash in *NetBSD::Factory::Launch

Summary:
We cannot call process_up->SetState() inside
the NativeProcessNetBSD::Factory::Launch
function because it triggers a NULL pointer
deference.

The generic code for launching a process in:
GDBRemoteCommunicationServerLLGS::LaunchProcess
sets the m_debugged_process_up pointer after
a successful call to  m_process_factory.Launch().
If we attempt to call process_up->SetState()
inside a platform specific Launch function we
end up dereferencing a NULL pointer in
NativeProcessProtocol::GetCurrentThreadID().

Use the proper call process_up->SetState(,false)
that sets notify_delegates to false.

Sponsored by 

Reviewers: labath, joerg

Reviewed By: labath

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D42868

Modified:
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp

Modified: lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp?rev=324234&r1=324233&r2=324234&view=diff
==
--- lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Mon Feb  5 
05:16:22 2018
@@ -113,7 +113,7 @@ NativeProcessNetBSD::Factory::Launch(Pro
 
   for (const auto &thread : process_up->m_threads)
 static_cast(*thread).SetStoppedBySignal(SIGSTOP);
-  process_up->SetState(StateType::eStateStopped);
+  process_up->SetState(StateType::eStateStopped, false);
 
   return std::move(process_up);
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r324251 - Sync PlatformNetBSD.cpp with Linux

2018-02-05 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Mon Feb  5 09:12:23 2018
New Revision: 324251

URL: http://llvm.org/viewvc/llvm-project?rev=324251&view=rev
Log:
Sync PlatformNetBSD.cpp with Linux

Summary:
Various changes in logging from log->Printf() to generic LLDB_LOG().

Sponsored by 

Reviewers: labath, joerg

Reviewed By: labath

Subscribers: llvm-commits, lldb-commits

Differential Revision: https://reviews.llvm.org/D42912

Modified:
lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp

Modified: lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp?rev=324251&r1=324250&r2=324251&view=diff
==
--- lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp Mon Feb  5 
09:12:23 2018
@@ -45,19 +45,9 @@ static uint32_t g_initialize_count = 0;
 
 PlatformSP PlatformNetBSD::CreateInstance(bool force, const ArchSpec *arch) {
   Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM));
-  if (log) {
-const char *arch_name;
-if (arch && arch->GetArchitectureName())
-  arch_name = arch->GetArchitectureName();
-else
-  arch_name = "";
-
-const char *triple_cstr =
-arch ? arch->GetTriple().getTriple().c_str() : "";
-
-log->Printf("PlatformNetBSD::%s(force=%s, arch={%s,%s})", __FUNCTION__,
-force ? "true" : "false", arch_name, triple_cstr);
-  }
+  LLDB_LOG(log, "force = {0}, arch=({1}, {2})", force,
+   arch ? arch->GetArchitectureName() : "",
+   arch ? arch->GetTriple().getTriple() : "");
 
   bool create = force;
   if (create == false && arch && arch->IsValid()) {
@@ -72,18 +62,10 @@ PlatformSP PlatformNetBSD::CreateInstanc
 }
   }
 
+  LLDB_LOG(log, "create = {0}", create);
   if (create) {
-if (log)
-  log->Printf("PlatformNetBSD::%s() creating remote-netbsd platform",
-  __FUNCTION__);
 return PlatformSP(new PlatformNetBSD(false));
   }
-
-  if (log)
-log->Printf(
-"PlatformNetBSD::%s() aborting creation of remote-netbsd platform",
-__FUNCTION__);
-
   return PlatformSP();
 }
 
@@ -258,19 +240,15 @@ bool PlatformNetBSD::CanDebugProcess() {
 }
 
 // For local debugging, NetBSD will override the debug logic to use llgs-launch
-// rather than
-// lldb-launch, llgs-attach.  This differs from current lldb-launch,
-// debugserver-attach
-// approach on MacOSX.
-lldb::ProcessSP PlatformNetBSD::DebugProcess(
-ProcessLaunchInfo &launch_info, Debugger &debugger,
-Target *target, // Can be NULL, if NULL create a new
-// target, else use existing one
-Status &error) {
+// rather than lldb-launch, llgs-attach.  This differs from current 
lldb-launch,
+// debugserver-attach approach on MacOSX.
+lldb::ProcessSP
+PlatformNetBSD::DebugProcess(ProcessLaunchInfo &launch_info, Debugger 
&debugger,
+ Target *target, // Can be NULL, if NULL create a 
new
+ // target, else use existing one
+ Status &error) {
   Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM));
-  if (log)
-log->Printf("PlatformNetBSD::%s entered (target %p)", __FUNCTION__,
-static_cast(target));
+  LLDB_LOG(log, "target {0}", target);
 
   // If we're a remote host, use standard behavior from parent class.
   if (!IsHost())
@@ -293,61 +271,42 @@ lldb::ProcessSP PlatformNetBSD::DebugPro
 
   // Ensure we have a target.
   if (target == nullptr) {
-if (log)
-  log->Printf("PlatformNetBSD::%s creating new target", __FUNCTION__);
-
+LLDB_LOG(log, "creating new target");
 TargetSP new_target_sp;
 error = debugger.GetTargetList().CreateTarget(debugger, "", "", false,
   nullptr, new_target_sp);
 if (error.Fail()) {
-  if (log)
-log->Printf("PlatformNetBSD::%s failed to create new target: %s",
-__FUNCTION__, error.AsCString());
+  LLDB_LOG(log, "failed to create new target: {0}", error);
   return process_sp;
 }
 
 target = new_target_sp.get();
 if (!target) {
   error.SetErrorString("CreateTarget() returned nullptr");
-  if (log)
-log->Printf("PlatformNetBSD::%s failed: %s", __FUNCTION__,
-error.AsCString());
+  LLDB_LOG(log, "error: {0}", error);
   return process_sp;
 }
-  } else {
-if (log)
-  log->Printf("PlatformNetBSD::%s using provided target", __FUNCTION__);
   }
 
   // Mark target as currently selected target.
   debugger.GetTargetList().SetSelectedTarget(target);
 
   // Now create the gdb-remote process.
-  if (log)
-log->Printf(
-"PlatformNetBSD::%s having target create process with gdb-remote 
plugin",
-__FUNCTION__);
+  LLDB_LOG(log, "hav

[Lldb-commits] [lldb] r298405 - Add NetBSD case in Entry::Type::ThreadID

2017-03-21 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Tue Mar 21 12:25:47 2017
New Revision: 298405

URL: http://llvm.org/viewvc/llvm-project?rev=298405&view=rev
Log:
Add NetBSD case in Entry::Type::ThreadID

Summary:
NetBSD native threads are printed as 64-bit unsigned integers.

The underlying system type of a thread identity is lwpid_t of type int32_t. For 
consistency with Linux and FreeBSD share the 64-bit unsigned integer type.

Sponsored by 

Reviewers: labath, kettenis, joerg, emaste

Reviewed By: labath, emaste

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31132

Modified:
lldb/trunk/source/Core/FormatEntity.cpp

Modified: lldb/trunk/source/Core/FormatEntity.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatEntity.cpp?rev=298405&r1=298404&r2=298405&view=diff
==
--- lldb/trunk/source/Core/FormatEntity.cpp (original)
+++ lldb/trunk/source/Core/FormatEntity.cpp Tue Mar 21 12:25:47 2017
@@ -1187,7 +1187,8 @@ bool FormatEntity::Format(const Entry &e
   ? arch.GetTriple().getOS()
   : llvm::Triple::UnknownOS;
 if ((ostype == llvm::Triple::FreeBSD) ||
-(ostype == llvm::Triple::Linux)) {
+(ostype == llvm::Triple::Linux) ||
+(ostype == llvm::Triple::NetBSD)) {
   format = "%" PRIu64;
 }
   } else {


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r298406 - Enable ProcessPOSIXLog on NetBSD

2017-03-21 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Tue Mar 21 12:26:55 2017
New Revision: 298406

URL: http://llvm.org/viewvc/llvm-project?rev=298406&view=rev
Log:
Enable ProcessPOSIXLog on NetBSD

Summary:
NetBSD can share the same logging functionality with Linux and FreeBSD.

Sponsored by 


Reviewers: labath, emaste, joerg, kettenis

Reviewed By: labath, emaste

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31191

Modified:
lldb/trunk/source/Initialization/SystemInitializerCommon.cpp

Modified: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/SystemInitializerCommon.cpp?rev=298406&r1=298405&r2=298406&view=diff
==
--- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp (original)
+++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp Tue Mar 21 
12:26:55 2017
@@ -26,7 +26,7 @@
 #include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
 #endif
 
-#if defined(__linux__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
 #include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
 #endif
 
@@ -93,7 +93,7 @@ void SystemInitializerCommon::Initialize
 #if defined(__APPLE__)
   ObjectFileMachO::Initialize();
 #endif
-#if defined(__linux__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
   ProcessPOSIXLog::Initialize();
 #endif
 #if defined(_MSC_VER)


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r298407 - Enable AUXV and QPassSignals in gdb-remote for NetBSD

2017-03-21 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Tue Mar 21 12:27:59 2017
New Revision: 298407

URL: http://llvm.org/viewvc/llvm-project?rev=298407&view=rev
Log:
Enable AUXV and QPassSignals in gdb-remote for NetBSD

Summary:
NetBSD is an ELF platform and it uses Elf Auxiliary Vector like Linux and other 
modern BSDs.

While there enable QPassSignals for the NetBSD port as well.

Sponsored by 

Reviewers: labath, kettenis, joerg, emaste

Reviewed By: labath

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31146

Modified:

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp?rev=298407&r1=298406&r2=298407&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
 Tue Mar 21 12:27:59 2017
@@ -840,7 +840,7 @@ GDBRemoteCommunicationServerCommon::Hand
   response.PutCString(";QThreadSuffixSupported+");
   response.PutCString(";QListThreadsInStopReply+");
   response.PutCString(";qEcho+");
-#if defined(__linux__)
+#if defined(__linux__) || defined(__NetBSD__)
   response.PutCString(";QPassSignals+");
   response.PutCString(";qXfer:auxv:read+");
 #endif

Modified: 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp?rev=298407&r1=298406&r2=298407&view=diff
==
--- 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
 (original)
+++ 
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
 Tue Mar 21 12:27:59 2017
@@ -2665,7 +2665,7 @@ GDBRemoteCommunication::PacketResult
 GDBRemoteCommunicationServerLLGS::Handle_qXfer_auxv_read(
 StringExtractorGDBRemote &packet) {
 // *BSD impls should be able to do this too.
-#if defined(__linux__)
+#if defined(__linux__) || defined(__NetBSD__)
   Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
 
   // Parse out the offset.


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r298408 - Add stub for PluginProcessNetBSD

2017-03-21 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Tue Mar 21 12:30:47 2017
New Revision: 298408

URL: http://llvm.org/viewvc/llvm-project?rev=298408&view=rev
Log:
Add stub for PluginProcessNetBSD

Summary:
This is the base for introduction of further features to support Process 
Tracing on NetBSD, in local and remote setup.

This code is also a starting point to synchronize the development with other 
BSDs. Currently NetBSD is ahead and other systems can catch up.

Sponsored by 

Reviewers: emaste, joerg, kettenis, labath

Reviewed By: labath

Subscribers: mgorny, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31138

Added:
lldb/trunk/source/Plugins/Process/NetBSD/
lldb/trunk/source/Plugins/Process/NetBSD/CMakeLists.txt
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
lldb/trunk/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.cpp
lldb/trunk/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h
lldb/trunk/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
lldb/trunk/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h
Modified:
lldb/trunk/source/Plugins/Process/CMakeLists.txt
lldb/trunk/tools/lldb-server/CMakeLists.txt

Modified: lldb/trunk/source/Plugins/Process/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/CMakeLists.txt?rev=298408&r1=298407&r2=298408&view=diff
==
--- lldb/trunk/source/Plugins/Process/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/CMakeLists.txt Tue Mar 21 12:30:47 2017
@@ -5,6 +5,7 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "FreeB
   add_subdirectory(FreeBSD)
   add_subdirectory(POSIX)
 elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+  add_subdirectory(NetBSD)
   add_subdirectory(POSIX)
 elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
   add_subdirectory(Windows/Common)

Added: lldb/trunk/source/Plugins/Process/NetBSD/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/CMakeLists.txt?rev=298408&view=auto
==
--- lldb/trunk/source/Plugins/Process/NetBSD/CMakeLists.txt (added)
+++ lldb/trunk/source/Plugins/Process/NetBSD/CMakeLists.txt Tue Mar 21 12:30:47 
2017
@@ -0,0 +1,20 @@
+include_directories(.)
+include_directories(../POSIX)
+include_directories(../Utility)
+
+add_lldb_library(lldbPluginProcessNetBSD PLUGIN
+  NativeProcessNetBSD.cpp
+  NativeRegisterContextNetBSD.cpp
+  NativeThreadNetBSD.cpp
+
+  LINK_LIBS
+lldbCore
+lldbHost
+lldbSymbol
+lldbTarget
+lldbUtility
+lldbPluginProcessPOSIX
+lldbPluginProcessUtility
+  LINK_COMPONENTS
+Support
+  )

Added: lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp?rev=298408&view=auto
==
--- lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp (added)
+++ lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Tue Mar 21 
12:30:47 2017
@@ -0,0 +1,51 @@
+//===-- NativeProcessNetBSD.cpp --- -*- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#include "NativeProcessNetBSD.h"
+
+// C Includes
+
+// C++ Includes
+
+// Other libraries and framework includes
+
+#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
+
+// System includes - They have to be included after framework includes because
+// they define some
+// macros which collide with variable names in other modules
+
+using namespace lldb;
+using namespace lldb_private;
+using namespace lldb_private::process_netbsd;
+using namespace llvm;
+
+// 
-
+// Public Static Methods
+// 
-
+
+Error NativeProcessProtocol::Launch(
+ProcessLaunchInfo &launch_info,
+NativeProcessProtocol::NativeDelegate &native_delegate, MainLoop &mainloop,
+NativeProcessProtocolSP &native_process_sp) {
+  return Error();
+}
+
+Error NativeProcessProtocol::Attach(
+lldb::pid_t pid, NativeProcessProtocol::NativeDelegate &native_delegate,
+MainLoop &mainloop, NativeProcessProtocolSP &native_process_sp) {
+  return Error();
+}
+
+// 
-
+// Public Instance Methods
+// 
-
+
+NativeProcessNetBSD::NativeProcessNetBSD()
+: NativeProcessPr

[Lldb-commits] [lldb] r298409 - Create instance of DynamicLoaderPOSIXDYLD on NetBSD

2017-03-21 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Tue Mar 21 12:39:15 2017
New Revision: 298409

URL: http://llvm.org/viewvc/llvm-project?rev=298409&view=rev
Log:
Create instance of DynamicLoaderPOSIXDYLD on NetBSD

Summary:
NetBSD is a modern ELF UNIX-like system.

There is requires DynamicLoaderPOSIXDYLD e.g. for ELF AUXV reading from the 
client.

Sponsored by 

Reviewers: labath, joerg, kettenis

Reviewed By: labath

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31192

Modified:

lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp

Modified: 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp?rev=298409&r1=298408&r2=298409&view=diff
==
--- 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp 
Tue Mar 21 12:39:15 2017
@@ -63,8 +63,9 @@ DynamicLoader *DynamicLoaderPOSIXDYLD::C
   if (!create) {
 const llvm::Triple &triple_ref =
 process->GetTarget().GetArchitecture().GetTriple();
-if (triple_ref.getOS() == llvm::Triple::Linux ||
-triple_ref.getOS() == llvm::Triple::FreeBSD)
+if (triple_ref.getOS() == llvm::Triple::FreeBSD ||
+triple_ref.getOS() == llvm::Triple::Linux ||
+triple_ref.getOS() == llvm::Triple::NetBSD)
   create = true;
   }
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r298524 - Reuse appropriate Launch and Attach on NetBSD

2017-03-22 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Wed Mar 22 12:24:37 2017
New Revision: 298524

URL: http://llvm.org/viewvc/llvm-project?rev=298524&view=rev
Log:
Reuse appropriate Launch and Attach on NetBSD

Summary:
NetBSD ships with NativeProcessNetBSD  inherited from NativeProcessProtocol.

Link Plugins/Process/gdb-remote with lldbPluginProcessNetBSD in order to resolve
correctly the linking to Launch and Attach from the NetBSD plugin.

Sponsored by 

Reviewers: kettenis, labath, emaste, joerg

Reviewed By: labath, emaste

Subscribers: mgorny, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31231

Modified:
lldb/trunk/source/Host/common/NativeProcessProtocol.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt

Modified: lldb/trunk/source/Host/common/NativeProcessProtocol.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/NativeProcessProtocol.cpp?rev=298524&r1=298523&r2=298524&view=diff
==
--- lldb/trunk/source/Host/common/NativeProcessProtocol.cpp (original)
+++ lldb/trunk/source/Host/common/NativeProcessProtocol.cpp Wed Mar 22 12:24:37 
2017
@@ -504,7 +504,7 @@ Error NativeProcessProtocol::ResolveProc
 return Error("failed to retrieve a valid architecture from the exe 
module");
 }
 
-#ifndef __linux__
+#if !defined(__linux__) && !defined(__NetBSD__)
 // These need to be implemented to support lldb-gdb-server on a given platform.
 // Stubs are
 // provided to make the rest of the code link on non-supported platforms.

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt?rev=298524&r1=298523&r2=298524&view=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/CMakeLists.txt Wed Mar 22 
12:24:37 2017
@@ -11,6 +11,10 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux|Andr
   list(APPEND LLDB_PLUGINS lldbPluginProcessLinux)
 endif()
 
+if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+  list(APPEND LLDB_PLUGINS lldbPluginProcessNetBSD)
+endif()
+
 add_lldb_library(lldbPluginProcessGDBRemote PLUGIN
   GDBRemoteClientBase.cpp
   GDBRemoteCommunication.cpp


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r298810 - [LLDB] OpenBSD support

2017-03-26 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Sun Mar 26 10:34:57 2017
New Revision: 298810

URL: http://llvm.org/viewvc/llvm-project?rev=298810&view=rev
Log:
[LLDB] OpenBSD support

Summary:
Add basic OpenBSD support. This is enough to be able to analyze core dumps for 
OpenBSD/amd64, OpenBSD/arm, OpenBSD/arm64 and OpenBSD/i386.

Note that part of the changes to 
source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp fix a bug that probably affects 
other platforms as well.  The GetProgramHeaderByIndex() interface use 1-based 
indices, but in some case when looping over the headers the, the loop starts at 
0 and misses the last header.  This caused problems on OpenBSD since OpenBSD 
core dumps have the PT_NOTE segment as the last program header.


Reviewers: joerg, labath, krytarowski

Reviewed By: krytarowski

Subscribers: aemerson, emaste, rengolin, srhines, krytarowski, mgorny, 
lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31131

Added:
lldb/trunk/include/lldb/Host/openbsd/
lldb/trunk/include/lldb/Host/openbsd/Config.h
lldb/trunk/include/lldb/Host/openbsd/HostInfoOpenBSD.h
lldb/trunk/source/Host/openbsd/
lldb/trunk/source/Host/openbsd/Host.cpp
lldb/trunk/source/Host/openbsd/HostInfoOpenBSD.cpp
lldb/trunk/source/Plugins/Platform/OpenBSD/
lldb/trunk/source/Plugins/Platform/OpenBSD/CMakeLists.txt
lldb/trunk/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp
lldb/trunk/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.h
lldb/trunk/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.h
lldb/trunk/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.h
Modified:
lldb/trunk/include/lldb/Host/Config.h
lldb/trunk/include/lldb/Host/Editline.h
lldb/trunk/include/lldb/Host/Host.h
lldb/trunk/include/lldb/Host/HostInfo.h
lldb/trunk/source/API/SystemInitializerFull.cpp
lldb/trunk/source/CMakeLists.txt
lldb/trunk/source/Host/CMakeLists.txt
lldb/trunk/source/Host/common/Host.cpp
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/trunk/source/Plugins/Platform/CMakeLists.txt
lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt
lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp

Modified: lldb/trunk/include/lldb/Host/Config.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Config.h?rev=298810&r1=298809&r2=298810&view=diff
==
--- lldb/trunk/include/lldb/Host/Config.h (original)
+++ lldb/trunk/include/lldb/Host/Config.h Sun Mar 26 10:34:57 2017
@@ -22,8 +22,7 @@
 
 #include "lldb/Host/linux/Config.h"
 
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ||   
\
-defined(__OpenBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 
 #include "lldb/Host/freebsd/Config.h"
 
@@ -31,6 +30,10 @@
 
 #include "lldb/Host/netbsd/Config.h"
 
+#elif defined(__OpenBSD__)
+
+#include "lldb/Host/openbsd/Config.h"
+
 #elif defined(__MINGW__) || defined(__MINGW32__)
 
 #include "lldb/Host/mingw/Config.h"

Modified: lldb/trunk/include/lldb/Host/Editline.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Editline.h?rev=298810&r1=298809&r2=298810&view=diff
==
--- lldb/trunk/include/lldb/Host/Editline.h (original)
+++ lldb/trunk/include/lldb/Host/Editline.h Sun Mar 26 10:34:57 2017
@@ -43,7 +43,8 @@
 // will only be
 // used in cases where this is true.  This is a compile time dependecy, for now
 // selected per target Platform
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) ||   
\
+defined(__OpenBSD__)
 #define LLDB_EDITLINE_USE_WCHAR 1
 #include 
 #else

Modified: lldb/trunk/include/lldb/Host/Host.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Host.h?rev=298810&r1=298809&r2=298810&view=diff
==
--- lldb/trunk/include/lldb/Host/Host.h (original)
+++ lldb/trunk/include/lldb/Host/Host.h Sun Mar 26 10:34:57 2017
@@ -185,7 +185,7 @@ public:
   static bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &proc_info);
 
 #if (defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) ||   
\
- defined(__GLIBC__) || defined(__NetBSD__)) && 
\
+ defined(__GLIBC__) || defined(__NetBSD__) || defined(__OpenBSD__)) && 
\
 !defined(__ANDROID__)
 
   static short GetPosixspawnFlags(const ProcessLaunchInfo &launch_info);

Modified:

[Lldb-commits] [lldb] r298953 - Add support for tracing hello-world application on NetBSD

2017-03-28 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Tue Mar 28 17:43:17 2017
New Revision: 298953

URL: http://llvm.org/viewvc/llvm-project?rev=298953&view=rev
Log:
Add support for tracing hello-world application on NetBSD

Summary:
This patch is a stripped down from features a NetBSD process
code (patch is kept under 2k LOC). This code has assumption that
there is only one thread within a debugged process. The only
debugger trap supported is software breakpoint (TRAP_BRKPT).
The generic platform code requires to add dummy function for
watchpoints etc. These functions are currently empty.
This code is not the final platform support as is and it's treated as
a base to extend, refactor and address issues afterwards.

Supported features:
 - handle software breakpoints,
 - correctly attach to a tracee,
 - support NetBSD specific ptrace(2),
 - monitor process termination,
 - monitor SIGTRAP events,
 - monitor SIGSTOP events,
 - monitor other signals events,
 - resume the whole process,
 - get memory region info perms,
 - read memory from tracee,
 - write memory to tracee,
 - read ELF AUXV,
 - x86_64 GPR read and write code

For the generic framework include:
 - halt,
 - detach,
 - signal,
 - kill,
 - allocatememory,
 - deallocatememory,
 - update threads,
 - getarchitecture,
 - getfileloadaddress,
 - and others.

This code has preliminary AddThread code.

Out of interest in this patch:
 - exec() traps,
 - hardware debug register traps,
 - single step trap,
 - thread creation/termination trap,
 - process fork(2), vfork(2) and vfork(2) done traps,
 - syscall entry and exit trap,
 - threads,
 - FPR registers,
 - retrieving tracee's thread name,
 - non x86_64 support.

This code can be used to start a hello world application and trace it.

This code can be used by other BSD systems as a starting point to get similar
capabilities.

Sponsored by 

Reviewers: emaste, joerg, kettenis, labath

Subscribers: mgorny, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31374

Added:

lldb/trunk/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp

lldb/trunk/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h
Modified:
lldb/trunk/source/Plugins/Process/NetBSD/CMakeLists.txt
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
lldb/trunk/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.cpp
lldb/trunk/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h
lldb/trunk/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
lldb/trunk/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h

Modified: lldb/trunk/source/Plugins/Process/NetBSD/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/CMakeLists.txt?rev=298953&r1=298952&r2=298953&view=diff
==
--- lldb/trunk/source/Plugins/Process/NetBSD/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/NetBSD/CMakeLists.txt Tue Mar 28 17:43:17 
2017
@@ -5,6 +5,7 @@ include_directories(../Utility)
 add_lldb_library(lldbPluginProcessNetBSD PLUGIN
   NativeProcessNetBSD.cpp
   NativeRegisterContextNetBSD.cpp
+  NativeRegisterContextNetBSD_x86_64.cpp
   NativeThreadNetBSD.cpp
 
   LINK_LIBS

Modified: lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp?rev=298953&r1=298952&r2=298953&view=diff
==
--- lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Tue Mar 28 
17:43:17 2017
@@ -14,18 +14,77 @@
 // C++ Includes
 
 // Other libraries and framework includes
-
 #include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
+#include "lldb/Core/State.h"
+#include "lldb/Host/HostProcess.h"
+#include "lldb/Host/common/NativeBreakpoint.h"
+#include "lldb/Host/common/NativeRegisterContext.h"
+#include "lldb/Host/posix/ProcessLauncherPosixFork.h"
+#include "lldb/Target/Process.h"
 
 // System includes - They have to be included after framework includes because
 // they define some
 // macros which collide with variable names in other modules
+// clang-format off
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+// clang-format on
 
 using namespace lldb;
 using namespace lldb_private;
 using namespace lldb_private::process_netbsd;
 using namespace llvm;
 
+static ExitType convert_pid_status_to_exit_type(int status) {
+  if (WIFEXITED(status))
+return ExitType::eExitTypeExit;
+  else if (WIFSIGNALED(status))
+return ExitType::eExitTypeSignal;
+  else if (WIFSTOPPED(status))
+return ExitType::eExitTypeStop;
+  else {
+// We don't know what this is.
+return ExitType::eExitTypeInvalid;
+  }
+}
+
+static int convert_pid_st

[Lldb-commits] [lldb] r298970 - Remove dead include from the NetBSD code.

2017-03-28 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Tue Mar 28 20:10:21 2017
New Revision: 298970

URL: http://llvm.org/viewvc/llvm-project?rev=298970&view=rev
Log:
Remove dead include  from the NetBSD code.

Modified:
lldb/trunk/source/Host/netbsd/Host.cpp

Modified: lldb/trunk/source/Host/netbsd/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/netbsd/Host.cpp?rev=298970&r1=298969&r2=298970&view=diff
==
--- lldb/trunk/source/Host/netbsd/Host.cpp (original)
+++ lldb/trunk/source/Host/netbsd/Host.cpp Tue Mar 28 20:10:21 2017
@@ -1,5 +1,4 @@
-//===-- source/Host/netbsd/Host.cpp --*- C++
-//-*-===//
+//===-- source/Host/netbsd/Host.cpp -*- C++ 
-*-===//
 //
 // The LLVM Compiler Infrastructure
 //
@@ -15,7 +14,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r299023 - Add NetBSD path for Debugging Information in Separate Files

2017-03-29 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Wed Mar 29 14:52:24 2017
New Revision: 299023

URL: http://llvm.org/viewvc/llvm-project?rev=299023&view=rev
Log:
Add NetBSD path for Debugging Information in Separate Files

Summary:
NetBSD stores debug information files in the `/usr/libdata/debug` path.

This change fixes debugging distribution executables, e.g. `look`(1):

```
$ lldb /usr/bin/look

(lldb) target create "/usr/bin/look"
Current executable set to '/usr/bin/look' (x86_64).
(lldb) b main
Breakpoint 1: where = look`main + 22 at look.c:107, address = 0x0da6
(lldb) r
Process 23473 launched: '/usr/bin/look' (x86_64)
Process 23473 stopped
* thread #1, stop reason = breakpoint 1.1
frame #0: 0x000186600da6 look`main(argc=1, argv=0x7f7fffc7c488) at 
look.c:107
   104  
   105  string = NULL;
   106  file = _PATH_WORDS;
-> 107  termchar = '\0';
   108  while ((ch = getopt(argc, argv, "dft:")) != -1)
   109  switch(ch) {
   110  case 'd':
(lldb)
```

There is no `/usr/lib/debug` path on NeBSD, so remove it from search.

Sponsored by 

Reviewers: jingham, emaste, kettenis, labath, joerg

Reviewed By: labath

Subscribers: aprantl, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31461

Modified:
lldb/trunk/source/Host/common/Symbols.cpp

Modified: lldb/trunk/source/Host/common/Symbols.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=299023&r1=299022&r2=299023&view=diff
==
--- lldb/trunk/source/Host/common/Symbols.cpp (original)
+++ lldb/trunk/source/Host/common/Symbols.cpp Wed Mar 29 14:52:24 2017
@@ -212,8 +212,13 @@ FileSpec Symbols::LocateExecutableSymbol
 debug_file_search_paths.AppendIfUnique(FileSpec(".", true));
 
 #ifndef LLVM_ON_WIN32
+#if defined(__NetBSD__)
+// Add /usr/libdata/debug directory.
+debug_file_search_paths.AppendIfUnique(FileSpec("/usr/libdata/debug", 
true));
+#else
 // Add /usr/lib/debug directory.
 debug_file_search_paths.AppendIfUnique(FileSpec("/usr/lib/debug", true));
+#endif
 #endif // LLVM_ON_WIN32
 
 std::string uuid_str;


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r299109 - Battery of NetBSD support improvements

2017-03-30 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Thu Mar 30 15:25:29 2017
New Revision: 299109

URL: http://llvm.org/viewvc/llvm-project?rev=299109&view=rev
Log:
Battery of NetBSD support improvements

Summary:
Include initial support for:
 - single step mode (PT_STEP)
 - single step trap handling (TRAP_TRACE)
 - exec() trap (TRAP_EXEC)
 - add placeholder interfaces for FPR
 - initial code for NetBSD core(5) files
 - minor tweaks

While there improve style of altered elf-core/ files.

This code raises the number of passing tests on NetBSD to around 50% 
(600+/1200+).

The introduced code is subject to improve afterwards for additional features 
and bug fixes.

Sponsored by 

Reviewers: labath, joerg, emaste, kettenis

Reviewed By: labath

Subscribers: srhines, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31450

Modified:
lldb/trunk/source/Host/common/Host.cpp
lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
lldb/trunk/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.cpp
lldb/trunk/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h

lldb/trunk/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp

lldb/trunk/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h
lldb/trunk/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
lldb/trunk/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h
lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=299109&r1=299108&r2=299109&view=diff
==
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Thu Mar 30 15:25:29 2017
@@ -679,7 +679,7 @@ Error Host::LaunchProcessPosixSpawn(cons
   sigemptyset(&no_signals);
   sigfillset(&all_signals);
   ::posix_spawnattr_setsigmask(&attr, &no_signals);
-#if defined(__linux__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
   ::posix_spawnattr_setsigdefault(&attr, &no_signals);
 #else
   ::posix_spawnattr_setsigdefault(&attr, &all_signals);

Modified: lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp?rev=299109&r1=299108&r2=299109&view=diff
==
--- lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp 
(original)
+++ lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp Thu 
Mar 30 15:25:29 2017
@@ -379,12 +379,13 @@ bool DYLDRendezvous::RemoveSOEntries() {
 }
 
 bool DYLDRendezvous::SOEntryIsMainExecutable(const SOEntry &entry) {
-  // On Linux the executable is indicated by an empty path in the entry. On
-  // FreeBSD and on Android it is the full path to the executable.
+  // On some systes the executable is indicated by an empty path in the entry.
+  // On others it is the full path to the executable.
 
   auto triple = m_process->GetTarget().GetArchitecture().GetTriple();
   switch (triple.getOS()) {
   case llvm::Triple::FreeBSD:
+  case llvm::Triple::NetBSD:
 return entry.file_spec == m_exe_file_spec;
   case llvm::Triple::Linux:
 if (triple.isAndroid())

Modified: lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp?rev=299109&r1=299108&r2=299109&view=diff
==
--- lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Thu Mar 30 
15:25:29 2017
@@ -235,6 +235,24 @@ void NativeProcessNetBSD::MonitorSIGTRAP
   }
   SetState(StateType::eStateStopped, true);
   break;
+case TRAP_TRACE:
+  for (const auto &thread_sp : m_threads) {
+
static_pointer_cast(thread_sp)->SetStoppedByTrace();
+  }
+  SetState(StateType::eStateStopped, true);
+  break;
+case TRAP_EXEC: {
+  Error error = ReinitializeThreads();
+  if (error.Fail()) {
+SetState(StateType::eStateInvalid);
+return;
+  }
+
+  // Let our delegate know we have just exec'd.
+  NotifyDidExec();
+
+  SetState(StateType::eStateStopped, true);
+} break;
 }
   }
 }
@@ -389,11 +407,13 @@ Error NativeProcessNetBSD::Resume(const
 return Error();
   }
 
+  Error error;
+
   switch (action->state) {
   case eStateRunning: {
 // Run the thread, possibly feeding it the signal.
-   

[Lldb-commits] [lldb] r299783 - Correct environ parsing on NetBSD

2017-04-07 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Fri Apr  7 11:45:36 2017
New Revision: 299783

URL: http://llvm.org/viewvc/llvm-project?rev=299783&view=rev
Log:
Correct environ parsing on NetBSD

Summary:
This replaces old code in Host::GetEnvironment for NetBSD
with the version from Linux. This makes parsing environment
variables correctly. It also fixes programs that depend on the
variables like curses(3) applications.

Long term this function should be moved to Process Plugin,
as currently env variables are not available with remote
debugging.

Other BSDs might want to catch up after this change.

Tested with NetBSD top(1).

Sponsored by 

Reviewers: emaste, labath, joerg, kettenis

Reviewed By: emaste

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31784

Modified:
lldb/trunk/source/Host/netbsd/Host.cpp

Modified: lldb/trunk/source/Host/netbsd/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/netbsd/Host.cpp?rev=299783&r1=299782&r2=299783&view=diff
==
--- lldb/trunk/source/Host/netbsd/Host.cpp (original)
+++ lldb/trunk/source/Host/netbsd/Host.cpp Fri Apr  7 11:45:36 2017
@@ -52,15 +52,12 @@ using namespace lldb;
 using namespace lldb_private;
 
 size_t Host::GetEnvironment(StringList &env) {
-  char *v;
-  char **var = environ;
-  for (; var != NULL && *var != NULL; ++var) {
-v = ::strchr(*var, (int)'-');
-if (v == NULL)
-  continue;
-env.AppendString(v);
-  }
-  return env.GetSize();
+  char **host_env = environ;
+  char *env_entry;
+  size_t i;
+  for (i = 0; (env_entry = host_env[i]) != NULL; ++i)
+env.AppendString(env_entry);
+  return i;
 }
 
 static bool GetNetBSDProcessArgs(const ProcessInstanceInfoMatch 
*match_info_ptr,


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D31825: Fix loading core(5) files from NetBSD 7.99.67

2017-04-11 Thread Kamil Rytarowski via lldb-commits
Right,

This patch happened to does not fully work for me (NetBSD-CORE@ switches
were skipped), I will be back to it once I will get my current efforts
done on watchpoints and fpr.

Thank you for the initial scratch!

On 11.04.2017 17:14, Zachary Turner wrote:
> Just to be clear, this patch was only intended to be a starting point. I
> didn't run the test suite or do anything other than verify that the core
> loaded. ArchSpec is a pretty core class so touching it in this manner is
> likely to have many side effects that you'll need to work out.
> 
> Most likely so many tests fail on NetBSD that it masks the regressions,
> but you should at least be able to diff your test results before/after
> On Tue, Apr 11, 2017 at 6:12 AM Kamil Rytarowski via Phabricator
> mailto:revi...@reviews.llvm.org>> wrote:
> 
> krytarowski added a comment.
> 
> I might need some guidance to address the asserts appropriately in
> finite time.
> 
> In general we set osabi to generic unix (value 0), and NetBSD
> core(5) files are distinguished only (or mostly) with "NetBSD-CORE*"
> notes.
> 
> 
> Repository:
>   rL LLVM
> 
> https://reviews.llvm.org/D31825
> 
> 
> 




signature.asc
Description: OpenPGP digital signature
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r300548 - Introduce FPR and Debug Registers/NetBSD/amd64 support

2017-04-18 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Tue Apr 18 07:53:35 2017
New Revision: 300548

URL: http://llvm.org/viewvc/llvm-project?rev=300548&view=rev
Log:
Introduce FPR and Debug Registers/NetBSD/amd64 support

Summary:
This code offers Debug Registers (80386) model in LLDB/amd64.

This is initial support and has one issue that will be addressed later,
Debug Register trap (TRAP_DBREG) is registered as (TRAP_TRACE)
for unknown reason.  On the other hand this works good enough to
move on and leave this bug to be squashed later.

Improve the NativeProcessNetBSD::ReinitializeThreads() function,
stop setting inside it SetStoppedByExec(). This fixes incorrect
stop reason on attaching (SetStoppedBySignal(SIGSTOP)).

This commits also has no functional style improvements from
clang-format.

This code also ships with FXSAVE support on NetBSD.

Demo:

```
$ lldb ./watch  

(lldb) target create "./watch"
Current executable set to './watch' (x86_64).
(lldb) b main
Breakpoint 1: where = watch`main + 15 at watch.c:8, address = 0x0040087f
(lldb) r
Process 1573 launched: './watch' (x86_64)
Process 1573 stopped
* thread #1, stop reason = breakpoint 1.1
frame #0: 0x0040087f watch`main(argc=1, argv=0x7f7fffa12b88) at 
watch.c:8
   5{
   6int i, j, k;
   7
-> 8for (i = 0; i < 3; i++)
   9for (j = 0; j < 3; j++)
   10   for (k = 0; k < 3; k++)
   11   printf("Hello world! i=%d j=%d k=%d\n", 
i, j, k);
(lldb) watch set var i
Watchpoint created: Watchpoint 1: addr = 0x7f7fffa12b4c size = 4 state = 
enabled type = w
declare @ '/public/lldb_devel/watch.c:6'
watchpoint spec = 'i'
new value: 0
(lldb) c
Process 1573 resuming
Hello world! i=0 j=0 k=0
Hello world! i=0 j=0 k=1
Hello world! i=0 j=0 k=2
Hello world! i=0 j=1 k=0
Hello world! i=0 j=1 k=1
Hello world! i=0 j=1 k=2
Hello world! i=0 j=2 k=0
Hello world! i=0 j=2 k=1
Hello world! i=0 j=2 k=2
Process 1573 stopped
* thread #1, stop reason = trace
frame #0: 0x004008cc watch`main(argc=1, argv=0x7f7fffa12b88) at 
watch.c:8
   5{
   6int i, j, k;
   7
-> 8for (i = 0; i < 3; i++)
   9for (j = 0; j < 3; j++)
   10   for (k = 0; k < 3; k++)
   11   printf("Hello world! i=%d j=%d k=%d\n", 
i, j, k)
```

FPR (in another program using libm)

```
(lldb) register read --all
General Purpose Registers:
   rax = 0x001c
   rbx = 0x7f7fff1d4fe0
   rcx = 0x000c
   rdx = 0x0002
   rdi = 0x746711d5b018  __sF + 152
   rsi = 0x0001
   rbp = 0x7f7fff1d3d80
   rsp = 0x7f7fff1d3d60
r8 = 0x7f7fff1d3470
r9 = 0x
   r10 = 0x0001
   r11 = 0x0202
   r12 = 0x7f7fff1d3da0
   r13 = 0x7d8ad2d88500
   r14 = 0x0002
   r15 = 0x7f7fffa627e0
   rip = 0x004009e9  fpr`main + 217 at fpr.c:15
rflags = 0x0202
cs = 0x0047
fs = 0x
gs = 0x
ss = 0x003f
ds = 0x003f
es = 0x003f
   eax = 0x001c
   ebx = 0xff1d4fe0
   ecx = 0x000c
   edx = 0x0002
   edi = 0x11d5b018
   esi = 0x0001
   ebp = 0xff1d3d80
   esp = 0xff1d3d60
   r8d = 0xff1d3470
   r9d = 0x
  r10d = 0x0001
  r11d = 0x0202
  r12d = 0xff1d3da0
  r13d = 0xd2d88500
  r14d = 0x0002
  r15d = 0xffa627e0
ax = 0x001c
bx = 0x4fe0
cx = 0x000c
dx = 0x0002
di = 0xb018
si = 0x0001
bp = 0x3d80
sp = 0x3d60
   r8w = 0x3470
   r9w = 0x
  r10w = 0x0001
  r11w = 0x0202
  r12w = 0x3da0
  r13w = 0x8500
  r14w = 0x0002
  r15w = 0x27e0
ah = 0x00
bh = 0x4f
ch = 0x00
dh = 0x00
al = 0x1c
bl = 0xe0
cl = 0x0c
dl = 0x02
   dil = 0x18
   sil = 0x01
   bpl = 0x80
   spl = 0x60
   r8l = 0x70
   r9l = 0x00
  r10l = 0x01
  r11l = 0x02
  r12l = 0xa0
  r13l = 0x00
  r14l = 0x02
  r15l = 0xe0

unknown:
 fctrl = 0x037f
 fstat = 0x0220
  ftag = 0x00
   fop = 0x
 fiseg = 0x11e1a52c
 fioff = 0x11e1a52c
 foseg = 0xff1d3d54
 fooff = 0xff1d3d54
 mxcsr = 0x1fa0
  mxcsrmask = 0x
   st0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
   st1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
   st2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
   st3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
   

[Lldb-commits] [lldb] r300853 - Resurrect LLDB Standalone build on NetBSD

2017-04-20 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Thu Apr 20 11:35:36 2017
New Revision: 300853

URL: http://llvm.org/viewvc/llvm-project?rev=300853&view=rev
Log:
Resurrect LLDB Standalone build on NetBSD

Include CheckIncludeFile for check_include_file() in CMake.

Detect  in CMake.
This header is available on NetBSD.

Modified:
lldb/trunk/cmake/modules/LLDBConfig.cmake

Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=300853&r1=300852&r2=300853&view=diff
==
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Thu Apr 20 11:35:36 2017
@@ -433,7 +433,9 @@ endif()
 
 find_package(Backtrace)
 
+include(CheckIncludeFile)
 check_include_file(termios.h HAVE_TERMIOS_H)
+check_include_file(sys/event.h HAVE_SYS_EVENT_H)
 
 # These checks exist in LLVM's configuration, so I want to match the LLVM names
 # so that the check isn't duplicated, but we translate them into the LLDB names


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D32149: Correct handling NetBSD core(5) files with threads

2017-04-21 Thread Kamil Rytarowski via lldb-commits
Thanks! I'm working on this, I will test new code soon and submit to review.

On 20.04.2017 15:51, Zachary Turner wrote:
> Note that getAsInteger returns false on success, so be careful!
> On Thu, Apr 20, 2017 at 6:09 AM Pavel Labath via Phabricator
> mailto:revi...@reviews.llvm.org>> wrote:
> 
> labath added a comment.
> 
> In https://reviews.llvm.org/D32149#731920, @krytarowski wrote:
> 
> > In https://reviews.llvm.org/D32149#731887, @labath wrote:
> >
> > > A test would infinitely times more valuable then a demo script.
> What is the tiniest core file you can produce on NetBSD? (on linux
> we've gotten them down to about 20K) Then we could check that in and
> write a test for it...
> >
> >
> > This is something I wanted to bring to the dev mailing list.
> >
> > I wanted to prepare at least three tests, if possible four:
> >
> > - one thread (if possible two variations: signal to one particular
> thread + signal to all threads)
> > - multiple threads (signal to one particular thread + signal to
> all threads)
> >
> >   And this in combination of all supported targets (x86_64, i386,
> etc).
> >
> >   Emitting SIGABRT for such program gives core of size 97kilobytes:
> >
> >   ``` int main(){for(;;);} ```
> >
> >   I will write assembly programs for the above cases, without libc.
> 
> 
> Cool, I am looking forward to the results.
> 
> 
> 
> 
> Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:795
> +
> +if ((note.n_name == "NetBSD-CORE") &&
> +(note.n_type == NETBSD::NT_PROCINFO)) {
> 
> How about `StringRef name = note.n_name;`
> 
> 
> 
> Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:803
> +  m_auxv = DataExtractor(note_data);
> +} else if ((note.n_name.substr(0, 12) == "NetBSD-CORE@")) {
> +  switch (arch.GetMachine()) {
> 
> Then this can be
> ```
> else if (name.consume_front("NetBSD-CORE@")) {
>   ...
>   if (name.getAsInteger(0, tid))
> error...
> ```
> 
> 
> 
> Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:848
> +  if (siglwp == 0) {
> +std::for_each(
> +m_thread_data.begin(), m_thread_data.end(),
> 
> `for (auto &data: m_thread_data) data.signo = signo` seems shorter,
> more understandable, and consistent with other usages in this file.
> 
> 
> 
> Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:856
> +
> +for (auto it = m_thread_data.begin(); it !=
> m_thread_data.end(); ++it) {
> +  if (it->tid == siglwp) {
> 
> This could also be a range-based for.
> 
> 
> Repository:
>   rL LLVM
> 
> https://reviews.llvm.org/D32149
> 
> 
> 




signature.asc
Description: OpenPGP digital signature
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D32149: Correct handling NetBSD core(5) files with threads

2017-04-27 Thread Kamil Rytarowski via lldb-commits
Thanks, I will give it a try!

On 27.04.2017 17:59, Zachary Turner wrote:
> In case it's not obvious, note the space in the command I said to run.
>  `git-clang-format` has a dash, and when you run `git clang-format`
> (with a space), it will run the file with the dash.
> 
> On Thu, Apr 27, 2017 at 8:58 AM Zachary Turner  > wrote:
> 
> There is a file in the repo called git-clang-format.  Make sure that
> file is on your PATH somewhere, then just run `git clang-format`. 
> It will only touch lines that are part of your diff, and leave
> surrounding lines alone.  When making a diff, we only want to
> clang-format the lines we touched, not the entire files.
> 
> On Thu, Apr 27, 2017 at 8:56 AM Kamil Rytarowski via Phabricator
> mailto:revi...@reviews.llvm.org>> wrote:
> 
> krytarowski added inline comments.
> 
> 
> 
> Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:302
> +  // default 32 or 64 bit arch (without any architecture
> revision) based on
> +  // object file's class.
>if (header.e_type == ET_CORE) {
> 
> joerg wrote:
> > Unrelated cosmetic change.
> I let clang-format to go and alter minor things. I can run
> clang-format over original files - commit, and add my diff again.
> 
> 
> 
> Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:463
> 
> -enum { NT_PROCINFO = 1, NT_AUXV, NT_AMD64_REGS = 33,
> NT_AMD64_FPREGS = 35 };
> +enum { NT_PROCINFO = 1, NT_PROCINFO_SIZE = 160, NT_AUXV = 2 };
> +
> 
> joerg wrote:
> > Either sort them by value or by name, but not randomly
> I will split this enum{} into two enums.
> 
> 
> 
> Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:523
> +
> +  offset += 108;
> +  cpi_nlwps = data.GetU32(&offset); /* number of LWPs */
> 
> joerg wrote:
> > Can you define a constant for the offset here below instead of
> a magic number?
> I will try to get something to define aliases for these magic
> numbers.
> 
> 
> 
> Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:844
> +  if (m_thread_data.size() != nlwps)
> +return Error("rror parsing NetBSD core(5) notes: Mismatch
> between the "
> + "number of LWPs in netbsd_elfcore_procinfo and
> the number of "
> 
> joerg wrote:
> > Typo
> OK
> 
> 
> 
> Comment at: source/Plugins/Process/elf-core/ProcessElfCore.cpp:854
> +  /* Signal destinated for a particular LWP */
> +  else {
> +bool passed = false;
> 
> joerg wrote:
> > Move the else to the } and the comment after the {
> OK
> 
> 
> Repository:
>   rL LLVM
> 
> https://reviews.llvm.org/D32149
> 
> 
> 




signature.asc
Description: OpenPGP digital signature
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r301603 - Resurrect the standalone build of LLDB

2017-04-27 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Thu Apr 27 19:29:54 2017
New Revision: 301603

URL: http://llvm.org/viewvc/llvm-project?rev=301603&view=rev
Log:
Resurrect the standalone build of LLDB

Switch includes "llvm/Config/config.h" to "llvm/Config/llvm-config.h".

Tested on NetBSD 7.99.70 amd64

Modified:
lldb/trunk/source/Host/common/MainLoop.cpp
lldb/trunk/source/Host/common/TCPSocket.cpp

Modified: lldb/trunk/source/Host/common/MainLoop.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/MainLoop.cpp?rev=301603&r1=301602&r2=301603&view=diff
==
--- lldb/trunk/source/Host/common/MainLoop.cpp (original)
+++ lldb/trunk/source/Host/common/MainLoop.cpp Thu Apr 27 19:29:54 2017
@@ -7,7 +7,7 @@
 //
 
//===--===//
 
-#include "llvm/Config/config.h"
+#include "llvm/Config/llvm-config.h"
 
 #include "lldb/Host/MainLoop.h"
 #include "lldb/Utility/Error.h"

Modified: lldb/trunk/source/Host/common/TCPSocket.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/TCPSocket.cpp?rev=301603&r1=301602&r2=301603&view=diff
==
--- lldb/trunk/source/Host/common/TCPSocket.cpp (original)
+++ lldb/trunk/source/Host/common/TCPSocket.cpp Thu Apr 27 19:29:54 2017
@@ -17,7 +17,7 @@
 #include "lldb/Host/MainLoop.h"
 #include "lldb/Utility/Log.h"
 
-#include "llvm/Config/config.h"
+#include "llvm/Config/llvm-config.h"
 #include "llvm/Support/raw_ostream.h"
 
 #ifndef LLDB_DISABLE_POSIX


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r303823 - Correct compiler warnings and Debug build of the NetBSD target

2017-05-24 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Wed May 24 18:59:50 2017
New Revision: 303823

URL: http://llvm.org/viewvc/llvm-project?rev=303823&view=rev
Log:
Correct compiler warnings and Debug build of the NetBSD target

Correct files present only in the NetBSD build.

Modified:
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h

Modified: lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp?rev=303823&r1=303822&r2=303823&view=diff
==
--- lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Wed May 24 
18:59:50 2017
@@ -167,8 +167,6 @@ NativeProcessNetBSD::NativeProcessNetBSD
 
 // Handles all waitpid events from the inferior process.
 void NativeProcessNetBSD::MonitorCallback(lldb::pid_t pid, int signal) {
-  Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS));
-
   switch (signal) {
   case SIGTRAP:
 return MonitorSIGTRAP(pid);
@@ -196,7 +194,6 @@ void NativeProcessNetBSD::MonitorExited(
 }
 
 void NativeProcessNetBSD::MonitorSIGSTOP(lldb::pid_t pid) {
-  Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS));
   ptrace_siginfo_t info;
 
   const auto siginfo_err =
@@ -305,8 +302,6 @@ void NativeProcessNetBSD::MonitorSIGTRAP
 }
 
 void NativeProcessNetBSD::MonitorSignal(lldb::pid_t pid, int signal) {
-  Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS));
-
   ptrace_siginfo_t info;
   const auto siginfo_err =
   PtraceWrapper(PT_GET_SIGINFO, pid, &info, sizeof(info));
@@ -898,6 +893,19 @@ void NativeProcessNetBSD::SigchldHandler
 MonitorCallback(wait_pid, signal);
 }
 
+bool NativeProcessNetBSD::HasThreadNoLock(lldb::tid_t thread_id) {
+  for (auto thread_sp : m_threads) {
+assert(thread_sp && "thread list should not contain NULL threads");
+if (thread_sp->GetID() == thread_id) {
+  // We have this thread.
+  return true;
+}
+  }
+
+  // We don't have this thread.
+  return false;
+}
+
 NativeThreadNetBSDSP NativeProcessNetBSD::AddThread(lldb::tid_t thread_id) {
 
   Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_THREAD));
@@ -916,8 +924,6 @@ NativeThreadNetBSDSP NativeProcessNetBSD
 }
 
 ::pid_t NativeProcessNetBSD::Attach(lldb::pid_t pid, Status &error) {
-  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
-
   if (pid <= 1) {
 error.SetErrorToGenericError();
 error.SetErrorString("Attaching to process 1 is not allowed.");
@@ -1006,7 +1012,7 @@ Status NativeProcessNetBSD::WriteMemory(
   io.piod_len = size;
 
   do {
-io.piod_addr = (void *)(src + bytes_written);
+io.piod_addr = const_cast(static_cast(src + 
bytes_written));
 io.piod_offs = (void *)(addr + bytes_written);
 
 Status error = NativeProcessNetBSD::PtraceWrapper(PT_IO, GetID(), &io);
@@ -1034,10 +1040,11 @@ NativeProcessNetBSD::GetAuxvData() const
   ErrorOr> buf =
   llvm::MemoryBuffer::getNewMemBuffer(auxv_size);
 
-  struct ptrace_io_desc io = {.piod_op = PIOD_READ_AUXV,
-  .piod_offs = 0,
-  .piod_addr = (void *)buf.get()->getBufferStart(),
-  .piod_len = auxv_size};
+  struct ptrace_io_desc io;
+  io.piod_op = PIOD_READ_AUXV;
+  io.piod_offs = 0;
+  io.piod_addr = const_cast(static_cast(buf.get()->getBufferStart()));
+  io.piod_len = auxv_size;
 
   Status error = NativeProcessNetBSD::PtraceWrapper(PT_IO, GetID(), &io);
 

Modified: lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h?rev=303823&r1=303822&r2=303823&view=diff
==
--- lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h (original)
+++ lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h Wed May 24 
18:59:50 2017
@@ -115,6 +115,8 @@ private:
   // -
   NativeProcessNetBSD();
 
+  bool HasThreadNoLock(lldb::tid_t thread_id);
+
   NativeThreadNetBSDSP AddThread(lldb::tid_t thread_id);
 
   Status LaunchInferior(MainLoop &mainloop, ProcessLaunchInfo &launch_info);


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r303907 - Fix bug #28898

2017-05-25 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Thu May 25 15:12:30 2017
New Revision: 303907

URL: http://llvm.org/viewvc/llvm-project?rev=303907&view=rev
Log:
Fix bug #28898
lldb: libedit produces garbled, unusable input on Linux

Apply patch from Christos Zoulas, upstream libedit developer.
It has been tested on NetBSD/amd64.

New code supports combination of wide libedit and disabled
LLDB_EDITLINE_USE_WCHAR, which was the popular case on Linux
systems.

Modified:
lldb/trunk/include/lldb/Host/Editline.h
lldb/trunk/source/Host/common/Editline.cpp

Modified: lldb/trunk/include/lldb/Host/Editline.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/Editline.h?rev=303907&r1=303906&r2=303907&view=diff
==
--- lldb/trunk/include/lldb/Host/Editline.h (original)
+++ lldb/trunk/include/lldb/Host/Editline.h Thu May 25 15:12:30 2017
@@ -82,8 +82,14 @@ using EditLineStringStreamType = std::st
 using EditLineCharType = char;
 #endif
 
+#ifdef EL_CLIENTDATA   /* editline with wide support + wide char read function 
*/
+using EditLineGetCharType = wchar_t;
+#else
+using EditLineGetCharType = char;
+#endif
+
 typedef int (*EditlineGetCharCallbackType)(::EditLine *editline,
-   EditLineCharType *c);
+   EditLineGetCharType *c);
 typedef unsigned char (*EditlineCommandCallbackType)(::EditLine *editline,
  int ch);
 typedef const char *(*EditlinePromptCallbackType)(::EditLine *editline);
@@ -270,7 +276,7 @@ private:
 
   /// Character reading implementation for EditLine that supports our 
multi-line
   /// editing trickery.
-  int GetCharacter(EditLineCharType *c);
+  int GetCharacter(EditLineGetCharType *c);
 
   /// Prompt implementation for EditLine.
   const char *Prompt();
@@ -323,7 +329,7 @@ private:
   /// single or multi-line editing.
   void ConfigureEditor(bool multiline);
 
-  bool CompleteCharacter(char ch, EditLineCharType &out);
+  bool CompleteCharacter(char ch, EditLineGetCharType &out);
 
 private:
 #if LLDB_EDITLINE_USE_WCHAR

Modified: lldb/trunk/source/Host/common/Editline.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Editline.cpp?rev=303907&r1=303906&r2=303907&view=diff
==
--- lldb/trunk/source/Host/common/Editline.cpp (original)
+++ lldb/trunk/source/Host/common/Editline.cpp Thu May 25 15:12:30 2017
@@ -474,7 +474,7 @@ unsigned char Editline::RecallHistory(bo
   return CC_NEWLINE;
 }
 
-int Editline::GetCharacter(EditLineCharType *c) {
+int Editline::GetCharacter(EditLineGetCharType *c) {
   const LineInfoW *info = el_wline(m_editline);
 
   // Paint a faint version of the desired prompt over the version libedit draws
@@ -969,7 +969,7 @@ void Editline::ConfigureEditor(bool mult
  }));
 
   el_wset(m_editline, EL_GETCFN, (EditlineGetCharCallbackType)([](
- EditLine *editline, EditLineCharType *c) {
+ EditLine *editline, EditLineGetCharType 
*c) {
 return Editline::InstanceFor(editline)->GetCharacter(c);
   }));
 
@@ -1360,12 +1360,12 @@ void Editline::PrintAsync(Stream *stream
   }
 }
 
-bool Editline::CompleteCharacter(char ch, EditLineCharType &out) {
+bool Editline::CompleteCharacter(char ch, EditLineGetCharType &out) {
 #if !LLDB_EDITLINE_USE_WCHAR
   if (ch == (char)EOF)
 return false;
 
-  out = ch;
+  out = (unsigned char)ch;
   return true;
 #else
   std::codecvt_utf8 cvt;


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r303907 - Fix bug #28898

2017-05-29 Thread Kamil Rytarowski via lldb-commits
Do you offer shell account? I don't have Linux and/or s390x to debug it.

On 29.05.2017 17:17, Ulrich Weigand via lldb-commits wrote:
> Hello,
> 
> It appears this commit broke the
> EditlineTestFixture.EditlineReceivesSingleLineText
> unit test on s390x-linux.  The test now simply hangs (hanging the whole
> test suite
> execution) ...
> 
> Mit freundlichen Gruessen / Best Regards
> 
> Ulrich Weigand
> 
> -- 
> Dr. Ulrich Weigand | Phone: +49-7031/16-3727
> STSM, GNU/Linux compilers and toolchain
> IBM Deutschland Research & Development GmbH
> Vorsitzende des Aufsichtsrats: Martina Koederitz | Geschäftsführung:
> Dirk Wittkopp
> Sitz der Gesellschaft: Böblingen | Registergericht: Amtsgericht
> Stuttgart, HRB 243294
> 
> 
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
> 




signature.asc
Description: OpenPGP digital signature
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r305794 - Correct syntax mistake hidden in assert(3)

2017-06-20 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Tue Jun 20 08:51:06 2017
New Revision: 305794

URL: http://llvm.org/viewvc/llvm-project?rev=305794&view=rev
Log:
Correct syntax mistake hidden in assert(3)

wait_status cannot be compared with WaitStatus::Stop,
go for wait_status.type.

Modified:
lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp

Modified: lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp?rev=305794&r1=305793&r2=305794&view=diff
==
--- lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp Tue Jun 20 
08:51:06 2017
@@ -845,7 +845,7 @@ void NativeProcessNetBSD::SigchldHandler
   if (exited)
 MonitorExited(wait_pid, wait_status);
   else {
-assert(wait_status == WaitStatus::Stop);
+assert(wait_status.type == WaitStatus::Stop);
 MonitorCallback(wait_pid, wait_status.status);
   }
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D23977: Support of lldb on Kfreebsd

2016-10-11 Thread Kamil Rytarowski via lldb-commits
krytarowski added inline comments.



Comment at: cmake/modules/LLDBConfig.cmake:414
+
+find_package(Backtrace REQUIRED)

tfiala wrote:
> Hi Sylvestre!
> 
> It's hard to tell without more context, but it looks like this location has 
> most/all configurations going through it.  For OSes that don't actually have 
> a backtrace package, I think this emits a cmake error, doesn't it?
> 
> This might need to be protected by the systems that need the backtrace 
> package.  (Probably Unix-like systems only?)
It's sufficient to drop the `REQUIRED` keyword and it will be fine. 
`${Backtrace_LIBRARY}` will be evaluated to NIL in case of lack of this 
dependency.

I'm unsure whether `find_pacakge()` might be after usage of 
`${Backtrace_LIBRARY}`. I would reorder it at least for clarity for a reader.


https://reviews.llvm.org/D23977



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25668: [cmake] Respect LLVM_CMAKE_PATH in stand-alone builds for GetSVN.cmake

2016-10-17 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

This change makes sense for stand-alone builds, but if it's possible to remove 
branching in this CMake file - please go for it.


https://reviews.llvm.org/D25668



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25680: [cmake] Make dependencies of lldb libraries private, take 2

2016-10-18 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Looks fine, thanks.


Repository:
  rL LLVM

https://reviews.llvm.org/D25680



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25830: Search for llvm-config in LLDB_PATH_TO_LLVM_BUILD first

2016-10-20 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

I think it's possible to specify `-DLLVM_CONFIG:PATH` option, if that does the 
job.


Repository:
  rL LLVM

https://reviews.llvm.org/D25830



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25756: FreeBSD ARM support for software single step.

2016-10-21 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

NetBSD is still focused on amd64-only port.

I start a funded project November 1st on getting x86 process plugin to work. 
More details here:

http://blog.netbsd.org/tnf/entry/funded_contract_2016_2017

Estimated time is 4 months full-time.

However there every help is appreciated and donations to TNF (The NetBSD 
Foundation) make it possible.


Repository:
  rL LLVM

https://reviews.llvm.org/D25756



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25756: FreeBSD ARM support for software single step.

2016-10-21 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

@emaste What's the status of remote debugging on FreeBSD?


Repository:
  rL LLVM

https://reviews.llvm.org/D25756



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D25756: FreeBSD ARM support for software single step.

2016-10-21 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

I just scrolled the discussion so it's not really started. Thanks.

My plan is to work on ptrace(2) for about a month.

Then I will take the FreeBSD code as it is and port to NetBSD trying to make it 
functional. This is difficult part as there is everywhere OS specific 
interfaces and behavior. I hope to get it to some usable point after a month.

Then ,I will start working on remote debugging, as my previous patch for 
process tracing (it was buggy) was rejected without this property. I planned to 
merge my previous work with master as I was forced to keep catching up after 
the project changes and it was time expensive, and move my focus on proper 
platform support.

So far all my efforts were voluntary and NetBSD build bot is paid from my 
private resources. Now I will be able to spend on in full-time about 4 months.

So to make it short, hopefully I can join you in remote capabilities after New 
Year (according to my estimations).


Repository:
  rL LLVM

https://reviews.llvm.org/D25756



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] LLGS for Free/NetBSD (was: Re: [PATCH] D25756: FreeBSD ARM support for software single step.)

2016-10-24 Thread Kamil Rytarowski via lldb-commits
On 24.10.2016 20:38, Ed Maste wrote:
> On 24 October 2016 at 06:26, Pavel Labath  wrote:
>>
>> It's not my place to tell you how to work, but I'd recommend a
>> different approach to this. If you base your work on the current
>> FreeBSD in-process plugin, then when you get around to actually
>> implementing remote support, you will find that you will have to
>> rewrite most of what you have already done to work with lldb-server,
>> as it uses completely different class hierarchies and everything. I'd
>> recommend starting with lldb-server right away. It's going to be a bit
>> more work as (I assume) freebsd implementation is closer to what you
>> need than linux, but I think it will save you time in the long run. I
>> can help you with factoring out any linux-specific code that you
>> encounter.
> 
> I definitely second the approach Pavel suggests here, and am happy to
> work with others on refactoring the Linux lldb-server so that we can
> get it to support both FreeBSD and NetBSD at the same time.
> 
> A direct port of the current FreeBSD support probably would result in
> a basic level of support running sooner, but that work would be
> largely thrown away in a future migration to lldb-server.
> 

I will take your recommended path as it will lead to the same goal.

I will try to shorten my initial work on ptrace(2) leaving additional
features+tests for later and jump to lldb-server as soon as possible.

For start, before switching to process plugin stage is to extend NetBSD
ptrace(2) with the following features:

 - PT_LWPINFO extend struct ptrace_lwpinfo with additional fields used
in LLDB in the current FreeBSD process code (pl_flags, pl_child_pid,
pl_siginfo),

 - PT_GETNUMLWPS - number of kernel threads associated with the traced
process,

 - PT_GETLWPLIST - get the current thread list,

 - PT_SUSPEND - suspend the specified thread,

 - PT_RESUME - resume the specified thread.

I need to add basic tests for new ptrace(2) calls in our automated test
infrastructure in order to get this code accepted.

I will reschedule debug registers and additional ptrace(2) calls for the
end, if time will permit.

I will also add support in LLDB for handling NetBSD Real-Time signals
(SIGRTMIN..SIGRTMAX) as it was already implemented during the latest
GSoC for NetBSD (thanks Google!).

I might need some guidance from LLDB developers (I prefer via IRC and
the dedicated LLDB channel) and maybe proof reading of patches and
debugging issues. I consider that the difficult part is not adapting
FreBSD or Linux specific implementation for NetBSD, but taking
everything to work.

My ultimate deadline for the overall LLDB work is February 28th, 2017 -
as I'm switching to Swift port for NetBSD *.



This work is sponsored by The NetBSD Foundation. If you like it, please
consider supporting it by making a donation.

* http://blog.netbsd.org/tnf/entry/funded_contract_2016_2017



signature.asc
Description: OpenPGP digital signature
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r293391 - Recognize Real-Time Signals on NetBSD

2017-01-28 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Sat Jan 28 14:01:53 2017
New Revision: 293391

URL: http://llvm.org/viewvc/llvm-project?rev=293391&view=rev
Log:
Recognize Real-Time Signals on NetBSD

Summary:
Real-Time Signals are available in NetBSD-current and will land NetBSD 8.0.
Older stable versions of NetBSD will not be supported.

Sponsored by 

Reviewers: labath, joerg, clayborg, emaste

Reviewed By: labath, clayborg, emaste

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D29091

Modified:
lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp?rev=293391&r1=293390&r2=293391&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp Sat Jan 28 
14:01:53 2017
@@ -24,7 +24,35 @@ void NetBSDSignals::Reset() {
   //===
   AddSignal(32, "SIGPWR", false, true, true,
 "power fail/restart (not reset when caught)");
-#ifdef SIGRTMIN /* SIGRTMAX */
-/* Kernel only; not exposed to userland yet */
-#endif
+  AddSignal(33, "SIGRTMIN", false, false, false, "real time signal 0");
+  AddSignal(34, "SIGRTMIN+1", false, false, false, "real time signal 1");
+  AddSignal(35, "SIGRTMIN+2", false, false, false, "real time signal 2");
+  AddSignal(36, "SIGRTMIN+3", false, false, false, "real time signal 3");
+  AddSignal(37, "SIGRTMIN+4", false, false, false, "real time signal 4");
+  AddSignal(38, "SIGRTMIN+5", false, false, false, "real time signal 5");
+  AddSignal(39, "SIGRTMIN+6", false, false, false, "real time signal 6");
+  AddSignal(40, "SIGRTMIN+7", false, false, false, "real time signal 7");
+  AddSignal(41, "SIGRTMIN+8", false, false, false, "real time signal 8");
+  AddSignal(42, "SIGRTMIN+9", false, false, false, "real time signal 9");
+  AddSignal(43, "SIGRTMIN+10", false, false, false, "real time signal 10");
+  AddSignal(44, "SIGRTMIN+11", false, false, false, "real time signal 11");
+  AddSignal(45, "SIGRTMIN+12", false, false, false, "real time signal 12");
+  AddSignal(46, "SIGRTMIN+13", false, false, false, "real time signal 13");
+  AddSignal(47, "SIGRTMIN+14", false, false, false, "real time signal 14");
+  AddSignal(48, "SIGRTMIN+15", false, false, false, "real time signal 15");
+  AddSignal(49, "SIGRTMIN-14", false, false, false, "real time signal 16");
+  AddSignal(50, "SIGRTMAX-13", false, false, false, "real time signal 17");
+  AddSignal(51, "SIGRTMAX-12", false, false, false, "real time signal 18");
+  AddSignal(52, "SIGRTMAX-11", false, false, false, "real time signal 19");
+  AddSignal(53, "SIGRTMAX-10", false, false, false, "real time signal 20");
+  AddSignal(54, "SIGRTMAX-9", false, false, false, "real time signal 21");
+  AddSignal(55, "SIGRTMAX-8", false, false, false, "real time signal 22");
+  AddSignal(56, "SIGRTMAX-7", false, false, false, "real time signal 23");
+  AddSignal(57, "SIGRTMAX-6", false, false, false, "real time signal 24");
+  AddSignal(58, "SIGRTMAX-5", false, false, false, "real time signal 25");
+  AddSignal(59, "SIGRTMAX-4", false, false, false, "real time signal 26");
+  AddSignal(60, "SIGRTMAX-3", false, false, false, "real time signal 27");
+  AddSignal(61, "SIGRTMAX-2", false, false, false, "real time signal 28");
+  AddSignal(62, "SIGRTMAX-1", false, false, false, "real time signal 29");
+  AddSignal(63, "SIGRTMAX", false, false, false, "real time signal 30");
 }


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r293392 - Switch HostInfoNetBSD::GetProgramFileSpec to sysctl(7)

2017-01-28 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Sat Jan 28 14:04:53 2017
New Revision: 293392

URL: http://llvm.org/viewvc/llvm-project?rev=293392&view=rev
Log:
Switch HostInfoNetBSD::GetProgramFileSpec to sysctl(7)

Summary:
Remove dependency on the proc (/proc) filesystem, which is optional.

KERN_PROC_PATHNAME is available in NetBSD-current and will land NetBSD 8.0.
Older stable versions of NetBSD will not be supported.

Sponsored by 

Reviewers: emaste, joerg, labath, clayborg

Reviewed By: clayborg

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D29089

Modified:
lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp

Modified: lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp?rev=293392&r1=293391&r2=293392&view=diff
==
--- lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp (original)
+++ lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp Sat Jan 28 14:04:53 2017
@@ -85,15 +85,15 @@ FileSpec HostInfoNetBSD::GetProgramFileS
   static FileSpec g_program_filespec;
 
   if (!g_program_filespec) {
-ssize_t len;
-static char buf[PATH_MAX];
-char name[PATH_MAX];
+static const int name[] = {
+CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME,
+};
+char path[MAXPATHLEN];
+size_t len;
 
-::snprintf(name, PATH_MAX, "/proc/%d/exe", ::getpid());
-len = ::readlink(name, buf, PATH_MAX - 1);
-if (len != -1) {
-  buf[len] = '\0';
-  g_program_filespec.SetFile(buf, false);
+len = sizeof(path);
+if (sysctl(name, __arraycount(name), path, &len, NULL, 0) != -1) {
+g_program_filespec.SetFile(path, false);
 }
   }
   return g_program_filespec;


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r293625 - Add NetBSD support in Host::GetCurrentThreadID

2017-01-31 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Tue Jan 31 07:38:42 2017
New Revision: 293625

URL: http://llvm.org/viewvc/llvm-project?rev=293625&view=rev
Log:
Add NetBSD support in Host::GetCurrentThreadID

Summary:
To retrieve the native thread ID there must be called _lwp_self().

Sponsored by 

Reviewers: joerg, clayborg, emaste, labath

Reviewed By: joerg, clayborg, labath

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D29264

Modified:
lldb/trunk/source/Host/common/Host.cpp

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=293625&r1=293624&r2=293625&view=diff
==
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Tue Jan 31 07:38:42 2017
@@ -40,6 +40,10 @@
 #include 
 #endif
 
+#if defined(__NetBSD__)
+#include 
+#endif
+
 // C++ Includes
 
 // Other libraries and framework includes
@@ -320,6 +324,8 @@ lldb::tid_t Host::GetCurrentThreadID() {
   return thread_self;
 #elif defined(__FreeBSD__)
   return lldb::tid_t(pthread_getthreadid_np());
+#elif defined(__NetBSD__)
+  return lldb::tid_t(_lwp_self());
 #elif defined(__ANDROID__)
   return lldb::tid_t(gettid());
 #elif defined(__linux__)


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r293768 - Transform ProcessLauncherLinux to ProcessLauncherPosixFork

2017-02-01 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Wed Feb  1 08:30:40 2017
New Revision: 293768

URL: http://llvm.org/viewvc/llvm-project?rev=293768&view=rev
Log:
Transform ProcessLauncherLinux to ProcessLauncherPosixFork

Summary:
Use ProcessLauncherPosixFork in Linux and NetBSD.

Changes to ProcessLauncherLinux:
 - Limit personality.h and ASLR code to Linux.
 - Reuse portable ptrace(2) PT_TRACE_ME operation available on Linux and BSDs.
 - Limit ETXTBSY error path from execve(2) to Linux.
 - In LaunchProcess declaration change virtual to override.

This code should be readily available for FreeBSD.

Sponsored by 

Reviewers: joerg, clayborg, labath, emaste

Reviewed By: labath

Subscribers: danalbert, srhines, mgorny, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D29347

Added:
lldb/trunk/include/lldb/Host/posix/ProcessLauncherPosixFork.h
lldb/trunk/source/Host/posix/ProcessLauncherPosixFork.cpp
Modified:
lldb/trunk/include/lldb/Host/linux/ProcessLauncherLinux.h
lldb/trunk/source/Host/CMakeLists.txt
lldb/trunk/source/Host/common/Host.cpp
lldb/trunk/source/Host/linux/ProcessLauncherLinux.cpp
lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp

Modified: lldb/trunk/include/lldb/Host/linux/ProcessLauncherLinux.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/linux/ProcessLauncherLinux.h?rev=293768&r1=293767&r2=293768&view=diff
==
--- lldb/trunk/include/lldb/Host/linux/ProcessLauncherLinux.h (original)
+++ lldb/trunk/include/lldb/Host/linux/ProcessLauncherLinux.h Wed Feb  1 
08:30:40 2017
@@ -1,25 +0,0 @@
-//===-- ProcessLauncherAndroid.h *- C++ 
-*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--===//
-
-#ifndef lldb_Host_android_ProcessLauncherAndroid_h_
-#define lldb_Host_android_ProcessLauncherAndroid_h_
-
-#include "lldb/Host/ProcessLauncher.h"
-
-namespace lldb_private {
-
-class ProcessLauncherLinux : public ProcessLauncher {
-public:
-  virtual HostProcess LaunchProcess(const ProcessLaunchInfo &launch_info,
-Error &error);
-};
-
-} // end of namespace lldb_private
-
-#endif

Added: lldb/trunk/include/lldb/Host/posix/ProcessLauncherPosixFork.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/posix/ProcessLauncherPosixFork.h?rev=293768&view=auto
==
--- lldb/trunk/include/lldb/Host/posix/ProcessLauncherPosixFork.h (added)
+++ lldb/trunk/include/lldb/Host/posix/ProcessLauncherPosixFork.h Wed Feb  1 
08:30:40 2017
@@ -0,0 +1,25 @@
+//===-- ProcessLauncherPosixFork.h --*- C++ 
-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef lldb_Host_posix_ProcessLauncherPosixFork_h_
+#define lldb_Host_posix_ProcessLauncherPosixFork_h_
+
+#include "lldb/Host/ProcessLauncher.h"
+
+namespace lldb_private {
+
+class ProcessLauncherPosixFork : public ProcessLauncher {
+public:
+  HostProcess LaunchProcess(const ProcessLaunchInfo &launch_info,
+Error &error) override;
+};
+
+} // end of namespace lldb_private
+
+#endif

Modified: lldb/trunk/source/Host/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/CMakeLists.txt?rev=293768&r1=293767&r2=293768&view=diff
==
--- lldb/trunk/source/Host/CMakeLists.txt (original)
+++ lldb/trunk/source/Host/CMakeLists.txt Wed Feb  1 08:30:40 2017
@@ -90,6 +90,7 @@ else()
 posix/LockFilePosix.cpp
 posix/MainLoopPosix.cpp
 posix/PipePosix.cpp
+posix/ProcessLauncherPosixFork.cpp
 )
 
   if (NOT (CMAKE_SYSTEM_NAME MATCHES "Android"))
@@ -122,7 +123,6 @@ else()
   linux/HostInfoLinux.cpp
   linux/HostThreadLinux.cpp
   linux/LibcGlue.cpp
-  linux/ProcessLauncherLinux.cpp
   linux/ThisThread.cpp
   )
 list(APPEND LLDB_PLUGINS lldbPluginProcessLinux)

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=293768&r1=293767&r2=293768&view=diff
==
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Wed Feb  1 08:30:40 2017
@@ -71,8 +71,8 @@
 
 #if defined(_WIN32)
 #include "lldb/Host/windows/ProcessLauncherWindows.h"
-#elif defined(__linux__)
-#include "lldb/Host/li

[Lldb-commits] [lldb] r293770 - Document that LaunchProcessPosixSpawn is used on NetBSD

2017-02-01 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Wed Feb  1 08:35:08 2017
New Revision: 293770

URL: http://llvm.org/viewvc/llvm-project?rev=293770&view=rev
Log:
Document that LaunchProcessPosixSpawn is used on NetBSD

No functional change.

Sponsored by 

Modified:
lldb/trunk/source/Host/common/Host.cpp

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=293770&r1=293769&r2=293770&view=diff
==
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Wed Feb  1 08:35:08 2017
@@ -623,7 +623,7 @@ Error Host::RunShellCommand(const Args &
   return error;
 }
 
-// LaunchProcessPosixSpawn for Apple, Linux, FreeBSD and other GLIBC
+// LaunchProcessPosixSpawn for Apple, Linux, FreeBSD, NetBSD and other GLIBC
 // systems
 
 #if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) ||
\


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r293774 - Do not pass non-POD type variables through variadic function

2017-02-01 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Wed Feb  1 10:02:55 2017
New Revision: 293774

URL: http://llvm.org/viewvc/llvm-project?rev=293774&view=rev
Log:
Do not pass non-POD type variables through variadic function

Summary:
Cannot pass object of non-POD type 'const CMIUtilString' through variadic 
function.

This behavior is undefined according to C++11 5.2.2/7:

> Passing a potentially-evaluated argument of class type having a non-trivial 
> copy constructor, a non-trivial move contructor, or a non-trivial destructor, 
> with no corresponding parameter, is conditionally-supported with 
> implementation-defined semantics.

Replace SetErrorDescriptionn(errMsg); with SetErrorDescription(errMsg);

Original patch by Tobias Nygren (NetBSD).

Sponsored by 


Reviewers: clayborg, labath, emaste, joerg, ki.stfu

Reviewed By: labath, ki.stfu

Subscribers: tnn, ki.stfu, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D29256

Modified:
lldb/trunk/tools/lldb-mi/MICmnBase.cpp
lldb/trunk/tools/lldb-mi/MICmnBase.h
lldb/trunk/tools/lldb-mi/MIDriver.cpp
lldb/trunk/tools/lldb-mi/MIUtilString.cpp
lldb/trunk/tools/lldb-mi/MIUtilString.h

Modified: lldb/trunk/tools/lldb-mi/MICmnBase.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnBase.cpp?rev=293774&r1=293773&r2=293774&view=diff
==
--- lldb/trunk/tools/lldb-mi/MICmnBase.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnBase.cpp Wed Feb  1 10:02:55 2017
@@ -122,7 +122,7 @@ void CMICmnBase::ClrErrorDescription() c
 // Return:  None.
 // Throws:  None.
 //--
-void CMICmnBase::SetErrorDescriptionn(const CMIUtilString vFormat, ...) const {
+void CMICmnBase::SetErrorDescriptionn(const char *vFormat, ...) const {
   va_list args;
   va_start(args, vFormat);
   CMIUtilString strResult = CMIUtilString::FormatValist(vFormat, args);

Modified: lldb/trunk/tools/lldb-mi/MICmnBase.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnBase.h?rev=293774&r1=293773&r2=293774&view=diff
==
--- lldb/trunk/tools/lldb-mi/MICmnBase.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnBase.h Wed Feb  1 10:02:55 2017
@@ -28,7 +28,7 @@ public:
   bool HaveErrorDescription() const;
   const CMIUtilString &GetErrorDescription() const;
   void SetErrorDescription(const CMIUtilString &vrTxt) const;
-  void SetErrorDescriptionn(const CMIUtilString vFormat, ...) const;
+  void SetErrorDescriptionn(const char *vFormat, ...) const;
   void SetErrorDescriptionNoLog(const CMIUtilString &vrTxt) const;
   void ClrErrorDescription() const;
 

Modified: lldb/trunk/tools/lldb-mi/MIDriver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MIDriver.cpp?rev=293774&r1=293773&r2=293774&view=diff
==
--- lldb/trunk/tools/lldb-mi/MIDriver.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MIDriver.cpp Wed Feb  1 10:02:55 2017
@@ -509,7 +509,7 @@ bool CMIDriver::StartWorkerThreads() {
 const CMIUtilString errMsg = CMIUtilString::Format(
 MIRSRC(IDS_THREADMGR_ERR_THREAD_FAIL_CREATE),
 CMICmnThreadMgrStd::Instance().GetErrorDescription().c_str());
-SetErrorDescriptionn(errMsg);
+SetErrorDescription(errMsg);
 return MIstatus::failure;
   }
 

Modified: lldb/trunk/tools/lldb-mi/MIUtilString.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MIUtilString.cpp?rev=293774&r1=293773&r2=293774&view=diff
==
--- lldb/trunk/tools/lldb-mi/MIUtilString.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MIUtilString.cpp Wed Feb  1 10:02:55 2017
@@ -157,7 +157,7 @@ CMIUtilString CMIUtilString::FormatPriv(
 // Return:  CMIUtilString - Number of splits found in the string data.
 // Throws:  None.
 //--
-CMIUtilString CMIUtilString::Format(const CMIUtilString vFormating, ...) {
+CMIUtilString CMIUtilString::Format(const char *vFormating, ...) {
   va_list args;
   va_start(args, vFormating);
   CMIUtilString strResult = CMIUtilString::FormatPriv(vFormating, args);

Modified: lldb/trunk/tools/lldb-mi/MIUtilString.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MIUtilString.h?rev=293774&r1=293773&r2=293774&view=diff
==
--- lldb/trunk/tools/lldb-mi/MIUtilString.h (original)
+++ lldb/trunk/tools/lldb-mi/MIUtilString.h Wed Feb  1 10:02:55 2017
@@ -30,7 +30,7 @@ public:
 
   // Static method:
 public:
-  static CMIUtilString Format(const CMIUtilString vFormating, ...);
+  static CMIUtilString Format(const char *vFormating, ...);
   static CMIUtilString FormatBinary(const MIuint64 vnDecimal);
   static CMIUtilString FormatValist(const CMIUtilString &vrFormating,
 va_list vArgs);


___

[Lldb-commits] [lldb] r293895 - Fix multi-process-driver.cpp build on NetBSD

2017-02-02 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Thu Feb  2 09:05:56 2017
New Revision: 293895

URL: http://llvm.org/viewvc/llvm-project?rev=293895&view=rev
Log:
Fix multi-process-driver.cpp build on NetBSD

Summary:
Include  for strcmp(3) and memset(3).

Sponsored by 

Reviewers: joerg, clayborg, emaste, labath

Reviewed By: clayborg

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D29403

Modified:

lldb/trunk/packages/Python/lldbsuite/test/api/multiple-debuggers/multi-process-driver.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/api/multiple-debuggers/multi-process-driver.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/api/multiple-debuggers/multi-process-driver.cpp?rev=293895&r1=293894&r2=293895&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/api/multiple-debuggers/multi-process-driver.cpp
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/api/multiple-debuggers/multi-process-driver.cpp
 Thu Feb  2 09:05:56 2017
@@ -15,7 +15,7 @@
 
 #include 
 #include 
-
+#include 
 
 #include "lldb/API/LLDB.h"
 #include "lldb/API/SBCommandInterpreter.h"


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r294071 - Install six.py conditionally

2017-02-03 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Fri Feb  3 18:20:24 2017
New Revision: 294071

URL: http://llvm.org/viewvc/llvm-project?rev=294071&view=rev
Log:
Install six.py conditionally

Summary:
The current version of LLDB installs six.py into global python library 
directory. This approach produces conflicts downstream with distribution's 
py-six copy.

Introduce new configure option LLDB_USE_SYSTEM_SIX (disabled by default). Once 
specified as TRUE, six.py won't be installed to Python's directory.

Add new option in finishSwigWrapperClasses.py, namely --useSystemSix.

Sponsored by 

Reviewers: mgorny, emaste, clayborg, joerg, labath

Reviewed By: labath

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D29405

Modified:
lldb/trunk/CMakeLists.txt
lldb/trunk/cmake/modules/LLDBConfig.cmake
lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
lldb/trunk/scripts/finishSwigWrapperClasses.py
lldb/trunk/scripts/utilsArgsParse.py

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=294071&r1=294070&r2=294071&view=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Fri Feb  3 18:20:24 2017
@@ -20,6 +20,10 @@ endif()
 # add_subdirectory(include)
 add_subdirectory(docs)
 if (NOT LLDB_DISABLE_PYTHON)
+  if(LLDB_USE_SYSTEM_SIX)
+set(SIX_EXTRA_ARGS "--useSystemSix")
+  endif()
+
   set(LLDB_PYTHON_TARGET_DIR ${LLDB_BINARY_DIR}/scripts)
   if(LLDB_BUILD_FRAMEWORK)
 set(LLDB_PYTHON_TARGET_DIR
@@ -50,6 +54,7 @@ if (NOT LLDB_DISABLE_PYTHON)
--prefix=${CMAKE_BINARY_DIR}
--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}
--lldbLibDir=lib${LLVM_LIBDIR_SUFFIX}
+   ${SIX_EXTRA_ARGS}
${FINISH_EXTRA_ARGS}
 VERBATIM
 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py

Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=294071&r1=294070&r2=294071&view=diff
==
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Fri Feb  3 18:20:24 2017
@@ -29,6 +29,9 @@ set(LLDB_DISABLE_CURSES ${LLDB_DEFAULT_D
 set(LLDB_RELOCATABLE_PYTHON 0 CACHE BOOL
   "Causes LLDB to use the PYTHONHOME environment variable to locate Python.")
 
+set(LLDB_USE_SYSTEM_SIX 0 CACHE BOOL
+  "Use six.py shipped with system and do not install a copy of it")
+
 if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
   set(LLDB_EXPORT_ALL_SYMBOLS 0 CACHE BOOL
 "Causes lldb to export all symbols when building liblldb.")

Modified: lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/finishSwigPythonLLDB.py?rev=294071&r1=294070&r2=294071&view=diff
==
--- lldb/trunk/scripts/Python/finishSwigPythonLLDB.py (original)
+++ lldb/trunk/scripts/Python/finishSwigPythonLLDB.py Fri Feb  3 18:20:24 2017
@@ -821,7 +821,9 @@ def main(vDictArgs):
 bOk, strMsg = create_symlinks(
 vDictArgs, strFrameworkPythonDir, strLldbLibDir)
 
-if bOk:
+bUseSystemSix = "--useSystemSix" in vDictArgs
+
+if not bUseSystemSix and bOk:
 bOk, strMsg = copy_six(vDictArgs, strFrameworkPythonDir)
 
 if bOk:

Modified: lldb/trunk/scripts/finishSwigWrapperClasses.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/finishSwigWrapperClasses.py?rev=294071&r1=294070&r2=294071&view=diff
==
--- lldb/trunk/scripts/finishSwigWrapperClasses.py (original)
+++ lldb/trunk/scripts/finishSwigWrapperClasses.py Fri Feb  3 18:20:24 2017
@@ -81,6 +81,7 @@ Args:   -h  (optional) Print
 created for a Windows build.\n\
 --argsFile= The args are read from a file instead of the\n\
 command line. Other command line args are ignored.\n\
+--useSystemSix  Use system six.py version.\n\
 \n\
 Usage:\n\
 finishSwigWrapperClasses.py --srcRoot=ADirPath --targetDir=ADirPath\n\
@@ -178,7 +179,8 @@ def validate_arguments(vArgv):
 "prefix=",
 "cmakeBuildConfiguration=",
 "lldbLibDir=",
-"argsFile"]
+"argsFile",
+"useSystemSix"]
 dictArgReq = {"-h": "o",  # o = optional, m = mandatory
   "-d": "o",
   "-m": "o",
@@ -188,7 +190,8 @@ def validate_arguments(vArgv):
   "--prefix": "o",
   "--cmakeBuildConfiguration": "o",
   "--lldbLibDir": "o",
-  "--argsFile": "o"}
+  "--argsFile": "o",
+  "--useSystemSix": "o"}
 
 # Check for

[Lldb-commits] [lldb] r294145 - Synchronize PlatformNetBSD with Linux

2017-02-05 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Sun Feb  5 15:32:38 2017
New Revision: 294145

URL: http://llvm.org/viewvc/llvm-project?rev=294145&view=rev
Log:
Synchronize PlatformNetBSD with Linux

Summary:
Update the code to the new world code.

These changes are needed for remote process plugin.

Sponsored by 

Reviewers: emaste, clayborg, joerg, labath

Reviewed By: clayborg, labath

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D29266

Modified:
lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.h

Modified: lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp?rev=294145&r1=294144&r2=294145&view=diff
==
--- lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp Sun Feb  5 
15:32:38 2017
@@ -19,25 +19,45 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Breakpoint/BreakpointLocation.h"
-#include "lldb/Breakpoint/BreakpointSite.h"
 #include "lldb/Core/Debugger.h"
-#include "lldb/Core/Module.h"
-#include "lldb/Core/ModuleSpec.h"
+#include "lldb/Core/Log.h"
 #include "lldb/Core/PluginManager.h"
-#include "lldb/Host/Host.h"
+#include "lldb/Core/State.h"
+#include "lldb/Host/FileSpec.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Target/Process.h"
+#include "lldb/Target/Target.h"
 #include "lldb/Utility/Error.h"
+#include "lldb/Utility/StreamString.h"
+
+// Define these constants from NetBSD mman.h for use when targeting
+// remote netbsd systems even when host has different values.
+#define MAP_PRIVATE 0x0002
+#define MAP_ANON 0x1000
 
 using namespace lldb;
 using namespace lldb_private;
 using namespace lldb_private::platform_netbsd;
 
+static uint32_t g_initialize_count = 0;
+
+//--
+
 PlatformSP PlatformNetBSD::CreateInstance(bool force, const ArchSpec *arch) {
-  // The only time we create an instance is when we are creating a remote
-  // netbsd platform
-  const bool is_host = false;
+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM));
+  if (log) {
+const char *arch_name;
+if (arch && arch->GetArchitectureName())
+  arch_name = arch->GetArchitectureName();
+else
+  arch_name = "";
+
+const char *triple_cstr =
+arch ? arch->GetTriple().getTriple().c_str() : "";
+
+log->Printf("PlatformNetBSD::%s(force=%s, arch={%s,%s})", __FUNCTION__,
+force ? "true" : "false", arch_name, triple_cstr);
+  }
 
   bool create = force;
   if (create == false && arch && arch->IsValid()) {
@@ -51,8 +71,19 @@ PlatformSP PlatformNetBSD::CreateInstanc
   break;
 }
   }
-  if (create)
-return PlatformSP(new PlatformNetBSD(is_host));
+
+  if (create) {
+if (log)
+  log->Printf("PlatformNetBSD::%s() creating remote-netbsd platform",
+  __FUNCTION__);
+return PlatformSP(new PlatformNetBSD(false));
+  }
+
+  if (log)
+log->Printf(
+"PlatformNetBSD::%s() aborting creation of remote-netbsd platform",
+__FUNCTION__);
+
   return PlatformSP();
 }
 
@@ -66,211 +97,51 @@ ConstString PlatformNetBSD::GetPluginNam
   }
 }
 
-const char *PlatformNetBSD::GetDescriptionStatic(bool is_host) {
+const char *PlatformNetBSD::GetPluginDescriptionStatic(bool is_host) {
   if (is_host)
 return "Local NetBSD user platform plug-in.";
   else
 return "Remote NetBSD user platform plug-in.";
 }
 
-static uint32_t g_initialize_count = 0;
+ConstString PlatformNetBSD::GetPluginName() {
+  return GetPluginNameStatic(IsHost());
+}
 
 void PlatformNetBSD::Initialize() {
-  Platform::Initialize();
+  PlatformPOSIX::Initialize();
 
   if (g_initialize_count++ == 0) {
 #if defined(__NetBSD__)
-// Force a host flag to true for the default platform object.
 PlatformSP default_platform_sp(new PlatformNetBSD(true));
 default_platform_sp->SetSystemArchitecture(HostInfo::GetArchitecture());
 Platform::SetHostPlatform(default_platform_sp);
 #endif
-PluginManager::RegisterPlugin(PlatformNetBSD::GetPluginNameStatic(false),
-  PlatformNetBSD::GetDescriptionStatic(false),
-  PlatformNetBSD::CreateInstance);
+PluginManager::RegisterPlugin(
+PlatformNetBSD::GetPluginNameStatic(false),
+PlatformNetBSD::GetPluginDescriptionStatic(false),
+PlatformNetBSD::CreateInstance, nullptr);
   }
 }
 
 void PlatformNetBSD::Terminate() {
-  if (g_initialize_count > 0 && --g_initialize_count == 0)
-PluginManager::UnregisterPlugin(PlatformNetBSD::CreateInstance);
-
-  Platform::Terminate();
-}
-
-bool PlatformNetBSD::GetModuleSpec(const FileSpec &module_file_spec,
- 

[Lldb-commits] [lldb] r294202 - Switch std::call_once to llvm::call_once

2017-02-06 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Mon Feb  6 11:55:02 2017
New Revision: 294202

URL: http://llvm.org/viewvc/llvm-project?rev=294202&view=rev
Log:
Switch std::call_once to llvm::call_once

Summary:
The std::call_once implementation in libstdc++ has problems on few systems: 
NetBSD, OpenBSD and Linux PPC. LLVM ships with a homegrown implementation 
llvm::call_once to help on these platforms.

This change is required in the NetBSD LLDB port. std::call_once with libstdc++ 
results with crashing the debugger.

Sponsored by 

Reviewers: labath, joerg, emaste, mehdi_amini, clayborg

Reviewed By: labath, clayborg

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D29288

Modified:
lldb/trunk/include/lldb/Core/Debugger.h
lldb/trunk/source/Commands/CommandObjectPlatform.cpp
lldb/trunk/source/Core/Debugger.cpp
lldb/trunk/source/Core/ModuleList.cpp
lldb/trunk/source/Host/common/Editline.cpp
lldb/trunk/source/Host/common/HostInfoBase.cpp
lldb/trunk/source/Host/linux/HostInfoLinux.cpp
lldb/trunk/source/Host/windows/HostInfoWindows.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/Language/Go/GoLanguage.cpp
lldb/trunk/source/Plugins/Language/Java/JavaLanguage.cpp
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp
lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindowsLog.cpp
lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
lldb/trunk/source/Plugins/Process/minidump/ProcessMinidump.cpp
lldb/trunk/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp

lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/GoASTContext.cpp
lldb/trunk/source/Target/Language.cpp
lldb/trunk/source/Utility/ConstString.cpp
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp

Modified: lldb/trunk/include/lldb/Core/Debugger.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Debugger.h?rev=294202&r1=294201&r2=294202&view=diff
==
--- lldb/trunk/include/lldb/Core/Debugger.h (original)
+++ lldb/trunk/include/lldb/Core/Debugger.h Mon Feb  6 11:55:02 2017
@@ -34,6 +34,8 @@
 #include "lldb/Target/TargetList.h"
 #include "lldb/lldb-public.h"
 
+#include "llvm/Support/Threading.h"
+
 namespace llvm {
 namespace sys {
 class DynamicLibrary;
@@ -374,7 +376,7 @@ protected:
   HostThread m_io_handler_thread;
   Broadcaster m_sync_broadcaster;
   lldb::ListenerSP m_forward_listener_sp;
-  std::once_flag m_clear_once;
+  llvm::once_flag m_clear_once;
 
   //--
   // Events for m_sync_broadcaster

Modified: lldb/trunk/source/Commands/CommandObjectPlatform.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectPlatform.cpp?rev=294202&r1=294201&r2=294202&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectPlatform.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectPlatform.cpp Mon Feb  6 11:55:02 
2017
@@ -29,6 +29,7 @@
 #include "lldb/Target/Process.h"
 
 #include "llvm/ADT/SmallString.h"
+#include "llvm/Support/Threading.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -1248,8 +1249,8 @@ protected:
   public:
 CommandOptions()
 : Options(), match_info(), show_args(false), verbose(false) {
-  static std::once_flag g_once_flag;
-  std::call_once(g_once_flag, []() {
+  static llvm::once_flag g_once_flag;
+  llvm::call_once(g_once_flag, []() {
 PosixPlatformCommandOptionValidator *posix_validator =
 new PosixPlatformCommandOptionValidator();
 for (auto &Option : g_platform_process_list_options) {

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: 

[Lldb-commits] [lldb] r295400 - Add myself to CODE_OWNERS.txt for NetBSD

2017-02-16 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Thu Feb 16 19:58:30 2017
New Revision: 295400

URL: http://llvm.org/viewvc/llvm-project?rev=295400&view=rev
Log:
Add myself to CODE_OWNERS.txt for NetBSD

Modified:
lldb/trunk/CODE_OWNERS.txt

Modified: lldb/trunk/CODE_OWNERS.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CODE_OWNERS.txt?rev=295400&r1=295399&r2=295400&view=diff
==
--- lldb/trunk/CODE_OWNERS.txt (original)
+++ lldb/trunk/CODE_OWNERS.txt Thu Feb 16 19:58:30 2017
@@ -41,6 +41,10 @@ N: Hafiz Abid Qadeer
 E: abidh@gmail.com
 D: lldb-mi
 
+N: Kamil Rytarowski
+E: ka...@netbsd.org
+D: NetBSD
+
 N: Zachary Turner
 E: ztur...@google.com
 D: CMake build, Host (common+windows), Plugins/Process/Windows, Anything 
Windows-specific


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r296070 - Switch NetBSD from paccept(2) to accept4(2)

2017-02-23 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Thu Feb 23 19:51:38 2017
New Revision: 296070

URL: http://llvm.org/viewvc/llvm-project?rev=296070&view=rev
Log:
Switch NetBSD from paccept(2) to accept4(2)

Summary:
NetBSD 8.0 will ship with accept4(2) in libc wrapping paccept(2).

This change reduces needless difference with other platforms.

Older versions of NetBSD will not be supported.

No functional change.

Sponsored by 

Reviewers: joerg, emaste, labath, clayborg

Reviewed By: emaste, labath, clayborg

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D30288

Modified:
lldb/trunk/source/Host/common/Socket.cpp

Modified: lldb/trunk/source/Host/common/Socket.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Socket.cpp?rev=296070&r1=296069&r2=296070&view=diff
==
--- lldb/trunk/source/Host/common/Socket.cpp (original)
+++ lldb/trunk/source/Host/common/Socket.cpp Thu Feb 23 19:51:38 2017
@@ -443,11 +443,7 @@ NativeSocket Socket::AcceptSocket(Native
   if (!child_processes_inherit) {
 flags |= SOCK_CLOEXEC;
   }
-#if defined(__NetBSD__)
-  NativeSocket fd = ::paccept(sockfd, addr, addrlen, nullptr, flags);
-#else
   NativeSocket fd = ::accept4(sockfd, addr, addrlen, flags);
-#endif
 #else
   NativeSocket fd = ::accept(sockfd, addr, addrlen);
 #endif


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r296071 - Introduce support for Debug Registers in RegisterContextNetBSD_x86_64

2017-02-23 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Thu Feb 23 19:53:45 2017
New Revision: 296071

URL: http://llvm.org/viewvc/llvm-project?rev=296071&view=rev
Log:
Introduce support for Debug Registers in RegisterContextNetBSD_x86_64

Summary:
NetBSD 7.99.62 introduced Debug Registers interface similar to the FreeBSD one.
This interface will land NetBSD-8.0.

Introduce support for this interface in Register Context NetBSD x86_64 
unconditionally as older versions of NetBSD will not be supported.

This change allows to reduce diff with other ports and remove local copy of the 
RegisterInfos_x86_64.h content.

NetBSD Register Context for 32-bit x86 support will be added later.

Sponsored by 

Reviewers: labath, joerg, emaste, clayborg

Reviewed By: labath, clayborg

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D30287

Modified:
lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp

Modified: 
lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp?rev=296071&r1=296070&r2=296071&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp 
Thu Feb 23 19:53:45 2017
@@ -47,10 +47,14 @@ typedef struct _GPR {
   uint64_t ss; /* 25 */
 } GPR;
 
-/*
- * As of NetBSD-7.99.25 there is no support for debug registers
- * https://en.wikipedia.org/wiki/X86_debug_register
- */
+struct DBG {
+  uint64_t dr[16]; /* debug registers */
+   /* Index 0-3: debug address registers */
+   /* Index 4-5: reserved */
+   /* Index 6: debug status */
+   /* Index 7: debug control */
+   /* Index 8-15: reserved */
+};
 
 /*
  * src/sys/arch/amd64/include/mcontext.h
@@ -66,276 +70,21 @@ struct UserArea {
   GPR gpr;
   uint64_t mc_tlsbase;
   FPR fpr;
+  DBG dbg;
 };
 
-//---
-// Cherry-pick parts of RegisterInfos_x86_64.h, without debug registers
-//---
-// Computes the offset of the given GPR in the user data area.
-#define GPR_OFFSET(regname) (LLVM_EXTENSION offsetof(GPR, regname))
-
-// Computes the offset of the given FPR in the extended data area.
-#define FPR_OFFSET(regname)
\
-  (LLVM_EXTENSION offsetof(UserArea, fpr) +
\
-   LLVM_EXTENSION offsetof(FPR, xstate) +  
\
-   LLVM_EXTENSION offsetof(FXSAVE, regname))
-
-// Computes the offset of the YMM register assembled from register halves.
-// Based on DNBArchImplX86_64.cpp from debugserver
-#define YMM_OFFSET(reg_index)  
\
-  (LLVM_EXTENSION offsetof(UserArea, fpr) +
\
-   LLVM_EXTENSION offsetof(FPR, xstate) +  
\
-   LLVM_EXTENSION offsetof(XSAVE, ymmh[0]) + (32 * reg_index))
-
-// Number of bytes needed to represent a FPR.
-#define FPR_SIZE(reg) sizeof(((FXSAVE *)nullptr)->reg)
-
-// Number of bytes needed to represent the i'th FP register.
-#define FP_SIZE sizeof(((MMSReg *)nullptr)->bytes)
-
-// Number of bytes needed to represent an XMM register.
-#define XMM_SIZE sizeof(XMMReg)
-
-// Number of bytes needed to represent a YMM register.
-#define YMM_SIZE sizeof(YMMReg)
-
-// RegisterKind: EHFrame, DWARF, Generic, Process Plugin, LLDB
-
-// Note that the size and offset will be updated by platform-specific classes.
-#define DEFINE_GPR(reg, alt, kind1, kind2, kind3, kind4)   
\
-  {
\
-#reg, alt, sizeof(((GPR *)nullptr)->reg),  
\
-  GPR_OFFSET(reg), eEncodingUint, eFormatHex,  
\
- {kind1, kind2, kind3, kind4,  
\
-  lldb_##reg##_x86_64 },   
\
-  nullptr, nullptr, nullptr, 0 
\
-  }
-
-#define DEFINE_FPR(name, reg, kind1, kind2, kind3, kind4)  
\
-  {
\
-#name, nullptr, FPR_SIZE(reg), FPR_OFFSET(reg), eEncodingUint, eFormatHex, 
\
-   {kind1, kind2, kind3, kind4,
\
-lldb_##name##_x86_64 },
\
-nullptr, nullptr, nullptr, 0   
\
-  }
+#define DR_OFFSET(reg_index) 

[Lldb-commits] [lldb] r296360 - Support NetBSD Thread ID in lldb-server tests

2017-02-27 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Mon Feb 27 11:52:48 2017
New Revision: 296360

URL: http://llvm.org/viewvc/llvm-project?rev=296360&view=rev
Log:
Support NetBSD Thread ID in lldb-server tests

Summary:
Native Thread ID is retrieved with _lwp_self() on NetBSD.

The returned value is of type int32_t, but for consistency with other Operating 
Systems cast it to uint64_t.

Sponsored by 

Reviewers: joerg, labath, clayborg, emaste

Reviewed By: labath, clayborg

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D30374

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/main.cpp
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/main.cpp?rev=296360&r1=296359&r2=296360&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/main.cpp 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/main.cpp 
Mon Feb 27 11:52:48 2017
@@ -18,6 +18,8 @@ __OSX_AVAILABLE_STARTING(__MAC_10_6, __I
 int pthread_threadid_np(pthread_t, __uint64_t *);
 #elif defined(__linux__)
 #include 
+#elif defined(__NetBSD__)
+#include 
 #endif
 
 static const char *const RETVAL_PREFIX = "retval:";
@@ -62,6 +64,9 @@ static void print_thread_id() {
 #elif defined(__linux__)
   // This is a call to gettid() via syscall.
   printf("%" PRIx64, static_cast(syscall(__NR_gettid)));
+#elif defined(__NetBSD__)
+  // Technically lwpid_t is 32-bit signed integer
+  printf("%" PRIx64, static_cast(_lwp_self()));
 #else
   printf("{no-tid-support}");
 #endif

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp?rev=296360&r1=296359&r2=296360&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp Mon 
Feb 27 11:52:48 2017
@@ -27,6 +27,8 @@ __OSX_AVAILABLE_STARTING(__MAC_10_6, __I
 int pthread_threadid_np(pthread_t, __uint64_t *);
 #elif defined(__linux__)
 #include 
+#elif defined(__NetBSD__)
+#include 
 #endif
 
 static const char *const RETVAL_PREFIX = "retval:";
@@ -71,6 +73,9 @@ static void print_thread_id() {
 #elif defined(__linux__)
   // This is a call to gettid() via syscall.
   printf("%" PRIx64, static_cast(syscall(__NR_gettid)));
+#elif defined(__NetBSD__)
+  // Technically lwpid_t is 32-bit signed integer
+  printf("%" PRIx64, static_cast(_lwp_self()));
 #else
   printf("{no-tid-support}");
 #endif


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D13334: Preliminary NetBSD support

2015-10-01 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added a reviewer: joerg.
krytarowski added a subscriber: lldb-commits.
krytarowski set the repository for this revision to rL LLVM.

This adds platform code without the cmake/gmake glue to the existing 
infrastructure.

The missing and incompatibility ptrace(2) bits (existing in FreeBSD) are under 
active research and development and will be submitted once verified to work.

This code was tested to build and run on NetBSD-current/amd64.

Proper build scripts will be integrated separately as a new commit.

Repository:
  rL LLVM

http://reviews.llvm.org/D13334

Files:
  include/lldb/Host/Config.h
  include/lldb/Host/HostInfo.h
  include/lldb/Host/HostNativeThread.h
  include/lldb/Host/HostNativeThreadForward.h
  include/lldb/Host/netbsd/Config.h
  include/lldb/Host/netbsd/HostInfoNetBSD.h
  include/lldb/Host/netbsd/HostThreadNetBSD.h
  source/Host/netbsd/Host.cpp
  source/Host/netbsd/HostInfoNetBSD.cpp
  source/Host/netbsd/HostThreadNetBSD.cpp
  source/Host/netbsd/ThisThread.cpp
  source/Initialization/SystemInitializerCommon.cpp
  source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
  source/Plugins/Platform/NetBSD/PlatformNetBSD.h

Index: source/Plugins/Platform/NetBSD/PlatformNetBSD.h
===
--- /dev/null
+++ source/Plugins/Platform/NetBSD/PlatformNetBSD.h
@@ -0,0 +1,182 @@
+//===-- PlatformNetBSD.h ---*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef liblldb_PlatformNetBSD_h_
+#define liblldb_PlatformNetBSD_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Target/Platform.h"
+
+namespace lldb_private {
+namespace platform_netbsd {
+
+class PlatformNetBSD : public Platform
+{
+public:
+
+//
+// Class functions
+//
+static lldb::PlatformSP
+CreateInstance(bool force, const ArchSpec *arch);
+
+static void
+Initialize ();
+
+static void
+Terminate ();
+
+static ConstString
+GetPluginNameStatic (bool is_host);
+
+static const char *
+GetDescriptionStatic (bool is_host);
+
+//
+// Class Methods
+//
+PlatformNetBSD (bool is_host);
+
+virtual
+~PlatformNetBSD();
+
+//
+// lldb_private::PluginInterface functions
+//
+ConstString
+GetPluginName() override
+{
+return GetPluginNameStatic (IsHost());
+}
+
+uint32_t
+GetPluginVersion() override
+{
+return 1;
+}
+
+const char *
+GetDescription () override
+{
+return GetDescriptionStatic(IsHost());
+}
+
+//
+// lldb_private::Platform functions
+//
+bool
+GetModuleSpec(const FileSpec& module_file_spec,
+  const ArchSpec& arch,
+  ModuleSpec &module_spec) override;
+
+Error
+RunShellCommand(const char *command,
+const FileSpec &working_dir,
+int *status_ptr,
+int *signo_ptr,
+std::string *command_output,
+uint32_t timeout_sec) override;
+
+Error
+ResolveExecutable(const ModuleSpec &module_spec,
+  lldb::ModuleSP &module_sp,
+  const FileSpecList *module_search_paths_ptr) override;
+
+size_t
+GetSoftwareBreakpointTrapOpcode(Target &target,
+BreakpointSite *bp_site) override;
+
+bool
+GetRemoteOSVersion () override;
+
+bool
+GetRemoteOSBuildString (std::string &s) override;
+
+bool
+GetRemoteOSKernelDescription (std::string &s) override;
+
+// Remote Platform subclasses need to override this function
+ArchSpec
+GetRemoteSystemArchitecture() override;
+
+bool
+IsConnected () const override;
+
+Error
+ConnectRemote(Args& args) override;
+
+Error
+DisconnectRemote() override;
+
+const char *
+ 

Re: [Lldb-commits] [PATCH] D13334: Preliminary NetBSD support

2015-10-01 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Primary reason to skip for now build scripts is that this patch takes long to 
be landed.

http://reviews.llvm.org/D12994

I don't want to submit a diff to patches sources...


Repository:
  rL LLVM

http://reviews.llvm.org/D13334



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13334: Preliminary NetBSD support

2015-10-01 Thread Kamil Rytarowski via lldb-commits
krytarowski added inline comments.


Comment at: source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp:1
@@ +1,2 @@
+//===-- PlatformNetBSD.cpp -*- C++ -*-===//
+//

labath wrote:
> This platform code looks like it was copy-pasted from PlatformFreeBSD. Do you 
> anticipate making significant changes here?
> 
> If not, it might be a good idea to share this code with FreeBSD in some way 
> (in fact there is a comment here to make this share code with PlatformPOSIX). 
> @emaste, what do you think about this?
Yes... however I have bad experiences (mostly in Gnome) when we drag common 
code for rotted platforms like BSD4.4, BSD/OS and such in a single source tree 
paralyzing sane platform support.


Repository:
  rL LLVM

http://reviews.llvm.org/D13334



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13334: Preliminary NetBSD support

2015-10-01 Thread Kamil Rytarowski via lldb-commits
krytarowski added inline comments.


Comment at: source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp:1
@@ +1,2 @@
+//===-- PlatformNetBSD.cpp -*- C++ -*-===//
+//

labath wrote:
> krytarowski wrote:
> > labath wrote:
> > > This platform code looks like it was copy-pasted from PlatformFreeBSD. Do 
> > > you anticipate making significant changes here?
> > > 
> > > If not, it might be a good idea to share this code with FreeBSD in some 
> > > way (in fact there is a comment here to make this share code with 
> > > PlatformPOSIX). @emaste, what do you think about this?
> > Yes... however I have bad experiences (mostly in Gnome) when we drag common 
> > code for rotted platforms like BSD4.4, BSD/OS and such in a single source 
> > tree paralyzing sane platform support.
> So which one do you expect to rot first ?
> 
> Joke aside, I agree that this could be an issue, but I think if we put some 
> thought into the design, we can limit the possible downsides of this 
> approach. The other alternative, where we copy everything is not ideal 
> either: we have had cases in the past, where we made a change in linux code, 
> and then we needed to apply the exact same change in the freebsd version. So 
> there is definitely some tradeoff to consider here...
> 
> In any case, I'm not trying to stop your changes because of this, but I think 
> it's good to open this discussion in the early stages of the 
> implementation... I don't know if you're aware but there are plans to move 
> freebsd to the client-server model to follow linux, so if you make copies of 
> the code, you may find out later that you may need to duplicate that work as 
> well.
I'm strongly for this to design and put common BSD code (for modern BSDs) into 
single library or module, limiting Free/Net specific pieces to their 
appropriate modules.

My requirement is to name the common parts as BSD, not FreeBSD. NetBSD isn't a 
variation of FreeBSD (neither e.g. Bitrig, which may come next -- there is 
already an active interest).

I was thinking how to do it, with virtual functions, inheritance, #ifdef 
magic... To make it clear, I don't use nor have FreeBSD to lonely 
design/redesign neither touch its platform support, therefor I request for 
active cooperation from the FreeBSD side.


Repository:
  rL LLVM

http://reviews.llvm.org/D13334



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13334: Preliminary NetBSD support

2015-10-01 Thread Kamil Rytarowski via lldb-commits
krytarowski added inline comments.


Comment at: source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp:1
@@ +1,2 @@
+//===-- PlatformNetBSD.cpp -*- C++ -*-===//
+//

labath wrote:
> krytarowski wrote:
> > labath wrote:
> > > krytarowski wrote:
> > > > labath wrote:
> > > > > This platform code looks like it was copy-pasted from 
> > > > > PlatformFreeBSD. Do you anticipate making significant changes here?
> > > > > 
> > > > > If not, it might be a good idea to share this code with FreeBSD in 
> > > > > some way (in fact there is a comment here to make this share code 
> > > > > with PlatformPOSIX). @emaste, what do you think about this?
> > > > Yes... however I have bad experiences (mostly in Gnome) when we drag 
> > > > common code for rotted platforms like BSD4.4, BSD/OS and such in a 
> > > > single source tree paralyzing sane platform support.
> > > So which one do you expect to rot first ?
> > > 
> > > Joke aside, I agree that this could be an issue, but I think if we put 
> > > some thought into the design, we can limit the possible downsides of this 
> > > approach. The other alternative, where we copy everything is not ideal 
> > > either: we have had cases in the past, where we made a change in linux 
> > > code, and then we needed to apply the exact same change in the freebsd 
> > > version. So there is definitely some tradeoff to consider here...
> > > 
> > > In any case, I'm not trying to stop your changes because of this, but I 
> > > think it's good to open this discussion in the early stages of the 
> > > implementation... I don't know if you're aware but there are plans to 
> > > move freebsd to the client-server model to follow linux, so if you make 
> > > copies of the code, you may find out later that you may need to duplicate 
> > > that work as well.
> > I'm strongly for this to design and put common BSD code (for modern BSDs) 
> > into single library or module, limiting Free/Net specific pieces to their 
> > appropriate modules.
> > 
> > My requirement is to name the common parts as BSD, not FreeBSD. NetBSD 
> > isn't a variation of FreeBSD (neither e.g. Bitrig, which may come next -- 
> > there is already an active interest).
> > 
> > I was thinking how to do it, with virtual functions, inheritance, #ifdef 
> > magic... To make it clear, I don't use nor have FreeBSD to lonely 
> > design/redesign neither touch its platform support, therefor I request for 
> > active cooperation from the FreeBSD side.
> >I'm strongly for this to design and put common BSD code (for modern BSDs) 
> >into single library or module, limiting Free/Net specific pieces to their 
> >appropriate modules.
> 
> >My requirement is to name the common parts as BSD, not FreeBSD. NetBSD isn't 
> >a variation of FreeBSD (neither e.g. Bitrig, which may come next -- there is 
> >already an active interest).
> 
> Sounds reasonable to me.
> 
> > I was thinking how to do it, with virtual functions, inheritance, #ifdef 
> > magic...
> LLDB is a cross-platform tool, we can already remotely debug linux from 
> windows and mac machines, etc. It would be great if this would eventually 
> work for BSD platforms as well. For this, we need both freebsd and netbsd 
> code in a single client binary, so #ifdefs are ruled out (at least in client 
> code). But I think inheritance is perfect for this particular case of 
> PlatformNetBSD -- just move the code to PlatformBSD and have Free/NetBSD 
> inherit from that.
> 
> > To make it clear, I don't use nor have FreeBSD to lonely design/redesign 
> > neither touch its platform support, therefor I request for active 
> > cooperation from the FreeBSD side.
> Let's see what FreeBSD has to say to this. :)
> LLDB is a cross-platform tool, we can already remotely debug linux from 
> windows and mac machines, etc. It would be great if this would eventually 
> work for BSD platforms as well.

Sounds great!

> Let's see what FreeBSD has to say to this. :)

I opened the offer from my site. The code is already there. I'm waiting for the 
feedback.


Repository:
  rL LLVM

http://reviews.llvm.org/D13334



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13334: Preliminary NetBSD support

2015-10-01 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 01.10.2015 23:20, Joerg Sonnenberger via lldb-commits wrote:
> On Thu, Oct 01, 2015 at 10:41:46AM +, Pavel Labath via
> lldb-commits wrote:
>> This platform code looks like it was copy-pasted from
>> PlatformFreeBSD. Do you anticipate making significant changes
>> here?
>> 
>> If not, it might be a good idea to share this code with FreeBSD
>> in some way (in fact there is a comment here to make this share
>> code with PlatformPOSIX). @emaste, what do you think about this?
> 
> I was talking about this with Ed and some of the other FreeBSD
> folks when I started my own efforts on LLDB for NetBSD. I think the
> best approach is to start with the patch as is and slowly
> refactoring from that.

I'm for it. Having in sources real-world reference will ease the
refactoring either way.

> IMO it is better here to have a basic working state first.

I've passed my current limits of the size of locally maintainable patch.

For the reference, I have more code locally still in progress of
active research (once I got to ~10k lines of git diff of the support
patch...).

Please help me to make the NetBSD support dept partially canceled.

> The other point we agreed on is that the FreeBSD code and the Linux
> code can often be more shared to, so there is a lot of room for
> improvements in any direction.

Yes, true. Integrating NetBSD will clearly help to spot these points.

> I'd prefer to avoid the classic "the enemy of good" situations
> here.
> 

Yes, please! Better incomplete support in the source trees then once
almost complete but rotting in a local patch...
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJWDb0eAAoJEEuzCOmwLnZs4YAP/1x9RW31pG6H6v9a9Z4GBEgG
FZy+EM5TMWp1LFBlqyxZuboLAp00E+KMHr9oM78zbrQbhng3Lf0K62nZBJKD3Zx7
Az56XBPreqdwUxMJsydD7tKXhDKldCm+1XR/8RE1xaPoG1l6qn0v6pQZek96P1RB
UJ9XCHB+w33IskbfkjK2zoIyA/KFOL4pGxHVtwdINxbeVMo8e7az2PVHspEd5IQe
vBDDlUNZU6x2xGlf9B09taUW+RcpRMrH/8OUagmqBei+v68hDaaL40GoCfMaOl1m
qV+6j0SbP4UEt9VN8gTgWkR1s4jb6PlX0eG5ktGr6cEQA3vO8kh4YmKQOJo6tF3w
y43DnQgwJBXRnNVQ60xWH+XNyBBtV6dl67DBWx1aFOORo9bseXW+KrGpjoLagQru
ZIKgIC1bt2R9wn+8vmYtp2cWac2YZHJZiT6jwWmLm796+Kb8tibnceHacPeoYFSx
LJy608GFTdUh/Zqje2J5SgL23w/Iti2ZZ6cUd1T/XpMnN8uzIH0EFXz80HVuEwvw
314PbVSYUKoOpQBLqigvOGk2SMTQm3gC5MUIX9JZBaDw2xTOyx/p9jxi2dtxPX73
Sr9WC9xKYpftDjff94MEqXqd1aSst4i5h0dCY9RcY+qFiSTYcq8jymfpTcrF44fx
UA+78iMc8QP+UOrx+hur
=Eogw
-END PGP SIGNATURE-
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13334: Preliminary NetBSD support

2015-10-02 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 02.10.2015 10:07, Ed Maste wrote:
> On 1 October 2015 at 23:09, Kamil Rytarowski via lldb-commits 
>  wrote:
>> 
>> Yes, please! Better incomplete support in the source trees then
>> once almost complete but rotting in a local patch...
> 
> I agree - I think it's better to get basic support in as soon as 
> possible and we can refactor as appropriate in the tree.
> 

Right. There are just few pending patches to make it buildable and
runnable:
- - ncurses one (already in review D12995),
- - platform code (pushed to review within D13334),
- - cmake glue for platform code (it will come next),
- - autotools glue for platform code (ditto),
- - minor glue (swig, ...).

When we will get the above in-trees I already have local patches to
polish the things up.

> Will you be able to get a NetBSD builder after the changes start
> going in?

I will try to ask for one. Two daily builds (one with CMake and the
second one with autotools) should be good enough.
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJWDllBAAoJEEuzCOmwLnZsimAP/R86mUDXyvOjXWupMZBzQQTM
NjvZZOBocm+cWWwesgByFc8B+GSxNSAJStlm+ooLt7/d88ajtE6TOtvuqE97ust7
/O1cVvjTMtSgMycosCc1bF/8BibPBV/LW+ce1JEj7FCXycfGIboK6W55CQhA6/++
DV0Qh3gAtdQjApLcrXVcu5PYvUpY783bIL1YL0vpecz+nLKtjfWjLjFuUUvP9FcB
nS8DTsZ+d+j1Y9cQYXa6EUCsTUie/aRinOo6JO00LJ7AVgOTcGYyb1auCldaEXBK
4qRCR42vfe1w0NLRqWqj6tWlzM3iQnP7UFuUOb4+GXTdh5jOdTePOsAzPdRI48JW
xNz51T1wFqzex0EQN9q+xb+D66wa7yDpM0DxL8xo4ry7ogz+tCvvn7A8uXjhaDWd
gVoP31IcATlfTkmvqinP7WcA8JuUr25gVwBsx7GC9XmmNnsPg9QUJnQs+dhS+rHj
NK/7KnRPQ1calP7E5iNq3omuhzLkmkIiCOnbYeGo81yk46DaexUG48LWiFU9PNu7
fwbcL572y07tqr2yCcbrSgpMq8Wf6rmMB7ObjZdsI21ZzogCIGW9WKyH86e/fc8l
4RYNMp9peFRNDqQbfCI9I9N7h+Gp9La1q/Kw0CbcjZ5ZTJJQdouYWWhGDFw0X+Od
e1Tanif6uzC4VEAUwUva
=giVS
-END PGP SIGNATURE-
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13334: Preliminary NetBSD support

2015-10-08 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 02.10.2015 12:15, Kamil Rytarowski via lldb-commits wrote:
> On 02.10.2015 10:07, Ed Maste wrote:
>> On 1 October 2015 at 23:09, Kamil Rytarowski via lldb-commits 
>>  wrote:
>>> 
>>> Yes, please! Better incomplete support in the source trees
>>> then once almost complete but rotting in a local patch...
> 
>> I agree - I think it's better to get basic support in as soon as
>>  possible and we can refactor as appropriate in the tree.
> 
> 
> Right. There are just few pending patches to make it buildable and 
> runnable: - ncurses one (already in review D12995), - platform code
> (pushed to review within D13334), - cmake glue for platform code
> (it will come next), - autotools glue for platform code (ditto), -
> minor glue (swig, ...).
> 
> When we will get the above in-trees I already have local patches
> to polish the things up.
> 
>> Will you be able to get a NetBSD builder after the changes start 
>> going in?
> 
> I will try to ask for one. Two daily builds (one with CMake and
> the second one with autotools) should be good enough.

The NetBSD operating system 7.0 has been formally announced today (and
antedated to 26 Sep)!

http://www.netbsd.org/releases/formal-7/NetBSD-7.0.html

I acquired a fresh NetBSD-7.0 machine (amd64 port), the current
parameters allow to build LLVM+Clang+LLDB (all platform backends) with
CMake & ninja within <40 minutes.

pkgsrc packages:
cmake-3.3.1
ninja-build-1.6.0
swig-1.3.38nb1
python27-2.7.10
ncurses{,w}-6.0nb1

Host toolchain:
$ ld -v
GNU ld (NetBSD Binutils nb1) 2.23.2
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/lto-wrapper
Target: x86_64--netbsd
Configured with:
/usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configure
- --target=x86_64--netbsd --enable-long-long --enable-threads
- --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html
- --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib
- --enable-__cxa_atexit --enable-libstdcxx-threads --with-tune=nocona
- --enable-libstdcxx-time=rt --enable-lto
- --with-mpc-lib=/var/obj/mknative/amd64-x86_64/usr/7/src/external/lgpl3/m
pc/lib/libmpc
- --with-mpfr-lib=/var/obj/mknative/amd64-x86_64/usr/7/src/external/lgpl3/
mpfr/lib/libmpfr
- --with-gmp-lib=/var/obj/mknative/amd64-x86_64/usr/7/src/external/lgpl3/g
mp/lib/libgmp
- --with-mpc-include=/usr/7/src/external/lgpl3/mpc/dist/src
- --with-mpfr-include=/usr/7/src/external/lgpl3/mpfr/dist/src
- --with-gmp-include=/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/x86_64
- --enable-tls
- --disable-multilib --disable-symvers --disable-libstdcxx-pch
- --build=x86_64-unknown-netbsd6.0. --host=x86_64--netbsd
- --with-sysroot=/var/obj/mknative/amd64-x86_64/usr/7/src/destdir.amd64
Thread model: posix
gcc version 4.8.4 (nb2 20150115)

I'm waiting for credentials for my buildbot-slave from Galina Kistanova.

I've verified that NetBSD-7.0 builds properly lldb with my patches for
NetBSD. Please help me to make merged the current code from review.

http://reviews.llvm.org/D13334 Preliminary NetBSD support
http://reviews.llvm.org/D12995 Add support for lldb config.h and
detect ncurses' include path
http://reviews.llvm.org/D12994 Improve support of the ncurses
dependency on NetBSD

When this will make happen I will send remaining glue to make it
buildable.

I develop locally on NetBSD-current/amd64, buildbot works on 7.0,
which is the minimal version I plan to support.

Thank you for your cooperation!
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJWFsrLAAoJEEuzCOmwLnZsAu8P/iDfDl/8/ZBLIsbvfUl0ks8Q
q6oNdtEYkZsfQw0vI3i4p6wUr4XlC2BsYAdnt6rhvfeVwOz84XovlsyLdBNsyv8F
oplzAgji9tADNAn+dXCBkWQkuNUnfQh4kEmZKGbW1bN7G1N6lWOfet9Al1DM9dgv
dASagXy+JOkwGQBnLFJWGR6KR2L9f8O8OqmmLD/qDafuL9+XlLMAYxuISx1BnjoF
IgpcQbBqmBr9WI5g/OATf61xhFTatMYw7EPXAs8qgHYichnbK1anjvTiJaiHNgLY
wkaaH/UqgMog2v0Jg78q6mjscVe98H3aLvTTaTO8Vb82qj0D5x/Yh4I11/HiQOOH
8KXlmONdC/Oetj3+TvIX/bdj5h6viqVef5UcKtaekRlJUEBAEyd+ltTinxWCmu/g
TDq5Oa2uP8Frxfl9pzOuOMWd32CcjOTxir1IeJ+1sDmjo1Qu+7RI8vzhqFG6FqgY
hwWy22Rb35xNzE1twA9sBv1mTdgNJghdv32oIKgjveom1yE8eBYp8H2HevkW6uLW
xYaTk2XNUQ/KmxycJCRh2yagyyrpXfB8DBcWyG2PIpisWz5kXDN22X4Cr4hYSQfp
xi/NhrGw0PCggxAwMsBbDNk0d9otr607qqWhVr9kLr6fInzWYbRHcU8s7Ah+RQjf
nD+ankMu9Ssek+kwGXIc
=p600
-END PGP SIGNATURE-
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13334: Preliminary NetBSD support

2015-10-11 Thread Kamil Rytarowski via lldb-commits
krytarowski updated this revision to Diff 37077.

Repository:
  rL LLVM

http://reviews.llvm.org/D13334

Files:
  include/lldb/Host/Config.h
  include/lldb/Host/HostInfo.h
  include/lldb/Host/HostNativeThread.h
  include/lldb/Host/HostNativeThreadForward.h
  include/lldb/Host/netbsd/Config.h
  include/lldb/Host/netbsd/HostInfoNetBSD.h
  include/lldb/Host/netbsd/HostThreadNetBSD.h
  source/Host/netbsd/Host.cpp
  source/Host/netbsd/HostInfoNetBSD.cpp
  source/Host/netbsd/HostThreadNetBSD.cpp
  source/Host/netbsd/ThisThread.cpp
  source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
  source/Plugins/Platform/NetBSD/PlatformNetBSD.h

Index: source/Plugins/Platform/NetBSD/PlatformNetBSD.h
===
--- /dev/null
+++ source/Plugins/Platform/NetBSD/PlatformNetBSD.h
@@ -0,0 +1,182 @@
+//===-- PlatformNetBSD.h ---*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef liblldb_PlatformNetBSD_h_
+#define liblldb_PlatformNetBSD_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Target/Platform.h"
+
+namespace lldb_private {
+namespace platform_netbsd {
+
+class PlatformNetBSD : public Platform
+{
+public:
+
+//
+// Class functions
+//
+static lldb::PlatformSP
+CreateInstance(bool force, const ArchSpec *arch);
+
+static void
+Initialize ();
+
+static void
+Terminate ();
+
+static ConstString
+GetPluginNameStatic (bool is_host);
+
+static const char *
+GetDescriptionStatic (bool is_host);
+
+//
+// Class Methods
+//
+PlatformNetBSD (bool is_host);
+
+virtual
+~PlatformNetBSD() override = default;
+
+//
+// lldb_private::PluginInterface functions
+//
+ConstString
+GetPluginName() override
+{
+return GetPluginNameStatic (IsHost());
+}
+
+uint32_t
+GetPluginVersion() override
+{
+return 1;
+}
+
+const char *
+GetDescription () override
+{
+return GetDescriptionStatic(IsHost());
+}
+
+//
+// lldb_private::Platform functions
+//
+bool
+GetModuleSpec(const FileSpec& module_file_spec,
+  const ArchSpec& arch,
+  ModuleSpec &module_spec) override;
+
+Error
+RunShellCommand(const char *command,
+const FileSpec &working_dir,
+int *status_ptr,
+int *signo_ptr,
+std::string *command_output,
+uint32_t timeout_sec) override;
+
+Error
+ResolveExecutable(const ModuleSpec &module_spec,
+  lldb::ModuleSP &module_sp,
+  const FileSpecList *module_search_paths_ptr) override;
+
+size_t
+GetSoftwareBreakpointTrapOpcode(Target &target,
+BreakpointSite *bp_site) override;
+
+bool
+GetRemoteOSVersion () override;
+
+bool
+GetRemoteOSBuildString (std::string &s) override;
+
+bool
+GetRemoteOSKernelDescription (std::string &s) override;
+
+// Remote Platform subclasses need to override this function
+ArchSpec
+GetRemoteSystemArchitecture() override;
+
+bool
+IsConnected () const override;
+
+Error
+ConnectRemote(Args& args) override;
+
+Error
+DisconnectRemote() override;
+
+const char *
+GetHostname () override;
+
+const char *
+GetUserName (uint32_t uid) override;
+
+const char *
+GetGroupName (uint32_t gid) override;
+
+bool
+GetProcessInfo(lldb::pid_t pid,
+   ProcessInstanceInfo &proc_info) override;
+
+uint32_t
+FindProcesses(const ProcessInstanceInfoMatch &match_info,
+  ProcessInstanceInfoList &process_infos) override;
+
+Error
+LaunchProcess(ProcessLaunchInfo &launch_info) override;
+
+

[Lldb-commits] [PATCH] D13707: Remove definition of ~PlatformNetBSD(), since its declaration is marked as '= default'

2015-10-13 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added a reviewer: joerg.
krytarowski added a subscriber: lldb-commits.
krytarowski set the repository for this revision to rL LLVM.

Local definition of ~PlatformNetBSD() results with a compiler error.

Repository:
  rL LLVM

http://reviews.llvm.org/D13707

Files:
  source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp

Index: source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
===
--- source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
+++ source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
@@ -290,19 +290,6 @@
 {
 }
 
-//--
-/// Destructor.
-///
-/// The destructor is virtual since this class is designed to be
-/// inherited from by the plug-in instance.
-//--
-PlatformNetBSD::~PlatformNetBSD()
-{
-}
-
-//TODO:VK: inherit PlatformPOSIX
-
-
 bool
 PlatformNetBSD::GetRemoteOSVersion ()
 {


Index: source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
===
--- source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
+++ source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
@@ -290,19 +290,6 @@
 {
 }
 
-//--
-/// Destructor.
-///
-/// The destructor is virtual since this class is designed to be
-/// inherited from by the plug-in instance.
-//--
-PlatformNetBSD::~PlatformNetBSD()
-{
-}
-
-//TODO:VK: inherit PlatformPOSIX
-
-
 bool
 PlatformNetBSD::GetRemoteOSVersion ()
 {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D13707: Remove definition of ~PlatformNetBSD(), since its declaration is marked as '= default'

2015-10-13 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Thank you!


Repository:
  rL LLVM

http://reviews.llvm.org/D13707



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D13711: Add initial CMake glue for the NetBSD platform

2015-10-13 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added a reviewer: joerg.
krytarowski added a subscriber: lldb-commits.
krytarowski set the repository for this revision to rL LLVM.

These changes aren't everything what is needed for the CMake target, but it's 
significantly approaching it.

These changes shouldn't effect the build process on other platforms.

Repository:
  rL LLVM

http://reviews.llvm.org/D13711

Files:
  source/CMakeLists.txt
  source/Host/CMakeLists.txt
  source/Plugins/Platform/CMakeLists.txt
  source/Plugins/Platform/NetBSD/CMakeLists.txt
  source/Plugins/Process/CMakeLists.txt
  tools/lldb-server/CMakeLists.txt

Index: tools/lldb-server/CMakeLists.txt
===
--- tools/lldb-server/CMakeLists.txt
+++ tools/lldb-server/CMakeLists.txt
@@ -14,6 +14,13 @@
   )
 endif ()
 
+if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
+include_directories(
+  ../../../../llvm/include
+  ../../source/Plugins/Process/POSIX
+  )
+endif ()
+
 include_directories(../../source)
 
 include(../../cmake/LLDBDependencies.cmake)
Index: source/Plugins/Process/CMakeLists.txt
===
--- source/Plugins/Process/CMakeLists.txt
+++ source/Plugins/Process/CMakeLists.txt
@@ -4,6 +4,8 @@
 elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
   add_subdirectory(FreeBSD)
   add_subdirectory(POSIX)
+elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+  add_subdirectory(POSIX)
 elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
   add_subdirectory(Windows/Live)
   add_subdirectory(Windows/MiniDump)
Index: source/Plugins/Platform/NetBSD/CMakeLists.txt
===
--- /dev/null
+++ source/Plugins/Platform/NetBSD/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_lldb_library(lldbPluginPlatformNetBSD
+  PlatformNetBSD.cpp
+  )
Index: source/Plugins/Platform/CMakeLists.txt
===
--- source/Plugins/Platform/CMakeLists.txt
+++ source/Plugins/Platform/CMakeLists.txt
@@ -2,6 +2,8 @@
   add_subdirectory(Linux)
 #elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
   add_subdirectory(FreeBSD)
+#elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+  add_subdirectory(NetBSD)
 #elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_subdirectory(MacOSX)
 #elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
Index: source/Host/CMakeLists.txt
===
--- source/Host/CMakeLists.txt
+++ source/Host/CMakeLists.txt
@@ -133,13 +133,22 @@
 linux/ThisThread.cpp
 )
 endif()
+
   elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
 add_host_subdirectory(freebsd
   freebsd/Host.cpp
   freebsd/HostInfoFreeBSD.cpp
   freebsd/HostThreadFreeBSD.cpp
   freebsd/ThisThread.cpp
   )
+
+  elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+add_host_subdirectory(netbsd
+  netbsd/Host.cpp
+  netbsd/HostInfoNetBSD.cpp
+  netbsd/HostThreadNetBSD.cpp
+  netbsd/ThisThread.cpp
+  )
   endif()
 endif()
 
@@ -157,3 +166,7 @@
 endif()
 
 add_lldb_library(lldbHost ${HOST_SOURCES})
+
+if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+target_link_libraries(lldbHost kvm)
+endif ()
Index: source/CMakeLists.txt
===
--- source/CMakeLists.txt
+++ source/CMakeLists.txt
@@ -14,6 +14,13 @@
   )
 endif ()
 
+if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
+include_directories(
+  Plugins/Process/POSIX
+  )
+endif ()
+
+
 set(lldbBase_SOURCES
 lldb.cpp
   )
@@ -83,4 +90,3 @@
 endif ()
 # FIXME: implement svn/git revision and repository parsing solution on Windows. There is an SVN-only
 #revision parsing solution in tools/clang/lib/Basic/CMakelists.txt.
-
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D13715: Add initial gmake glue for the NetBSD platform

2015-10-13 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added a reviewer: joerg.
krytarowski added a subscriber: lldb-commits.
krytarowski set the repository for this revision to rL LLVM.
Herald added subscribers: srhines, danalbert, tberghammer.

These changes aren't everything what is needed for the autotools target, but 
it's significantly approaching it.

These changes shouldn't effect the build process on other platforms.

Repository:
  rL LLVM

http://reviews.llvm.org/D13715

Files:
  lib/Makefile
  source/Host/Makefile
  source/Host/netbsd/Makefile
  source/Plugins/Makefile
  source/Plugins/Platform/Makefile
  source/Plugins/Platform/NetBSD/Makefile

Index: source/Plugins/Platform/NetBSD/Makefile
===
--- /dev/null
+++ source/Plugins/Platform/NetBSD/Makefile
@@ -0,0 +1,14 @@
+##===- source/Plugins/Platform/NetBSD/Makefile *- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===--===##
+
+LLDB_LEVEL := ../../../..
+LIBRARYNAME := lldbPluginPlatformNetBSD
+BUILD_ARCHIVE = 1
+
+include $(LLDB_LEVEL)/Makefile
Index: source/Plugins/Platform/Makefile
===
--- source/Plugins/Platform/Makefile
+++ source/Plugins/Platform/Makefile
@@ -11,7 +11,7 @@
 
 include $(LLDB_LEVEL)/../../Makefile.config
 
-PARALLEL_DIRS := gdb-server MacOSX Linux FreeBSD POSIX Windows Kalimba Android
+PARALLEL_DIRS := gdb-server MacOSX Linux FreeBSD NetBSD POSIX Windows Kalimba Android
 
 # ifeq ($(HOST_OS),Darwin)
 #   DIRS += MacOSX
@@ -24,9 +24,13 @@
 # ifeq ($(HOST_OS),FreeBSD)
 #   DIRS += FreeBSD
 # endif
-# 
+#
 # ifeq ($(HOST_OS),GNU/kFreeBSD)
 #   DIRS += FreeBSD
 # endif
+#
+# ifeq ($(HOST_OS),NetBSD)
+#   DIRS += NetBSD
+# endif
 
 include $(LLDB_LEVEL)/Makefile
Index: source/Plugins/Makefile
===
--- source/Plugins/Makefile
+++ source/Plugins/Makefile
@@ -58,4 +58,8 @@
 PARALLEL_DIRS += Process/FreeBSD Process/POSIX
 endif
 
+ifeq ($(HOST_OS),NetBSD)
+PARALLEL_DIRS += Process/POSIX
+endif
+
 include $(LLDB_LEVEL)/Makefile
Index: source/Host/netbsd/Makefile
===
--- /dev/null
+++ source/Host/netbsd/Makefile
@@ -0,0 +1,14 @@
+##===- source/Host/netbsd/Makefile --*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===--===##
+
+LLDB_LEVEL := ../../..
+LIBRARYNAME := lldbHostNetBSD
+BUILD_ARCHIVE = 1
+
+include $(LLDB_LEVEL)/Makefile
Index: source/Host/Makefile
===
--- source/Host/Makefile
+++ source/Host/Makefile
@@ -43,6 +43,11 @@
 $(eval $(call DIR_SOURCES,freebsd))
 endif
 
+ifneq ($(HOST_OS),NetBSD)
+$(eval $(call DIR_SOURCES,posix))
+$(eval $(call DIR_SOURCES,netbsd))
+endif
+
 ifeq ($(HOST_OS),MingW)
 $(eval $(call DIR_SOURCES,windows))
 endif
Index: lib/Makefile
===
--- lib/Makefile
+++ lib/Makefile
@@ -103,6 +103,7 @@
 	lldbPluginPlatformLinux.a \
 	lldbPluginPlatformWindows.a \
 	lldbPluginPlatformFreeBSD.a \
+	lldbPluginPlatformNetBSD.a \
 	lldbPluginPlatformPOSIX.a \
 	lldbPluginPlatformKalimba.a \
 	lldbPluginPlatformAndroid.a \
@@ -142,6 +143,10 @@
   lldbPluginProcessFreeBSD.a
 endif
 
+ifneq ($(HOST_OS),NetBSD)
+  USEDLIBS += lldbPluginProcessPOSIX.a
+endif
+
 include $(LEVEL)/Makefile.common
 
 ifeq ($(HOST_OS),MingW)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12994: Improve support of the ncurses dependency on NetBSD

2015-10-14 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

There is already preliminary NetBSD support merged with trunk, I need this 
commit (or altered version of it) to build lldb against ncurses on this 
platform.

Thank you for your time.


Repository:
  rL LLVM

http://reviews.llvm.org/D12994



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hello Ying,

I'm in trouble with my attempts to connect my NetBSD/amd64 machine to
the LLDB/LLVM build zone.

My host is NetBSD-7.0 (with buildslave ID: lldb-amd64-ninja-netbsd7).
I use pkgsrc (2015Q3) to ship packages. I'm attaching a list of
installed ones to this mail.

I talked with Joerg and it was decided to go for CMake and Ninja, we
don't want to change it for now (at least till single machine will be
plugged in).

Please try to spawn local NetBSD session and connect to the staging
buildbot and debug it locally, to cut the number of iterations between
me and the Galina.

I'm adding here a short tutorial to get to reproduce quickly the setup
of mine. It will take you like 2-5 minutes to get into installed
system (depends of an internet connection).

1. Prepare a disk image.
$ qemu-img create -f qcow2 netbsd7.0_amd64 10G

2. Get an installation media.
$ $FETCH_TOOL
ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-7.0/amd64/installation/cdrom/boot
- -com.iso

3. Spawn installation
$ qemu-system-x86_64 \
-enable-kvm \
-net user \
-m 2G \
-cdrom boot-com.iso \
-nographic \
-smp cores=2 \
-hda netbsd7.0_amd64 \
-boot d

4. Inside the installer push ctrl-c and get the command line.

5. Setup network connection:
# dhcpcd

6. Go to a writable dir, like /tmp
# cd /tmp

7. Fetch the autoinst.sh script of mine
# ftp ftp://ftp.netbsd.org/pub/NetBSD/misc/kamil/autoinst.sh

# sh autoinst.sh -s 128 -r mypass -c com0 -C 9600 -p wd0

(take a coffee break)

8. If everything went OK, just type:
# poweroff

9. Start your newly installed system
qemu-system-x86_64 \
-enable-kvm \
-net user \
-m 2G \
-nographic \
-smp cores=2 \
-hda netbsd7.0_amd64 \
-boot c
(root password is empty)

10. Install dependencies from pkgsrc, like:
# cd /usr/pkgsrc/devel/cmake && make install

Please install packags needed for buildslave, create dedicated user
and try to connect it to the salve.

Thank you in advance,

On 20.10.2015 21:40, Galina Kistanova wrote:
> Hello Kamil,
> 
> It looks like you are missing dependencies for the LLDB builder
> you have chosen. 
> http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/75/s
teps/update%20scripts/logs/stdio
>
>
> 
The getLLDBScriptCommandsFactory build factory does not document
> the assumed dependency, so you may want to contact Ying Chen, who 
> is the author for the complete list of dependencies.
> 
> Another thing you may want to do is to reconsider the builder you 
> want to use. Maybe LLDBBuilder.getLLDBBuildFactory would work 
> better for you, though it requires autoconfig and make.
> 
> I'm adding the LLDB mail list in case somebody has an idea of what 
> would be the easiest way to get the NetBSD builder for LLDB up and 
> running.
> 
> Hello everyone,
> 
> Kamil is on the mission of getting LLDB builder for NetBSDwhich 
> would build clang+LLVM, then LLDB and run tests. What is the 
> shortest and less painful route there? Any suggestions? Just 
> looking at the source code of the current set of the LLDB builders,
> it is hard to tell which one is the "main".
> 
> Thanks
> 
> Galina
> 
> 
> 
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJWJqgPAAoJEEuzCOmwLnZsnA8P/1UpAgS4F6iViH1PbNcq6/8K
FhAaLm3spctbiJpYs51OVyqv+cu0pjziwdEU3KRWvHqWq7Rd29smlRj9w7sPGijD
iH5ofH/uTRpShwO/0taIyVtbMehyah2mtqk+M20Tx5V0H6ajRTYI+PKZWYKUs3V8
bhCnD09emc0clqsHSc1dEUyBY+1n7ID5NjZsMKViKj5lT3EsCIk8hYHYcrFq8Zxh
eDBXwCZUJHvItEA6FXED09IlhCdkeJd7rpLHeITb+3zg5ZNP6all1DnAaalSFRDm
ObDRpsqD8DLGhe9MPPDZVXVKVaFH3lOcrpV0U3qx9ccy4ihRHEWWdgD+n8vEslXF
Ai/j8PTgnZ1hQfmVTQPQoo9LCe3IS68Q2omEkZx+0/Thfv97yQ9rZk6RjWwekzfK
okf4JcnxG4jxhE8jRkKKuOWLCo/es53Rc1UQ9Q8BgoyTRRUmicNEM+eiWBIHUWFs
YRGcFbI+S8wJZuxFRizE0XkP4e1z4EGxn6Tu6m9WJYcUdhDn0mzDpjr6YVj+YgvS
xtlGB78uVj5p3e/ljfBUkcwqGS9HNH15VGgA1sV5j5gvpJu37wqXXT6/4i4wLbuP
0vIH6PoCwxiyP0FawQwyY7RZwY89LhnlHQbINMFAi5ZaH7q8ELNNkn7YXBSSlHjy
VmVVg06mkdC3bo7U8lMT
=Lm1Q
-END PGP SIGNATURE-
$ pkg_info  
   
digest-20121220 Message digest wrapper utility
checkperms-1.11 Check and correct file permissions
gmake-4.1nb1GNU version of 'make' utility
libtool-base-2.4.2nb10 Generic shared library support script (the script itself)
libarchive-3.1.2nb1 Library to read/create different archive formats
gsed-4.2.2nb4   GNU implementation of sed, the POSIX stream editor
perl-5.22.0 Practical Extraction and Report Language
pkg-config-0.28 System for managing library compile/link flags
libidn-1.32 Internationalized Domain Names command line tool
curl-7.44.0 Client that groks URLs
cmake-3.3.1 Cross platform make
ncurses-6.0nb1  CRT screen handling and optimization package
mg-20110905nb2  Small, fast, public domain EMACS style edit

Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Where can I find this updateScripts.sh? It's missing under your link:

https://android.googlesource.com/platform/external/lldb-utils/+/lldb-mas
ter-dev/buildbotScripts/bashShell/svntotbuild/

On 21.10.2015 00:29, Ying Chen wrote:
> Hello Kamil, Galina,
> 
> If you would like to build LLDB with cmake and ninja, I suggest to 
> consider the following two factory functions. Depends on what you
> described, I feel the first one works better for you.
> 
> 1. getLLDBUbuntuCMakeBuildFactory If you only run local lldb tests,
> this is the factory to use.
> 
> For example, if you would like to build host lldb with clang and
> Release config, and run tests with clang on x86_64 host, then call
> the function this way,
> 
> getLLDBUbuntuCMakeBuildFactory(build_compiler = "clang", build_type
> = "Release", local_test_archs=["x86_64"], 
> local_test_compilers=["clang"]) If you would like to run local
> tests with gcc compiler as well, then pass
> local_test_compilers=["clang", "gcc"]
> 
> Dependency: You need to have the required packages to build lldb.
> 
> Note*: please disable the last step in this function 
> "archiveLLDBTestTraces", this steps will upload the log files to a
> cloud storage that you might not have access to.
> 
> 2. getLLDBScriptCommandsFactory
> 
> If you have multiple targets to run tests against, for example,
> remote linux, remote android targets and etc, you should choose
> this factory. The advantage of this factory is that it calls a
> script in each step, so it's highly configurable and easy to make
> changes. You just need to make sure the scripts are in builder
> machine and have the correct commands. For your reference, the ones
> that we're currently using could be found here. 
> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-m
aster-dev/buildbotScripts/bashShell/svntotbuild/
>
> 
updateScript as the first step, is just copy the scripts to local builde
rs.
> 
> Please let me know if you have further questions.
> 
> Thanks, Ying
> 
> 
> On Tue, Oct 20, 2015 at 1:46 PM, Kamil Rytarowski  > wrote:
> 
> Hello Ying,
> 
> I'm in trouble with my attempts to connect my NetBSD/amd64 machine
> to the LLDB/LLVM build zone.
> 
> My host is NetBSD-7.0 (with buildslave ID:
> lldb-amd64-ninja-netbsd7). I use pkgsrc (2015Q3) to ship packages.
> I'm attaching a list of installed ones to this mail.
> 
> I talked with Joerg and it was decided to go for CMake and Ninja,
> we don't want to change it for now (at least till single machine
> will be plugged in).
> 
> Please try to spawn local NetBSD session and connect to the
> staging buildbot and debug it locally, to cut the number of
> iterations between me and the Galina.
> 
> I'm adding here a short tutorial to get to reproduce quickly the
> setup of mine. It will take you like 2-5 minutes to get into
> installed system (depends of an internet connection).
> 
> 1. Prepare a disk image. $ qemu-img create -f qcow2 netbsd7.0_amd64
> 10G
> 
> 2. Get an installation media. $ $FETCH_TOOL 
> ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-7.0/amd64/installation/cdrom/bo
ot
>
> 
- -com.iso
> 
> 3. Spawn installation $ qemu-system-x86_64 \ -enable-kvm \ -net
> user \ -m 2G \ -cdrom boot-com.iso \ -nographic \ -smp cores=2 \ 
> -hda netbsd7.0_amd64 \ -boot d
> 
> 4. Inside the installer push ctrl-c and get the command line.
> 
> 5. Setup network connection: # dhcpcd
> 
> 6. Go to a writable dir, like /tmp # cd /tmp
> 
> 7. Fetch the autoinst.sh script of mine # ftp
> ftp://ftp.netbsd.org/pub/NetBSD/misc/kamil/autoinst.sh
> 
> # sh autoinst.sh -s 128 -r mypass -c com0 -C 9600 -p wd0
> 
> (take a coffee break)
> 
> 8. If everything went OK, just type: # poweroff
> 
> 9. Start your newly installed system qemu-system-x86_64 \ 
> -enable-kvm \ -net user \ -m 2G \ -nographic \ -smp cores=2 \ -hda
> netbsd7.0_amd64 \ -boot c (root password is empty)
> 
> 10. Install dependencies from pkgsrc, like: # cd
> /usr/pkgsrc/devel/cmake && make install
> 
> Please install packags needed for buildslave, create dedicated
> user and try to connect it to the salve.
> 
> Thank you in advance,
> 
> On 20.10.2015 21:40, Galina Kistanova wrote:
>> Hello Kamil,
> 
>> It looks like you are missing dependencies for the LLDB builder 
>> you have chosen. 
>> http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/75/
s
>
>> 
teps/update%20scripts/logs/stdio
> 
> 
teps/update%20scripts/logs/stdio>
> 
> 
> 
> The getLLDBScriptCommandsFactory build factory does not document
>> the assumed dependency, so you may want to contact Ying Chen,
>> who is the author for the complete list of dependencies.
> 
>> Another thing you may want to do is to reconsider the builder
>> you want to use. Maybe LLDBBuilder.getLLDBBuildFactory would
>> work better for you, though it requires autoconfig and make.
> 
>> I'm adding the LLDB mail list in case s

Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

It just appeared there.

I took your updateScripts.sh, moved it to my $PATH. Is it everything?

Will the rest of the scripts from
https://android.googlesource.com/platform/external/lldb-utils/+/lldb-mas
ter-dev/buildbotScripts/bashShell/svntotbuild/
be fetched/used automatically?

Do I need a local copy of it? If so, do I need to fetch the whole
directory
https://android.googlesource.com/platform/external/lldb-utils/+/lldb-mas
ter-dev/buildbotScripts
?

According to builders.py (
https://github.com/llvm-mirror/zorg/commit/c901503848e900fc1af0c43c93c98
daddd2f23fd
)

I use: 'factory':LLDBBuilder.getLLDBScriptCommandsFactory(runTest=False)
}

At the moment I don't want to run tests and leave it for later.

I restarted the build bot with the staging server and this is what I get
:
2015-10-20 23:43:33+ [-] Log opened.
2015-10-20 23:43:33+ [-] twistd 15.4.0 (/usr/pkg/bin/python2.7
2.7.10) starting up.
2015-10-20 23:43:33+ [-] reactor class:
twisted.internet.pollreactor.PollReactor.
2015-10-20 23:43:33+ [-] Starting BuildSlave -- version: 0.8.8
2015-10-20 23:43:33+ [-] recording hostname in twistd.hostname
2015-10-20 23:43:33+ [-] Starting factory

2015-10-20 23:43:33+ [-] Connecting to lab.llvm.org:9994
2015-10-20 23:43:34+ [Broker,client] message from master: attached
2015-10-20 23:43:35+ [Broker,client]
SlaveBuilder.remote_print(lldb-amd64-ninja-netbsd7): message from
master: attached
2015-10-20 23:43:35+ [Broker,client] Connected to
lab.llvm.org:9994; slave is ready
2015-10-20 23:43:35+ [Broker,client] sending application-level
keepalives every 600 seconds


How to enforce it to start a test build now? I want to check quickly
whether it works, not just send keepalives every 10 minutes..

Thank you in advance,


On 21.10.2015 01:17, Ying Chen wrote:
> Please check again. Please note that this file needs to be included
> in your PATH. The rest of the scripts don't have to. Sample of test
> configuration file could be found here. 
> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-m
aster-dev/buildbotScripts/testCfg/
>
>  On Tue, Oct 20, 2015 at 3:50 PM, Kamil Rytarowski  > wrote:
> 
> Where can I find this updateScripts.sh? It's missing under your
> link:
> 
> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-m
as
>
> 
ter-dev/buildbotScripts/bashShell/svntotbuild/
> 
> 
ter-dev/buildbotScripts/bashShell/svntotbuild/>
> 
> On 21.10.2015 00:29, Ying Chen wrote:
>> Hello Kamil, Galina,
> 
>> If you would like to build LLDB with cmake and ninja, I suggest
>> to consider the following two factory functions. Depends on what
>> you described, I feel the first one works better for you.
> 
>> 1. getLLDBUbuntuCMakeBuildFactory If you only run local lldb
>> tests, this is the factory to use.
> 
>> For example, if you would like to build host lldb with clang and 
>> Release config, and run tests with clang on x86_64 host, then
>> call the function this way,
> 
>> getLLDBUbuntuCMakeBuildFactory(build_compiler = "clang",
>> build_type = "Release", local_test_archs=["x86_64"], 
>> local_test_compilers=["clang"]) If you would like to run local 
>> tests with gcc compiler as well, then pass 
>> local_test_compilers=["clang", "gcc"]
> 
>> Dependency: You need to have the required packages to build
>> lldb.
> 
>> Note*: please disable the last step in this function 
>> "archiveLLDBTestTraces", this steps will upload the log files to
>> a cloud storage that you might not have access to.
> 
>> 2. getLLDBScriptCommandsFactory
> 
>> If you have multiple targets to run tests against, for example, 
>> remote linux, remote android targets and etc, you should choose 
>> this factory. The advantage of this factory is that it calls a 
>> script in each step, so it's highly configurable and easy to
>> make changes. You just need to make sure the scripts are in
>> builder machine and have the correct commands. For your
>> reference, the ones that we're currently using could be found
>> here. 
>> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-
m
>
>> 
aster-dev/buildbotScripts/bashShell/svntotbuild/
> 
> 
aster-dev/buildbotScripts/bashShell/svntotbuild/>
> 
> 
> updateScript as the first step, is just copy the scripts to local
> builde rs.
> 
>> Please let me know if you have further questions.
> 
>> Thanks, Ying
> 
> 
>> On Tue, Oct 20, 2015 at 1:46 PM, Kamil Rytarowski  
>> >> wrote:
> 
>> Hello Ying,
> 
>> I'm in trouble with my attempts to connect my NetBSD/amd64
>> machine to the LLDB/LLVM build zone.
> 
>> My host is NetBSD-7.0 (with buildslave ID: 
>> lldb-amd64-ninja-netbsd7). I use pkgsrc (2015Q3) to ship
>> packages. I'm attaching a list of installed

Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 21.10.2015 02:03, Ying Chen wrote:
> 
> 
> On Tue, Oct 20, 2015 at 4:46 PM, Kamil Rytarowski  > wrote:
> 
> It just appeared there.
> 
> I took your updateScripts.sh, moved it to my $PATH. Is it
> everything?
> 
> 
>> Please also put the test_cfg.json to this location,
>> /home/motus/build/build/. A dummy file is ok if you don't want to
>> run any test.
> 

I added there a dummy literally empty file (of size 0) there.

> 
> 
> Will the rest of the scripts from 
> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-m
as
>
> 
ter-dev/buildbotScripts/bashShell/svntotbuild/
> 
> 
ter-dev/buildbotScripts/bashShell/svntotbuild/>
> be fetched/used automatically?
> 
> Do I need a local copy of it? If so, do I need to fetch the whole 
> directory 
> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-m
as
>
> 
ter-dev/buildbotScripts
> 
> 
ter-dev/buildbotScripts>
> ?
> 
> 
>> You don't need a local copy of any of it. updateScripts.sh will
>> fetch everything automatically.
> 

Thank you!

I also linked /bin/bash to /usr/pkg/bin/bash on my NetBSD host.

If there are some GNU tools used there, gawk please let me know.

> 
> 
> According to builders.py ( 
> https://github.com/llvm-mirror/zorg/commit/c901503848e900fc1af0c43c93c
98
>
> 
daddd2f23fd
> 
> 
daddd2f23fd>
> )
> 
> I use:
> 'factory':LLDBBuilder.getLLDBScriptCommandsFactory(runTest=False) 
> }
> 
> 
>> Please also add "downloadBinary=False"
> 

Please add this change there to the zorg repository and commit (I
don't have a commit bit).

> At the moment I don't want to run tests and leave it for later.
> 
> I restarted the build bot with the staging server and this is what
> I get : 2015-10-20 23:43:33+ [-] Log opened. 2015-10-20
> 23:43:33+ [-] twistd 15.4.0 (/usr/pkg/bin/python2.7 2.7.10)
> starting up. 2015-10-20 23:43:33+ [-] reactor class: 
> twisted.internet.pollreactor.PollReactor. 2015-10-20 23:43:33+
> [-] Starting BuildSlave -- version: 0.8.8 2015-10-20 23:43:33+
> [-] recording hostname in twistd.hostname 2015-10-20 23:43:33+
> [-] Starting factory  0x7f7ff53e0908> 2015-10-20 23:43:33+ [-] Connecting to
> lab.llvm.org:9994  2015-10-20
> 23:43:34+ [Broker,client] message from master: attached 
> 2015-10-20 23:43:35+ [Broker,client] 
> SlaveBuilder.remote_print(lldb-amd64-ninja-netbsd7): message from 
> master: attached 2015-10-20 23:43:35+ [Broker,client] Connected
> to lab.llvm.org:9994 ; slave is ready 
> 2015-10-20 23:43:35+ [Broker,client] sending application-level 
> keepalives every 600 seconds
> 
> 
> How to enforce it to start a test build now? I want to check
> quickly whether it works, not just send keepalives every 10
> minutes..
> 
> 
>> Click force build button from this page to kick off a build right
>> away. http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7
> 

I will do, thank you!

> 
> 
> 
> Thank you in advance,
> 
> 
> On 21.10.2015 01:17, Ying Chen wrote:
>> Please check again. Please note that this file needs to be
>> included in your PATH. The rest of the scripts don't have to.
>> Sample of test configuration file could be found here. 
>> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-
m
>
>> 
aster-dev/buildbotScripts/testCfg/
> 
> 
aster-dev/buildbotScripts/testCfg/>
> 
>> On Tue, Oct 20, 2015 at 3:50 PM, Kamil Rytarowski >  >>
>> wrote:
> 
>> Where can I find this updateScripts.sh? It's missing under your 
>> link:
> 
>> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-
m
>
>> 
as
> 
> 
> ter-dev/buildbotScripts/bashShell/svntotbuild/
>> 
>> 
mas
> 
> 
> ter-dev/buildbotScripts/bashShell/svntotbuild/>
> 
>> On 21.10.2015 00:29, Ying Chen wrote:
>>> Hello Kamil, Galina,
> 
>>> If you would like to build LLDB with cmake and ninja, I
>>> suggest to consider the following two factory functions.
>>> Depends on what you described, I feel the first one works
>>> better for you.
> 
>>> 1. getLLDBUbuntuCMakeBuildFactory If you only run local lldb 
>>> tests, this is the factory to use.
> 
>>> For example, if you would like to build host lldb with clang
>>> and Release config, and run tests with clang on x86_64 host,
>>> then call the function this way,
> 
>>> getLLDBUbuntuCMakeBuildFactory(build_compiler = "clang", 
>>> build_type = "Release", local_test_archs=["x86_64"], 
>>> local_test_compilers=["clang"]) If you would like to run local 
>>> tests wit

Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/90

cmake.sh is still wrong:

#!/bin/bash -e
set -x
host=$(uname)
if [[ $host != Linux ]];
then
  echo "Skip cmake step for" $host
else
  source setEnv.sh
  mkdir -p $buildDir
  cd $buildDir
  cmake -GNinja -DCMAKE_BUILD_TYPE=Release $llvmDir
- -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
fi


The uname result on NetBSD is 'NetBSD' and we need to use cmake. The
correct check is:

if [[ $host != Linux ]] && [[ $host != NetBSD ]]


I noticed also a check for ${OS} in
/home/motus/build/build/scripts/lldb-utils/build.sh

case "$(uname -s)" in
Linux)  OS=linux;;
Darwin) OS=darwin;;
*_NT-*) OS=windows;;
esac

There is need for NetBSD) OS=netbsd;; and new file build-netbsd.sh.

This is why, I suggested you to install NetBSD locally and adapt the
scripts for this system. Ping-pong overmails can take another 2 weeks.

On 21.10.2015 02:05, Kamil Rytarowski via lldb-commits wrote:
> On 21.10.2015 02:03, Ying Chen wrote:
> 
> 
>> On Tue, Oct 20, 2015 at 4:46 PM, Kamil Rytarowski > <mailto:n...@gmx.com>> wrote:
> 
>> It just appeared there.
> 
>> I took your updateScripts.sh, moved it to my $PATH. Is it 
>> everything?
> 
> 
>>> Please also put the test_cfg.json to this location, 
>>> /home/motus/build/build/. A dummy file is ok if you don't want
>>> to run any test.
> 
> 
> I added there a dummy literally empty file (of size 0) there.
> 
> 
> 
>> Will the rest of the scripts from 
>> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-
m
>
>> 
as
> 
> 
> ter-dev/buildbotScripts/bashShell/svntotbuild/
>> <https://android.googlesource.com/platform/external/lldb-utils/+/lldb
- -
>
>> 
mas
> 
> 
> ter-dev/buildbotScripts/bashShell/svntotbuild/>
>> be fetched/used automatically?
> 
>> Do I need a local copy of it? If so, do I need to fetch the whole
>>  directory 
>> https://android.googlesource.com/platform/external/lldb-utils/+/lldb-
m
>
>> 
as
> 
> 
> ter-dev/buildbotScripts
>> <https://android.googlesource.com/platform/external/lldb-utils/+/lldb
- -
>
>> 
mas
> 
> 
> ter-dev/buildbotScripts>
>> ?
> 
> 
>>> You don't need a local copy of any of it. updateScripts.sh
>>> will fetch everything automatically.
> 
> 
> Thank you!
> 
> I also linked /bin/bash to /usr/pkg/bin/bash on my NetBSD host.
> 
> If there are some GNU tools used there, gawk please let me know.
> 
> 
> 
>> According to builders.py ( 
>> https://github.com/llvm-mirror/zorg/commit/c901503848e900fc1af0c43c93
c
>
>> 
98
> 
> 
> daddd2f23fd
>> <https://github.com/llvm-mirror/zorg/commit/c901503848e900fc1af0c43c9
3
>
>> 
c98
> 
> 
> daddd2f23fd>
>> )
> 
>> I use: 
>> 'factory':LLDBBuilder.getLLDBScriptCommandsFactory(runTest=False)
>>  }
> 
> 
>>> Please also add "downloadBinary=False"
> 
> 
> Please add this change there to the zorg repository and commit (I 
> don't have a commit bit).
> 
>> At the moment I don't want to run tests and leave it for later.
> 
>> I restarted the build bot with the staging server and this is
>> what I get : 2015-10-20 23:43:33+ [-] Log opened. 2015-10-20 
>> 23:43:33+ [-] twistd 15.4.0 (/usr/pkg/bin/python2.7 2.7.10) 
>> starting up. 2015-10-20 23:43:33+ [-] reactor class: 
>> twisted.internet.pollreactor.PollReactor. 2015-10-20
>> 23:43:33+ [-] Starting BuildSlave -- version: 0.8.8
>> 2015-10-20 23:43:33+ [-] recording hostname in
>> twistd.hostname 2015-10-20 23:43:33+ [-] Starting factory
>>  2015-10-20
>> 23:43:33+ [-] Connecting to lab.llvm.org:9994
>> <http://lab.llvm.org:9994> 2015-10-20 23:43:34+
>> [Broker,client] message from master: attached 2015-10-20
>> 23:43:35+ [Broker,client] 
>> SlaveBuilder.remote_print(lldb-amd64-ninja-netbsd7): message from
>>  master: attached 2015-10-20 23:43:35+ [Broker,client]
>> Connected to lab.llvm.org:9994 <http://lab.llvm.org:9994>; slave
>> is ready 2015-10-20 23:43:35+ [Broker,client] sending
>> application-level keepalives every 600 seconds
> 
> 
>> How to enforce it to start a test build now? I want to check 
>> quickly whether it works, not just send keepalives every 10 
>> minutes..
> 
> 
>>> Click force build button from this page to kick off a build
>>> right away.
>>> http://lab.llvm.org:8014/builders/lld

Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

My $CC/$CXX is GCC 4.8.5.

I have good reason for it - to not intermix system-wide and fetched
headers for llvm. In the past this was causing problems for me during
my lldb porting.

Please update my builder.py for using gcc.

On 21.10.2015 03:11, Ying Chen wrote:
> Submitted the change, http://reviews.llvm.org/rL250871
> 
> The problem you mentioned has been resolved. But clang is missing
> from your system. You need to make sure the system is able to build
> and test lldb. Follow this
> http://lldb.llvm.org/build.html#BuildingLldbOnLinux.
> 
> 
> On Tue, Oct 20, 2015 at 5:47 PM, Kamil Rytarowski  <mailto:n...@gmx.com>> wrote:
> 
> http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/90
>
>  cmake.sh is still wrong:
> 
> #!/bin/bash -e set -x host=$(uname) if [[ $host != Linux ]]; then 
> echo "Skip cmake step for" $host else source setEnv.sh mkdir -p
> $buildDir cd $buildDir cmake -GNinja -DCMAKE_BUILD_TYPE=Release
> $llvmDir -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ fi
> 
> 
> The uname result on NetBSD is 'NetBSD' and we need to use cmake.
> The correct check is:
> 
> if [[ $host != Linux ]] && [[ $host != NetBSD ]]
> 
> 
> I noticed also a check for ${OS} in 
> /home/motus/build/build/scripts/lldb-utils/build.sh
> 
> case "$(uname -s)" in Linux)  OS=linux;; Darwin) OS=darwin;; 
> *_NT-*) OS=windows;; esac
> 
> There is need for NetBSD) OS=netbsd;; and new file
> build-netbsd.sh.
> 
> This is why, I suggested you to install NetBSD locally and adapt
> the scripts for this system. Ping-pong overmails can take another 2
> weeks.
> 
> On 21.10.2015 02:05, Kamil Rytarowski via lldb-commits wrote:
>> On 21.10.2015 02:03, Ying Chen wrote:
> 
> 
>>> On Tue, Oct 20, 2015 at 4:46 PM, Kamil Rytarowski >> <mailto:n...@gmx.com> <mailto:n...@gmx.com <mailto:n...@gmx.com>>>
>>> wrote:
> 
>>> It just appeared there.
> 
>>> I took your updateScripts.sh, moved it to my $PATH. Is it 
>>> everything?
> 
> 
>>>> Please also put the test_cfg.json to this location, 
>>>> /home/motus/build/build/. A dummy file is ok if you don't
>>>> want to run any test.
> 
> 
>> I added there a dummy literally empty file (of size 0) there.
> 
> 
> 
>>> Will the rest of the scripts from 
>>> https://android.googlesource.com/platform/external/lldb-utils/+/lldb
- -
>
>>> 
m
> 
>>> 
> as
> 
> 
>> ter-dev/buildbotScripts/bashShell/svntotbuild/
>>> <https://android.googlesource.com/platform/external/lldb-utils/+/lld
b
>
>>> 
- -
> 
>>> 
> mas
> 
> 
>> ter-dev/buildbotScripts/bashShell/svntotbuild/>
>>> be fetched/used automatically?
> 
>>> Do I need a local copy of it? If so, do I need to fetch the
>>> whole directory 
>>> https://android.googlesource.com/platform/external/lldb-utils/+/lldb
- -
>
>>> 
m
> 
>>> 
> as
> 
> 
>> ter-dev/buildbotScripts
>>> <https://android.googlesource.com/platform/external/lldb-utils/+/lld
b
>
>>> 
- -
> 
>>> 
> mas
> 
> 
>> ter-dev/buildbotScripts>
>>> ?
> 
> 
>>>> You don't need a local copy of any of it. updateScripts.sh 
>>>> will fetch everything automatically.
> 
> 
>> Thank you!
> 
>> I also linked /bin/bash to /usr/pkg/bin/bash on my NetBSD host.
> 
>> If there are some GNU tools used there, gawk please let me know.
> 
> 
> 
>>> According to builders.py ( 
>>> https://github.com/llvm-mirror/zorg/commit/c901503848e900fc1af0c43c9
3
>
>>> 
c
> 
>>> 
> 98
> 
> 
>> daddd2f23fd
>>> <https://github.com/llvm-mirror/zorg/commit/c901503848e900fc1af0c43c
9
>
>>> 
3
> 
>>> 
> c98
> 
> 
>> daddd2f23fd>
>>> )
> 
>>> I use: 
>>> 'factory':LLDBBuilder.getLLDBScriptCommandsFactory(runTest=False)
>>>
>>> 
}
> 
> 
>>>> Please also add "downloadBinary=False"
> 
> 
>> Please add this change there to the zorg repository and commit
>> (I don't have a commit bit).
> 
>>> At the moment I don't want to run tests and leave it for
>>> later.
> 
>>> I restarted the build bot with the staging server and this is 
>>> what I get : 2015-10-20 23:43:33+ [-] Log opened.
>>> 2015-10-20 23:43:33+ [-] twistd 15.4.0
>>> (/usr/pkg/bin/python2.7 2

Re: [Lldb-commits] New llvm build server account request

2015-10-20 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Please update the documentation from
http://lldb.llvm.org/build.html#BuildingLldbOnLinux. and add an entry
for NetBSD:

On NetBSD one might run:
> pkgin install swig python27

Regarding the cmake issue, I suggest to add this change to cmake.sh:

if [[ $host == NetBSD ]]; then
  cmake -GNinja -DCMAKE_BUILD_TYPE=Release $llvmDir
- -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
else
  cmake -GNinja -DCMAKE_BUILD_TYPE=Release $llvmDir
- -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
endif


Additionally please replace all shebangs '/bin/bash' to /usr/bin/env
bash' it will be more portable and I will drop my /bin/bash linkage.

Thank you in advance,

On 21.10.2015 03:23, Kamil Rytarowski via lldb-commits wrote:
> My $CC/$CXX is GCC 4.8.5.
> 
> I have good reason for it - to not intermix system-wide and
> fetched headers for llvm. In the past this was causing problems for
> me during my lldb porting.
> 
> Please update my builder.py for using gcc.
> 
> On 21.10.2015 03:11, Ying Chen wrote:
>> Submitted the change, http://reviews.llvm.org/rL250871
> 
>> The problem you mentioned has been resolved. But clang is
>> missing from your system. You need to make sure the system is
>> able to build and test lldb. Follow this 
>> http://lldb.llvm.org/build.html#BuildingLldbOnLinux.
> 
> 
>> On Tue, Oct 20, 2015 at 5:47 PM, Kamil Rytarowski > <mailto:n...@gmx.com>> wrote:
> 
>> http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/90
>
>>  cmake.sh is still wrong:
> 
>> #!/bin/bash -e set -x host=$(uname) if [[ $host != Linux ]]; then
>>  echo "Skip cmake step for" $host else source setEnv.sh mkdir -p 
>> $buildDir cd $buildDir cmake -GNinja -DCMAKE_BUILD_TYPE=Release 
>> $llvmDir -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
>> fi
> 
> 
>> The uname result on NetBSD is 'NetBSD' and we need to use cmake. 
>> The correct check is:
> 
>> if [[ $host != Linux ]] && [[ $host != NetBSD ]]
> 
> 
>> I noticed also a check for ${OS} in 
>> /home/motus/build/build/scripts/lldb-utils/build.sh
> 
>> case "$(uname -s)" in Linux)  OS=linux;; Darwin) OS=darwin;; 
>> *_NT-*) OS=windows;; esac
> 
>> There is need for NetBSD) OS=netbsd;; and new file 
>> build-netbsd.sh.
> 
>> This is why, I suggested you to install NetBSD locally and adapt 
>> the scripts for this system. Ping-pong overmails can take another
>> 2 weeks.
> 
>> On 21.10.2015 02:05, Kamil Rytarowski via lldb-commits wrote:
>>> On 21.10.2015 02:03, Ying Chen wrote:
> 
> 
>>>> On Tue, Oct 20, 2015 at 4:46 PM, Kamil Rytarowski
>>>> mailto:n...@gmx.com> <mailto:n...@gmx.com
>>>> <mailto:n...@gmx.com>>> wrote:
> 
>>>> It just appeared there.
> 
>>>> I took your updateScripts.sh, moved it to my $PATH. Is it 
>>>> everything?
> 
> 
>>>>> Please also put the test_cfg.json to this location, 
>>>>> /home/motus/build/build/. A dummy file is ok if you don't 
>>>>> want to run any test.
> 
> 
>>> I added there a dummy literally empty file (of size 0) there.
> 
> 
> 
>>>> Will the rest of the scripts from 
>>>> https://android.googlesource.com/platform/external/lldb-utils/+/lld
b
>
>>>> 
- -
> 
>>>> 
> m
> 
>>>> 
>> as
> 
> 
>>> ter-dev/buildbotScripts/bashShell/svntotbuild/
>>>> <https://android.googlesource.com/platform/external/lldb-utils/+/ll
d
>
>>>> 
b
> 
>>>> 
> -
> 
>>>> 
>> mas
> 
> 
>>> ter-dev/buildbotScripts/bashShell/svntotbuild/>
>>>> be fetched/used automatically?
> 
>>>> Do I need a local copy of it? If so, do I need to fetch the 
>>>> whole directory 
>>>> https://android.googlesource.com/platform/external/lldb-utils/+/lld
b
>
>>>> 
- -
> 
>>>> 
> m
> 
>>>> 
>> as
> 
> 
>>> ter-dev/buildbotScripts
>>>> <https://android.googlesource.com/platform/external/lldb-utils/+/ll
d
>
>>>> 
b
> 
>>>> 
> -
> 
>>>> 
>> mas
> 
> 
>>> ter-dev/buildbotScripts>
>>>> ?
> 
> 
>>>>> You don't need a local copy of any of it. updateScripts.sh
>>>>>  will fetch everything automatically.
> 
> 
>>> Thank you!
> 
>>> I also linked /bin/bash to /usr/pkg/bin/bash on my NetBSD
>>>

Re: [Lldb-commits] [PATCH] D13715: Add initial gmake glue for the NetBSD platform

2015-10-20 Thread Kamil Rytarowski via lldb-commits
krytarowski updated this revision to Diff 37957.
krytarowski added a comment.

Typos.


Repository:
  rL LLVM

http://reviews.llvm.org/D13715

Files:
  lib/Makefile
  source/Host/Makefile
  source/Host/netbsd/Makefile
  source/Plugins/Makefile
  source/Plugins/Platform/Makefile
  source/Plugins/Platform/NetBSD/Makefile

Index: source/Plugins/Platform/NetBSD/Makefile
===
--- /dev/null
+++ source/Plugins/Platform/NetBSD/Makefile
@@ -0,0 +1,14 @@
+##===- source/Plugins/Platform/NetBSD/Makefile *- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===--===##
+
+LLDB_LEVEL := ../../../..
+LIBRARYNAME := lldbPluginPlatformNetBSD
+BUILD_ARCHIVE = 1
+
+include $(LLDB_LEVEL)/Makefile
Index: source/Plugins/Platform/Makefile
===
--- source/Plugins/Platform/Makefile
+++ source/Plugins/Platform/Makefile
@@ -11,7 +11,7 @@
 
 include $(LLDB_LEVEL)/../../Makefile.config
 
-PARALLEL_DIRS := gdb-server MacOSX Linux FreeBSD POSIX Windows Kalimba Android
+PARALLEL_DIRS := gdb-server MacOSX Linux FreeBSD NetBSD POSIX Windows Kalimba Android
 
 # ifeq ($(HOST_OS),Darwin)
 #   DIRS += MacOSX
@@ -24,9 +24,13 @@
 # ifeq ($(HOST_OS),FreeBSD)
 #   DIRS += FreeBSD
 # endif
-# 
+#
 # ifeq ($(HOST_OS),GNU/kFreeBSD)
 #   DIRS += FreeBSD
 # endif
+#
+# ifeq ($(HOST_OS),NetBSD)
+#   DIRS += NetBSD
+# endif
 
 include $(LLDB_LEVEL)/Makefile
Index: source/Plugins/Makefile
===
--- source/Plugins/Makefile
+++ source/Plugins/Makefile
@@ -58,4 +58,8 @@
 PARALLEL_DIRS += Process/FreeBSD Process/POSIX
 endif
 
+ifeq ($(HOST_OS),NetBSD)
+PARALLEL_DIRS += Process/POSIX
+endif
+
 include $(LLDB_LEVEL)/Makefile
Index: source/Host/netbsd/Makefile
===
--- /dev/null
+++ source/Host/netbsd/Makefile
@@ -0,0 +1,14 @@
+##===- source/Host/netbsd/Makefile --*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===--===##
+
+LLDB_LEVEL := ../../..
+LIBRARYNAME := lldbHostNetBSD
+BUILD_ARCHIVE = 1
+
+include $(LLDB_LEVEL)/Makefile
Index: source/Host/Makefile
===
--- source/Host/Makefile
+++ source/Host/Makefile
@@ -43,6 +43,11 @@
 $(eval $(call DIR_SOURCES,freebsd))
 endif
 
+ifeq ($(HOST_OS),NetBSD)
+$(eval $(call DIR_SOURCES,posix))
+$(eval $(call DIR_SOURCES,netbsd))
+endif
+
 ifeq ($(HOST_OS),MingW)
 $(eval $(call DIR_SOURCES,windows))
 endif
Index: lib/Makefile
===
--- lib/Makefile
+++ lib/Makefile
@@ -103,6 +103,7 @@
 	lldbPluginPlatformLinux.a \
 	lldbPluginPlatformWindows.a \
 	lldbPluginPlatformFreeBSD.a \
+	lldbPluginPlatformNetBSD.a \
 	lldbPluginPlatformPOSIX.a \
 	lldbPluginPlatformKalimba.a \
 	lldbPluginPlatformAndroid.a \
@@ -142,6 +143,10 @@
   lldbPluginProcessFreeBSD.a
 endif
 
+ifeq ($(HOST_OS),NetBSD)
+  USEDLIBS += lldbPluginProcessPOSIX.a
+endif
+
 include $(LEVEL)/Makefile.common
 
 ifeq ($(HOST_OS),MingW)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12995: Add support for lldb config.h and detect ncurses' include path

2015-10-21 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

This ncurses header is now the blocker for buildslave.

  [2817/3214] Building CXX object 
tools/lldb/source/Core/CMakeFiles/lldbCore.dir/IOHandler.cpp.o
  FAILED: /usr/bin/g++   -DGTEST_HAS_RTTI=0 -DHAVE_ROUND 
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fPIC 
-fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings 
-Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long 
-Wno-maybe-uninitialized -Wno-comment -std=c++11 -ffunction-sections 
-fdata-sections -Wno-deprecated-declarations -Wno-unknown-pragmas 
-Wno-deprecated-register -Wno-vla-extension  -fno-exceptions -fno-rtti -fPIC 
-fPIC  -DNDEBUG -Itools/lldb/source/Core 
-I/home/motus/build/build/llvm/tools/lldb/source/Core 
-I/home/motus/build/build/llvm/tools/lldb/include -Itools/lldb/include 
-Iinclude -I/home/motus/build/build/llvm/include -I/usr/pkg/include/python2.7 
-I/home/motus/build/build/llvm/tools/lldb/../clang/include 
-Itools/lldb/../clang/include 
-I/home/motus/build/build/llvm/tools/lldb/source/. -fno-exceptions 
-fno-rtti -MMD -MT 
tools/lldb/source/Core/CMakeFiles/lldbCore.dir/IOHandler.cpp.o -MF 
tools/lldb/source/Core/CMakeFiles/lldbCore.dir/IOHandler.cpp.o.d -o 
tools/lldb/source/Core/CMakeFiles/lldbCore.dir/IOHandler.cpp.o -c 
/home/motus/build/build/llvm/tools/lldb/source/Core/IOHandler.cpp
  /home/motus/build/build/llvm/tools/lldb/source/Core/IOHandler.cpp:32:21: 
fatal error: ncurses.h: No such file or directory
   #include 
   ^
  compilation terminated.
  ninja: build stopped: subcommand failed.
  program finished with exit code 1
  elapsedTime=2238.962841

http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/139/steps/ninja%20build%20local/logs/stdio


Repository:
  rL LLVM

http://reviews.llvm.org/D12995



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [Diffusion] rL250335: Fix codesign command with cmake.

2015-10-21 Thread Kamil Rytarowski via lldb-commits
krytarowski added a subscriber: krytarowski.
krytarowski added a comment.

  cmake_minimum_required(VERSION 2.8)

in CMakeLists.txt


Users:
  sas (Author)
  dawn (Auditor)

http://reviews.llvm.org/rL250335



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12994: Improve support of the ncurses dependency on NetBSD

2015-10-23 Thread Kamil Rytarowski via lldb-commits
krytarowski abandoned this revision.
krytarowski added a comment.

Closing. We are going for reuse of the NetBSD native curses(8) library.

The reason for it is limit of detecting ncurses on various systems. For 
example, Ubuntu ships with `` and linkage from ``, 
`ncurses.h` isn't detected by CMake. Detecting `` on NetBSD is 
reusing conflicting header from the host curses(8) and pkgsrc's ncurses library.


Repository:
  rL LLVM

http://reviews.llvm.org/D12994



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12995: Add support for lldb config.h and detect ncurses' include path

2015-10-23 Thread Kamil Rytarowski via lldb-commits
krytarowski abandoned this revision.
krytarowski added a comment.

Closing. We are going for reuse of the NetBSD native curses(8) library.

The reason for it is limit of detecting ncurses on various systems. For 
example, Ubuntu ships with `` and linkage from ``, 
`ncurses.h` isn't detected by CMake. Detecting `` on NetBSD is 
reusing conflicting header from the host curses(8) and pkgsrc's ncurses library.


Repository:
  rL LLVM

http://reviews.llvm.org/D12995



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D14037: Reuse native curses(8) library on NetBSD

2015-10-23 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added subscribers: lldb-commits, joerg.
krytarowski set the repository for this revision to rL LLVM.

The reason for it is limit of detecting ncurses on various systems. For
example, Ubuntu ships with  and linkage from , 
isn't detected by CMake. Detecting `` on NetBSD is reusing
conflicting header from the host curses(8) and pkgsrc's ncurses library.

ncurses ships on most (till conflicting) systems with curses.h. On NetBSD it
might be conflicting, so the ncurses headers are installed with pkgsrc to a
subdirectory "ncurses/".

Repository:
  rL LLVM

http://reviews.llvm.org/D14037

Files:
  source/Core/IOHandler.cpp

Index: source/Core/IOHandler.cpp
===
--- source/Core/IOHandler.cpp
+++ source/Core/IOHandler.cpp
@@ -29,7 +29,7 @@
 #include "lldb/Target/ThreadPlan.h"
 
 #ifndef LLDB_DISABLE_CURSES
-#include 
+#include 
 #include 
 #endif
 
@@ -4133,7 +4133,9 @@
 case KEY_UNDO:  return "undo key";
 case KEY_MOUSE: return "Mouse event has occurred";
 case KEY_RESIZE:return "Terminal resize event";
+#ifdef KEY_EVENT
 case KEY_EVENT: return "We were interrupted by an event";
+#endif
 case KEY_RETURN:return "return";
 case ' ':   return "space";
 case '\t':  return "tab";


Index: source/Core/IOHandler.cpp
===
--- source/Core/IOHandler.cpp
+++ source/Core/IOHandler.cpp
@@ -29,7 +29,7 @@
 #include "lldb/Target/ThreadPlan.h"
 
 #ifndef LLDB_DISABLE_CURSES
-#include 
+#include 
 #include 
 #endif
 
@@ -4133,7 +4133,9 @@
 case KEY_UNDO:  return "undo key";
 case KEY_MOUSE: return "Mouse event has occurred";
 case KEY_RESIZE:return "Terminal resize event";
+#ifdef KEY_EVENT
 case KEY_EVENT: return "We were interrupted by an event";
+#endif
 case KEY_RETURN:return "return";
 case ' ':   return "space";
 case '\t':  return "tab";
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14037: Reuse native curses(8) library on NetBSD

2015-10-23 Thread Kamil Rytarowski via lldb-commits
krytarowski added a subscriber: brucem.
krytarowski added a comment.

Bruce was involved in the older version with `config.h`.


Repository:
  rL LLVM

http://reviews.llvm.org/D14037



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14042: Add more NetBSD platform glue for lldb

2015-10-24 Thread Kamil Rytarowski via lldb-commits
krytarowski added a subscriber: brucem.
krytarowski added a comment.

+brucem, committer of the previous NetBSD glue


Repository:
  rL LLVM

http://reviews.llvm.org/D14042



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14042: Add more NetBSD platform glue for lldb

2015-10-28 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

I have successfully compiled this patch on FreeBSD.

  $   uname -a
  FreeBSD 10.1-RELEASE-p19 FreeBSD 10.1-RELEASE-p19 #0: Sat Aug 22 03:55:09 UTC 
2015 r...@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64


Repository:
  rL LLVM

http://reviews.llvm.org/D14042



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14037: Reuse native curses(8) library on NetBSD

2015-10-28 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

I have successfully compiled this patch on FreeBSD.

  $   uname -a
  FreeBSD 10.1-RELEASE-p19 FreeBSD 10.1-RELEASE-p19 #0: Sat Aug 22 03:55:09 UTC 
2015 r...@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64


Repository:
  rL LLVM

http://reviews.llvm.org/D14037



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14182: Centos 5 compile fixes for lldb

2015-10-29 Thread Kamil Rytarowski via lldb-commits
krytarowski added a subscriber: krytarowski.


Comment at: tools/lldb/source/Host/common/File.cpp:301
@@ -299,1 +300,3 @@
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
 if (options & eOpenOptionCloseOnExec)

labath wrote:
> This needs to evaluate to true on non-linux systems.
> Would `#ifdef O_CLOEXEC` work for you ?
NetBSD:

```
/usr/include/fcntl.h:#defineO_CLOEXEC   0x0040  /* set close on 
exec */
```


Repository:
  rL LLVM

http://reviews.llvm.org/D14182



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14182: Centos 5 compile fixes for lldb

2015-10-29 Thread Kamil Rytarowski via lldb-commits
krytarowski requested changes to this revision.
krytarowski added a reviewer: krytarowski.


Comment at: tools/lldb/source/Host/posix/PipePosix.cpp:32
@@ -31,1 +31,3 @@
 
+#include 
+

Is this file just for Linux?


Comment at: tools/lldb/source/Host/posix/PipePosix.cpp:254
@@ -251,1 +253,3 @@
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
 if (!child_process_inherit)

Stop breaking NetBSD.


Repository:
  rL LLVM

http://reviews.llvm.org/D14182



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14182: Centos 5 compile fixes for lldb

2015-10-29 Thread Kamil Rytarowski via lldb-commits
krytarowski added inline comments.


Comment at: tools/lldb/source/Host/posix/PipePosix.cpp:43
@@ -40,3 +42,3 @@
 // TODO: Add more platforms that support pipe2.
-#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD__ >= 10) || 
defined(__NetBSD__)
+#if (defined(__linux__) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) || 
(defined(__FreeBSD__) && __FreeBSD__ >= 10) || defined(__NetBSD__)
 #define PIPE2_SUPPORTED 1

How about moving `PIPE2_SUPPORTED` to `include/lldb/Host/*/Config.h`? It could 
be renamed to `LLDB_CONFIG_PIPE2_SUPPORTED`. Feel free to include in the Linux 
configuration headers needed to detect Linux version.


Repository:
  rL LLVM

http://reviews.llvm.org/D14182



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14182: Centos 5 compile fixes for lldb

2015-10-29 Thread Kamil Rytarowski via lldb-commits
krytarowski added inline comments.


Comment at: tools/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp:72
@@ -71,1 +71,3 @@
 
+// Missing defines due to bug: 
https://sourceware.org/bugzilla/show_bug.cgi?id=4125
+

brucem wrote:
> This bug was fixed in 2007, over 8 years ago ... at what point do we stop 
> carrying around this baggage?
Few defines aren't much of entanglement. RHEL5 is still supported upstream 
(till 2017).

https://en.wikipedia.org/wiki/Red_Hat_Enterprise_Linux#Product_life_cycle


Repository:
  rL LLVM

http://reviews.llvm.org/D14182



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14037: Reuse native curses(8) library on NetBSD

2015-11-05 Thread Kamil Rytarowski via lldb-commits
krytarowski updated this revision to Diff 39440.
krytarowski added a comment.

Rebase to master


Repository:
  rL LLVM

http://reviews.llvm.org/D14037

Files:
  source/Core/IOHandler.cpp

Index: source/Core/IOHandler.cpp
===
--- source/Core/IOHandler.cpp
+++ source/Core/IOHandler.cpp
@@ -9,7 +9,7 @@
 
 // C Includes
 #ifndef LLDB_DISABLE_CURSES
-#include 
+#include 
 #include 
 #endif
 
@@ -4107,7 +4107,9 @@
 case KEY_UNDO:  return "undo key";
 case KEY_MOUSE: return "Mouse event has occurred";
 case KEY_RESIZE:return "Terminal resize event";
+#ifdef KEY_EVENT
 case KEY_EVENT: return "We were interrupted by an event";
+#endif
 case KEY_RETURN:return "return";
 case ' ':   return "space";
 case '\t':  return "tab";


Index: source/Core/IOHandler.cpp
===
--- source/Core/IOHandler.cpp
+++ source/Core/IOHandler.cpp
@@ -9,7 +9,7 @@
 
 // C Includes
 #ifndef LLDB_DISABLE_CURSES
-#include 
+#include 
 #include 
 #endif
 
@@ -4107,7 +4107,9 @@
 case KEY_UNDO:  return "undo key";
 case KEY_MOUSE: return "Mouse event has occurred";
 case KEY_RESIZE:return "Terminal resize event";
+#ifdef KEY_EVENT
 case KEY_EVENT: return "We were interrupted by an event";
+#endif
 case KEY_RETURN:return "return";
 case ' ':   return "space";
 case '\t':  return "tab";
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14042: Add more NetBSD platform glue for lldb

2015-11-07 Thread Kamil Rytarowski via lldb-commits
krytarowski updated this revision to Diff 39639.
krytarowski added a comment.

Rebase to head


Repository:
  rL LLVM

http://reviews.llvm.org/D14042

Files:
  cmake/LLDBDependencies.cmake
  cmake/modules/LLDBConfig.cmake
  source/Initialization/SystemInitializerCommon.cpp
  source/lldb.cpp
  tools/Makefile
  tools/lldb-mi/CMakeLists.txt

Index: tools/lldb-mi/CMakeLists.txt
===
--- tools/lldb-mi/CMakeLists.txt
+++ tools/lldb-mi/CMakeLists.txt
@@ -76,7 +76,7 @@
   Platform.cpp
   )
 
-if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
+if ( CMAKE_SYSTEM_NAME MATCHES "Windows" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD" 
)
   add_definitions( -DIMPORT_LIBLLDB )
   list(APPEND LLDB_MI_SOURCES
 ${LLDB_SOURCE_ROOT}/Host/common/GetOptInc.cpp
Index: tools/Makefile
===
--- tools/Makefile
+++ tools/Makefile
@@ -13,7 +13,7 @@
 DIRS :=
 
 # enable lldb-gdbserver for supported platforms
-ifneq (,$(strip $(filter $(HOST_OS), FreeBSD Linux GNU/kFreeBSD)))
+ifneq (,$(strip $(filter $(HOST_OS), FreeBSD Linux NetBSD GNU/kFreeBSD)))
 DIRS += lldb-server
 endif
 
Index: source/lldb.cpp
===
--- source/lldb.cpp
+++ source/lldb.cpp
@@ -67,7 +67,7 @@
 
 return g_version_string;
 #else
-// On Linux/FreeBSD/Windows, report a version number in the same style as 
the clang tool.
+// On platforms other than Darwin, report a version number in the same 
style as the clang tool.
 static std::string g_version_str;
 if (g_version_str.empty())
 {
Index: source/Initialization/SystemInitializerCommon.cpp
===
--- source/Initialization/SystemInitializerCommon.cpp
+++ source/Initialization/SystemInitializerCommon.cpp
@@ -33,6 +33,7 @@
 #include "Plugins/Platform/Linux/PlatformLinux.h"
 #include "Plugins/Platform/MacOSX/PlatformMacOSX.h"
 #include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h"
+#include "Plugins/Platform/NetBSD/PlatformNetBSD.h"
 #include "Plugins/Platform/Windows/PlatformWindows.h"
 #include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
 
Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -381,7 +381,8 @@
 # ensure we build lldb-server when an lldb target is being built.
 if ((CMAKE_SYSTEM_NAME MATCHES "Darwin") OR
 (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") OR
-(CMAKE_SYSTEM_NAME MATCHES "Linux"))
+(CMAKE_SYSTEM_NAME MATCHES "Linux") OR
+(CMAKE_SYSTEM_NAME MATCHES "NetBSD"))
 set(LLDB_CAN_USE_LLDB_SERVER 1)
 else()
 set(LLDB_CAN_USE_LLDB_SERVER 0)
Index: cmake/LLDBDependencies.cmake
===
--- cmake/LLDBDependencies.cmake
+++ cmake/LLDBDependencies.cmake
@@ -38,6 +38,7 @@
   lldbPluginPlatformFreeBSD
   lldbPluginPlatformKalimba
   lldbPluginPlatformLinux
+  lldbPluginPlatformNetBSD
   lldbPluginPlatformPOSIX
   lldbPluginPlatformWindows
   lldbPluginObjectContainerMachOArchive
@@ -105,6 +106,13 @@
 )
 endif ()
 
+# NetBSD-only libraries
+if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
+  list(APPEND LLDB_USED_LIBS
+lldbPluginProcessPOSIX
+)
+endif ()
+
 # Darwin-only libraries
 if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
   list(APPEND LLDB_USED_LIBS


Index: tools/lldb-mi/CMakeLists.txt
===
--- tools/lldb-mi/CMakeLists.txt
+++ tools/lldb-mi/CMakeLists.txt
@@ -76,7 +76,7 @@
   Platform.cpp
   )
 
-if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
+if ( CMAKE_SYSTEM_NAME MATCHES "Windows" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
   add_definitions( -DIMPORT_LIBLLDB )
   list(APPEND LLDB_MI_SOURCES
 ${LLDB_SOURCE_ROOT}/Host/common/GetOptInc.cpp
Index: tools/Makefile
===
--- tools/Makefile
+++ tools/Makefile
@@ -13,7 +13,7 @@
 DIRS :=
 
 # enable lldb-gdbserver for supported platforms
-ifneq (,$(strip $(filter $(HOST_OS), FreeBSD Linux GNU/kFreeBSD)))
+ifneq (,$(strip $(filter $(HOST_OS), FreeBSD Linux NetBSD GNU/kFreeBSD)))
 DIRS += lldb-server
 endif
 
Index: source/lldb.cpp
===
--- source/lldb.cpp
+++ source/lldb.cpp
@@ -67,7 +67,7 @@
 
 return g_version_string;
 #else
-// On Linux/FreeBSD/Windows, report a version number in the same style as the clang tool.
+// On platforms other than Darwin, report a version number in the same style as the clang tool.
 static std::string g_version_str;
 if (g_version_str.empty())
 {
Index: source/Initialization/SystemInitializerCommon.cpp
===
--- source/Initialization/SystemInitializerCommon.cpp
+++ source/Initialization/SystemInitializerCommo

[Lldb-commits] [PATCH] D14528: Allow to override python-config executable name from command line

2015-11-09 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added subscribers: joerg, lldb-commits, brucem.
krytarowski set the repository for this revision to rL LLVM.

pkgsrc (on NetBSD) ships with python2.7-config.

Repository:
  rL LLVM

http://reviews.llvm.org/D14528

Files:
  Makefile
  lib/Makefile
  scripts/Python/modules/readline/Makefile

Index: scripts/Python/modules/readline/Makefile
===
--- scripts/Python/modules/readline/Makefile
+++ scripts/Python/modules/readline/Makefile
@@ -20,7 +20,8 @@
 SHARED_LIBRARY = 1
 LOADABLE_MODULE = 1
 
-PYTHON_INC_DIR = $(shell python-config --includes)
+PYTHON_CONFIG?=python-config
+PYTHON_INC_DIR = $(shell $(PYTHON_CONFIG) --includes)
 
 # Include all archives in the shared lib
 USEDLIBS :=
Index: lib/Makefile
===
--- lib/Makefile
+++ lib/Makefile
@@ -18,7 +18,8 @@
 SHARED_LIBRARY = 1
 
 ifeq (,$(findstring -DLLDB_DISABLE_PYTHON,$(CXXFLAGS)))
-PYTHON_BUILD_FLAGS = $(shell python-config --ldflags)
+PYTHON_CONFIG?=python-config
+PYTHON_BUILD_FLAGS = $(shell $(PYTHON_CONFIG) --ldflags)
 endif
 
 # Include all archives in liblldb.so file
Index: Makefile
===
--- Makefile
+++ Makefile
@@ -46,7 +46,8 @@
 
 ifeq (,$(findstring -DLLDB_DISABLE_PYTHON,$(CXXFLAGS)))
 # Set Python include directory
-PYTHON_INC_DIR = $(shell python-config --includes)
+PYTHON_CONFIG?=python-config
+PYTHON_INC_DIR = $(shell $(PYTHON_CONFIG) --includes)
 CPP.Flags +=   $(PYTHON_INC_DIR)
 endif
 


Index: scripts/Python/modules/readline/Makefile
===
--- scripts/Python/modules/readline/Makefile
+++ scripts/Python/modules/readline/Makefile
@@ -20,7 +20,8 @@
 SHARED_LIBRARY = 1
 LOADABLE_MODULE = 1
 
-PYTHON_INC_DIR = $(shell python-config --includes)
+PYTHON_CONFIG?=	python-config
+PYTHON_INC_DIR = $(shell $(PYTHON_CONFIG) --includes)
 
 # Include all archives in the shared lib
 USEDLIBS :=
Index: lib/Makefile
===
--- lib/Makefile
+++ lib/Makefile
@@ -18,7 +18,8 @@
 SHARED_LIBRARY = 1
 
 ifeq (,$(findstring -DLLDB_DISABLE_PYTHON,$(CXXFLAGS)))
-PYTHON_BUILD_FLAGS = $(shell python-config --ldflags)
+PYTHON_CONFIG?=	python-config
+PYTHON_BUILD_FLAGS = $(shell $(PYTHON_CONFIG) --ldflags)
 endif
 
 # Include all archives in liblldb.so file
Index: Makefile
===
--- Makefile
+++ Makefile
@@ -46,7 +46,8 @@
 
 ifeq (,$(findstring -DLLDB_DISABLE_PYTHON,$(CXXFLAGS)))
 # Set Python include directory
-PYTHON_INC_DIR = $(shell python-config --includes)
+PYTHON_CONFIG?=	python-config
+PYTHON_INC_DIR = $(shell $(PYTHON_CONFIG) --includes)
 CPP.Flags +=   $(PYTHON_INC_DIR)
 endif
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D14529: Use library discovery for curses and panel

2015-11-09 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added subscribers: lldb-commits, joerg, brucem.
krytarowski set the repository for this revision to rL LLVM.

This approach is tunable with custom paths for curses library.

It also detects whether there are requirements met.

I make use of it on NetBSD.

Repository:
  rL LLVM

http://reviews.llvm.org/D14529

Files:
  cmake/LLDBDependencies.cmake
  cmake/modules/LLDBConfig.cmake

Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -309,7 +309,7 @@
   find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS 
"/System/Library/PrivateFrameworks")
 
   add_definitions( -DLIBXML2_DEFINED )
-  list(APPEND system_libs xml2 ncurses panel)
+  list(APPEND system_libs xml2 ${CURSES_LIBRARIES})
   list(APPEND system_libs ${CARBON_LIBRARY} ${FOUNDATION_LIBRARY}
   ${CORE_FOUNDATION_LIBRARY} ${CORE_SERVICES_LIBRARY} ${SECURITY_LIBRARY}
   ${DEBUG_SYMBOLS_LIBRARY})
@@ -395,3 +395,18 @@
 else()
 set(LLDB_CAN_USE_DEBUGSERVER 0)
 endif()
+
+if (NOT LLDB_DISABLE_CURSES)
+find_package(Curses REQUIRED)
+
+find_library(CURSES_PANEL_LIBRARY NAMES panel DOC "The curses panel 
library")
+if (NOT CURSES_PANEL_LIBRARY)
+message(FATAL_ERROR "A required curses' panel library not found.")
+endif ()
+
+# Add panels to the library path
+set (CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_PANEL_LIBRARY})
+
+list(APPEND system_libs ${CURSES_LIBRARIES})
+include_directories(${CURSES_INCLUDE_DIR})
+endif ()
Index: cmake/LLDBDependencies.cmake
===
--- cmake/LLDBDependencies.cmake
+++ cmake/LLDBDependencies.cmake
@@ -146,7 +146,7 @@
 list(APPEND LLDB_SYSTEM_LIBS edit)
   endif()
   if (NOT LLDB_DISABLE_CURSES)
-list(APPEND LLDB_SYSTEM_LIBS panel ncurses)
+list(APPEND LLDB_SYSTEM_LIBS ${CURSES_LIBRARIES})
 if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
   list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
 endif()


Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -309,7 +309,7 @@
   find_library(DEBUG_SYMBOLS_LIBRARY DebugSymbols PATHS "/System/Library/PrivateFrameworks")
 
   add_definitions( -DLIBXML2_DEFINED )
-  list(APPEND system_libs xml2 ncurses panel)
+  list(APPEND system_libs xml2 ${CURSES_LIBRARIES})
   list(APPEND system_libs ${CARBON_LIBRARY} ${FOUNDATION_LIBRARY}
   ${CORE_FOUNDATION_LIBRARY} ${CORE_SERVICES_LIBRARY} ${SECURITY_LIBRARY}
   ${DEBUG_SYMBOLS_LIBRARY})
@@ -395,3 +395,18 @@
 else()
 set(LLDB_CAN_USE_DEBUGSERVER 0)
 endif()
+
+if (NOT LLDB_DISABLE_CURSES)
+find_package(Curses REQUIRED)
+
+find_library(CURSES_PANEL_LIBRARY NAMES panel DOC "The curses panel library")
+if (NOT CURSES_PANEL_LIBRARY)
+message(FATAL_ERROR "A required curses' panel library not found.")
+endif ()
+
+# Add panels to the library path
+set (CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_PANEL_LIBRARY})
+
+list(APPEND system_libs ${CURSES_LIBRARIES})
+include_directories(${CURSES_INCLUDE_DIR})
+endif ()
Index: cmake/LLDBDependencies.cmake
===
--- cmake/LLDBDependencies.cmake
+++ cmake/LLDBDependencies.cmake
@@ -146,7 +146,7 @@
 list(APPEND LLDB_SYSTEM_LIBS edit)
   endif()
   if (NOT LLDB_DISABLE_CURSES)
-list(APPEND LLDB_SYSTEM_LIBS panel ncurses)
+list(APPEND LLDB_SYSTEM_LIBS ${CURSES_LIBRARIES})
 if(LLVM_ENABLE_TERMINFO AND HAVE_TERMINFO)
   list(APPEND LLDB_SYSTEM_LIBS ${TERMINFO_LIBS})
 endif()
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D14530: Plug-in PlatformNetBSD initializer and terminator

2015-11-09 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added subscribers: brucem, lldb-commits, joerg.
krytarowski set the repository for this revision to rL LLVM.

Other platform parts needed to build this code are already merged.

Repository:
  rL LLVM

http://reviews.llvm.org/D14530

Files:
  source/Initialization/SystemInitializerCommon.cpp

Index: source/Initialization/SystemInitializerCommon.cpp
===
--- source/Initialization/SystemInitializerCommon.cpp
+++ source/Initialization/SystemInitializerCommon.cpp
@@ -115,6 +115,7 @@
 DynamicLoaderWindowsDYLD::Initialize();
 platform_freebsd::PlatformFreeBSD::Initialize();
 platform_linux::PlatformLinux::Initialize();
+platform_netbsd::PlatformNetBSD::Initialize();
 PlatformWindows::Initialize();
 PlatformKalimba::Initialize();
 platform_android::PlatformAndroid::Initialize();
@@ -162,6 +163,7 @@
 DynamicLoaderWindowsDYLD::Terminate();
 platform_freebsd::PlatformFreeBSD::Terminate();
 platform_linux::PlatformLinux::Terminate();
+platform_netbsd::PlatformNetBSD::Terminate();
 PlatformWindows::Terminate();
 PlatformKalimba::Terminate();
 platform_android::PlatformAndroid::Terminate();


Index: source/Initialization/SystemInitializerCommon.cpp
===
--- source/Initialization/SystemInitializerCommon.cpp
+++ source/Initialization/SystemInitializerCommon.cpp
@@ -115,6 +115,7 @@
 DynamicLoaderWindowsDYLD::Initialize();
 platform_freebsd::PlatformFreeBSD::Initialize();
 platform_linux::PlatformLinux::Initialize();
+platform_netbsd::PlatformNetBSD::Initialize();
 PlatformWindows::Initialize();
 PlatformKalimba::Initialize();
 platform_android::PlatformAndroid::Initialize();
@@ -162,6 +163,7 @@
 DynamicLoaderWindowsDYLD::Terminate();
 platform_freebsd::PlatformFreeBSD::Terminate();
 platform_linux::PlatformLinux::Terminate();
+platform_netbsd::PlatformNetBSD::Terminate();
 PlatformWindows::Terminate();
 PlatformKalimba::Terminate();
 platform_android::PlatformAndroid::Terminate();
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D14531: Add more autotools/gmake NetBSD glue

2015-11-10 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added subscribers: lldb-commits, brucem, joerg.
krytarowski set the repository for this revision to rL LLVM.

This diff approaches building the project natively on NetBSD with the 
autoconf/gmake framework.

Repository:
  rL LLVM

http://reviews.llvm.org/D14531

Files:
  lib/Makefile
  tools/driver/Makefile
  tools/lldb-mi/Makefile
  tools/lldb-server/Makefile

Index: tools/lldb-server/Makefile
===
--- tools/lldb-server/Makefile
+++ tools/lldb-server/Makefile
@@ -20,6 +20,6 @@
LLVMLibsOptions += -Wl,-rpath,@loader_path/../lib/
 endif
 
-ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU/kFreeBSD))
+ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU/kFreeBSD NetBSD))
LLVMLibsOptions += -Wl,-rpath,$(LibDir) -lpthread
 endif
Index: tools/lldb-mi/Makefile
===
--- tools/lldb-mi/Makefile
+++ tools/lldb-mi/Makefile
@@ -22,12 +22,11 @@
LLVMLibsOptions += -Wl,-sectcreate -Wl,__TEXT -Wl,__info_plist 
-Wl,"$(PROJ_SRC_DIR)/lldb-Info.plist"
 endif
 
-ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD))
+ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD NetBSD))
LLVMLibsOptions += -Wl,-rpath,$(LibDir) -lpthread
 endif
 
 ifeq ($(HOST_OS),FreeBSD)
CPP.Flags += -I/usr/include/edit #-v
LLVMLibsOptions += -Wl,-rpath,$(LibDir) -lpthread
 endif
-
Index: tools/driver/Makefile
===
--- tools/driver/Makefile
+++ tools/driver/Makefile
@@ -26,12 +26,11 @@
LLVMLibsOptions += -Wl,-sectcreate -Wl,__TEXT -Wl,__info_plist 
-Wl,"$(PROJ_SRC_DIR)/lldb-Info.plist"
 endif
 
-ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD))
+ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD NetBSD))
LLVMLibsOptions += -Wl,-rpath,$(LibDir)
 endif
 
 ifeq ($(HOST_OS),FreeBSD)
CPP.Flags += -I/usr/include/edit #-v
LLVMLibsOptions += -Wl,-rpath,$(LibDir)
 endif
-
Index: lib/Makefile
===
--- lib/Makefile
+++ lib/Makefile
@@ -203,3 +203,14 @@
 LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/local/lib -lexecinfo \
-ledit -lncurses -lpanel -lpthread
 endif
+
+ifeq ($(HOST_OS),NetBSD)
+# Include everything from the .a's into the shared library.
+ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
+   -Wl,--no-whole-archive
+# Allow unresolved symbols.
+LLVMLibsOptions += -Wl,--allow-shlib-undefined
+# Link in python
+LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/pkg/lib -lexecinfo \
+   -ledit -lcurses -lpthread -lkvm -Wl,-rpath,/usr/pkg/lib
+endif


Index: tools/lldb-server/Makefile
===
--- tools/lldb-server/Makefile
+++ tools/lldb-server/Makefile
@@ -20,6 +20,6 @@
 	LLVMLibsOptions += -Wl,-rpath,@loader_path/../lib/
 endif
 
-ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU/kFreeBSD))
+ifeq ($(HOST_OS), $(filter $(HOST_OS), Linux FreeBSD GNU/kFreeBSD NetBSD))
 	LLVMLibsOptions += -Wl,-rpath,$(LibDir) -lpthread
 endif
Index: tools/lldb-mi/Makefile
===
--- tools/lldb-mi/Makefile
+++ tools/lldb-mi/Makefile
@@ -22,12 +22,11 @@
 	LLVMLibsOptions += -Wl,-sectcreate -Wl,__TEXT -Wl,__info_plist -Wl,"$(PROJ_SRC_DIR)/lldb-Info.plist"
 endif
 
-ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD))
+ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD NetBSD))
 	LLVMLibsOptions += -Wl,-rpath,$(LibDir) -lpthread
 endif
 
 ifeq ($(HOST_OS),FreeBSD)
 	CPP.Flags += -I/usr/include/edit #-v
 	LLVMLibsOptions += -Wl,-rpath,$(LibDir) -lpthread
 endif
-
Index: tools/driver/Makefile
===
--- tools/driver/Makefile
+++ tools/driver/Makefile
@@ -26,12 +26,11 @@
 	LLVMLibsOptions += -Wl,-sectcreate -Wl,__TEXT -Wl,__info_plist -Wl,"$(PROJ_SRC_DIR)/lldb-Info.plist"
 endif
 
-ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD))
+ifneq (,$(filter $(HOST_OS), Linux GNU/kFreeBSD NetBSD))
 	LLVMLibsOptions += -Wl,-rpath,$(LibDir)
 endif
 
 ifeq ($(HOST_OS),FreeBSD)
 	CPP.Flags += -I/usr/include/edit #-v
 	LLVMLibsOptions += -Wl,-rpath,$(LibDir)
 endif
-
Index: lib/Makefile
===
--- lib/Makefile
+++ lib/Makefile
@@ -203,3 +203,14 @@
 LLVMLibsOptions += $(PYTHON_BUILD_FLAGS) -lrt -L/usr/local/lib -lexecinfo \
-ledit -lncurses -lpanel -lpthread
 endif
+
+ifeq ($(HOST_OS),NetBSD)
+# Include everything from the .a's into the shared library.
+ProjLibsOptions := -Wl,--whole-archive $(ProjLibsOptions) \
+   -Wl,--no-whole-archive
+# Allow unresolved symbols.
+LLVMLibsOptions += -Wl,--allow-shlib-undefined
+ 

Re: [Lldb-commits] [PATCH] D14531: Add more autotools/gmake NetBSD glue

2015-11-10 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

In http://reviews.llvm.org/D14531#285997, @tberghammer wrote:

> I have no objection against this change but considering that LLVM plans to 
> remove the autotools/gmake support after branching the 3.8 release (most 
> likely in January 2016) it would be good if you can bring up CMake on NetBSD 
> instead of autotools/gmake.


This diff is for CMake:
http://reviews.llvm.org/D14529 Use library discovery for curses and panel

This is general support:
http://reviews.llvm.org/D14529 Plug-in PlatformNetBSD initializer and terminator

This one and the following one for autoconf/gmake:
http://reviews.llvm.org/D14528 Allow to override python-config executable name 
from command line

With these diffs I can build lldb/llvm on CMake. autotools build is almost 
there. They shouldn't be big deal to land them in the sources.


Repository:
  rL LLVM

http://reviews.llvm.org/D14531



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D14689: Embed libpanel(3) for NetBSD-7.0

2015-11-15 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added reviewers: clayborg, emaste.
krytarowski added subscribers: lldb-commits, brucem.
krytarowski set the repository for this revision to rL LLVM.

The libpanel(3) library was developed after the NetBSD-7.0 release.
This curses' extension lib is used within lldb.

There were few ways to address this lack of functionality in the base:
 a. require ncurses in 7.0 (ncurses it's not a part of base in NetBSD)
 b. provide external package library with libpanel in pkgsrc
 c. mix native curses with ncurses' panel
 d. embed libpanel in lldb

I was trying to go for a) and b), but it was trouble some increasing
complexity of Makefiles and sources and it required additional paths from
command line, as pkgsrc with ncurses may be installed in freely given prefix.
b) and c) resulted in conflicts.

Go for d) as it's the simplest solution:
 - it doesn't require pkgsrc neither any externally specified libpanel,
 - this approach is already in use for getopt_long_only(3),
 - no need to ifdefing paths for libraries and headers of curses(3),
   ncurses headers are prefixed with a directory 'ncurses/' and source code
   will need to be fixed for it,
 - paradoxically it doesn't require changes in the common code like the other
   solutions,
 - it doesn't need manually specified paths from command line,
 - it's self-containing.

The libpanel library is relatively tiny and built only for the NetBSD target.

With this diff I can built LLDB on NetBSD using CMake.

Repository:
  rL LLVM

http://reviews.llvm.org/D14689

Files:
  cmake/modules/LLDBConfig.cmake
  include/lldb/Host/HostLibPanel.h
  include/lldb/Host/netbsd/libpanel/panel.h
  source/Core/IOHandler.cpp
  source/Host/CMakeLists.txt
  source/Host/netbsd/libpanel/_deck.cpp
  source/Host/netbsd/libpanel/above.cpp
  source/Host/netbsd/libpanel/below.cpp
  source/Host/netbsd/libpanel/bottom.cpp
  source/Host/netbsd/libpanel/del.cpp
  source/Host/netbsd/libpanel/getuser.cpp
  source/Host/netbsd/libpanel/hidden.cpp
  source/Host/netbsd/libpanel/hide.cpp
  source/Host/netbsd/libpanel/move.cpp
  source/Host/netbsd/libpanel/new.cpp
  source/Host/netbsd/libpanel/panel_impl.h
  source/Host/netbsd/libpanel/replace.cpp
  source/Host/netbsd/libpanel/setuser.cpp
  source/Host/netbsd/libpanel/show.cpp
  source/Host/netbsd/libpanel/top.cpp
  source/Host/netbsd/libpanel/update.cpp
  source/Host/netbsd/libpanel/window.cpp

Index: source/Host/netbsd/libpanel/window.cpp
===
--- /dev/null
+++ source/Host/netbsd/libpanel/window.cpp
@@ -0,0 +1,41 @@
+/*	$NetBSD: window.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */
+
+/*
+ * Copyright (c) 2015 Valery Ushakov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__RCSID("$NetBSD: window.c,v 1.1 2015/10/26 23:09:49 uwe Exp $");
+
+#include "panel_impl.h"
+
+
+WINDOW *
+panel_window(PANEL *p)
+{
+	if (p == NULL)
+		return NULL;
+
+	return p->win;
+}
Index: source/Host/netbsd/libpanel/update.cpp
===
--- /dev/null
+++ source/Host/netbsd/libpanel/update.cpp
@@ -0,0 +1,62 @@
+/*	$NetBSD: update.c,v 1.1 2015/10/26 23:09:49 uwe Exp $ */
+
+/*
+ * Copyright (c) 2015 Valery Ushakov
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in th

Re: [Lldb-commits] [PATCH] D14689: Embed libpanel(3) for NetBSD-7.0

2015-11-16 Thread Kamil Rytarowski via lldb-commits
krytarowski abandoned this revision.
krytarowski added a comment.

I will go with other way around. If curses(3) or libpanel(3) is missing, 
disable the curses(3) option for LLDB.


Repository:
  rL LLVM

http://reviews.llvm.org/D14689



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D14740: Define LLDB_DISABLE_CURSES as a fallback for missing curses(3) or panel(3)

2015-11-16 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added reviewers: clayborg, emaste.
krytarowski added subscribers: lldb-commits, joerg, brucem.
krytarowski set the repository for this revision to rL LLVM.

This enables build on NetBSD-7.0. It would be nice to have a fall-back for
externally provided ncurses via pkgsrc, but it's left after the scheduled drop
of the autoconf/gmake build system. For not it's not worth the effort.

Repository:
  rL LLVM

http://reviews.llvm.org/D14740

Files:
  cmake/modules/LLDBConfig.cmake

Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -2,6 +2,8 @@
 set(LLDB_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/source")
 set(LLDB_INCLUDE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include")
 
+include(CheckIncludeFiles)
+
 set(LLDB_LINKER_SUPPORTS_GROUPS OFF)
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES 
"Darwin")
   # The Darwin linker doesn't understand --start-group/--end-group.
@@ -42,6 +44,23 @@
   add_definitions( -DHAVE_ROUND )
 endif()
 
+if (NOT LLDB_DISABLE_CURSES)
+find_package(Curses)
+
+find_library(CURSES_PANEL_LIBRARY NAMES panel DOC "The curses panel 
library")
+check_include_files(panel.h HAVE_PANEL_H)
+if (NOT CURSES_FOUND OR NOT CURSES_PANEL_LIBRARY OR NOT HAVE_PANEL_H)
+message("-- Unable to find pair curses and libpanel")
+set(LLDB_DISABLE_CURSES 1)
+else ()
+# Add panels to the library path
+set (CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_PANEL_LIBRARY})
+
+list(APPEND system_libs ${CURSES_LIBRARIES})
+include_directories(${CURSES_INCLUDE_DIR})
+endif ()
+endif ()
+
 if (LLDB_DISABLE_CURSES)
   add_definitions( -DLLDB_DISABLE_CURSES )
 endif()
@@ -395,18 +414,3 @@
 else()
 set(LLDB_CAN_USE_DEBUGSERVER 0)
 endif()
-
-if (NOT LLDB_DISABLE_CURSES)
-find_package(Curses REQUIRED)
-
-find_library(CURSES_PANEL_LIBRARY NAMES panel DOC "The curses panel 
library")
-if (NOT CURSES_PANEL_LIBRARY)
-message(FATAL_ERROR "A required curses' panel library not found.")
-endif ()
-
-# Add panels to the library path
-set (CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_PANEL_LIBRARY})
-
-list(APPEND system_libs ${CURSES_LIBRARIES})
-include_directories(${CURSES_INCLUDE_DIR})
-endif ()


Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -2,6 +2,8 @@
 set(LLDB_SOURCE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/source")
 set(LLDB_INCLUDE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/include")
 
+include(CheckIncludeFiles)
+
 set(LLDB_LINKER_SUPPORTS_GROUPS OFF)
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
   # The Darwin linker doesn't understand --start-group/--end-group.
@@ -42,6 +44,23 @@
   add_definitions( -DHAVE_ROUND )
 endif()
 
+if (NOT LLDB_DISABLE_CURSES)
+find_package(Curses)
+
+find_library(CURSES_PANEL_LIBRARY NAMES panel DOC "The curses panel library")
+check_include_files(panel.h HAVE_PANEL_H)
+if (NOT CURSES_FOUND OR NOT CURSES_PANEL_LIBRARY OR NOT HAVE_PANEL_H)
+message("-- Unable to find pair curses and libpanel")
+set(LLDB_DISABLE_CURSES 1)
+else ()
+# Add panels to the library path
+set (CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_PANEL_LIBRARY})
+
+list(APPEND system_libs ${CURSES_LIBRARIES})
+include_directories(${CURSES_INCLUDE_DIR})
+endif ()
+endif ()
+
 if (LLDB_DISABLE_CURSES)
   add_definitions( -DLLDB_DISABLE_CURSES )
 endif()
@@ -395,18 +414,3 @@
 else()
 set(LLDB_CAN_USE_DEBUGSERVER 0)
 endif()
-
-if (NOT LLDB_DISABLE_CURSES)
-find_package(Curses REQUIRED)
-
-find_library(CURSES_PANEL_LIBRARY NAMES panel DOC "The curses panel library")
-if (NOT CURSES_PANEL_LIBRARY)
-message(FATAL_ERROR "A required curses' panel library not found.")
-endif ()
-
-# Add panels to the library path
-set (CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_PANEL_LIBRARY})
-
-list(APPEND system_libs ${CURSES_LIBRARIES})
-include_directories(${CURSES_INCLUDE_DIR})
-endif ()
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14740: Define LLDB_DISABLE_CURSES as a fallback for missing curses(3) or panel(3)

2015-11-17 Thread Kamil Rytarowski via lldb-commits
krytarowski abandoned this revision.
krytarowski added a comment.

I resign from this change. I will just go for -DLLDB_DISABLE_CURSES from 
command line on NetBSD-7.0.


Repository:
  rL LLVM

http://reviews.llvm.org/D14740



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] New llvm build server account request

2015-11-17 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hello Ying,

Regarding the NetBSD buildbot for LLDB one NetBSD we need a tweak.

Please test for the existence (only on NetBSD) of a file
/usr/include/panel.h. If it's missing please add
'-DLLDB_DISABLE_CURSES' to CMake configure arguments.

if [ ! -f /usr/include/panel.h ]; then
# Add this line to the CMake configure arguments on NetBSD
echo "-DLLDB_DISABLE_CURSES"
fi

This change is for both: staging and master build farm. I'm going to
switch the NetBSD7 buildbot to the master one soon, once it will build
the sources properly.
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJWSxDFAAoJEEuzCOmwLnZsvDQQAKJKGGvRUIVACZmcYQbhcWuE
Ee6iH+aWFp0fg+my6krKGEPHFSgQ0J5/Hq7Ud/lJZLeJq990UNMhybXFlntPDZgb
GmGTHgNgTzH/J1+QXE4/3rqO4oKWMqynPPfDDvNyv0D8CDlFzToL+40lFdKk1We+
icRJM1L4eUzPa3NDFKoPB17KS4l9unb1A0WdrK8XHwuxaxrkTtA79teXc+5bWjvX
DyDk/Q9Awnjx6M30WL2yqQ1AWaMKUEjAPh4nl29b/q4vr+JxP0xEhOfq1bOqs4z8
NsNwd3bLJN9xlngWL12RFwOSeB4o4LTzvfRrA1shZhPN1dwYs5oH7T/0GtnC2i4U
FMVQDpYTXpymZXJznuzGvTDYhUO2On76BklUevLxciPhpwhap+80aLq44kP3XxTK
+BonLN35thYlruHoPD52OFds+nXbytU6tC9vCVZXgK+4Nhryag/ffmQ8XGkyxL9c
CrTmAQVV5FsVuwwZVLKR7U6ohHJAkHEbHXchP0Y9DHWCh7eSpI4OYcBhWUEtrWYq
EddvRoSqbD5P5tmiOMExIh9SdYCgMSf9FHJ7wdTZY6Ye5kmmP305+JZu4QGdbrgx
4LW0rzBOVRScaKm6KGrJDYIyPQBDY5J8vIuWSlUK7oYVq7/3/9Lny9dcyPhGmrS4
EUJ/75S1VItcntQhqX4l
=QhzH
-END PGP SIGNATURE-
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] New llvm build server account request

2015-11-17 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

I've noted the first set of successfully built LLDB instances on NetBSD!

http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/973

I've stopped the buildbot on the Staging server and redirected port to
port 9990.

There are some issues with scripts again:
http://lab.llvm.org:8011/builders/lldb-amd64-ninja-netbsd7/builds/53

Are they synced between the master and staging one?

Could you please have a look.

On 17.11.2015 21:37, Ying Chen wrote:
> Done. Please let me know if it works for you.
> 
> Thanks, Ying
> 
> On Tue, Nov 17, 2015 at 3:34 AM, Kamil Rytarowski  > wrote:
> 
> Hello Ying,
> 
> Regarding the NetBSD buildbot for LLDB one NetBSD we need a tweak.
> 
> Please test for the existence (only on NetBSD) of a file 
> /usr/include/panel.h. If it's missing please add 
> '-DLLDB_DISABLE_CURSES' to CMake configure arguments.
> 
> if [ ! -f /usr/include/panel.h ]; then # Add this line to the CMake
> configure arguments on NetBSD echo "-DLLDB_DISABLE_CURSES" fi
> 
> This change is for both: staging and master build farm. I'm going
> to switch the NetBSD7 buildbot to the master one soon, once it will
> build the sources properly.
> 
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJWS+MNAAoJEEuzCOmwLnZsPkwQAMNE6PCm1SccmTy8wFnp0k+L
TALbcpT/4zLSIJ98GYdSrvmNQVZsKz8E7bYxlzf79NqzpaB6Zk6FzP7UtN/zolAE
xgoXJvfXwGWKazFKPxjd1wct4w6oOtgmKgspG+kTpnfIp5gkFtzoMGT4ZSCbcAoM
sPRwuoI6VKbtKltIq523JBXFX5YzchVH+2sYFWrjCqgGIvnBfqeghgD/Azs8LXCu
d0aSNh8EbaJi0OquhAtZADOxws9THeJskP5G7VmSTWUhgTaA3VL8xlh26dCeSMuN
ApWwDh7IiBIfAsfFJS/crQIuQ0H0IjS6wMSiBzi3FYXe5R9nx16NMTw7X+qHw5yA
lZKX22pafK0xzM5kqd69yEfztYdxSlS9cWcgH/VyRki4ZvsQTkoB+wPshQrTKx9o
a7m8kXPIG1Sf4leAQjBLqM0wt3TWY8chPFUwuBLlxViZatLrP0nq6uUHRt/CrdWJ
82O/J4EUoAPbXwGN9XpScNL1+bpOymF/ejd3ZrEEXSrgCoeT/mNiPqRiufsU0j9a
+i48WaJjD2Nykn/LPN1ecNCetdsuKLGVTXeOs06id+MyuYq7cppeKX/WYc1+m+1b
aRiqMlj9mNVDdYKashEPQHaQ8g6AE7G2MGd4hLn+BETzC9Ussy19xxnKLb5ihwrT
o0941kY6B7a+r4y2YXgy
=Yvz1
-END PGP SIGNATURE-
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] New llvm build server account request

2015-11-17 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

It's fixed. It was my fault as I forgot to make updateScripts.sh
available via PATH.

Buildslave works properly.

Thank you!

On 18.11.2015 03:31, Kamil Rytarowski via lldb-commits wrote:
> I've noted the first set of successfully built LLDB instances on
> NetBSD!
> 
> http://lab.llvm.org:8014/builders/lldb-amd64-ninja-netbsd7/builds/973
>
>  I've stopped the buildbot on the Staging server and redirected
> port to port 9990.
> 
> There are some issues with scripts again: 
> http://lab.llvm.org:8011/builders/lldb-amd64-ninja-netbsd7/builds/53
>
>  Are they synced between the master and staging one?
> 
> Could you please have a look.
> 
> On 17.11.2015 21:37, Ying Chen wrote:
>> Done. Please let me know if it works for you.
> 
>> Thanks, Ying
> 
>> On Tue, Nov 17, 2015 at 3:34 AM, Kamil Rytarowski > <mailto:n...@gmx.com>> wrote:
> 
>> Hello Ying,
> 
>> Regarding the NetBSD buildbot for LLDB one NetBSD we need a
>> tweak.
> 
>> Please test for the existence (only on NetBSD) of a file 
>> /usr/include/panel.h. If it's missing please add 
>> '-DLLDB_DISABLE_CURSES' to CMake configure arguments.
> 
>> if [ ! -f /usr/include/panel.h ]; then # Add this line to the
>> CMake configure arguments on NetBSD echo "-DLLDB_DISABLE_CURSES"
>> fi
> 
>> This change is for both: staging and master build farm. I'm
>> going to switch the NetBSD7 buildbot to the master one soon, once
>> it will build the sources properly.
> 
> 
> 
> ___ lldb-commits
> mailing list lldb-commits@lists.llvm.org 
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCAAGBQJWS+37AAoJEEuzCOmwLnZsSW4P/jQv6bQyjqg2A/+CG6lE8kyq
FppZaboCnZDXZdrOStWoG5nzsXkd04AyKrFCf3lkSpxiqI30KboA7D8YU0arL8lA
I4X889DXK35cbdveuRkX/VYTFGYLn7DQECidHnj0+QqajnodV2CMy41Z+6Dv7py2
eu1ormgxRzAPx+Iyij6+sqZx7N3Okz+MG8r2ZSUOyIp9HuKAWk+fn5AWbCe2wwu8
CV+Gf2ekeHxlkD++QeNnxwngvIqkt3wvG0oyvLSxf0vKxvTz1VUevjbx508mPPqy
dq383ZZF+JU2VX825v4DZPOqh2KU4BB/k5dswTUkPX8d8NZSbA2IL99uTIiR4zyi
BBb++tK+/RmCwIM87WAsfi7W7Jfglt7JkegIZz2bm012Vo3qtOf14QzTNwvGn3qz
/VDG1tdOjE7HL8/S5zBhp1TD7m9wCeZnqWaCAb1tQ7nu63lDoLX2RkCmMUQl2Bn7
6l6WrfffZihB7l9bztQTaa+byMwP90x8JH72vFoM3CGoCwp6l1NjxjT4q5tQi9Zk
eA6xGp70Ai78mWQS4FrZ87D8EK1qvT2jHBHTpTBwFKxzte5/Pcgmxz+r0h7puFpV
b0tFOLPQIIpV9INSxRf7wbaj3UaOVFkhxFL2y/Ze69N3dYhtapPDa8Wao5OtU12/
5nAKYigd6t2QnHNyf5hJ
=frjd
-END PGP SIGNATURE-
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14530: Plug-in PlatformNetBSD initializer and terminator

2015-11-18 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Are we ready to land it? Without this patch I cannot launch lldb.


Repository:
  rL LLVM

http://reviews.llvm.org/D14530



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14790: cmake: add -DLLDB_ALLOW_STATIC_BINDINGS=1, defaults off

2015-11-18 Thread Kamil Rytarowski via lldb-commits
krytarowski added a subscriber: krytarowski.
krytarowski added a comment.

Not long ago we rejected dynamic dependency on `curses`(3), as a fall-back for 
NetBSD (without `libpanel`(3) in the 7.0 release). Why doing the similar thing 
with swig is fine?

Why are we abstracting swig when there is no other option viable?

Is possible to improve this approach of finding swig? We are looking for it in 
CMake and later in Python?
`find_package(SWIG)`, `--find-swig`.

Maybe just add a single switch in CMake to enable or disable it without options.

Please explain what does static bindings mean here.


http://reviews.llvm.org/D14790



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14790: cmake: add -DLLDB_ALLOW_STATIC_BINDINGS=1, defaults off

2015-11-18 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

I dislike delegating jobs (or hiding problems) of CMake (assuming that 
autoconf/gmake is already dead) to external scripts like Python ones.

In the goal, I plan to add LLDB in the NetBSD base (next to LLVM and Clang) 
where there is no Python at all. In FreeBSD there is no Python in base as well. 
To state it stronger, there might never be Python in the base.

I would expect to just have a single switch like `-DLLDB_ENABLE_PYTHON`, while 
I don't understand `-DLLDB_ALLOW_STATIC_BINDINGS`.

When I will catch up with platform support I'm considering to prepare bindings 
in Lua, as this is the standard scripting language in NetBSD (we script with it 
kernel, packet filter, userland etc). Lua offers native C/C++ bindings (as 
there is no need for intermediate tool) by design and is a dynamic language 
close to Python. But this isn't plan for this year.

For now please leave an option that end user to disable Python. Otherwise 
erasing it will be done downstream without benefit for the project.


http://reviews.llvm.org/D14790



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D14790: cmake: add -DLLDB_ALLOW_STATIC_BINDINGS=1, defaults off

2015-11-18 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Sure, I'm just giving general feedback.

From a user perspective I want to get yes/no information whether I need swig or 
not, if so what version. If we allow Python, I don't see any reason to not 
allowing swig. if some version gives you problems (license, bad code 
generator), please enforce a certain one.


http://reviews.llvm.org/D14790



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


  1   2   3   >