[Lldb-commits] [lldb] 52f4272 - [lldb] [netbsd] Avoid comparison of signed and unsigned integers

2020-09-10 Thread Kamil Rytarowski via lldb-commits

Author: Kamil Rytarowski
Date: 2020-09-10T15:49:15+02:00
New Revision: 52f42720b26a32c9dffc9331841415442f784700

URL: 
https://github.com/llvm/llvm-project/commit/52f42720b26a32c9dffc9331841415442f784700
DIFF: 
https://github.com/llvm/llvm-project/commit/52f42720b26a32c9dffc9331841415442f784700.diff

LOG: [lldb] [netbsd] Avoid comparison of signed and unsigned integers

Cast ProcessID to ::pid_t.

Added: 


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

Removed: 




diff  --git a/lldb/source/Host/netbsd/HostNetBSD.cpp 
b/lldb/source/Host/netbsd/HostNetBSD.cpp
index 4708fb45deed..38e2aa5c1e05 100644
--- a/lldb/source/Host/netbsd/HostNetBSD.cpp
+++ b/lldb/source/Host/netbsd/HostNetBSD.cpp
@@ -220,7 +220,7 @@ uint32_t Host::FindProcessesImpl(const 
ProcessInstanceInfoMatch _info,
 if (proc_kinfo[i].p_nlwps > 1) {
   bool already_registered = false;
   for (size_t pi = 0; pi < process_infos.size(); pi++) {
-if (process_infos[pi].GetProcessID() == proc_kinfo[i].p_pid) {
+if ((::pid_t)process_infos[pi].GetProcessID() == proc_kinfo[i].p_pid) {
   already_registered = true;
   break;
 }



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


[Lldb-commits] [lldb] 273f638 - [LLDB] [doc] Document NetBSD status and sort OSs alphabetically

2020-02-09 Thread Kamil Rytarowski via lldb-commits

Author: Kamil Rytarowski
Date: 2020-02-09T18:02:07+01:00
New Revision: 273f638384d69f71838978001bf2f542d472b5f9

URL: 
https://github.com/llvm/llvm-project/commit/273f638384d69f71838978001bf2f542d472b5f9
DIFF: 
https://github.com/llvm/llvm-project/commit/273f638384d69f71838978001bf2f542d472b5f9.diff

LOG: [LLDB] [doc] Document NetBSD status and sort OSs alphabetically

Added: 


Modified: 
lldb/docs/status/status.rst

Removed: 




diff  --git a/lldb/docs/status/status.rst b/lldb/docs/status/status.rst
index e793e5e7bc2c..180d7ed5e4bc 100644
--- a/lldb/docs/status/status.rst
+++ b/lldb/docs/status/status.rst
@@ -1,6 +1,21 @@
 Status
 ==
 
+FreeBSD
+---
+
+LLDB on FreeBSD lags behind the Linux implementation but is improving rapidly.
+For more details, see the Features by OS section below.
+
+Linux
+-
+
+LLDB is improving on Linux. While the debugserver has not been ported (to
+enable remote debugging) Linux is nearing feature completeness with Darwin to
+debug x86_64 programs, and is partially working with i386 programs. ARM
+architectures on Linux are untested. For more details, see the Features by OS
+section below.
+
 macOS
 -
 
@@ -15,20 +30,10 @@ used from Python on the command line. This allows debug 
sessions to be
 scripted. It also allows powerful debugging actions to be created and attached
 to a variety of debugging workflows.
 
-Linux
--
-
-LLDB is improving on Linux. While the debugserver has not been ported (to
-enable remote debugging) Linux is nearing feature completeness with Darwin to
-debug x86_64 programs, and is partially working with i386 programs. ARM
-architectures on Linux are untested. For more details, see the Features by OS
-section below.
-
-FreeBSD

+NetBSD
+--
 
-LLDB on FreeBSD lags behind the Linux implementation but is improving rapidly.
-For more details, see the Features by OS section below.
+LLDB is improving on NetBSD and reaching feature completeness with Linux.
 
 Windows
 ---
@@ -40,26 +45,26 @@ section below.
 
 Features Matrix
 ---
-+++-++--+
-| Feature| FreeBSD| Linux   | 
macOS  | Windows  |
-+++=++==+
-| Backtracing| OK | OK  | OK   
  | OK   |
-+++-++--+
-| Breakpoints| OK | OK  | OK   
  | OK   |
-+++-++--+
-| C++11: | OK | OK  | OK   
  | Unknown  |
-+++-++--+
-| Commandline lldb tool  | OK | OK  | OK   
  | OK   |
-+++-++--+
-| Core file debugging| OK (ELF)   | OK (ELF)| OK 
(MachO) | OK (Minidump)|
-+++-++--+
-| Debugserver (remote debugging) | Not ported | OK (lldb-server)| OK   
  | Not ported   |
-+++-++--+
-| Disassembly| OK | OK  | OK   
  | OK   |
-+++-++--+
-| Expression evaluation  | Unknown| Works with some bugs| OK   
  | Works with some bugs |
-+++-++--+
-| JIT debugging  | Unknown| Symbolic debugging only | 
Untested   | No   |
-+++-++--+
-| Objective-C 2.0:   | Unknown| Not applicable  | OK   
  | Not applicable   |
-+++-++--+
++++-++--+--+
+| Feature| FreeBSD| Linux   | 
macOS  | NetBSD   | Windows  |

[Lldb-commits] [lldb] 5a285f2 - [LLDB] [doc] Remove note about libpanel(3) and NetBSD

2020-02-09 Thread Kamil Rytarowski via lldb-commits

Author: Kamil Rytarowski
Date: 2020-02-09T15:01:17+01:00
New Revision: 5a285f207e109221572a0aabc83f2bce521322bd

URL: 
https://github.com/llvm/llvm-project/commit/5a285f207e109221572a0aabc83f2bce521322bd
DIFF: 
https://github.com/llvm/llvm-project/commit/5a285f207e109221572a0aabc83f2bce521322bd.diff

LOG: [LLDB] [doc] Remove note about libpanel(3) and NetBSD

libpanel(3) is now supported in all supported versions of NetBSD.

Added: 


Modified: 
lldb/docs/resources/build.rst

Removed: 




diff  --git a/lldb/docs/resources/build.rst b/lldb/docs/resources/build.rst
index 41586e22048d..285ea0144d90 100644
--- a/lldb/docs/resources/build.rst
+++ b/lldb/docs/resources/build.rst
@@ -286,14 +286,6 @@ the executable and the working directory to point to 
binaries inside of the
 ninja tree.
 
 
-NetBSD
-^^
-
-Current stable NetBSD release doesn't ship with libpanel(3), therefore it's
-required to disable curses(3) support with the
-``-DLLDB_ENABLE_CURSES:BOOL=FALSE`` option. To make sure check if
-``/usr/include/panel.h`` exists in your system.
-
 macOS
 ^
 



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


[Lldb-commits] [lldb] 0ea4d18 - [LLDB] [doc] Update the current status of pkgsrc (NetBSD) building

2020-02-09 Thread Kamil Rytarowski via lldb-commits

Author: Kamil Rytarowski
Date: 2020-02-09T15:01:17+01:00
New Revision: 0ea4d18a288bf2a4010632f841b421e1bdc5072a

URL: 
https://github.com/llvm/llvm-project/commit/0ea4d18a288bf2a4010632f841b421e1bdc5072a
DIFF: 
https://github.com/llvm/llvm-project/commit/0ea4d18a288bf2a4010632f841b421e1bdc5072a.diff

LOG: [LLDB] [doc] Update the current status of pkgsrc (NetBSD) building

Added: 


Modified: 
lldb/docs/status/releases.rst

Removed: 




diff  --git a/lldb/docs/status/releases.rst b/lldb/docs/status/releases.rst
index de397f233c42..250d656c0b83 100644
--- a/lldb/docs/status/releases.rst
+++ b/lldb/docs/status/releases.rst
@@ -8,14 +8,7 @@ Nightly builds of LLDB are packaged and tested from trunk:
 
 Debian and Ubuntu: https://apt.llvm.org
 
-The pkgsrc framework offers a package with recent LLDB in the wip repository:
-
-::
-
-  cd pkgsrc/wip/lldb-git
-  make install clean
-
 Releases
 
 
-LLDB is packaged in most of the Debian & Ubuntu releases.
+LLDB is packaged in most of the Debian & Ubuntu releases and in pkgsrc 
(NetBSD).



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


[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=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=346099=346100=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=346099=346100=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, , 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=346099=346100=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] 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=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=324250=324251=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 _info, Debugger ,
-Target *target, // Can be NULL, if NULL create a new
-// target, else use existing one
-Status ) {
+// rather than lldb-launch, llgs-attach.  This differs from current 
lldb-launch,
+// debugserver-attach approach on MacOSX.
+lldb::ProcessSP
+PlatformNetBSD::DebugProcess(ProcessLaunchInfo _info, Debugger 
,
+ Target *target, // Can be NULL, if NULL create a 
new
+ // target, else use existing one
+ Status ) {
   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, "having target create process with gdb-remote plugin");
   

[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=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=324233=324234=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  : 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] 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=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=305793=305794=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


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] 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=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=303906=303907=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 );
+  bool CompleteCharacter(char ch, EditLineGetCharType );
 
 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=303906=303907=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 ) {
+bool Editline::CompleteCharacter(char ch, EditLineGetCharType ) {
 #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


[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=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=303822=303823=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, , 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 ) {
-  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(), );
@@ -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(), );
 

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=303822=303823=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 , ProcessLaunchInfo _info);


___
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
> > 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(); /* 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


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
> > 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 : 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


[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=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=300852=300853=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


[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=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}
   

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
> > 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] 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=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=299782=299783=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 ) {
-  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


[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=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=299108=299109=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(_signals);
   sigfillset(_signals);
   ::posix_spawnattr_setsigmask(, _signals);
-#if defined(__linux__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
   ::posix_spawnattr_setsigdefault(, _signals);
 #else
   ::posix_spawnattr_setsigdefault(, _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=299108=299109=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 ) {
-  // 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=299108=299109=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 _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.
-Error error = NativeProcessNetBSD::PtraceWrapper(PT_CONTINUE, GetID(),
-  

[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=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=299022=299023=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] 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=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=298969=298970=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] 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=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=298952=298953=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=298952=298953=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_status_to_return_code(int 

[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=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=298809=298810=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=298809=298810=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=298809=298810=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 _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 _info);

Modified: lldb/trunk/include/lldb/Host/HostInfo.h
URL: 

[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=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=298408=298409=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 _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] 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=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=298407=298408=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=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=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 _info,
+NativeProcessProtocol::NativeDelegate _delegate, MainLoop ,
+NativeProcessProtocolSP _process_sp) {
+  return Error();
+}
+
+Error NativeProcessProtocol::Attach(
+lldb::pid_t pid, NativeProcessProtocol::NativeDelegate _delegate,
+MainLoop , NativeProcessProtocolSP _process_sp) {
+  return Error();
+}
+
+// 
-
+// Public Instance Methods
+// 
-
+
+NativeProcessNetBSD::NativeProcessNetBSD()
+: NativeProcessProtocol(LLDB_INVALID_PROCESS_ID) {}

Added: 

[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=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=298406=298407=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=298406=298407=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 ) {
 // *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] 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=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=298404=298405=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 
   ? 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] 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=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=296359=296360=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=296359=296360=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] [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=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=296070=296071=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] 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=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=296069=296070=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] 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=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=295399=295400=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] 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=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=294201=294202=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=294201=294202=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  : g_platform_process_list_options) {

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

[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=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=294144=294145=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 _file_spec,
-   const 

[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=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=294070=294071=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=294070=294071=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=294070=294071=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=294070=294071=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 mandatory parameters
 nResult, dictArgs, 

[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=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=293894=293895=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] 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=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=293773=293774=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=293773=293774=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 () const;
   void SetErrorDescription(const CMIUtilString ) const;
-  void SetErrorDescriptionn(const CMIUtilString vFormat, ...) const;
+  void SetErrorDescriptionn(const char *vFormat, ...) const;
   void SetErrorDescriptionNoLog(const CMIUtilString ) 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=293773=293774=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=293773=293774=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=293773=293774=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 ,
 va_list vArgs);


___
lldb-commits mailing list
lldb-commits@lists.llvm.org

[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=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=293769=293770=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] 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=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=293767=293768=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 _info,
-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=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 _info,
+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=293767=293768=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=293767=293768=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/linux/ProcessLauncherLinux.h"
+#elif defined(__linux__) || 

[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=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=293624=293625=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] 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=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=293391=293392=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, , 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] 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=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=293390=293391=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


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] [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


[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] 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] 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] 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] 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] [lldb] r282032 - Unbreak the NetBSD build after recent changes

2016-09-20 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Tue Sep 20 17:26:29 2016
New Revision: 282032

URL: http://llvm.org/viewvc/llvm-project?rev=282032=rev
Log:
Unbreak the NetBSD build after recent changes

Similar to r281922 "Try to fix freebsd and android builds."

Replace .AppendArgument(cstr) with .AppendArgument(llvm::StringRef(cstr))

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=282032=282031=282032=diff
==
--- lldb/trunk/source/Host/netbsd/Host.cpp (original)
+++ lldb/trunk/source/Host/netbsd/Host.cpp Tue Sep 20 17:26:29 2016
@@ -110,7 +110,7 @@ static bool GetNetBSDProcessArgs(const P
 if (!cstr)
   break;
 
-proc_args.AppendArgument(cstr);
+proc_args.AppendArgument(llvm::StringRef(cstr));
   }
 
   return true;


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


Re: [Lldb-commits] [PATCH] D23883: Remove MIUtilParse (no longer used)

2016-09-11 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

In https://reviews.llvm.org/D23883#539471, @mgorny wrote:

> In https://reviews.llvm.org/D23883#539442, @krytarowski wrote:
>
> > It looks good. Remaining TODO for standalone builds:
> >
> > - sanitize six.py usage (it's installed into system-wide directory, where 
> > standard py-six lands)
>
>
> How would you prefer handling it? Can we just kill it and rely on user 
> installing it system-wide or via pip?




1. Patch scripts/Python/finishSwigPythonLLDB.py and install six into lldb 
subdir with a custom name (`lldb_six.py`).
2. Patch the Python sources to make use of `lldb_six`.

Unfortunately there is resistance to grab system-wide (provided by a user) six 
module.

> > - bump cmake_minimum_required(VERSION 2.8.12.2) to 3.4.3 in 
> > cmake/modules/LLDBStandalone.cmake Final bits for Windows:

> 

> > - eliminate the usage of ../lib/Support/regex_impl.h in RegularExpression.h

> 

> 

> Wouldn't it be actually better to kill that regex implementation as well, and 
> use the class provided by LLVMSupport everywhere? I started with the other 
> since it caused direct build issues on Linux but I think I could try to kill 
> this one as well.


It makes sense.


https://reviews.llvm.org/D23883



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


Re: [Lldb-commits] [PATCH] D23883: Remove MIUtilParse (no longer used)

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

It looks good. Remaining TODO for standalone builds:

- sanitize six.py usage (it's installed into system-wide directory, where 
standard py-six lands)
- bump cmake_minimum_required(VERSION 2.8.12.2) to 3.4.3 in 
cmake/modules/LLDBStandalone.cmake

Final bits for Windows:

- eliminate the usage of ../lib/Support/regex_impl.h in RegularExpression.h


https://reviews.llvm.org/D23883



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


Re: [Lldb-commits] [lldb] r280755 - Reorder FreeBSD Host.cpp #includes to fix build

2016-09-06 Thread Kamil Rytarowski via lldb-commits
On NetBSD /usr/share/misc/style says:

 


/*
 * Kernel include files come first.
 */
#include           /*  first, */
#include           /*    next, */
#include           /*   and then the rest, */
#include          /*   sorted lexicographically.  */
#include 
#include            /* Non-local includes in brackets.  */

/*
 * If it's a network program, put the network include files next.
 * Group the includes files by subdirectory.
 */
#include 
#include 
#include 
#include 
#include 

/*
 * Then there's a blank line, followed by the /usr include files.
 * The /usr include files should be sorted lexicographically!
 */
#include 
#include 
#include 
#include 
#include 

/*
 * Global pathnames are defined in /usr/include/paths.h.  Pathnames local
 * to the program go in pathnames.h in the local directory.
 */
#include 

/* Then, there's a blank line, and the user include files. */
#include "pathnames.h"          /* Local includes in double quotes. */

 

While the order of standard C headers can be pretty arbitrary, the system ones shall be included in the above order.



It's crucial for  and  to be on a top as other headers may assume that they were

already included.

 


Sent: Wednesday, September 07, 2016 at 12:05 AM
From: "Dimitry Andric via lldb-commits" 
To: "Zachary Turner" 
Cc: lldb-commits@lists.llvm.org
Subject: Re: [Lldb-commits] [lldb] r280755 - Reorder FreeBSD Host.cpp #includes to fix build



In general,  and  headers should be at the top, followed by standard headers such as , then followed by application-specific headers.  IIRC this is also the case for Linux.

 

-Dimitry
 



On 07 Sep 2016, at 00:02, Zachary Turner via lldb-commits  wrote:
 


Why was this causing a problem?  The only headers that were re-ordered are system headers.  Does FreeBSD's libraries have requirements about certain headers being included before other headers?
 


On Tue, Sep 6, 2016 at 2:33 PM Ed Maste via lldb-commits  wrote:

Author: emaste
Date: Tue Sep  6 16:25:31 2016
New Revision: 280755

URL: http://llvm.org/viewvc/llvm-project?rev=280755=rev
Log:
Reorder FreeBSD Host.cpp #includes to fix build

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

Modified: lldb/trunk/source/Host/freebsd/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/freebsd/Host.cpp?rev=280755=280754=280755=diff
==
--- lldb/trunk/source/Host/freebsd/Host.cpp (original)
+++ lldb/trunk/source/Host/freebsd/Host.cpp Tue Sep  6 16:25:31 2016
@@ -9,17 +9,19 @@
 //===--===//

 // C Includes
-#include 
-#include 
-#include 
+#include 
+
+#include 
 #include 
+#include 
 #include 
-#include 
 #include 

 #include 
-#include 
-#include 
+
+#include 
+#include 
+#include 

 // C++ Includes
 // Other libraries and framework includes


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

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



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



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


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

2016-08-29 Thread Kamil Rytarowski via lldb-commits
krytarowski added a subscriber: krytarowski.


Comment at: cmake/LLDBDependencies.cmake:168
@@ -167,3 +167,3 @@
 # On FreeBSD/NetBSD backtrace() is provided by libexecinfo, not libc.
-if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+if ((CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES 
"NetBSD") AND NOT CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD")
   list(APPEND LLDB_SYSTEM_LIBS execinfo)

brucem wrote:
> This really should turn into a check so that we don't need this to be 
> extended for every single OS that gets added.
There is now support for CMake >= 3.0, which offers a builtin check for it.


https://reviews.llvm.org/D23977



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


Re: [Lldb-commits] [PATCH] D23881: [LLDB] [cmake]: Add local module directory to search path for standalone build

2016-08-25 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

In https://reviews.llvm.org/D23881#525420, @mgorny wrote:

> In https://reviews.llvm.org/D23881#525411, @krytarowski wrote:
>
> > In https://reviews.llvm.org/D23881#525405, @mgorny wrote:
> >
> > > In https://reviews.llvm.org/D23881#525401, @krytarowski wrote:
> > >
> > > > The proper way to fix it is to install CheckAtomic from LLVM/Clang.
> > > >
> > > > See https://reviews.llvm.org/D22999
> > >
> > >
> > > Wasn't that rejected?
> >
> >
> > There was rejected a proposal to add CheckAtomic copy to LLDB. Not a 
> > proposal to install CheckAtomic for more customers of LLVM.
>
>
> Ah, sorry, I didn't read that thoroughly. Should I create a patch for that, 
> or will you handle it from here?


Please create it and I will test it on NetBSD.

Please add reviewers from https://reviews.llvm.org/D22999


Repository:
  rL LLVM

https://reviews.llvm.org/D23881



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


Re: [Lldb-commits] [PATCH] D22999: Resurrect standalone build

2016-08-25 Thread Kamil Rytarowski via lldb-commits
krytarowski abandoned this revision.
krytarowski added a comment.

Will be addressed in LLVM/Clang.


Repository:
  rL LLVM

https://reviews.llvm.org/D22999



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


Re: [Lldb-commits] [PATCH] D23881: [LLDB] [cmake]: Add local module directory to search path for standalone build

2016-08-25 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

In https://reviews.llvm.org/D23881#525405, @mgorny wrote:

> In https://reviews.llvm.org/D23881#525401, @krytarowski wrote:
>
> > The proper way to fix it is to install CheckAtomic from LLVM/Clang.
> >
> > See https://reviews.llvm.org/D22999
>
>
> Wasn't that rejected?


There was rejected a proposal to add CheckAtomic copy to LLDB. Not a proposal 
to install CheckAtomic for more customers of LLVM.


Repository:
  rL LLVM

https://reviews.llvm.org/D23881



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


Re: [Lldb-commits] [PATCH] D23830: Add cmake option to choose whether to use the builtin demangler

2016-08-25 Thread Kamil Rytarowski via lldb-commits
krytarowski added a subscriber: joerg.
krytarowski added a comment.

Looks OK for NetBSD. @joerg are you fine with this?


https://reviews.llvm.org/D23830



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


Re: [Lldb-commits] [PATCH] D23830: Add cmake option to choose whether to use the builtin demangler

2016-08-24 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

In https://reviews.llvm.org/D23830#524039, @labath wrote:

> @krytarowski: I thought I'd switch netbsd as well, as all the other platforms 
> are doing it already. However, if you want to stick with the system demangler 
> by default, I can easily change it to OFF ...


Thanks, I need to take a closer look at it.


https://reviews.llvm.org/D23830



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


Re: [Lldb-commits] [PATCH] D22999: Resurrect standalone build

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

ping


Repository:
  rL LLVM

https://reviews.llvm.org/D22999



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


Re: [Lldb-commits] [PATCH] D22999: Resurrect standalone build

2016-08-01 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

In https://reviews.llvm.org/D22999#501999, @tberghammer wrote:

> I think it is a bad idea to duplicate the CheckAtomic.cmake file from LLVM as 
> the 2 copy will diverge over time and cause extra maintenance cost. What do 
> you think about trying to change LLVM to install this file instead of 
> duplicating it into LLDB?


I'm fine with it. How about LLVM devs?


Repository:
  rL LLVM

https://reviews.llvm.org/D22999



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


[Lldb-commits] [PATCH] D22999: Resurrect standalone build

2016-07-31 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added reviewers: labath, zturner.
krytarowski added subscribers: lldb-commits, llvm-commits, joerg.
krytarowski set the repository for this revision to rL LLVM.

LLVM doesn't install "CheckAtomic" cmake file, so add it locally.
Bump required CMake version to 3.4.3 (sync with the master CMakeLists.txt)

This fixes build on NetBSD.

Repository:
  rL LLVM

https://reviews.llvm.org/D22999

Files:
  cmake/modules/CheckAtomic.cmake
  cmake/modules/LLDBStandalone.cmake

Index: cmake/modules/LLDBStandalone.cmake
===
--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -2,7 +2,7 @@
 # standalone project, using LLVM as an external library:
 if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
   project(lldb)
-  cmake_minimum_required(VERSION 2.8.12.2)
+  cmake_minimum_required(VERSION 3.4.3)
 
   if (POLICY CMP0022)
 cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required
@@ -86,7 +86,7 @@
 
   include(AddLLVM)
   include(HandleLLVMOptions)
-  include(CheckAtomic)
+  include(cmake/modules/CheckAtomic.cmake)
 
   if (PYTHON_EXECUTABLE STREQUAL "")
 set(Python_ADDITIONAL_VERSIONS 3.5 3.4 3.3 3.2 3.1 3.0 2.7 2.6 2.5)
Index: cmake/modules/CheckAtomic.cmake
===
--- /dev/null
+++ cmake/modules/CheckAtomic.cmake
@@ -0,0 +1,106 @@
+# atomic builtins are required for threading support.
+
+INCLUDE(CheckCXXSourceCompiles)
+
+# Sometimes linking against libatomic is required for atomic ops, if
+# the platform doesn't support lock-free atomics.
+
+function(check_working_cxx_atomics varname)
+  set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+  set(CMAKE_REQUIRED_FLAGS "-std=c++11")
+  CHECK_CXX_SOURCE_COMPILES("
+#include 
+std::atomic x;
+int main() {
+  return x;
+}
+" ${varname})
+  set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
+endfunction(check_working_cxx_atomics)
+
+function(check_working_cxx_atomics64 varname)
+  set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+  set(CMAKE_REQUIRED_FLAGS "-std=c++11 ${CMAKE_REQUIRED_FLAGS}")
+  CHECK_CXX_SOURCE_COMPILES("
+#include 
+#include 
+std::atomic x (0);
+int main() {
+  uint64_t i = x.load(std::memory_order_relaxed);
+  return 0;
+}
+" ${varname})
+  set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
+endfunction(check_working_cxx_atomics64)
+
+
+# This isn't necessary on MSVC, so avoid command-line switch annoyance
+# by only running on GCC-like hosts.
+if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
+  # First check if atomics work without the library.
+  check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB)
+  # If not, check if the library exists, and atomics work with it.
+  if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
+check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC)
+if( HAVE_LIBATOMIC )
+  list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
+  check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITH_LIB)
+  if (NOT HAVE_CXX_ATOMICS_WITH_LIB)
+	message(FATAL_ERROR "Host compiler must support std::atomic!")
+  endif()
+else()
+  message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.")
+endif()
+  endif()
+endif()
+
+# Check for 64 bit atomic operations.
+if(MSVC)
+  set(HAVE_CXX_ATOMICS64_WITHOUT_LIB True)
+else()
+  check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+endif()
+
+# If not, check if the library exists, and atomics work with it.
+if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+  check_library_exists(atomic __atomic_load_8 "" HAVE_CXX_LIBATOMICS64)
+  if(HAVE_CXX_LIBATOMICS64)
+list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic")
+check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITH_LIB)
+if (NOT HAVE_CXX_ATOMICS64_WITH_LIB)
+  message(FATAL_ERROR "Host compiler must support std::atomic!")
+endif()
+  else()
+message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.")
+  endif()
+endif()
+
+## TODO: This define is only used for the legacy atomic operations in
+## llvm's Atomic.h, which should be replaced.  Other code simply
+## assumes C++11  works.
+CHECK_CXX_SOURCE_COMPILES("
+#ifdef _MSC_VER
+#include  /* Workaround for PR19898. */
+#include 
+#endif
+int main() {
+#ifdef _MSC_VER
+volatile LONG val = 1;
+MemoryBarrier();
+InterlockedCompareExchange(, 0, 1);
+InterlockedIncrement();
+InterlockedDecrement();
+#else
+volatile unsigned long val = 1;
+__sync_synchronize();
+__sync_val_compare_and_swap(, 1, 0);
+__sync_add_and_fetch(, 1);
+__sync_sub_and_fetch(, 1);
+#endif
+return 0;
+  }
+" LLVM_HAS_ATOMICS)
+
+if( NOT LLVM_HAS_ATOMICS )
+  message(STATUS "Warning: LLVM will be built thread-unsafe because atomic builtins are missing")
+endif()
___
lldb-commits mailing list

Re: [Lldb-commits] [PATCH] D20274: Add preliminary bits for Plugins/Process/NetBSD

2016-05-26 Thread Kamil Rytarowski via lldb-commits
krytarowski abandoned this revision.
krytarowski added a comment.

It no longer builds due to mutex refactoring. Remove as it will need to be 
redone for remote debugging.


Repository:
  rL LLVM

http://reviews.llvm.org/D20274



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


Re: [Lldb-commits] [PATCH] D20344: [LLDB] Fix standalone LLDB build when LLVM/Clang were built with LLVM_INSTALL_TOOLCHAIN_ONLY=ON

2016-05-18 Thread Kamil Rytarowski via lldb-commits
krytarowski accepted this revision.
krytarowski added a comment.

It works for me.


Repository:
  rL LLVM

http://reviews.llvm.org/D20344



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


Re: [Lldb-commits] [PATCH] D20274: Add preliminary bits for Plugins/Process/NetBSD

2016-05-16 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

> Does remote debugging interest you?


Yes.

However, on the other hand it's low priority for me right now. I will rebase to 
FreeBSD once I will get improved system support in ptrace(2) and functional 
process/core instrumentation.


Repository:
  rL LLVM

http://reviews.llvm.org/D20274



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


Re: [Lldb-commits] [PATCH] D20278: first pass for removing Mutex for std::{, recursive_}mutex

2016-05-16 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

There is `Mutex::` used in my code. And it's going to be removed soon.


http://reviews.llvm.org/D20278



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


[Lldb-commits] [PATCH] D20224: Unbreak build on NetBSD-7.0

2016-05-12 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added reviewers: joerg, emaste, clayborg.
krytarowski added a subscriber: lldb-commits.
krytarowski set the repository for this revision to rL LLVM.

NetBSD 7.0 ships with too old libstdc++ and it lacks .

It's no longer true in the current version -- it has been tested with 7.99.28.

This arbitrary value is an temporary version just to retain building on 7.0 and 
head for fully functional NetBSD-8.0.

Repository:
  rL LLVM

http://reviews.llvm.org/D20224

Files:
  include/lldb/Host/Editline.h

Index: include/lldb/Host/Editline.h
===
--- include/lldb/Host/Editline.h
+++ include/lldb/Host/Editline.h
@@ -23,6 +23,15 @@
 
 #ifndef liblldb_Editline_h_
 #define liblldb_Editline_h_
+
+#if defined(__NetBSD__)
+#include 
+#if __NetBSD_Prereq__(7,99,28)
+#define NETBSD_USE_WCHAR
+#endif
+#endif
+
+
 #if defined(__cplusplus)
 
 #include 
@@ -32,7 +41,7 @@
 // components needed to handle wide characters ( , codecvt_utf8, 
libedit built with '--enable-widec' )
 // are available on some platforms. The wchar_t versions of libedit functions 
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(__NetBSD__)
+#if defined (__APPLE__) || defined(NETBSD_USE_WCHAR)
 #define LLDB_EDITLINE_USE_WCHAR 1
 #include 
 #else


Index: include/lldb/Host/Editline.h
===
--- include/lldb/Host/Editline.h
+++ include/lldb/Host/Editline.h
@@ -23,6 +23,15 @@
 
 #ifndef liblldb_Editline_h_
 #define liblldb_Editline_h_
+
+#if defined(__NetBSD__)
+#include 
+#if __NetBSD_Prereq__(7,99,28)
+#define NETBSD_USE_WCHAR
+#endif
+#endif
+
+
 #if defined(__cplusplus)
 
 #include 
@@ -32,7 +41,7 @@
 // components needed to handle wide characters ( , codecvt_utf8, libedit built with '--enable-widec' )
 // are available on some platforms. The wchar_t versions of libedit functions 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(__NetBSD__)
+#if defined (__APPLE__) || defined(NETBSD_USE_WCHAR)
 #define LLDB_EDITLINE_USE_WCHAR 1
 #include 
 #else
___
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

2016-05-12 Thread Kamil Rytarowski via lldb-commits
krytarowski resigned from this revision.
krytarowski removed a reviewer: krytarowski.
krytarowski added a comment.

This patch looks dead -- no activity.


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] D15067: Add CMake bits necessary for standalone build

2016-05-12 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

@Eugene.Zelenko do you agree with this patch and what @labath wrote?


Repository:
  rL LLVM

http://reviews.llvm.org/D15067



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


[Lldb-commits] [PATCH] D20188: Turn on LLDB_EDITLINE_USE_WCHAR on NetBSD

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

The editline(3) library in NetBSD is by default internally wide.

Repository:
  rL LLVM

http://reviews.llvm.org/D20188

Files:
  include/lldb/Host/Editline.h

Index: include/lldb/Host/Editline.h
===
--- include/lldb/Host/Editline.h
+++ include/lldb/Host/Editline.h
@@ -27,11 +27,12 @@
 
 #include 
 #include 
+#include 
 
 // components needed to handle wide characters ( , codecvt_utf8, 
libedit built with '--enable-widec' )
-// are not consistenly available on non-OSX platforms.  The wchar_t versions 
of libedit functions will only be
+// are available on OSX and NetBSD. The wchar_t versions of libedit functions 
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__)
+#if defined (__APPLE__) || defined(__NetBSD__)
 #define LLDB_EDITLINE_USE_WCHAR 1
 #include 
 #else


Index: include/lldb/Host/Editline.h
===
--- include/lldb/Host/Editline.h
+++ include/lldb/Host/Editline.h
@@ -27,11 +27,12 @@
 
 #include 
 #include 
+#include 
 
 // components needed to handle wide characters ( , codecvt_utf8, libedit built with '--enable-widec' )
-// are not consistenly available on non-OSX platforms.  The wchar_t versions of libedit functions will only be
+// are available on OSX and NetBSD. The wchar_t versions of libedit functions 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__)
+#if defined (__APPLE__) || defined(__NetBSD__)
 #define LLDB_EDITLINE_USE_WCHAR 1
 #include 
 #else
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D15067: Add CMake bits necessary for standalone build

2016-05-11 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Updated. Can I commit it this way as it is?


Repository:
  rL LLVM

http://reviews.llvm.org/D15067



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


Re: [Lldb-commits] [PATCH] D15067: Add CMake bits necessary for standalone build

2016-05-11 Thread Kamil Rytarowski via lldb-commits
krytarowski retitled this revision from "Design building out of sources" to 
"Add CMake bits necessary for standalone build".
krytarowski updated this revision to Diff 56970.

Repository:
  rL LLVM

http://reviews.llvm.org/D15067

Files:
  cmake/modules/LLDBStandalone.cmake
  scripts/CMakeLists.txt

Index: scripts/CMakeLists.txt
===
--- scripts/CMakeLists.txt
+++ scripts/CMakeLists.txt
@@ -9,6 +9,8 @@
   ${LLDB_SOURCE_DIR}/include/lldb/lldb-versioning.h
 )
 
+include(FindPythonInterp)
+
 find_package(SWIG REQUIRED)
 add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp
Index: cmake/modules/LLDBStandalone.cmake
===
--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -6,57 +6,78 @@
 
   option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)
 
-  set(LLDB_PATH_TO_LLVM_SOURCE "" CACHE PATH
-"Path to LLVM source code. Not necessary if using an installed LLVM.")
-  set(LLDB_PATH_TO_LLVM_BUILD "" CACHE PATH
-"Path to the directory where LLVM was built or installed.")
-
-  set(LLDB_PATH_TO_CLANG_SOURCE "" CACHE PATH
-"Path to Clang source code. Not necessary if using an installed Clang.")
-  set(LLDB_PATH_TO_CLANG_BUILD "" CACHE PATH
-"Path to the directory where Clang was built or installed.")
-
-  if (LLDB_PATH_TO_LLVM_SOURCE)
-if (NOT EXISTS "${LLDB_PATH_TO_LLVM_SOURCE}/cmake/config-ix.cmake")
-  message(FATAL_ERROR "Please set LLDB_PATH_TO_LLVM_SOURCE to the root "
-  "directory of LLVM source code.")
+  # Rely on llvm-config.
+  set(CONFIG_OUTPUT)
+  find_program(LLVM_CONFIG "llvm-config")
+  if(LLVM_CONFIG)
+message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
+set(CONFIG_COMMAND ${LLVM_CONFIG}
+  "--assertion-mode"
+  "--bindir"
+  "--libdir"
+  "--includedir"
+  "--prefix"
+  "--src-root")
+execute_process(
+  COMMAND ${CONFIG_COMMAND}
+  RESULT_VARIABLE HAD_ERROR
+  OUTPUT_VARIABLE CONFIG_OUTPUT
+)
+if(NOT HAD_ERROR)
+  string(REGEX REPLACE
+"[ \t]*[\r\n]+[ \t]*" ";"
+CONFIG_OUTPUT ${CONFIG_OUTPUT})
+
 else()
-  get_filename_component(LLVM_MAIN_SRC_DIR ${LLDB_PATH_TO_LLVM_SOURCE}
- ABSOLUTE)
-  set(LLVM_MAIN_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/include")
-  list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")
+  string(REPLACE ";" " " CONFIG_COMMAND_STR "${CONFIG_COMMAND}")
+  message(STATUS "${CONFIG_COMMAND_STR}")
+  message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
 endif()
+  else()
+message(FATAL_ERROR "llvm-config not found -- ${LLVM_CONFIG}")
   endif()
 
-  if (LLDB_PATH_TO_CLANG_SOURCE)
-  get_filename_component(CLANG_MAIN_SRC_DIR ${LLDB_PATH_TO_CLANG_SOURCE}
- ABSOLUTE)
-  set(CLANG_MAIN_INCLUDE_DIR "${CLANG_MAIN_SRC_DIR}/include")
+  list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
+  list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
+  list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
+  list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
+  list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
+  list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
+
+  if(NOT MSVC_IDE)
+set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
+  CACHE BOOL "Enable assertions")
+# Assertions should follow llvm-config's.
+mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
   endif()
 
-  list(APPEND CMAKE_MODULE_PATH "${LLDB_PATH_TO_LLVM_BUILD}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
+  set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin")
+  set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
+  set(LLVM_MAIN_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")
+  set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
+  set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
 
-  if (LLDB_PATH_TO_LLVM_BUILD)
-get_filename_component(PATH_TO_LLVM_BUILD ${LLDB_PATH_TO_LLVM_BUILD}
-   ABSOLUTE)
-  else()
-message(FATAL_ERROR "Please set LLDB_PATH_TO_LLVM_BUILD to the root "
-"directory of LLVM build or install site.")
-  endif()
+  find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
+NO_DEFAULT_PATH)
 
-  if (LLDB_PATH_TO_CLANG_BUILD)
-get_filename_component(PATH_TO_CLANG_BUILD ${LLDB_PATH_TO_CLANG_BUILD}
-   ABSOLUTE)
+  set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
+  set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
+  if(EXISTS ${LLVMCONFIG_FILE})
+list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
+include(${LLVMCONFIG_FILE})
   else()
-message(FATAL_ERROR "Please set LLDB_PATH_TO_CLANG_BUILD to the root "
-"directory of Clang build or install site.")
+message(FATAL_ERROR 

Re: [Lldb-commits] [PATCH] D15067: Design building out of sources

2016-05-11 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

In http://reviews.llvm.org/D15067#419964, @labath wrote:

> Good question. I don't really have an opinion on that... Is it just that 
> single line? (this would be simpler if you uploaded the final version :) ). 
> If it just that single line, then I think it's fine. If you also need to play 
> with the ADDITIONAL_VERSIONS and such, then we should think about making a 
> macro or doing something else to avoid code duplication (there is already a 
> FIXME in scripts/Python/modules/readline mentioning the additional versions).


Sorry for delay. I'm going to update the diff.


Repository:
  rL LLVM

http://reviews.llvm.org/D15067



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


Re: [Lldb-commits] [PATCH] D15067: Design building out of sources

2016-05-03 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

In http://reviews.llvm.org/D15067#419632, @labath wrote:

> Looks good.


Thanks!

Are you accepting it with the patch in `scripts/CMakeLists.txt` as noted in the 
comment?


Repository:
  rL LLVM

http://reviews.llvm.org/D15067



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


Re: [Lldb-commits] [PATCH] D15067: Design building out of sources

2016-05-01 Thread Kamil Rytarowski via lldb-commits
krytarowski added inline comments.


Comment at: cmake/modules/LLDBStandalone.cmake:85
@@ -63,3 +84,3 @@
 
   if (PYTHON_EXECUTABLE STREQUAL "")
 set(Python_ADDITIONAL_VERSIONS 3.5 3.4 3.3 3.2 3.1 3.0 2.7 2.6 2.5)

When I am including conditionally `include(FindPythonInterp)` with this 
`PYTHON_EXECUTABLE STREQUAL ""` conditional I'm facing the said issue with:

```
CMake Error at scripts/cmake_install.cmake:31 (file):
  file INSTALL cannot find
  "/tmp/pkgsrc-tmp/wip/lldb-git/work/build/lib/python.".
Call Stack (most recent call first):
  cmake_install.cmake:37 (include)
  


*** Error code 1
```

If I put here `include(FindPythonInterp)` unconditionally, there is no error in 
`cmake_install.cmake:37`.


Repository:
  rL LLVM

http://reviews.llvm.org/D15067



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


Re: [Lldb-commits] [PATCH] D15067: Design building out of sources

2016-05-01 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

please take a look @zturner @labath


Repository:
  rL LLVM

http://reviews.llvm.org/D15067



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


Re: [Lldb-commits] [PATCH] D15067: Design building out of sources

2016-05-01 Thread Kamil Rytarowski via lldb-commits
krytarowski updated this revision to Diff 55742.
krytarowski added a comment.

Revamp the patch and reduce it only to the CMake part.

Leave regex code for later.


Repository:
  rL LLVM

http://reviews.llvm.org/D15067

Files:
  cmake/modules/LLDBStandalone.cmake

Index: cmake/modules/LLDBStandalone.cmake
===
--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -6,57 +6,78 @@
 
   option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)
 
-  set(LLDB_PATH_TO_LLVM_SOURCE "" CACHE PATH
-"Path to LLVM source code. Not necessary if using an installed LLVM.")
-  set(LLDB_PATH_TO_LLVM_BUILD "" CACHE PATH
-"Path to the directory where LLVM was built or installed.")
-
-  set(LLDB_PATH_TO_CLANG_SOURCE "" CACHE PATH
-"Path to Clang source code. Not necessary if using an installed Clang.")
-  set(LLDB_PATH_TO_CLANG_BUILD "" CACHE PATH
-"Path to the directory where Clang was built or installed.")
-
-  if (LLDB_PATH_TO_LLVM_SOURCE)
-if (NOT EXISTS "${LLDB_PATH_TO_LLVM_SOURCE}/cmake/config-ix.cmake")
-  message(FATAL_ERROR "Please set LLDB_PATH_TO_LLVM_SOURCE to the root "
-  "directory of LLVM source code.")
+  # Rely on llvm-config.
+  set(CONFIG_OUTPUT)
+  find_program(LLVM_CONFIG "llvm-config")
+  if(LLVM_CONFIG)
+message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
+set(CONFIG_COMMAND ${LLVM_CONFIG}
+  "--assertion-mode"
+  "--bindir"
+  "--libdir"
+  "--includedir"
+  "--prefix"
+  "--src-root")
+execute_process(
+  COMMAND ${CONFIG_COMMAND}
+  RESULT_VARIABLE HAD_ERROR
+  OUTPUT_VARIABLE CONFIG_OUTPUT
+)
+if(NOT HAD_ERROR)
+  string(REGEX REPLACE
+"[ \t]*[\r\n]+[ \t]*" ";"
+CONFIG_OUTPUT ${CONFIG_OUTPUT})
+
 else()
-  get_filename_component(LLVM_MAIN_SRC_DIR ${LLDB_PATH_TO_LLVM_SOURCE}
- ABSOLUTE)
-  set(LLVM_MAIN_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/include")
-  list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")
+  string(REPLACE ";" " " CONFIG_COMMAND_STR "${CONFIG_COMMAND}")
+  message(STATUS "${CONFIG_COMMAND_STR}")
+  message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
 endif()
+  else()
+message(FATAL_ERROR "llvm-config not found -- ${LLVM_CONFIG}")
   endif()
 
-  if (LLDB_PATH_TO_CLANG_SOURCE)
-  get_filename_component(CLANG_MAIN_SRC_DIR ${LLDB_PATH_TO_CLANG_SOURCE}
- ABSOLUTE)
-  set(CLANG_MAIN_INCLUDE_DIR "${CLANG_MAIN_SRC_DIR}/include")
+  list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
+  list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
+  list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
+  list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
+  list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
+  list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
+
+  if(NOT MSVC_IDE)
+set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
+  CACHE BOOL "Enable assertions")
+# Assertions should follow llvm-config's.
+mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
   endif()
 
-  list(APPEND CMAKE_MODULE_PATH "${LLDB_PATH_TO_LLVM_BUILD}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
+  set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin")
+  set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
+  set(LLVM_MAIN_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")
+  set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
+  set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
 
-  if (LLDB_PATH_TO_LLVM_BUILD)
-get_filename_component(PATH_TO_LLVM_BUILD ${LLDB_PATH_TO_LLVM_BUILD}
-   ABSOLUTE)
-  else()
-message(FATAL_ERROR "Please set LLDB_PATH_TO_LLVM_BUILD to the root "
-"directory of LLVM build or install site.")
-  endif()
+  find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
+NO_DEFAULT_PATH)
 
-  if (LLDB_PATH_TO_CLANG_BUILD)
-get_filename_component(PATH_TO_CLANG_BUILD ${LLDB_PATH_TO_CLANG_BUILD}
-   ABSOLUTE)
+  set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
+  set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
+  if(EXISTS ${LLVMCONFIG_FILE})
+list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
+include(${LLVMCONFIG_FILE})
   else()
-message(FATAL_ERROR "Please set LLDB_PATH_TO_CLANG_BUILD to the root "
-"directory of Clang build or install site.")
+message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
   endif()
 
-
-  # These variables are used by add_llvm_library.
+  # They are used as destination of target generators.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
   set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
-  set(LLVM_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
+  if(WIN32 

[Lldb-commits] [lldb] r268191 - Fix NetBSD build with CMake 3.5.2

2016-05-01 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Sun May  1 05:23:24 2016
New Revision: 268191

URL: http://llvm.org/viewvc/llvm-project?rev=268191=rev
Log:
Fix NetBSD build with CMake 3.5.2

Summary:
Building HEAD of LLDB fails in linking against DebugInfoPDB. It also prints the 
following warning:

```
CMake Warning (dev) in source/Plugins/SymbolFile/PDB/CMakeLists.txt:
  Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
  interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "lldbPluginSymbolFilePDB" has an INTERFACE_LINK_LIBRARIES property.
  This should be preferred as the source of the link interface for this
  library but because CMP0022 is not set CMake is ignoring the property and
  using the link implementation as the link interface instead.

  INTERFACE_LINK_LIBRARIES:

LLVMDebugInfoPDB

  Link implementation:

(empty)
```

CMP0022 was introduced in CMake-2.8.11, bump minimal required version from 2.8 
to 3.0 to gain more useful features like libexecinfo(3) detection on NetBSD.

Reviewers: emaste, zturner, labath

Subscribers: zturner, lldb-commits, joerg

Differential Revision: http://reviews.llvm.org/D19685

Modified:
lldb/trunk/CMakeLists.txt
lldb/trunk/cmake/modules/LLDBStandalone.cmake

Modified: lldb/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=268191=268190=268191=diff
==
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Sun May  1 05:23:24 2016
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12.2)
 
 include(cmake/modules/LLDBStandalone.cmake)
 include(cmake/modules/LLDBConfig.cmake)

Modified: lldb/trunk/cmake/modules/LLDBStandalone.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBStandalone.cmake?rev=268191=268190=268191=diff
==
--- lldb/trunk/cmake/modules/LLDBStandalone.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBStandalone.cmake Sun May  1 05:23:24 2016
@@ -2,7 +2,7 @@
 # standalone project, using LLVM as an external library:
 if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
   project(lldb)
-  cmake_minimum_required(VERSION 2.8)
+  cmake_minimum_required(VERSION 2.8.12.2)
 
   option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 
'install' target." OFF)
 


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


Re: [Lldb-commits] [PATCH] D19685: Fix NetBSD build with CMake 3.5.2

2016-05-01 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Thanks, since it has been accepted. I will commit it and move to LLDBStandalone.


Repository:
  rL LLVM

http://reviews.llvm.org/D19685



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


Re: [Lldb-commits] [PATCH] D19772: Detect Python's executable on NetBSD

2016-04-30 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

If the change should go to LLDBStandalone.cmake -- can I just put there in one 
go all the bits for standalone builds?

  --- cmake/modules/LLDBStandalone.cmake.orig 2016-04-27 00:55:49.0 
+
  +++ cmake/modules/LLDBStandalone.cmake
  @@ -2,61 +2,82 @@
   # standalone project, using LLVM as an external library:
   if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
 project(lldb)
  -  cmake_minimum_required(VERSION 2.8)
  +  cmake_minimum_required(VERSION 2.8.12.2)
   
 option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 
'install' target." OFF)
   
  -  set(LLDB_PATH_TO_LLVM_SOURCE "" CACHE PATH
  -"Path to LLVM source code. Not necessary if using an installed LLVM.")
  -  set(LLDB_PATH_TO_LLVM_BUILD "" CACHE PATH
  -"Path to the directory where LLVM was built or installed.")
  -
  -  set(LLDB_PATH_TO_CLANG_SOURCE "" CACHE PATH
  -"Path to Clang source code. Not necessary if using an installed Clang.")
  -  set(LLDB_PATH_TO_CLANG_BUILD "" CACHE PATH
  -"Path to the directory where Clang was built or installed.")
  -
  -  if (LLDB_PATH_TO_LLVM_SOURCE)
  -if (NOT EXISTS "${LLDB_PATH_TO_LLVM_SOURCE}/cmake/config-ix.cmake")
  -  message(FATAL_ERROR "Please set LLDB_PATH_TO_LLVM_SOURCE to the root "
  -  "directory of LLVM source code.")
  +  # Rely on llvm-config.
  +  set(CONFIG_OUTPUT)
  +  find_program(LLVM_CONFIG "llvm-config")
  +  if(LLVM_CONFIG)
  +message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
  +set(CONFIG_COMMAND ${LLVM_CONFIG}
  +  "--assertion-mode"
  +  "--bindir"
  +  "--libdir"
  +  "--includedir"
  +  "--prefix"
  +  "--src-root")
  +execute_process(
  +  COMMAND ${CONFIG_COMMAND}
  +  RESULT_VARIABLE HAD_ERROR
  +  OUTPUT_VARIABLE CONFIG_OUTPUT
  +)
  +if(NOT HAD_ERROR)
  +  string(REGEX REPLACE
  +"[ \t]*[\r\n]+[ \t]*" ";"
  +CONFIG_OUTPUT ${CONFIG_OUTPUT})
  +
   else()
  -  get_filename_component(LLVM_MAIN_SRC_DIR ${LLDB_PATH_TO_LLVM_SOURCE}
  - ABSOLUTE)
  -  set(LLVM_MAIN_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/include")
  -  list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")
  +  string(REPLACE ";" " " CONFIG_COMMAND_STR "${CONFIG_COMMAND}")
  +  message(STATUS "${CONFIG_COMMAND_STR}")
  +  message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
   endif()
  -  endif()
  -
  -  if (LLDB_PATH_TO_CLANG_SOURCE)
  -  get_filename_component(CLANG_MAIN_SRC_DIR ${LLDB_PATH_TO_CLANG_SOURCE}
  - ABSOLUTE)
  -  set(CLANG_MAIN_INCLUDE_DIR "${CLANG_MAIN_SRC_DIR}/include")
  -  endif()
  -
  -  list(APPEND CMAKE_MODULE_PATH 
"${LLDB_PATH_TO_LLVM_BUILD}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
  -
  -  if (LLDB_PATH_TO_LLVM_BUILD)
  -get_filename_component(PATH_TO_LLVM_BUILD ${LLDB_PATH_TO_LLVM_BUILD}
  -   ABSOLUTE)
 else()
  -message(FATAL_ERROR "Please set LLDB_PATH_TO_LLVM_BUILD to the root "
  -"directory of LLVM build or install site.")
  +message(FATAL_ERROR "llvm-config not found -- ${LLVM_CONFIG}")
 endif()
   
  -  if (LLDB_PATH_TO_CLANG_BUILD)
  -get_filename_component(PATH_TO_CLANG_BUILD ${LLDB_PATH_TO_CLANG_BUILD}
  -   ABSOLUTE)
  +  list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
  +  list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
  +  list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
  +  list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
  +  list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
  +  list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
  +
  +  if(NOT MSVC_IDE)
  +set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
  +  CACHE BOOL "Enable assertions")
  +# Assertions should follow llvm-config's.
  +mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
  +  endif()
  +
  +  set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to 
llvm/bin")
  +  set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
  +  set(LLVM_MAIN_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")
  +  set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
  +  set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source 
tree")
  +
  +  find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
  +NO_DEFAULT_PATH)
  +
  +  set(LLVM_CMAKE_PATH 
"${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
  +  set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
  +  if(EXISTS ${LLVMCONFIG_FILE})
  +list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
  +include(${LLVMCONFIG_FILE})
 else()
  -message(FATAL_ERROR "Please set LLDB_PATH_TO_CLANG_BUILD to the root "
  -"directory of Clang build or install site.")
  +message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
 endif()
   
  -
  -  # These variables are used by add_llvm_library.
  +  # They are used as 

[Lldb-commits] [PATCH] D19772: Detect Python's executable on NetBSD

2016-04-30 Thread Kamil Rytarowski via lldb-commits
krytarowski created this revision.
krytarowski added reviewers: emaste, labath, zturner.
krytarowski added subscribers: lldb-commits, joerg.
krytarowski set the repository for this revision to rL LLVM.

NetBSD ships with pkgsrc that installs versioned Python executables with 
suffix, like: python2.7 or python3.5.

CMake needs more help to detect appropriate name, so require where needed 
`FindPythonInterp`.

This diff addresses the following failure:

```
CMake Error at scripts/cmake_install.cmake:31 (file):
  file INSTALL cannot find
  "/tmp/pkgsrc-tmp/wip/lldb-git/work/build/lib/python.".
Call Stack (most recent call first):
  cmake_install.cmake:37 (include)
  


*** Error code 1
```

Repository:
  rL LLVM

http://reviews.llvm.org/D19772

Files:
  scripts/CMakeLists.txt

Index: scripts/CMakeLists.txt
===
--- scripts/CMakeLists.txt
+++ scripts/CMakeLists.txt
@@ -9,6 +9,8 @@
   ${LLDB_SOURCE_DIR}/include/lldb/lldb-versioning.h
 )
 
+include(FindPythonInterp)
+
 find_package(SWIG REQUIRED)
 add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp


Index: scripts/CMakeLists.txt
===
--- scripts/CMakeLists.txt
+++ scripts/CMakeLists.txt
@@ -9,6 +9,8 @@
   ${LLDB_SOURCE_DIR}/include/lldb/lldb-versioning.h
 )
 
+include(FindPythonInterp)
+
 find_package(SWIG REQUIRED)
 add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D19685: Fix NetBSD build with CMake 3.5.2

2016-04-30 Thread Kamil Rytarowski via lldb-commits
krytarowski updated this revision to Diff 55729.
krytarowski added a comment.

Set minimal required CMake to 2.8.12.2 - fixes build on NetBSD with CMake 3.5.2


Repository:
  rL LLVM

http://reviews.llvm.org/D19685

Files:
  CMakeLists.txt
  cmake/modules/LLDBStandalone.cmake

Index: cmake/modules/LLDBStandalone.cmake
===
--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -2,7 +2,7 @@
 # standalone project, using LLVM as an external library:
 if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
   project(lldb)
-  cmake_minimum_required(VERSION 2.8)
+  cmake_minimum_required(VERSION 2.8.12.2)
 
   option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 
'install' target." OFF)
 
Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12.2)
 
 include(cmake/modules/LLDBStandalone.cmake)
 include(cmake/modules/LLDBConfig.cmake)


Index: cmake/modules/LLDBStandalone.cmake
===
--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -2,7 +2,7 @@
 # standalone project, using LLVM as an external library:
 if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
   project(lldb)
-  cmake_minimum_required(VERSION 2.8)
+  cmake_minimum_required(VERSION 2.8.12.2)
 
   option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)
 
Index: CMakeLists.txt
===
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12.2)
 
 include(cmake/modules/LLDBStandalone.cmake)
 include(cmake/modules/LLDBConfig.cmake)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D19685: Fix NetBSD build with CMake 3.5.2

2016-04-30 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

In http://reviews.llvm.org/D19685#417896, @zturner wrote:

> I don't think we should be adding more CMake hacks in lldb when llvm is
>  supposed to handle this. Why don't the existing lines work?


I don't know. Perhaps because LLVM and Clang requires newer cmake than 2.8.11.

I tested locally with setting the minimal required version to 2.8.12.2 and LLDB 
builds.


Repository:
  rL LLVM

http://reviews.llvm.org/D19685



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


Re: [Lldb-commits] [PATCH] D17724: Replace getopt with llvm::cl in lldb driver

2016-03-02 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

In http://reviews.llvm.org/D17724#366479, @clayborg wrote:

> Our current consistent way of parsing options is to use getopt_long() 
> everywhere.


Actually with usage of `getopt_long_only()` which is unportable.


http://reviews.llvm.org/D17724



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


Re: [Lldb-commits] [PATCH] D15067: Design building out of sources

2016-02-09 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Just in case someone will be quicker, new version against revamped CMake dirs 
is in pkgsrc-wip/lldb-git


Repository:
  rL LLVM

http://reviews.llvm.org/D15067



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


Re: [Lldb-commits] [PATCH] D16818: [lldb/NetBSD] Remove dead function. Unbreak the build with -Werror

2016-02-04 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Feel free to land it.


http://reviews.llvm.org/D16818



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


Re: [Lldb-commits] [PATCH] D16508: NetBSD: Define initial RegisterContextNetBSD_x86_64

2016-02-01 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Thank you very much! You made this patch possible.


Repository:
  rL LLVM

http://reviews.llvm.org/D16508



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


[Lldb-commits] [lldb] r259462 - NetBSD: Define initial RegisterContextNetBSD_x86_64

2016-02-01 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Mon Feb  1 21:47:44 2016
New Revision: 259462

URL: http://llvm.org/viewvc/llvm-project?rev=259462=rev
Log:
NetBSD: Define initial RegisterContextNetBSD_x86_64

Summary: Add basic support, i386 version will be added later.

Reviewers: emaste, joerg, clayborg, tfiala

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D16508

Added:
lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h
Modified:
lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt

Modified: lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt?rev=259462=259461=259462=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt Mon Feb  1 
21:47:44 2016
@@ -34,6 +34,7 @@ add_lldb_library(lldbPluginProcessUtilit
   RegisterContextMach_i386.cpp
   RegisterContextMach_x86_64.cpp
   RegisterContextMemory.cpp
+  RegisterContextNetBSD_x86_64.cpp
   RegisterContextPOSIX_arm.cpp
   RegisterContextPOSIX_arm64.cpp
   RegisterContextPOSIX_mips64.cpp

Added: 
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=259462=auto
==
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp 
(added)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp 
Mon Feb  1 21:47:44 2016
@@ -0,0 +1,364 @@
+//===-- RegisterContextNetBSD_x86_64.cpp --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===-===//
+
+#include 
+#include 
+
+#include "llvm/Support/Compiler.h"
+
+#include "RegisterContextPOSIX_x86.h"
+#include "RegisterContextNetBSD_x86_64.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+// src/sys/arch/amd64/include/frame_regs.h
+typedef struct _GPR
+{
+uint64_t rdi; /*  0 */
+uint64_t rsi; /*  1 */
+uint64_t rdx; /*  2 */
+uint64_t rcx; /*  3 */
+uint64_t r8;  /*  4 */
+uint64_t r9;  /*  5 */
+uint64_t r10; /*  6 */
+uint64_t r11; /*  7 */
+uint64_t r12; /*  8 */
+uint64_t r13; /*  9 */
+uint64_t r14; /* 10 */
+uint64_t r15; /* 11 */
+uint64_t rbp; /* 12 */
+uint64_t rbx; /* 13 */
+uint64_t rax; /* 14 */
+uint64_t gs;  /* 15 */
+uint64_t fs;  /* 16 */
+uint64_t es;  /* 17 */
+uint64_t ds;  /* 18 */
+uint64_t trapno;  /* 19 */
+uint64_t err; /* 20 */
+uint64_t rip; /* 21 */
+uint64_t cs;  /* 22 */
+uint64_t rflags;  /* 23 */
+uint64_t rsp; /* 24 */
+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
+ */
+
+/*
+ * src/sys/arch/amd64/include/mcontext.h
+ *
+ * typedef struct {
+ *   __gregset_t __gregs;
+ *   __greg_t_mc_tlsbase;
+ *   __fpregset_t__fpregs;
+ * } mcontext_t;
+ */
+
+struct UserArea {
+GPR  gpr;
+uint64_t mc_tlsbase;
+FPR  fpr;
+};
+
+
+//---
+// 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*)NULL)->reg)
+
+// Number of bytes needed to represent the i'th FP register.
+#define FP_SIZE sizeof(((MMSReg*)NULL)->bytes)
+
+// Number of bytes needed to represent an XMM register.
+#define XMM_SIZE sizeof(XMMReg)
+
+// Number of bytes 

Re: [Lldb-commits] [PATCH] D16508: NetBSD: Define initial RegisterContextNetBSD_x86_64

2016-01-31 Thread Kamil Rytarowski via lldb-commits
krytarowski updated this revision to Diff 46489.
krytarowski added a comment.

Revamped version.

Changes:

- change type of registers from int64_t to uint64_t,
- remove unsupported debug x86 registers,
- model UserArea after mcontext_t

Patch building tested.


Repository:
  rL LLVM

http://reviews.llvm.org/D16508

Files:
  source/Plugins/Process/Utility/CMakeLists.txt
  source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp
  source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h

Index: source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h
===
--- /dev/null
+++ source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h
@@ -0,0 +1,35 @@
+//===-- RegisterContextNetBSD_x86_64.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_RegisterContextNetBSD_x86_64_H_
+#define liblldb_RegisterContextNetBSD_x86_64_H_
+
+#include "RegisterInfoInterface.h"
+
+class RegisterContextNetBSD_x86_64:
+public lldb_private::RegisterInfoInterface
+{
+public:
+RegisterContextNetBSD_x86_64(const lldb_private::ArchSpec _arch);
+
+size_t
+GetGPRSize() const override;
+
+const lldb_private::RegisterInfo *
+GetRegisterInfo() const override;
+
+uint32_t
+GetRegisterCount () const override;
+
+private:
+const lldb_private::RegisterInfo *m_register_info_p;
+const uint32_t m_register_count;
+};
+
+#endif
Index: source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp
===
--- /dev/null
+++ source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp
@@ -0,0 +1,364 @@
+//===-- RegisterContextNetBSD_x86_64.cpp --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===-===//
+
+#include 
+#include 
+
+#include "llvm/Support/Compiler.h"
+
+#include "RegisterContextPOSIX_x86.h"
+#include "RegisterContextNetBSD_x86_64.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+// src/sys/arch/amd64/include/frame_regs.h
+typedef struct _GPR
+{
+uint64_t rdi; /*  0 */
+uint64_t rsi; /*  1 */
+uint64_t rdx; /*  2 */
+uint64_t rcx; /*  3 */
+uint64_t r8;  /*  4 */
+uint64_t r9;  /*  5 */
+uint64_t r10; /*  6 */
+uint64_t r11; /*  7 */
+uint64_t r12; /*  8 */
+uint64_t r13; /*  9 */
+uint64_t r14; /* 10 */
+uint64_t r15; /* 11 */
+uint64_t rbp; /* 12 */
+uint64_t rbx; /* 13 */
+uint64_t rax; /* 14 */
+uint64_t gs;  /* 15 */
+uint64_t fs;  /* 16 */
+uint64_t es;  /* 17 */
+uint64_t ds;  /* 18 */
+uint64_t trapno;  /* 19 */
+uint64_t err; /* 20 */
+uint64_t rip; /* 21 */
+uint64_t cs;  /* 22 */
+uint64_t rflags;  /* 23 */
+uint64_t rsp; /* 24 */
+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
+ */
+
+/*
+ * src/sys/arch/amd64/include/mcontext.h
+ *
+ * typedef struct {
+ *   __gregset_t __gregs;
+ *   __greg_t_mc_tlsbase;
+ *   __fpregset_t__fpregs;
+ * } mcontext_t;
+ */
+
+struct UserArea {
+GPR  gpr;
+uint64_t mc_tlsbase;
+FPR  fpr;
+};
+
+
+//---
+// 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*)NULL)->reg)
+
+// Number of bytes needed to represent the i'th FP register.
+#define FP_SIZE sizeof(((MMSReg*)NULL)->bytes)
+
+// 

Re: [Lldb-commits] [PATCH] D16508: NetBSD: Define initial RegisterContextNetBSD_x86_64

2016-01-28 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Thank you @clayborg and @tfiala I'm processing your feedback. In case of 
further questions I will let you know.

Your answers make the things more clear.


Repository:
  rL LLVM

http://reviews.llvm.org/D16508



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


Re: [Lldb-commits] [PATCH] D16508: NetBSD: Define initial RegisterContextNetBSD_x86_64

2016-01-26 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

Thank you @clayborg for your notes. I'm planning to submit new version in the 
coming days.


Repository:
  rL LLVM

http://reviews.llvm.org/D16508



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


Re: [Lldb-commits] [PATCH] D16508: NetBSD: Define initial RegisterContextNetBSD_x86_64

2016-01-24 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

It looks like UserArea will need to map this structure:

  typedef struct {
  __gregset_t __gregs;
  __greg_t_mc_tlsbase;
  __fpregset_t__fpregs;
  } mcontext_t;

- src/sys/arch/amd64/include/mcontext.h

https://github.com/IIJ-NetBSD/netbsd-src/blob/master/sys/arch/amd64/include/mcontext.h#L61

I'm thinking if I need to customize FPR as well:

  /*
   * Floating point register state
   * The format of __fpregset_t is that of the fxsave instruction
   * which requires 16 byte alignment. However the mcontext version
   * is never directly accessed.
   */
  typedef char __fpregset_t[512] __aligned(8);

https://github.com/IIJ-NetBSD/netbsd-src/blob/master/sys/arch/amd64/include/mcontext.h#L53

Joerg Sonnenberg (I forgot @login) wrote:

> I think you want to keep at least the mc_tlsbase field as well.

>  Access to __thread variables will need it.


This will be handled by new UserArea.

I will research if I can skip the definition of `struct DBG`, as currently 
there is no support for debug registers on NetBSD.


Repository:
  rL LLVM

http://reviews.llvm.org/D16508



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


Re: [Lldb-commits] [PATCH] D16508: NetBSD: Define initial RegisterContextNetBSD_x86_64

2016-01-23 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

I had difficulties with this code, as each platform implements it differently.

What is DBG? What should be there?

What is UserArea? What should be there?


Repository:
  rL LLVM

http://reviews.llvm.org/D16508



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


Re: [Lldb-commits] [PATCH] D15067: Design building out of sources

2016-01-23 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

For the reference, I hold on with pushing this forward, till I will get 
significantly larger coverage with tests on my platform.

I keep this patch locally for local development.


Repository:
  rL LLVM

http://reviews.llvm.org/D15067



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


Re: [Lldb-commits] [PATCH] D16508: NetBSD: Define initial RegisterContextNetBSD_x86_64

2016-01-23 Thread Kamil Rytarowski via lldb-commits
krytarowski added a comment.

NetBSD currently doesn't support debug registers.


Repository:
  rL LLVM

http://reviews.llvm.org/D16508



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


Re: [Lldb-commits] [PATCH] D15566: Patch cmake to allow detection of python 2.7.9+

2015-12-16 Thread Kamil Rytarowski via lldb-commits
krytarowski added a subscriber: krytarowski.
krytarowski added a comment.

In http://reviews.llvm.org/D15566#311998, @zturner wrote:

> Where did you get this version of Python?  I don't see anything wrong with 
> this patch, but I'm a little curious what this + means


I think a patched version. I don't know what vendor is changing Python's 
version. Perhaps good to stop doing it if it breaks software.


Repository:
  rL LLVM

http://reviews.llvm.org/D15566



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


Re: [Lldb-commits] Buildbot numbers for week of 12/06/2015 - 12/12/2015

2015-12-16 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 15.12.2015 20:23, Galina Kistanova via lldb-commits wrote:
> Hello everyone,
> 
> Below are some buildbot numbers for the last week of 12/06/2015 - 
> 12/12/2015.
> 
> Thanks
> 
> Galina
> 
> 
> 
> Top 10 fastest builders(not docs):
> 
> lldb-amd64-ninja-freebsd11 clang-bpf-build 
> llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast 
> libomp-gcc-x86_64-linux-debian sanitizer-windows llvm-hexagon-elf 
> libcxx-libcxxabi-x86_64-linux-ubuntu-cxx11 
> libcxx-libcxxabi-singlethreaded-x86_64-linux-debian 
> libcxx-libcxxabi-x86_64-linux-debian-noexceptions 
> libcxx-libcxxabi-x86_64-linux-debian
> 
> 
> 10 most slow builders:
> 
> clang-native-arm-lnt-perf clang-atom-d525-fedora 
> clang-native-aarch64-full clang-cmake-thumbv7-a15-full-sh 
> clang-cmake-armv7-a15-selfhost-neon perf-x86_64-penryn-O3 
> clang-cmake-mipsel perf-x86_64-penryn-O3-polly llvm-mips-linux 
> clang-cmake-armv7-a15-selfhost
> 
> 


How these lists of 10 quickest and 10 slowest machines are helping out?

Usual !x86 machines will be always slower than Intel architecture
counter parts.

More interesting will be coverage of the code by OS, Architecture,
ABI, Instruction set etc. Personally I don't care if arm, mips, s390x
or powerpc builds Clang in 1h or 12h - I'm happy they are there at all.

> 
> Number of commits by project:
> 
> project   |   commits 
> ---+--- llvm  |
> 258 lldb  |90 cfe   |
> 89 compiler-rt   |45 lld   |
> 21 libcxx| 6 polly |
> 3 openmp| 3 clang-tools-extra |
> 3 libcxxabi | 1 libunwind |
> 1 --- 520
> 
> 
> Number of completed builds, failed builds and average build time
> for successful builds per active builder:
> 
> buildername   |
> completed | failed | time 
> ---+--
- --++
>
> 
clang-aarch64-lnt | 51
> |  4 | 02:31:19 clang-atom-d525-fedora
> | 15 || 08:58:01 clang-atom-d525-fedora-rel
> | 49 |  2 | 02:21:40 clang-bpf-build
> |272 | 12 | 00:03:10 clang-cmake-aarch64-42vma
> |213 | 24 | 00:19:38 clang-cmake-aarch64-full
> | 37 | 13 | 03:28:30 clang-cmake-aarch64-quick
> |168 |  9 | 00:27:25 clang-cmake-armv7-a15
> |150 | 10 | 00:31:57 clang-cmake-armv7-a15-full
> |118 |  1 | 00:50:50 clang-cmake-armv7-a15-selfhost
> | 28 |  2 | 04:37:24 
> clang-cmake-armv7-a15-selfhost-neon   |
> 21 |  2 | 06:17:58 clang-cmake-mips
> | 82 | 12 | 01:32:08 clang-cmake-mipsel
> | 12 |  1 | 06:00:38 clang-cmake-thumbv7-a15
> |161 |  8 | 00:31:53 
> clang-cmake-thumbv7-a15-full-sh   |
> 11 || 06:39:48 clang-hexagon-elf
> |206 | 72 | 00:17:15 clang-native-aarch64-full
> | 18 |  6 | 07:34:46 clang-native-arm-lnt
> | 44 || 01:15:44 clang-native-arm-lnt-perf
> |  7 || 10:33:02 clang-ppc64-elf-linux
> |100 |  7 | 01:04:00 clang-ppc64-elf-linux2
> | 72 |  3 | 01:33:52 clang-sphinx-docs
> | 97 |  1 | 00:00:22 clang-x64-ninja-win7
> |150 | 36 | 00:35:55 clang-x86-win2008-selfhost
> |102 | 17 | 01:03:28 
> clang-x86_64-darwin13-cross-arm   |
> 200 || 00:20:02 clang-x86_64-darwin13-cross-mingw32
> |186 |  1 | 00:23:37 clang-x86_64-debian-fast
> |119 |  7 | 00:12:34 clang-x86_64-linux-abi-test
> |276 |  2 | 00:16:22 
> clang-x86_64-linux-selfhost-modules   |
> 230 | 50 | 00:15:16 clang-x86_64-ubuntu-gdb-75
> |102 |  7 | 00:58:02 libcxx-libcxxabi-arm-linux
> |  5 || 01:07:24 
> libcxx-libcxxabi-singlethreaded-x86_64-linux-debian   |
> 5 || 00:08:22 libcxx-libcxxabi-x86_64-linux-debian
> |  5 || 00:08:45 
> libcxx-libcxxabi-x86_64-linux-debian-noexceptions |
> 4 || 00:08:28 libcxx-libcxxabi-x86_64-linux-ubuntu-asan
> |  5 || 00:14:23 
> libcxx-libcxxabi-x86_64-linux-ubuntu-cxx03|
> 5 || 00:09:01 
> libcxx-libcxxabi-x86_64-linux-ubuntu-cxx11|
> 5 || 00:08:08 
> libcxx-libcxxabi-x86_64-linux-ubuntu-cxx14|
> 6 || 00:09:43 
> libcxx-libcxxabi-x86_64-linux-ubuntu-cxx1z|
> 6 || 00:09:47 

Re: [Lldb-commits] [PATCH] D15482: Welcome to NetBSD signals

2015-12-14 Thread Kamil Rytarowski via lldb-commits
krytarowski added inline comments.


Comment at: source/Target/UnixSignals.cpp:66
@@ -64,4 +65,3 @@
 case llvm::Triple::FreeBSD:
 case llvm::Triple::OpenBSD:
 return std::make_shared();

emaste wrote:
> Not part of your change, but just spotted it during this review; The default 
> case should probably be used for OpenBSD. We can change it later.
I will leave it as it is.


Repository:
  rL LLVM

http://reviews.llvm.org/D15482



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


Re: [Lldb-commits] [PATCH] D15482: Welcome to NetBSD signals

2015-12-14 Thread Kamil Rytarowski via lldb-commits
krytarowski updated this revision to Diff 42800.
krytarowski added a comment.

Improve abc order of source files


Repository:
  rL LLVM

http://reviews.llvm.org/D15482

Files:
  source/Plugins/Process/Utility/CMakeLists.txt
  source/Plugins/Process/Utility/NetBSDSignals.cpp
  source/Plugins/Process/Utility/NetBSDSignals.h
  source/Target/UnixSignals.cpp

Index: source/Target/UnixSignals.cpp
===
--- source/Target/UnixSignals.cpp
+++ source/Target/UnixSignals.cpp
@@ -19,6 +19,7 @@
 #include "Plugins/Process/Utility/FreeBSDSignals.h"
 #include "Plugins/Process/Utility/LinuxSignals.h"
 #include "Plugins/Process/Utility/MipsLinuxSignals.h"
+#include "Plugins/Process/Utility/NetBSDSignals.h"
 
 using namespace lldb_private;
 
@@ -63,8 +64,9 @@
 }
 case llvm::Triple::FreeBSD:
 case llvm::Triple::OpenBSD:
-case llvm::Triple::NetBSD:
 return std::make_shared();
+case llvm::Triple::NetBSD:
+return std::make_shared();
 default:
 return std::make_shared();
 }
Index: source/Plugins/Process/Utility/NetBSDSignals.h
===
--- /dev/null
+++ source/Plugins/Process/Utility/NetBSDSignals.h
@@ -0,0 +1,31 @@
+//===-- NetBSDSignals.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_NetBSDSignals_H_
+#define liblldb_NetBSDSignals_H_
+
+// Project includes
+#include "lldb/Target/UnixSignals.h"
+
+namespace lldb_private {
+
+/// NetBSD specific set of Unix signals.
+class NetBSDSignals : public UnixSignals
+{
+public:
+NetBSDSignals();
+
+private:
+void
+Reset() override;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_NetBSDSignals_H_
Index: source/Plugins/Process/Utility/NetBSDSignals.cpp
===
--- /dev/null
+++ source/Plugins/Process/Utility/NetBSDSignals.cpp
@@ -0,0 +1,34 @@
+//===-- NetBSDSignals.cpp --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "NetBSDSignals.h"
+
+using namespace lldb_private;
+
+NetBSDSignals::NetBSDSignals()
+: UnixSignals()
+{
+Reset();
+}
+
+void
+NetBSDSignals::Reset()
+{
+UnixSignals::Reset();
+//SIGNO  NAME  SUPPRESS STOP   NOTIFY DESCRIPTION
+//==    == == ===
+AddSignal (32,   "SIGPWR", false,   true , true , "power fail/restart (not reset when caught)");
+#ifdef SIGRTMIN /* SIGRTMAX */
+/* Kernel only; not exposed to userland yet */
+#endif
+}
Index: source/Plugins/Process/Utility/CMakeLists.txt
===
--- source/Plugins/Process/Utility/CMakeLists.txt
+++ source/Plugins/Process/Utility/CMakeLists.txt
@@ -9,6 +9,7 @@
   InferiorCallPOSIX.cpp
   LinuxSignals.cpp
   MipsLinuxSignals.cpp
+  NetBSDSignals.cpp
   RegisterContextDarwin_arm.cpp
   RegisterContextDarwin_arm64.cpp
   RegisterContextDarwin_i386.cpp
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r255592 - Welcome to NetBSD signals

2015-12-14 Thread Kamil Rytarowski via lldb-commits
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Sorry, only NetBSD around :-) (I'm ok to port xcode to it, perhaps it
might run with the Darwin compat layer..)

Thanks for fixing xcode.

I'm planning to land more NetBSD platform parts in the following days.

Keep tuned and thank you!

On 15.12.2015 03:43, Siva Chandra wrote:
> Ah, yes! Thank you.
> 
> On Mon, Dec 14, 2015 at 6:41 PM, Jim Ingham <jing...@apple.com>
> wrote:
>> I think Jason already did (r255597).
>> 
>> Jim
>> 
>>> On Dec 14, 2015, at 6:35 PM, Siva Chandra via lldb-commits
>>> <lldb-commits@lists.llvm.org> wrote:
>>> 
>>> On Mon, Dec 14, 2015 at 4:50 PM, Kamil Rytarowski via
>>> lldb-commits <lldb-commits@lists.llvm.org> wrote:
>>>> Author: kamil Date: Mon Dec 14 18:50:19 2015 New Revision:
>>>> 255592
>>>> 
>>>> Added: 
>>>> lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp 
>>>> lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h
>>> 
>>> Should these files be added to the xcode build? If yes, can
>>> someone help with this?
>>> 
>>>> Modified: 
>>>> lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt 
>>>> lldb/trunk/source/Target/UnixSignals.cpp
>>> ___ 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

iQIcBAEBCAAGBQJWb4OAAAoJEEuzCOmwLnZs5UoP/38XNH+tNaeY0rRmDtuY3x0i
YpXdF+/2NVbdvjpZggd2VjNg0QlKoXnxoMcBVQQsP6so06sBApY2rJZICqrp6hOR
SDOxCOf3L4dA62m0ylHXR8EmUFz5meUZwrfWDaAF2FlQUnKjNkk9EXJcBBcpBcbw
b+g0FGO+Z1dhfjPCWuc2sc/pVDoL/I1l1CUya5g2OaWX/V9+yJ2H1OMXG3N47ivR
gPYAu/L5Gs779GJ13AUXfTdynr+MZxIpDhzTgpRnbBin7+cWA4g1oD0HArwmOxzF
adpkuhozH9WT7Ay72rGLcH9WX1bnXBQp+pUlqwMyYrRTZQIlyUo6eD15xcxVj9bX
2YWnJvqYkdRCwceVJAc3dyUJ4SJymMrdb0K6FFRrPhGfVZOX+8rkYYtxjXPMP/Yk
R9KJaqFEyE5Hp+QmjpfsmdLb79mTNA+JEpasXzHfNdewqgSVfAJIxnrxmz5KUiEH
oCti+vRu0HReOBbO3ZMI8VN0fy+cvNm39m4BkcbfXcJplIMxjG9mfUm04QstujEA
bN+tZBB7o9j03sxM8O36ifyc7jeRn6DJytBy9Qij87s4w2iFHYMC5MHXzqmzmAtQ
FVffreqxKjjY6Q5QhjIJ/CewyULQvRbR4RpAefcAYkYPFboeo+/ZAV4KpGQuKPUE
nybiAlCRgCZ3tNoyi9vK
=MoxW
-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] D15482: Welcome to NetBSD signals

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

Thank you. After fixing the order I'm going to land this diff.



Comment at: source/Plugins/Process/Utility/CMakeLists.txt:6
@@ -5,2 +5,3 @@
   FreeBSDSignals.cpp
+  NetBSDSignals.cpp
   GDBRemoteSignals.cpp

emaste wrote:
> Should keep these in alpha order
Good catch.


Repository:
  rL LLVM

http://reviews.llvm.org/D15482



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


[Lldb-commits] [lldb] r255592 - Welcome to NetBSD signals

2015-12-14 Thread Kamil Rytarowski via lldb-commits
Author: kamil
Date: Mon Dec 14 18:50:19 2015
New Revision: 255592

URL: http://llvm.org/viewvc/llvm-project?rev=255592=rev
Log:
Welcome to NetBSD signals

Summary:
Signals 1-32 are matching the default UNIX platform.

There are platform specific ones above 32.

From the `/usr/include/sys/signal.h` header:

```
#define SIGPWR  32  /* power fail/restart (not reset when caught) */
#ifdef _KERNEL
#define SIGRTMIN33  /* Kernel only; not exposed to userland yet */
#define SIGRTMAX63  /* Kernel only; not exposed to userland yet */
#endif
```

Reviewers: emaste, joerg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D15482

Added:
lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp
lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h
Modified:
lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt
lldb/trunk/source/Target/UnixSignals.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt?rev=255592=255591=255592=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/Utility/CMakeLists.txt Mon Dec 14 
18:50:19 2015
@@ -9,6 +9,7 @@ add_lldb_library(lldbPluginProcessUtilit
   InferiorCallPOSIX.cpp
   LinuxSignals.cpp
   MipsLinuxSignals.cpp
+  NetBSDSignals.cpp
   RegisterContextDarwin_arm.cpp
   RegisterContextDarwin_arm64.cpp
   RegisterContextDarwin_i386.cpp

Added: lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp?rev=255592=auto
==
--- lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp (added)
+++ lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp Mon Dec 14 
18:50:19 2015
@@ -0,0 +1,34 @@
+//===-- NetBSDSignals.cpp --*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===--===//
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "NetBSDSignals.h"
+
+using namespace lldb_private;
+
+NetBSDSignals::NetBSDSignals()
+: UnixSignals()
+{
+Reset();
+}
+
+void
+NetBSDSignals::Reset()
+{
+UnixSignals::Reset();
+//SIGNO  NAME  SUPPRESS STOP   NOTIFY DESCRIPTION
+//==    == == 
===
+AddSignal (32,   "SIGPWR", false,   true , true , "power fail/restart 
(not reset when caught)");
+#ifdef SIGRTMIN /* SIGRTMAX */
+/* Kernel only; not exposed to userland yet */
+#endif
+}

Added: lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h?rev=255592=auto
==
--- lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h (added)
+++ lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h Mon Dec 14 
18:50:19 2015
@@ -0,0 +1,31 @@
+//===-- NetBSDSignals.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_NetBSDSignals_H_
+#define liblldb_NetBSDSignals_H_
+
+// Project includes
+#include "lldb/Target/UnixSignals.h"
+
+namespace lldb_private {
+
+/// NetBSD specific set of Unix signals.
+class NetBSDSignals : public UnixSignals
+{
+public:
+NetBSDSignals();
+
+private:
+void
+Reset() override;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_NetBSDSignals_H_

Modified: lldb/trunk/source/Target/UnixSignals.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/UnixSignals.cpp?rev=255592=255591=255592=diff
==
--- lldb/trunk/source/Target/UnixSignals.cpp (original)
+++ lldb/trunk/source/Target/UnixSignals.cpp Mon Dec 14 18:50:19 2015
@@ -19,6 +19,7 @@
 #include "Plugins/Process/Utility/FreeBSDSignals.h"
 #include "Plugins/Process/Utility/LinuxSignals.h"
 #include "Plugins/Process/Utility/MipsLinuxSignals.h"
+#include "Plugins/Process/Utility/NetBSDSignals.h"
 
 using namespace lldb_private;
 
@@ -63,8 +64,9 @@ UnixSignals::Create(const ArchSpec 
 }
 case 

  1   2   >