pkgsrc-WIP-changes archive

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

lldb-netbsd: Rebase patches to 293625 (5.0.0svn)



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Tue Jan 31 18:25:59 2017 +0100
Changeset:	a45e01754421ab99b76e331e9f3d2075ab52a4a8

Modified Files:
	lldb-netbsd/distinfo
	lldb-netbsd/patches/patch-cmake_LLDBDependencies.cmake
	lldb-netbsd/patches/patch-include_lldb_Host_netbsd_ProcessLauncherNetBSD.h
	lldb-netbsd/patches/patch-source_Commands_CommandObjectPlatform.cpp
	lldb-netbsd/patches/patch-source_Core_ConstString.cpp
	lldb-netbsd/patches/patch-source_Core_Debugger.cpp
	lldb-netbsd/patches/patch-source_Core_ModuleList.cpp
	lldb-netbsd/patches/patch-source_Host_CMakeLists.txt
	lldb-netbsd/patches/patch-source_Host_common_Editline.cpp
	lldb-netbsd/patches/patch-source_Host_common_Host.cpp
	lldb-netbsd/patches/patch-source_Host_common_HostInfoBase.cpp
	lldb-netbsd/patches/patch-source_Host_linux_HostInfoLinux.cpp
	lldb-netbsd/patches/patch-source_Host_netbsd_ProcessLauncherNetBSD.cpp
	lldb-netbsd/patches/patch-source_Host_windows_HostInfoWindows.cpp
	lldb-netbsd/patches/patch-source_Plugins_ExpressionParser_Clang_ClangModulesDeclVendor.cpp
	lldb-netbsd/patches/patch-source_Plugins_Language_CPlusPlus_CPlusPlusLanguage.cpp
	lldb-netbsd/patches/patch-source_Plugins_Language_Go_GoLanguage.cpp
	lldb-netbsd/patches/patch-source_Plugins_Language_Java_JavaLanguage.cpp
	lldb-netbsd/patches/patch-source_Plugins_Language_ObjC_ObjCLanguage.cpp
	lldb-netbsd/patches/patch-source_Plugins_Platform_MacOSX_PlatformDarwin.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_CMakeLists.txt
	lldb-netbsd/patches/patch-source_Plugins_Process_FreeBSD_ProcessFreeBSD.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_Linux_NativeProcessLinux.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_MacOSX-Kernel_ProcessKDP.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_POSIX_ProcessPOSIXLog.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_Windows_Common_ProcessWindows.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_Windows_Common_ProcessWindowsLog.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_elf-core_ProcessElfCore.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_gdb-remote_GDBRemoteCommunicationServerPlatform.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_gdb-remote_ProcessGDBRemote.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_gdb-remote_ProcessGDBRemoteLog.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_mach-core_ProcessMachCore.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_minidump_ProcessMinidump.cpp
	lldb-netbsd/patches/patch-source_Plugins_ScriptInterpreter_None_ScriptInterpreterNone.cpp
	lldb-netbsd/patches/patch-source_Plugins_ScriptInterpreter_Python_ScriptInterpreterPython.cpp
	lldb-netbsd/patches/patch-source_Plugins_SymbolFile_DWARF_SymbolFileDWARF.cpp
	lldb-netbsd/patches/patch-source_Symbol_ClangASTContext.cpp
	lldb-netbsd/patches/patch-source_Symbol_GoASTContext.cpp
	lldb-netbsd/patches/patch-source_Target_Language.cpp
	lldb-netbsd/patches/patch-tools_debugserver_source_MacOSX_DarwinLog_DarwinLogCollector.cpp
	lldb-netbsd/patches/patch-tools_lldb-server_CMakeLists.txt
Added Files:
	lldb-netbsd/patches/patch-CMakeLists.txt
	lldb-netbsd/patches/patch-NativeProcessNetBSD.cpp
	lldb-netbsd/patches/patch-NativeProcessNetBSD.h
	lldb-netbsd/patches/patch-NativeThreadNetBSD.cpp
	lldb-netbsd/patches/patch-NativeThreadNetBSD.h
	lldb-netbsd/patches/patch-source_Plugins_SymbolFile_DWARF_SymbolFileDWARF.h
Removed Files:
	lldb-netbsd/patches/patch-cmake_modules_AddLLDB.cmake
	lldb-netbsd/patches/patch-source_Host_netbsd_HostInfoNetBSD.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_CMakeLists.txt
	lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
	lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
	lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h
	lldb-netbsd/patches/patch-source_Plugins_Process_Utility_NetBSDSignals.cpp
	lldb-netbsd/patches/patch-tools_lldb-mi_MICmnBase.cpp
	lldb-netbsd/patches/patch-tools_lldb-mi_MICmnBase.h
	lldb-netbsd/patches/patch-tools_lldb-mi_MIDriver.cpp
	lldb-netbsd/patches/patch-tools_lldb-mi_MIUtilString.cpp
	lldb-netbsd/patches/patch-tools_lldb-mi_MIUtilString.h

Log Message:
lldb-netbsd: Rebase patches to 293625 (5.0.0svn)

Sponsored by <The NetBSD Foundation>

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=a45e01754421ab99b76e331e9f3d2075ab52a4a8

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

diffstat:
 lldb-netbsd/distinfo                               |   99 +-
 lldb-netbsd/patches/patch-CMakeLists.txt           |   16 +
 lldb-netbsd/patches/patch-NativeProcessNetBSD.cpp  | 1392 ++++++++++++++++++++
 lldb-netbsd/patches/patch-NativeProcessNetBSD.h    |  188 +++
 lldb-netbsd/patches/patch-NativeThreadNetBSD.cpp   |  393 ++++++
 lldb-netbsd/patches/patch-NativeThreadNetBSD.h     |   92 ++
 .../patches/patch-cmake_LLDBDependencies.cmake     |    2 +-
 .../patches/patch-cmake_modules_AddLLDB.cmake      |   17 -
 ...nclude_lldb_Host_netbsd_ProcessLauncherNetBSD.h |    2 +-
 ...patch-source_Commands_CommandObjectPlatform.cpp |    8 +-
 .../patches/patch-source_Core_ConstString.cpp      |   19 +-
 lldb-netbsd/patches/patch-source_Core_Debugger.cpp |    2 +-
 .../patches/patch-source_Core_ModuleList.cpp       |    7 +-
 .../patches/patch-source_Host_CMakeLists.txt       |    4 +-
 .../patches/patch-source_Host_common_Editline.cpp  |    4 +-
 .../patches/patch-source_Host_common_Host.cpp      |   30 +-
 .../patch-source_Host_common_HostInfoBase.cpp      |   36 +-
 .../patch-source_Host_linux_HostInfoLinux.cpp      |   12 +-
 .../patch-source_Host_netbsd_HostInfoNetBSD.cpp    |   28 -
 ...ch-source_Host_netbsd_ProcessLauncherNetBSD.cpp |    2 +-
 .../patch-source_Host_windows_HostInfoWindows.cpp  |   10 +-
 ...pressionParser_Clang_ClangModulesDeclVendor.cpp |   12 +-
 ...lugins_Language_CPlusPlus_CPlusPlusLanguage.cpp |   18 +-
 ...patch-source_Plugins_Language_Go_GoLanguage.cpp |   12 +-
 ...h-source_Plugins_Language_Java_JavaLanguage.cpp |   10 +-
 ...h-source_Plugins_Language_ObjC_ObjCLanguage.cpp |   10 +-
 ...urce_Plugins_Platform_MacOSX_PlatformDarwin.cpp |   12 +-
 .../patch-source_Plugins_Process_CMakeLists.txt    |    2 +-
 ...urce_Plugins_Process_FreeBSD_ProcessFreeBSD.cpp |   12 +-
 ...ce_Plugins_Process_Linux_NativeProcessLinux.cpp |    4 +-
 ...ce_Plugins_Process_MacOSX-Kernel_ProcessKDP.cpp |   12 +-
 ...ch-source_Plugins_Process_NetBSD_CMakeLists.txt |   13 -
 ..._Plugins_Process_NetBSD_NativeProcessNetBSD.cpp | 1392 --------------------
 ...ce_Plugins_Process_NetBSD_NativeProcessNetBSD.h |  188 ---
 ...e_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp |  393 ------
 ...rce_Plugins_Process_NetBSD_NativeThreadNetBSD.h |   92 --
 ...ource_Plugins_Process_POSIX_ProcessPOSIXLog.cpp |    9 +-
 ...ource_Plugins_Process_Utility_NetBSDSignals.cpp |   43 -
 ...ugins_Process_Windows_Common_ProcessWindows.cpp |   10 +-
 ...ns_Process_Windows_Common_ProcessWindowsLog.cpp |   10 +-
 ...rce_Plugins_Process_elf-core_ProcessElfCore.cpp |   10 +-
 ...remote_GDBRemoteCommunicationServerPlatform.cpp |   12 +-
 ...Plugins_Process_gdb-remote_ProcessGDBRemote.cpp |   12 +-
 ...gins_Process_gdb-remote_ProcessGDBRemoteLog.cpp |   10 +-
 ...e_Plugins_Process_mach-core_ProcessMachCore.cpp |   11 +-
 ...ce_Plugins_Process_minidump_ProcessMinidump.cpp |   10 +-
 ...criptInterpreter_None_ScriptInterpreterNone.cpp |    9 +-
 ...tInterpreter_Python_ScriptInterpreterPython.cpp |   10 +-
 ...ce_Plugins_SymbolFile_DWARF_SymbolFileDWARF.cpp |   39 +-
 ...urce_Plugins_SymbolFile_DWARF_SymbolFileDWARF.h |   12 +
 .../patch-source_Symbol_ClangASTContext.cpp        |    2 +-
 .../patches/patch-source_Symbol_GoASTContext.cpp   |    9 +-
 .../patches/patch-source_Target_Language.cpp       |    9 +-
 ..._source_MacOSX_DarwinLog_DarwinLogCollector.cpp |   17 +-
 .../patches/patch-tools_lldb-mi_MICmnBase.cpp      |   13 -
 .../patches/patch-tools_lldb-mi_MICmnBase.h        |   13 -
 .../patches/patch-tools_lldb-mi_MIDriver.cpp       |   13 -
 .../patches/patch-tools_lldb-mi_MIUtilString.cpp   |   13 -
 .../patches/patch-tools_lldb-mi_MIUtilString.h     |   13 -
 .../patches/patch-tools_lldb-server_CMakeLists.txt |    4 +-
 60 files changed, 2248 insertions(+), 2610 deletions(-)

diffs:
diff --git a/lldb-netbsd/distinfo b/lldb-netbsd/distinfo
index 2ad7311..f54cb4f 100644
--- a/lldb-netbsd/distinfo
+++ b/lldb-netbsd/distinfo
@@ -12,66 +12,59 @@ Size (libcxx-3.6.2.src.tar.xz) = 944020 bytes
 SHA1 (llvm-3.6.2.src.tar.xz) = 7a00257eb2bc9431e4c77c3a36b033072c54bc7e
 RMD160 (llvm-3.6.2.src.tar.xz) = 521cbc5fe2925ea3c6e90c7a31f752a04045c972
 Size (llvm-3.6.2.src.tar.xz) = 12802380 bytes
-SHA1 (patch-cmake_LLDBDependencies.cmake) = 81673d8624ca7a9ad60bcaf530587fbfbd695dca
-SHA1 (patch-cmake_modules_AddLLDB.cmake) = 39de9d6ff91641b9c625dbb95c2618f336be28c4
+SHA1 (patch-CMakeLists.txt) = c32acbd129892af26103907b6d1e8727ba27ee18
+SHA1 (patch-NativeProcessNetBSD.cpp) = 5ab447d6074d0e121e7bbebe73e79a6154fcc380
+SHA1 (patch-NativeProcessNetBSD.h) = e19d9c9b89f87a0bbe9c95729458b851df266f25
+SHA1 (patch-NativeThreadNetBSD.cpp) = ce068afa0377491a6675bad1e8f010e77c7e087a
+SHA1 (patch-NativeThreadNetBSD.h) = c649705780c7148df22807c1f5d1dae7aa8581dc
+SHA1 (patch-cmake_LLDBDependencies.cmake) = 2577a759167675d3a89915bebad05c8159798e8a
 SHA1 (patch-include_lldb_Core_Debugger.h) = 20d7995866bfe129ab532e470509d8ff9f4ebdea
 SHA1 (patch-include_lldb_Host_netbsd_HostThreadNetBSD.h) = 79f207cdb9da2ef57d39eeb307ec6d10cf828925
-SHA1 (patch-include_lldb_Host_netbsd_ProcessLauncherNetBSD.h) = fe65d50b595974e69ec9bd331dda30abfd3482dd
+SHA1 (patch-include_lldb_Host_netbsd_ProcessLauncherNetBSD.h) = 2c5f99e7c60f683942cee45b55e52042bcecc2f2
 SHA1 (patch-source_CMakeLists.txt) = 5dacabc3f39c23bdfd432b5a4895866157b97aa0
-SHA1 (patch-source_Commands_CommandObjectPlatform.cpp) = 41efff0af1f21e42dc7c6291e12698a3585ad743
-SHA1 (patch-source_Core_ConstString.cpp) = 97165809067ed09aeb42395fa352bf7b14cd5afb
-SHA1 (patch-source_Core_Debugger.cpp) = 1548c96130453b7d9623def91057384230cc4ac5
-SHA1 (patch-source_Core_ModuleList.cpp) = 2697f6d2c181fe602a56e9fd471f0345c838e0de
-SHA1 (patch-source_Host_CMakeLists.txt) = b7b5fbf2354e05c33c63bf47ffa1ef58f58727ef
-SHA1 (patch-source_Host_common_Editline.cpp) = 33d356079c71e78abe423b338fd5dedbfa2d1c15
-SHA1 (patch-source_Host_common_Host.cpp) = 4d9b4f9ef3c2600c46e5f5d5f1f11aa59f15e87f
-SHA1 (patch-source_Host_common_HostInfoBase.cpp) = 42919cd2d5ed702b2930716114efba81951421c6
+SHA1 (patch-source_Commands_CommandObjectPlatform.cpp) = c578e1b7e787a92b453b343ac8b63583f47585f7
+SHA1 (patch-source_Core_ConstString.cpp) = e79f25d82a90afa3d8a75098d66cab15c13d799f
+SHA1 (patch-source_Core_Debugger.cpp) = 6b284cafa93a30d3ea5d4f88478efb0ada659249
+SHA1 (patch-source_Core_ModuleList.cpp) = ff470cfe29d4702d5be6c5a096d5a8db700547e7
+SHA1 (patch-source_Host_CMakeLists.txt) = 497dcdc995139f6737543a833a8259cc9ff4de24
+SHA1 (patch-source_Host_common_Editline.cpp) = 6bc60cc72e5a6148add175cb276bb445bb3ee0f5
+SHA1 (patch-source_Host_common_Host.cpp) = 18d82f284eaa91ce0fd61c17f7da0a84f5800fa2
+SHA1 (patch-source_Host_common_HostInfoBase.cpp) = 402e11c3c8775ba993159cb27c30b2ed9fa82076
 SHA1 (patch-source_Host_common_NativeProcessProtocol.cpp) = 23cc7da280b2123cf0206f3d5660d2647935edbc
-SHA1 (patch-source_Host_linux_HostInfoLinux.cpp) = 87c56f543d8ced086439db729d1d06cf3667d6b1
-SHA1 (patch-source_Host_netbsd_HostInfoNetBSD.cpp) = fd4035ec03f08ebba0c9f81e5a05939da436ec58
+SHA1 (patch-source_Host_linux_HostInfoLinux.cpp) = fb375b959fe0f08c9e888194c58af356edeee441
 SHA1 (patch-source_Host_netbsd_HostThreadNetBSD.cpp) = a1b0fbdad062309a845cfefe4469614fbbe9d20e
-SHA1 (patch-source_Host_netbsd_ProcessLauncherNetBSD.cpp) = 8f2999d3c57bb2776b048e112ec6b800fb0cea20
+SHA1 (patch-source_Host_netbsd_ProcessLauncherNetBSD.cpp) = a1bc51e9f2d20ee207e800f255a8ca13ea0509bc
 SHA1 (patch-source_Host_netbsd_ThisThread.cpp) = f0d32c81bc1b8fe9aeb86519ea46ba2cb16571c2
-SHA1 (patch-source_Host_windows_HostInfoWindows.cpp) = c6e2b33793ad465185658980233eaf65006ae7e1
+SHA1 (patch-source_Host_windows_HostInfoWindows.cpp) = 73be6130bfc54bde057c23eee23aecd09c200b8d
 SHA1 (patch-source_Initialization_SystemInitializerCommon.cpp) = 80c850b980fe2902f10e441df7a18f428dd1154a
-SHA1 (patch-source_Plugins_ExpressionParser_Clang_ClangModulesDeclVendor.cpp) = d7b20ebdc172d2943ee223a22d142bbee438225c
-SHA1 (patch-source_Plugins_Language_CPlusPlus_CPlusPlusLanguage.cpp) = 5f97ef77b852ded977b5f837529c5b77aa7f9cda
-SHA1 (patch-source_Plugins_Language_Go_GoLanguage.cpp) = 74ff151f0ce3a773a033ba8298a413db2ae17128
-SHA1 (patch-source_Plugins_Language_Java_JavaLanguage.cpp) = f7814e3ffe7a707b0ed67f8936fc2615e55be907
-SHA1 (patch-source_Plugins_Language_ObjC_ObjCLanguage.cpp) = 7e80af39a9e2f7bb293c774a3a2fd081acc1eae4
+SHA1 (patch-source_Plugins_ExpressionParser_Clang_ClangModulesDeclVendor.cpp) = a7f61c10f28fdc3280fdd81b2719f014e854c4fa
+SHA1 (patch-source_Plugins_Language_CPlusPlus_CPlusPlusLanguage.cpp) = 5cb3541392d313714c23b737bbaa12cafe8d7c93
+SHA1 (patch-source_Plugins_Language_Go_GoLanguage.cpp) = bc470b574171eb46036eac90c977ce4cadcaefb6
+SHA1 (patch-source_Plugins_Language_Java_JavaLanguage.cpp) = b894be0215a1079c81db4d65ccedc7798369f93a
+SHA1 (patch-source_Plugins_Language_ObjC_ObjCLanguage.cpp) = 8b3e09479f8d242c3e6bf16129206aa1474b9366
 SHA1 (patch-source_Plugins_Platform_MacOSX_PlatformAppleSimulator.cpp) = 70955caefbeeae6f938337bc35aac8cc57a143b7
-SHA1 (patch-source_Plugins_Platform_MacOSX_PlatformDarwin.cpp) = 4526689abb29e3736a58023deb67dcf0f4194dce
+SHA1 (patch-source_Plugins_Platform_MacOSX_PlatformDarwin.cpp) = 99761cb3d3dd3bf7786dace0ef7b7178c4ca12b1
 SHA1 (patch-source_Plugins_Platform_NetBSD_PlatformNetBSD.cpp) = 129e853c1f93f063a0d30c737bcd82e3e589539b
 SHA1 (patch-source_Plugins_Platform_NetBSD_PlatformNetBSD.h) = 4327a21e79378b8f35adb07614adb41c37bbaf61
-SHA1 (patch-source_Plugins_Process_CMakeLists.txt) = c0168f81da56d9896eb414e6b8bb7262de04ac33
-SHA1 (patch-source_Plugins_Process_FreeBSD_ProcessFreeBSD.cpp) = 88979d77c473c903e514e8907961cb30e0fd5289
-SHA1 (patch-source_Plugins_Process_Linux_NativeProcessLinux.cpp) = 09607391fd890b50c6d96d94ac17203611d03a79
-SHA1 (patch-source_Plugins_Process_MacOSX-Kernel_ProcessKDP.cpp) = f6e315807e5ae0b2df706356cf8ddd7a2b914601
-SHA1 (patch-source_Plugins_Process_NetBSD_CMakeLists.txt) = df17afdf71c29d945c887e318718904793cd48ad
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp) = 46ca5bd672a87e9af6eef44989ead304b542f518
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h) = bdd9fe37e47de8fa626c7eacf81e07d47a76787c
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp) = a92c655c447cc0829fdb48786f474929f09e1a71
-SHA1 (patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h) = d251c4f1b52089f96d435a99f45353aa3992924a
-SHA1 (patch-source_Plugins_Process_POSIX_ProcessPOSIXLog.cpp) = 263b02c4f1be986ac6806e4575d73bbd212579f5
-SHA1 (patch-source_Plugins_Process_Utility_NetBSDSignals.cpp) = fe27031d3b496d91b8f55500a905d067a726eea0
-SHA1 (patch-source_Plugins_Process_Windows_Common_ProcessWindows.cpp) = 18b9d17ad1ec21410734bd47b957e5a3a61302a1
-SHA1 (patch-source_Plugins_Process_Windows_Common_ProcessWindowsLog.cpp) = 24f6d9139e137a47fb8faad51cb919817897dd3f
-SHA1 (patch-source_Plugins_Process_elf-core_ProcessElfCore.cpp) = b4cb6dfb073a336b7ce8d26a9c9f7bddd44699ee
-SHA1 (patch-source_Plugins_Process_gdb-remote_GDBRemoteCommunicationServerPlatform.cpp) = 3282168834ca689c4b2b3a022ab2e4320772eec4
-SHA1 (patch-source_Plugins_Process_gdb-remote_ProcessGDBRemote.cpp) = a801891e542934ffe39d837d50fc8d7316774a8e
-SHA1 (patch-source_Plugins_Process_gdb-remote_ProcessGDBRemoteLog.cpp) = 7e6877baa38faf81130e403e98452a505d940f54
-SHA1 (patch-source_Plugins_Process_mach-core_ProcessMachCore.cpp) = 5660588507f211005f2f866784cc5f5cc86af7bf
-SHA1 (patch-source_Plugins_Process_minidump_ProcessMinidump.cpp) = cab0af49ee18dd69cc66b92d20f6c2defae92dae
-SHA1 (patch-source_Plugins_ScriptInterpreter_None_ScriptInterpreterNone.cpp) = e24000a7a5a959c40a54c9623e5c2edb3cd4fea9
-SHA1 (patch-source_Plugins_ScriptInterpreter_Python_ScriptInterpreterPython.cpp) = f05df4842751fa76a358723b970a5050fb2c39da
-SHA1 (patch-source_Plugins_SymbolFile_DWARF_SymbolFileDWARF.cpp) = 2ca5f09c2d9e03e6c6178b3ec7891b9cc5198287
-SHA1 (patch-source_Symbol_ClangASTContext.cpp) = dd20092f80ddad807cb6a9bbbf985693d3de5ba9
-SHA1 (patch-source_Symbol_GoASTContext.cpp) = 4b03354c97a15c312d507e409aac4138b4dd67f9
-SHA1 (patch-source_Target_Language.cpp) = 409a1ee2dfe6677e383c6ceea735740b2b71c98e
-SHA1 (patch-tools_debugserver_source_MacOSX_DarwinLog_DarwinLogCollector.cpp) = 74d920b49333f79a0a48b003192833ced3862e5d
-SHA1 (patch-tools_lldb-mi_MICmnBase.cpp) = 851c82ac61e1241018755fbd7236af00379ac986
-SHA1 (patch-tools_lldb-mi_MICmnBase.h) = f550d5e10bcf02fb46472733acdbb820791f22e5
-SHA1 (patch-tools_lldb-mi_MIDriver.cpp) = bf1b5399e82bcfe54d6d852f64ed155328f2064d
-SHA1 (patch-tools_lldb-mi_MIUtilString.cpp) = 200d9712753b5559da79c2e16fa0889fea1e9432
-SHA1 (patch-tools_lldb-mi_MIUtilString.h) = 7e7befec383f88502a97aec509ba39477efde37d
-SHA1 (patch-tools_lldb-server_CMakeLists.txt) = 39a390a7598bc0028a8a93cb512af2050ee7718f
+SHA1 (patch-source_Plugins_Process_CMakeLists.txt) = c689ff4ec455234f8d506dc9eb8e0ed7f750d426
+SHA1 (patch-source_Plugins_Process_FreeBSD_ProcessFreeBSD.cpp) = 125cf947d59593d7be7dd90419a1e8f89104b4fc
+SHA1 (patch-source_Plugins_Process_Linux_NativeProcessLinux.cpp) = d260fdfdc464b1bfb1822e9be17c04480b0d2af4
+SHA1 (patch-source_Plugins_Process_MacOSX-Kernel_ProcessKDP.cpp) = 2f4e5859d80f8b0e55554eeb8955bf482cb04b57
+SHA1 (patch-source_Plugins_Process_POSIX_ProcessPOSIXLog.cpp) = 8821c2c0a64e43cbb80434ab3a2ed91d33607c3a
+SHA1 (patch-source_Plugins_Process_Windows_Common_ProcessWindows.cpp) = 819ea02c833cd80ae2c749accd0f74e6ff95b8bc
+SHA1 (patch-source_Plugins_Process_Windows_Common_ProcessWindowsLog.cpp) = 4baf3afe84d6689c554c5708cabd83d196266b36
+SHA1 (patch-source_Plugins_Process_elf-core_ProcessElfCore.cpp) = dff1a42d1ef11956cd26d16881a772c8c3e15011
+SHA1 (patch-source_Plugins_Process_gdb-remote_GDBRemoteCommunicationServerPlatform.cpp) = b9fe1cac11219549e33397353393fd9ce60e9a2b
+SHA1 (patch-source_Plugins_Process_gdb-remote_ProcessGDBRemote.cpp) = 03e085ae30119c0081944800137c1321bef3ad40
+SHA1 (patch-source_Plugins_Process_gdb-remote_ProcessGDBRemoteLog.cpp) = 69386fbf89dfa55ca90d024b648a8b7cb7bd5ca5
+SHA1 (patch-source_Plugins_Process_mach-core_ProcessMachCore.cpp) = c4662ce90748668c61e61bdf3be23676577a750f
+SHA1 (patch-source_Plugins_Process_minidump_ProcessMinidump.cpp) = 0f275d25be7db7f38bfcf55fad6690507be20ffd
+SHA1 (patch-source_Plugins_ScriptInterpreter_None_ScriptInterpreterNone.cpp) = 641daf2e5b97fe216b66b1ae40f176dca7c9771c
+SHA1 (patch-source_Plugins_ScriptInterpreter_Python_ScriptInterpreterPython.cpp) = 6c9a61972e640756bb8e1fbb14329a04961a28db
+SHA1 (patch-source_Plugins_SymbolFile_DWARF_SymbolFileDWARF.cpp) = 88d298fabaf94cedef24cb2a1e880815a65ca88f
+SHA1 (patch-source_Plugins_SymbolFile_DWARF_SymbolFileDWARF.h) = be1f74bfa4bd3b1ab2ce1760d6e375ccd53c1292
+SHA1 (patch-source_Symbol_ClangASTContext.cpp) = 0148bcb2ff278fc76f87320085af712fe033c208
+SHA1 (patch-source_Symbol_GoASTContext.cpp) = f6ea8faca07b6ac41e9d42341ed0f56b33ebfb7c
+SHA1 (patch-source_Target_Language.cpp) = 11f75093db8373193558a0ae484c57ee2fefd44d
+SHA1 (patch-tools_debugserver_source_MacOSX_DarwinLog_DarwinLogCollector.cpp) = fb52ca3a5f1aa6763b689c1692718248ad871c6f
+SHA1 (patch-tools_lldb-server_CMakeLists.txt) = 7a25edbff78d8091fa907b01c2c01c3e51579c15
diff --git a/lldb-netbsd/patches/patch-CMakeLists.txt b/lldb-netbsd/patches/patch-CMakeLists.txt
new file mode 100644
index 0000000..21b3099
--- /dev/null
+++ b/lldb-netbsd/patches/patch-CMakeLists.txt
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- CMakeLists.txt.orig	2017-01-31 17:20:58.000000000 +0000
++++ CMakeLists.txt
+@@ -1,3 +1,11 @@
++include_directories(.)
++include_directories(../POSIX)
++include_directories(../Utility)
++
++add_lldb_library(lldbPluginProcessNetBSD
++  NativeProcessNetBSD.cpp
++  NativeThreadNetBSD.cpp
++  )
+ cmake_minimum_required(VERSION 3.4.3)
+ 
+ include(cmake/modules/LLDBStandalone.cmake)
diff --git a/lldb-netbsd/patches/patch-NativeProcessNetBSD.cpp b/lldb-netbsd/patches/patch-NativeProcessNetBSD.cpp
new file mode 100644
index 0000000..1cc3a55
--- /dev/null
+++ b/lldb-netbsd/patches/patch-NativeProcessNetBSD.cpp
@@ -0,0 +1,1392 @@
+$NetBSD$
+
+--- NativeProcessNetBSD.cpp.orig	2017-01-31 17:49:05.519192818 +0000
++++ NativeProcessNetBSD.cpp
+@@ -0,0 +1,1387 @@
++//===-- 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
++#include <errno.h>
++#include <stdint.h>
++#include <string.h>
++#include <unistd.h>
++
++// C++ Includes
++#include <fstream>
++#include <mutex>
++#include <sstream>
++#include <string>
++#include <unordered_map>
++
++
++// Other libraries and framework includes
++#include "lldb/Core/EmulateInstruction.h"
++#include "lldb/Core/Error.h"
++#include "lldb/Core/ModuleSpec.h"
++#include "lldb/Core/RegisterValue.h"
++#include "lldb/Core/State.h"
++#include "lldb/Host/Host.h"
++#include "lldb/Host/HostProcess.h"
++#include "lldb/Host/ThreadLauncher.h"
++#include "lldb/Host/common/NativeBreakpoint.h"
++#include "lldb/Host/common/NativeRegisterContext.h"
++#include "lldb/Host/netbsd/ProcessLauncherNetBSD.h"
++#include "lldb/Symbol/ObjectFile.h"
++#include "lldb/Target/Process.h"
++#include "lldb/Target/ProcessLaunchInfo.h"
++#include "lldb/Target/Target.h"
++#include "lldb/Utility/LLDBAssert.h"
++#include "lldb/Utility/PseudoTerminal.h"
++#include "lldb/Utility/StringExtractor.h"
++
++#include "NativeThreadNetBSD.h"
++#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
++#include <sys/socket.h>
++
++#include <sys/ptrace.h>
++#include <sys/syscall.h>
++#include <sys/types.h>
++#include <sys/user.h>
++#include <sys/wait.h>
++
++using namespace lldb;
++using namespace lldb_private;
++using namespace lldb_private::process_netbsd;
++using namespace llvm;
++
++namespace {
++void MaybeLogLaunchInfo(const ProcessLaunchInfo &info) {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
++  if (!log)
++    return;
++
++  if (const FileAction *action = info.GetFileActionForFD(STDIN_FILENO))
++    log->Printf("%s: setting STDIN to '%s'", __FUNCTION__,
++                action->GetFileSpec().GetCString());
++  else
++    log->Printf("%s leaving STDIN as is", __FUNCTION__);
++
++  if (const FileAction *action = info.GetFileActionForFD(STDOUT_FILENO))
++    log->Printf("%s setting STDOUT to '%s'", __FUNCTION__,
++                action->GetFileSpec().GetCString());
++  else
++    log->Printf("%s leaving STDOUT as is", __FUNCTION__);
++
++  if (const FileAction *action = info.GetFileActionForFD(STDERR_FILENO))
++    log->Printf("%s setting STDERR to '%s'", __FUNCTION__,
++                action->GetFileSpec().GetCString());
++  else
++    log->Printf("%s leaving STDERR as is", __FUNCTION__);
++
++  int i = 0;
++  for (const char **args = info.GetArguments().GetConstArgumentVector(); *args;
++       ++args, ++i)
++    log->Printf("%s arg %d: \"%s\"", __FUNCTION__, i,
++                *args ? *args : "nullptr");
++}
++
++void DisplayBytes(StreamString &s, void *bytes, uint32_t count) {
++  uint8_t *ptr = (uint8_t *)bytes;
++  const uint32_t loop_count = count;
++  for (uint32_t i = 0; i < loop_count; i++) {
++    s.Printf("[%x]", *ptr);
++    ptr++;
++  }
++}
++
++void PtraceDisplayBytes(int &req, void *addr, int data) {
++  StreamString buf;
++  Log *verbose_log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(
++      POSIX_LOG_PTRACE | POSIX_LOG_VERBOSE));
++
++  if (verbose_log) {
++    switch (req) {
++    case PT_WRITE_I: {
++      DisplayBytes(buf, &data, sizeof(int));
++      verbose_log->Printf("PT_WRITE_I %s", buf.GetData());
++      break;
++    }
++    case PT_WRITE_D: {
++      DisplayBytes(buf, &data, sizeof(int));
++      verbose_log->Printf("PT_WRITE_I %s", buf.GetData());
++      break;
++    }
++#ifdef PT_SETREGS
++    case PT_SETREGS: {
++      DisplayBytes(buf, addr, sizeof(struct reg));
++      verbose_log->Printf("PT_SETREGS %s", buf.GetData());
++      break;
++    }
++#endif
++#ifdef PT_SETFPREGS
++    case PT_SETFPREGS: {
++      DisplayBytes(buf, addr, sizeof(struct fpreg));
++      verbose_log->Printf("PT_SETFPREGS %s", buf.GetData());
++      break;
++    }
++#endif
++#ifdef PT_SETXMMREGS
++    case PT_SETXMMREGS: {
++      DisplayBytes(buf, addr, sizeof(struct xmmregs));
++      verbose_log->Printf("PT_SETXMMREGS %s", buf.GetData());
++      break;
++    }
++#endif
++#ifdef PT_SETVECREGS
++    case PT_SETVECREGS: {
++      DisplayBytes(buf, addr, sizeof(struct vreg));
++      verbose_log->Printf("PT_SETVECREGS %s", buf.GetData());
++      break;
++    }
++#endif
++    default: {}
++    }
++  }
++}
++
++static constexpr unsigned k_ptrace_word_size = sizeof(void *);
++static_assert(sizeof(long) >= k_ptrace_word_size,
++              "Size of long must be larger than ptrace word size");
++} // end of anonymous namespace
++
++// Simple helper function to ensure flags are enabled on the given file
++// descriptor.
++static Error EnsureFDFlags(int fd, int flags) {
++  Error error;
++
++  int status = fcntl(fd, F_GETFL);
++  if (status == -1) {
++    error.SetErrorToErrno();
++    return error;
++  }
++
++  if (fcntl(fd, F_SETFL, status | flags) == -1) {
++    error.SetErrorToErrno();
++    return error;
++  }
++
++  return error;
++}
++
++// -----------------------------------------------------------------------------
++// Public Static Methods
++// -----------------------------------------------------------------------------
++
++Error NativeProcessProtocol::Launch(
++    ProcessLaunchInfo &launch_info,
++    NativeProcessProtocol::NativeDelegate &native_delegate, MainLoop &mainloop,
++    NativeProcessProtocolSP &native_process_sp) {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
++
++  Error error;
++
++  // Verify the working directory is valid if one was specified.
++  FileSpec working_dir{launch_info.GetWorkingDirectory()};
++  if (working_dir &&
++      (!working_dir.ResolvePath() ||
++       working_dir.GetFileType() != FileSpec::eFileTypeDirectory)) {
++    error.SetErrorStringWithFormat("No such file or directory: %s",
++                                   working_dir.GetCString());
++    return error;
++  }
++
++  // Create the NativeProcessNetBSD in launch mode.
++  native_process_sp.reset(new NativeProcessNetBSD());
++
++  if (!native_process_sp->RegisterNativeDelegate(native_delegate)) {
++    native_process_sp.reset();
++    error.SetErrorStringWithFormat("failed to register the native delegate");
++    return error;
++  }
++
++  error = std::static_pointer_cast<NativeProcessNetBSD>(native_process_sp)
++              ->LaunchInferior(mainloop, launch_info);
++
++  if (error.Fail()) {
++    native_process_sp.reset();
++    if (log)
++      log->Printf("NativeProcessNetBSD::%s failed to launch process: %s",
++                  __FUNCTION__, error.AsCString());
++    return error;
++  }
++
++  launch_info.SetProcessID(native_process_sp->GetID());
++
++  return error;
++}
++
++Error NativeProcessProtocol::Attach(
++    lldb::pid_t pid, NativeProcessProtocol::NativeDelegate &native_delegate,
++    MainLoop &mainloop, NativeProcessProtocolSP &native_process_sp) {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
++  if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))
++    log->Printf("NativeProcessNetBSD::%s(pid = %" PRIi64 ")", __FUNCTION__, pid);
++
++  // Retrieve the architecture for the running process.
++  ArchSpec process_arch;
++  Error error = ResolveProcessArchitecture(pid, process_arch);
++  if (!error.Success())
++    return error;
++
++  std::shared_ptr<NativeProcessNetBSD> native_process_netbsd_sp(
++      new NativeProcessNetBSD());
++
++  if (!native_process_netbsd_sp->RegisterNativeDelegate(native_delegate)) {
++    error.SetErrorStringWithFormat("failed to register the native delegate");
++    return error;
++  }
++
++  native_process_netbsd_sp->AttachToInferior(mainloop, pid, error);
++  if (!error.Success())
++    return error;
++
++  native_process_sp = native_process_netbsd_sp;
++  return error;
++}
++
++// -----------------------------------------------------------------------------
++// Public Instance Methods
++// -----------------------------------------------------------------------------
++
++NativeProcessNetBSD::NativeProcessNetBSD()
++    : NativeProcessProtocol(LLDB_INVALID_PROCESS_ID), m_arch(),
++      m_supports_mem_region(eLazyBoolCalculate), m_mem_region_cache(),
++      m_pending_notification_tid(LLDB_INVALID_THREAD_ID) {}
++
++void NativeProcessNetBSD::AttachToInferior(MainLoop &mainloop, lldb::pid_t pid,
++                                          Error &error) {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
++  if (log)
++    log->Printf("NativeProcessNetBSD::%s (pid = %" PRIi64 ")", __FUNCTION__,
++                pid);
++
++  m_sigchld_handle = mainloop.RegisterSignal(
++      SIGCHLD, [this](MainLoopBase &) { SigchldHandler(); }, error);
++  if (!m_sigchld_handle)
++    return;
++
++  error = ResolveProcessArchitecture(pid, m_arch);
++  if (!error.Success())
++    return;
++
++  // Set the architecture to the exe architecture.
++  if (log)
++    log->Printf("NativeProcessNetBSD::%s (pid = %" PRIi64
++                ") detected architecture %s",
++                __FUNCTION__, pid, m_arch.GetArchitectureName());
++
++  m_pid = pid;
++  SetState(eStateAttaching);
++
++  Attach(pid, error);
++}
++
++Error NativeProcessNetBSD::LaunchInferior(MainLoop &mainloop,
++                                         ProcessLaunchInfo &launch_info) {
++  Error error;
++  m_sigchld_handle = mainloop.RegisterSignal(
++      SIGCHLD, [this](MainLoopBase &) { SigchldHandler(); }, error);
++  if (!m_sigchld_handle)
++    return error;
++
++  SetState(eStateLaunching);
++
++  MaybeLogLaunchInfo(launch_info);
++
++  ::pid_t pid =
++      ProcessLauncherNetBSD().LaunchProcess(launch_info, error).GetProcessId();
++  if (error.Fail())
++    return error;
++
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
++
++  // Wait for the child process to trap on its call to execve.
++  ::pid_t wpid;
++  int status;
++  if ((wpid = waitpid(pid, &status, 0)) < 0) {
++    error.SetErrorToErrno();
++    if (log)
++      log->Printf("NativeProcessNetBSD::%s waitpid for inferior failed with %s",
++                  __FUNCTION__, error.AsCString());
++
++    // Mark the inferior as invalid.
++    // FIXME this could really use a new state - eStateLaunchFailure.  For now,
++    // using eStateInvalid.
++    SetState(StateType::eStateInvalid);
++
++    return error;
++  }
++  assert(WIFSTOPPED(status) && (wpid == static_cast<::pid_t>(pid)) &&
++         "Could not sync with inferior process.");
++
++  if (log)
++    log->Printf("NativeProcessNetBSD::%s inferior started, now in stopped state",
++                __FUNCTION__);
++
++  SetDefaultPtraceOpts(pid);
++
++  // Release the master terminal descriptor and pass it off to the
++  // NativeProcessNetBSD instance.  Similarly stash the inferior pid.
++  m_terminal_fd = launch_info.GetPTY().ReleaseMasterFileDescriptor();
++  m_pid = pid;
++  launch_info.SetProcessID(pid);
++
++  if (m_terminal_fd != -1) {
++    error = EnsureFDFlags(m_terminal_fd, O_NONBLOCK);
++    if (error.Fail()) {
++      if (log)
++        log->Printf("NativeProcessNetBSD::%s inferior EnsureFDFlags failed for "
++                    "ensuring terminal O_NONBLOCK setting: %s",
++                    __FUNCTION__, error.AsCString());
++
++      // Mark the inferior as invalid.
++      // FIXME this could really use a new state - eStateLaunchFailure.  For
++      // now, using eStateInvalid.
++      SetState(StateType::eStateInvalid);
++
++      return error;
++    }
++  }
++
++  if (log)
++    log->Printf("NativeProcessNetBSD::%s() adding pid = %" PRIu64, __FUNCTION__,
++                uint64_t(pid));
++
++  ResolveProcessArchitecture(m_pid, m_arch);
++
++  /* Initialize threads */
++  struct ptrace_lwpinfo info = {};
++  error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info));
++  if (error.Fail()) {
++    SetState(StateType::eStateInvalid);
++    return error;
++  }
++  while (info.pl_lwpid != 0) {
++    NativeThreadNetBSDSP thread_sp = AddThread(info.pl_lwpid);
++    thread_sp->SetStoppedBySignal(SIGSTOP);
++    error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info));
++    if (error.Fail()) {
++      SetState(StateType::eStateInvalid);
++      return error;
++    }
++  }
++
++  /* Set process stopped */
++  SetState(StateType::eStateStopped);
++
++  if (log) {
++    if (error.Success())
++      log->Printf("NativeProcessNetBSD::%s inferior launching succeeded",
++                  __FUNCTION__);
++    else
++      log->Printf("NativeProcessNetBSD::%s inferior launching failed: %s",
++                  __FUNCTION__, error.AsCString());
++  }
++  return error;
++}
++
++::pid_t NativeProcessNetBSD::Attach(lldb::pid_t pid, Error &error) {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
++
++  // Use a map to keep track of the threads which we have attached/need to
++  // attach.
++  Host::TidMap tids_to_attach;
++  if (pid <= 1) {
++    error.SetErrorToGenericError();
++    error.SetErrorString("Attaching to process 1 is not allowed.");
++    return -1;
++  }
++
++  // Attach to the requested process.
++  // An attach will cause the thread to stop with a SIGSTOP.
++  error = PtraceWrapper(PT_ATTACH, pid);
++  if (error.Fail())
++    return -1;
++
++  int status;
++  // Need to use WALLSIG otherwise we receive an error with errno=ECHLD
++  // At this point we should have a thread stopped if waitpid succeeds.
++  if ((status = waitpid(pid, NULL, WALLSIG)) < 0)
++    return -1;
++
++  SetDefaultPtraceOpts(pid);
++
++  m_pid = pid;
++
++  /* Initialize threads */
++  struct ptrace_lwpinfo info = {};
++  error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info));
++  if (error.Fail()) {
++    SetState(StateType::eStateInvalid);
++    return -1;
++  }
++  while (info.pl_lwpid != 0) {
++    NativeThreadNetBSDSP thread_sp = AddThread(info.pl_lwpid);
++    thread_sp->SetStoppedBySignal(SIGSTOP);
++    error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info));
++    if (error.Fail()) {
++      SetState(StateType::eStateInvalid);
++      return -1;
++    }
++  }
++
++  // Let our process instance know the thread has stopped.
++  SetState(StateType::eStateStopped);
++
++  return pid;
++}
++
++Error NativeProcessNetBSD::SetDefaultPtraceOpts(lldb::pid_t pid) {
++  ptrace_event_t event = {};
++
++#if notyet
++  // Report forks
++  event.pe_set_event |= PTRACE_FORK;
++
++  // Report vforks
++  // TODO: Currently unsupported in NetBSD
++  event.pe_set_event |= PTRACE_VFORK;
++
++  // Report finished vforks - the parent unblocked after execve(2) or exit(2) of the child
++  event.pe_set_event |= PTRACE_VFORK_DONE;
++#endif
++
++  // Report LWP (thread) creation
++  event.pe_set_event |= PTRACE_LWP_CREATE;
++
++  // Report LWP (thread) termination
++  event.pe_set_event |= PTRACE_LWP_EXIT;
++
++  return PtraceWrapper(PT_SET_EVENT_MASK, pid, &event, sizeof(struct ptrace_event));
++}
++
++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 status) {
++  if (WIFEXITED(status))
++    return WEXITSTATUS(status);
++  else if (WIFSIGNALED(status))
++    return WTERMSIG(status);
++  else if (WIFSTOPPED(status))
++    return WSTOPSIG(status);
++  else {
++    // We don't know what this is.
++    return ExitType::eExitTypeInvalid;
++  }
++}
++
++// Handles all waitpid events from the inferior process.
++void NativeProcessNetBSD::MonitorCallback(lldb::pid_t pid, bool exited,
++                                         int signal, int status) {
++  Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
++
++  // Handle when the process exits.
++  if (exited) {
++    if (log)
++      log->Printf(
++          "NativeProcessNetBSD::%s() got exit signal(%d) , pid = %d",
++          __FUNCTION__, signal, pid);
++
++    /* Stop Tracking All Threads attached to Process */
++    m_threads.clear();
++
++    SetExitStatus(convert_pid_status_to_exit_type(status),
++                  convert_pid_status_to_return_code(status), nullptr, true);
++
++    // Notify delegate that our process has exited.
++    SetState(StateType::eStateExited, true);
++
++    return;
++  }
++
++  ptrace_siginfo_t info;
++  const auto siginfo_err = PtraceWrapper(PT_GET_SIGINFO, pid, &info, sizeof(info));
++
++  ptrace_state_t state;
++  const auto state_err = PtraceWrapper(PT_GET_PROCESS_STATE, pid, &state, sizeof(state));
++
++  printf("Signal received signo=%d errno=%d code=%d\n", info.psi_siginfo.si_signo,
++    info.psi_siginfo.si_errno, info.psi_siginfo.si_code);
++
++  // Get details on the signal raised.
++  if (siginfo_err.Success() && state_err.Success()) {
++    switch (info.psi_siginfo.si_signo) {
++    case SIGTRAP:
++      switch (info.psi_siginfo.si_code) {
++      case TRAP_BRKPT:
++        for (const auto &thread_sp : m_threads) {
++          static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedByBreakpoint();
++        }
++        SetState(StateType::eStateStopped, true);
++        break;
++      case TRAP_TRACE:
++        for (const auto &thread_sp : m_threads) {
++          static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedByTrace();
++        }
++        SetState(StateType::eStateStopped, true);
++        break;
++      case TRAP_EXEC:
++        {
++        // Clear old threads
++        m_threads.clear();
++
++        // Initialize new thread
++        struct ptrace_lwpinfo info = {};
++        Error error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info));
++        if (error.Fail()) {
++          SetState(StateType::eStateInvalid);
++          return;
++        }
++
++        // Reinitialize from scratch threads and register them in process
++        while (info.pl_lwpid != 0) {
++          NativeThreadNetBSDSP thread_sp = AddThread(info.pl_lwpid);
++          thread_sp->SetStoppedByExec();
++          error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info));
++          if (error.Fail()) {
++            SetState(StateType::eStateInvalid);
++            return;
++          }
++        }
++
++        // Let our delegate know we have just exec'd.
++        NotifyDidExec();
++
++        SetState(StateType::eStateStopped, true);
++        }
++        break;
++      case TRAP_CHLD:
++        {
++        // fork(2)
++        if ((state.pe_report_event & PTRACE_FORK) != 0)
++          printf("Fork reported\n");
++        // vfork(2)
++        else if ((state.pe_report_event & PTRACE_VFORK) != 0)
++          printf("VFork reported\n");
++        // vfork(2) done
++        else if ((state.pe_report_event & PTRACE_VFORK_DONE) != 0)
++          printf("VFork Done reported\n");
++        }
++        break;
++      case TRAP_LWP:
++        {
++        // _lwp_create(2)
++        if ((state.pe_report_event & PTRACE_LWP_CREATE) != 0) {
++          AddThread(state.pe_lwp);
++          for (const auto &thread_sp : m_threads) {
++            static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(info.psi_siginfo.si_signo, &info.psi_siginfo);
++          }
++        }
++        // _lwp_exit(2)
++        if ((state.pe_report_event & PTRACE_LWP_EXIT) != 0)
++          for (size_t i; i < m_threads.size(); i++) {
++            if (static_pointer_cast<NativeThreadNetBSD>(m_threads[i])->GetID() == state.pe_lwp) {
++              m_threads.erase(m_threads.begin() + i);
++              break;
++            }
++          }
++          for (const auto &thread_sp : m_threads) {
++            static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(info.psi_siginfo.si_signo, &info.psi_siginfo);
++          }
++        }
++        SetState(StateType::eStateStopped, true);
++        break;
++      case TRAP_HWWPT:
++        printf("hw watchpoint reported\n");
++        break;
++      }
++    case SIGSTOP:
++      // Handle SIGSTOP from LLGS (LLDB GDB Server)
++      if (info.psi_siginfo.si_code == SI_USER && info.psi_siginfo.si_pid == ::getpid()) {
++        /* Stop Tracking All Threads attached to Process */
++        for (const auto &thread_sp : m_threads) {
++          static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(SIGSTOP, &info.psi_siginfo);
++        }
++      }
++    default:
++      // Other signals
++      for (const auto &thread_sp : m_threads) {
++        static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(info.psi_siginfo.si_signo, &info.psi_siginfo);
++      }
++      SetState(StateType::eStateStopped, true);
++    }
++  }
++}
++
++namespace {
++
++struct EmulatorBaton {
++  NativeProcessNetBSD *m_process;
++  NativeRegisterContext *m_reg_context;
++
++  // eRegisterKindDWARF -> RegsiterValue
++  std::unordered_map<uint32_t, RegisterValue> m_register_values;
++
++  EmulatorBaton(NativeProcessNetBSD *process, NativeRegisterContext *reg_context)
++      : m_process(process), m_reg_context(reg_context) {}
++};
++
++} // anonymous namespace
++
++static size_t ReadMemoryCallback(EmulateInstruction *instruction, void *baton,
++                                 const EmulateInstruction::Context &context,
++                                 lldb::addr_t addr, void *dst, size_t length) {
++  EmulatorBaton *emulator_baton = static_cast<EmulatorBaton *>(baton);
++
++  size_t bytes_read;
++  emulator_baton->m_process->ReadMemory(addr, dst, length, bytes_read);
++  return bytes_read;
++}
++
++static bool ReadRegisterCallback(EmulateInstruction *instruction, void *baton,
++                                 const RegisterInfo *reg_info,
++                                 RegisterValue &reg_value) {
++  EmulatorBaton *emulator_baton = static_cast<EmulatorBaton *>(baton);
++
++  auto it = emulator_baton->m_register_values.find(
++      reg_info->kinds[eRegisterKindDWARF]);
++  if (it != emulator_baton->m_register_values.end()) {
++    reg_value = it->second;
++    return true;
++  }
++
++  // The emulator only fill in the dwarf regsiter numbers (and in some case
++  // the generic register numbers). Get the full register info from the
++  // register context based on the dwarf register numbers.
++  const RegisterInfo *full_reg_info =
++      emulator_baton->m_reg_context->GetRegisterInfo(
++          eRegisterKindDWARF, reg_info->kinds[eRegisterKindDWARF]);
++
++  Error error =
++      emulator_baton->m_reg_context->ReadRegister(full_reg_info, reg_value);
++  if (error.Success())
++    return true;
++
++  return false;
++}
++
++static bool WriteRegisterCallback(EmulateInstruction *instruction, void *baton,
++                                  const EmulateInstruction::Context &context,
++                                  const RegisterInfo *reg_info,
++                                  const RegisterValue &reg_value) {
++  EmulatorBaton *emulator_baton = static_cast<EmulatorBaton *>(baton);
++  emulator_baton->m_register_values[reg_info->kinds[eRegisterKindDWARF]] =
++      reg_value;
++  return true;
++}
++
++static size_t WriteMemoryCallback(EmulateInstruction *instruction, void *baton,
++                                  const EmulateInstruction::Context &context,
++                                  lldb::addr_t addr, const void *dst,
++                                  size_t length) {
++  return length;
++}
++
++static lldb::addr_t ReadFlags(NativeRegisterContext *regsiter_context) {
++  const RegisterInfo *flags_info = regsiter_context->GetRegisterInfo(
++      eRegisterKindGeneric, LLDB_REGNUM_GENERIC_FLAGS);
++  return regsiter_context->ReadRegisterAsUnsigned(flags_info,
++                                                  LLDB_INVALID_ADDRESS);
++}
++
++Error NativeProcessNetBSD::Resume(const ResumeActionList &resume_actions) {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_THREAD));
++  if (log)
++    log->Printf("NativeProcessNetBSD::%s called: pid %d", __FUNCTION__,
++                GetID());
++
++  const auto &thread_sp = m_threads[0];
++  const ResumeAction *const action = resume_actions.GetActionForThread(thread_sp->GetID(), true);
++
++  if (action == nullptr) {
++    if (log)
++      log->Printf("NativeProcessLinux::%s no action specified for pid %" PRIu64 " tid %" PRIu64,
++                  __FUNCTION__, GetID(), thread_sp->GetID());
++     return Error();
++  }
++
++  switch (action->state) {
++  case eStateRunning: {
++    // Run the thread, possibly feeding it the signal.
++    Error error = NativeProcessNetBSD::PtraceWrapper(PT_CONTINUE, GetID(),(void *)1, action->signal);
++    if (!error.Success())
++      return error;
++    for (const auto &thread_sp : m_threads) {
++      static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetRunning();
++    }
++    SetState(eStateRunning, true);
++    break;
++  }
++  case eStateStepping: {
++    // Run the thread, possibly feeding it the signal.
++    Error error = NativeProcessNetBSD::PtraceWrapper(PT_STEP, GetID(),(void *)1, action->signal);
++    if (!error.Success())
++      return error;
++    for (const auto &thread_sp : m_threads) {
++      static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStepping();
++    }
++    SetState(eStateStepping, true);
++    break;
++  }
++
++  case eStateSuspended:
++  case eStateStopped:
++    lldbassert(0 && "Unexpected state");
++ 
++  default:
++    return Error("NativeProcessLinux::%s (): unexpected state %s specified "
++                 "for pid %" PRIu64 ", tid %" PRIu64,
++                 __FUNCTION__, StateAsCString(action->state), GetID(),
++                 thread_sp->GetID());
++  }
++
++  return Error();
++}
++
++Error NativeProcessNetBSD::Halt() {
++  Error error;
++
++  if (kill(GetID(), SIGSTOP) != 0)
++    error.SetErrorToErrno();
++
++  return error;
++}
++
++Error NativeProcessNetBSD::Detach() {
++  Error error;
++
++  // Stop monitoring the inferior.
++  m_sigchld_handle.reset();
++
++  // Tell ptrace to detach from the process.
++  if (GetID() == LLDB_INVALID_PROCESS_ID)
++    return error;
++
++  return PtraceWrapper(PT_DETACH, GetID());
++}
++
++Error NativeProcessNetBSD::Signal(int signo) {
++  Error error;
++
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
++  if (log)
++    log->Printf(
++        "NativeProcessNetBSD::%s: sending signal %d (%s) to pid %" PRIu64,
++        __FUNCTION__, signo, Host::GetSignalAsCString(signo), GetID());
++
++  if (kill(GetID(), signo))
++    error.SetErrorToErrno();
++
++  return error;
++}
++
++Error NativeProcessNetBSD::Interrupt() {
++  // Pick a running thread (or if none, a not-dead stopped thread) as
++  // the chosen thread that will be the stop-reason thread.
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
++
++  NativeThreadProtocolSP running_thread_sp;
++  NativeThreadProtocolSP stopped_thread_sp;
++
++  if (log)
++    log->Printf(
++        "NativeProcessNetBSD::%s selecting running thread for interrupt target",
++        __FUNCTION__);
++
++  for (auto thread_sp : m_threads) {
++    // The thread shouldn't be null but lets just cover that here.
++    if (!thread_sp)
++      continue;
++
++    // If we have a running or stepping thread, we'll call that the
++    // target of the interrupt.
++    const auto thread_state = thread_sp->GetState();
++    if (thread_state == eStateRunning || thread_state == eStateStepping) {
++      running_thread_sp = thread_sp;
++      break;
++    } else if (!stopped_thread_sp && StateIsStoppedState(thread_state, true)) {
++      // Remember the first non-dead stopped thread.  We'll use that as a backup
++      // if there are no running threads.
++      stopped_thread_sp = thread_sp;
++    }
++  }
++
++  if (!running_thread_sp && !stopped_thread_sp) {
++    Error error("found no running/stepping or live stopped threads as target "
++                "for interrupt");
++    if (log)
++      log->Printf("NativeProcessNetBSD::%s skipping due to error: %s",
++                  __FUNCTION__, error.AsCString());
++
++    return error;
++  }
++
++  NativeThreadProtocolSP deferred_signal_thread_sp =
++      running_thread_sp ? running_thread_sp : stopped_thread_sp;
++
++  if (log)
++    log->Printf("NativeProcessNetBSD::%s pid %" PRIu64 " %s tid %" PRIu64
++                " chosen for interrupt target",
++                __FUNCTION__, GetID(),
++                running_thread_sp ? "running" : "stopped",
++                deferred_signal_thread_sp->GetID());
++
++  return Error();
++}
++
++Error NativeProcessNetBSD::Kill() {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
++  if (log)
++    log->Printf("NativeProcessNetBSD::%s called for PID %" PRIu64, __FUNCTION__,
++                GetID());
++
++  Error error;
++
++  switch (m_state) {
++  case StateType::eStateInvalid:
++  case StateType::eStateExited:
++  case StateType::eStateCrashed:
++  case StateType::eStateDetached:
++  case StateType::eStateUnloaded:
++    // Nothing to do - the process is already dead.
++    if (log)
++      log->Printf("NativeProcessNetBSD::%s ignored for PID %" PRIu64
++                  " due to current state: %s",
++                  __FUNCTION__, GetID(), StateAsCString(m_state));
++    return error;
++
++  case StateType::eStateConnected:
++  case StateType::eStateAttaching:
++  case StateType::eStateLaunching:
++  case StateType::eStateStopped:
++  case StateType::eStateRunning:
++  case StateType::eStateStepping:
++  case StateType::eStateSuspended:
++    // We can try to kill a process in these states.
++    break;
++  }
++
++  if (kill(GetID(), SIGKILL) != 0) {
++    error.SetErrorToErrno();
++    return error;
++  }
++
++  return error;
++}
++
++static Error
++ParseMemoryRegionInfoFromProcMapsLine(const std::string &maps_line,
++                                      MemoryRegionInfo &memory_region_info) {
++  memory_region_info.Clear();
++
++  StringExtractor line_extractor(maps_line.c_str());
++
++  // Format: {address_start_hex}-{address_end_hex} perms offset  dev   inode
++  // pathname
++  // perms: rwxp   (letter is present if set, '-' if not, final character is
++  // p=private, s=shared).
++
++  // Parse out the starting address
++  lldb::addr_t start_address = line_extractor.GetHexMaxU64(false, 0);
++
++  // Parse out hyphen separating start and end address from range.
++  if (!line_extractor.GetBytesLeft() || (line_extractor.GetChar() != '-'))
++    return Error(
++        "malformed /proc/{pid}/maps entry, missing dash between address range");
++
++  // Parse out the ending address
++  lldb::addr_t end_address = line_extractor.GetHexMaxU64(false, start_address);
++
++  // Parse out the space after the address.
++  if (!line_extractor.GetBytesLeft() || (line_extractor.GetChar() != ' '))
++    return Error("malformed /proc/{pid}/maps entry, missing space after range");
++
++  // Save the range.
++  memory_region_info.GetRange().SetRangeBase(start_address);
++  memory_region_info.GetRange().SetRangeEnd(end_address);
++
++  // Any memory region in /proc/{pid}/maps is by definition mapped into the
++  // process.
++  memory_region_info.SetMapped(MemoryRegionInfo::OptionalBool::eYes);
++
++  // Parse out each permission entry.
++  if (line_extractor.GetBytesLeft() < 4)
++    return Error("malformed /proc/{pid}/maps entry, missing some portion of "
++                 "permissions");
++
++  // Handle read permission.
++  const char read_perm_char = line_extractor.GetChar();
++  if (read_perm_char == 'r')
++    memory_region_info.SetReadable(MemoryRegionInfo::OptionalBool::eYes);
++  else if (read_perm_char == '-')
++    memory_region_info.SetReadable(MemoryRegionInfo::OptionalBool::eNo);
++  else
++    return Error("unexpected /proc/{pid}/maps read permission char");
++
++  // Handle write permission.
++  const char write_perm_char = line_extractor.GetChar();
++  if (write_perm_char == 'w')
++    memory_region_info.SetWritable(MemoryRegionInfo::OptionalBool::eYes);
++  else if (write_perm_char == '-')
++    memory_region_info.SetWritable(MemoryRegionInfo::OptionalBool::eNo);
++  else
++    return Error("unexpected /proc/{pid}/maps write permission char");
++
++  // Handle execute permission.
++  const char exec_perm_char = line_extractor.GetChar();
++  if (exec_perm_char == 'x')
++    memory_region_info.SetExecutable(MemoryRegionInfo::OptionalBool::eYes);
++  else if (exec_perm_char == '-')
++    memory_region_info.SetExecutable(MemoryRegionInfo::OptionalBool::eNo);
++  else
++    return Error("unexpected /proc/{pid}/maps exec permission char");
++
++  line_extractor.GetChar();              // Read the private bit
++  line_extractor.SkipSpaces();           // Skip the separator
++  line_extractor.GetHexMaxU64(false, 0); // Read the offset
++  line_extractor.GetHexMaxU64(false, 0); // Read the major device number
++  line_extractor.GetChar();              // Read the device id separator
++  line_extractor.GetHexMaxU64(false, 0); // Read the major device number
++  line_extractor.SkipSpaces();           // Skip the separator
++  line_extractor.GetU64(0, 10);          // Read the inode number
++
++  line_extractor.SkipSpaces();
++  const char *name = line_extractor.Peek();
++  if (name)
++    memory_region_info.SetName(name);
++
++  return Error();
++}
++
++Error NativeProcessNetBSD::GetMemoryRegionInfo(lldb::addr_t load_addr,
++                                              MemoryRegionInfo &range_info) {
++  // FIXME review that the final memory region returned extends to the end of
++  // the virtual address space,
++  // with no perms if it is not mapped.
++
++  // Use an approach that reads memory regions from /proc/{pid}/maps.
++  // Assume proc maps entries are in ascending order.
++  // FIXME assert if we find differently.
++
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
++  Error error;
++
++  if (m_supports_mem_region == LazyBool::eLazyBoolNo) {
++    // We're done.
++    error.SetErrorString("unsupported");
++    return error;
++  }
++
++ {
++    if (log)
++      log->Printf("NativeProcessNetBSD::%s reusing %" PRIu64
++                  " cached memory region entries",
++                  __FUNCTION__,
++                  static_cast<uint64_t>(m_mem_region_cache.size()));
++  }
++
++  lldb::addr_t prev_base_address = 0;
++
++  // FIXME start by finding the last region that is <= target address using
++  // binary search.  Data is sorted.
++  // There can be a ton of regions on pthreads apps with lots of threads.
++  for (auto it = m_mem_region_cache.begin(); it != m_mem_region_cache.end();
++       ++it) {
++    MemoryRegionInfo &proc_entry_info = *it;
++
++    // Sanity check assumption that /proc/{pid}/maps entries are ascending.
++    assert((proc_entry_info.GetRange().GetRangeBase() >= prev_base_address) &&
++           "descending /proc/pid/maps entries detected, unexpected");
++    prev_base_address = proc_entry_info.GetRange().GetRangeBase();
++
++    // If the target address comes before this entry, indicate distance to next
++    // region.
++    if (load_addr < proc_entry_info.GetRange().GetRangeBase()) {
++      range_info.GetRange().SetRangeBase(load_addr);
++      range_info.GetRange().SetByteSize(
++          proc_entry_info.GetRange().GetRangeBase() - load_addr);
++      range_info.SetReadable(MemoryRegionInfo::OptionalBool::eNo);
++      range_info.SetWritable(MemoryRegionInfo::OptionalBool::eNo);
++      range_info.SetExecutable(MemoryRegionInfo::OptionalBool::eNo);
++      range_info.SetMapped(MemoryRegionInfo::OptionalBool::eNo);
++
++      return error;
++    } else if (proc_entry_info.GetRange().Contains(load_addr)) {
++      // The target address is within the memory region we're processing here.
++      range_info = proc_entry_info;
++      return error;
++    }
++
++    // The target memory address comes somewhere after the region we just
++    // parsed.
++  }
++
++  // If we made it here, we didn't find an entry that contained the given
++  // address. Return the
++  // load_addr as start and the amount of bytes betwwen load address and the end
++  // of the memory as
++  // size.
++  range_info.GetRange().SetRangeBase(load_addr);
++  range_info.GetRange().SetRangeEnd(LLDB_INVALID_ADDRESS);
++  range_info.SetReadable(MemoryRegionInfo::OptionalBool::eNo);
++  range_info.SetWritable(MemoryRegionInfo::OptionalBool::eNo);
++  range_info.SetExecutable(MemoryRegionInfo::OptionalBool::eNo);
++  range_info.SetMapped(MemoryRegionInfo::OptionalBool::eNo);
++  return error;
++}
++
++void NativeProcessNetBSD::DoStopIDBumped(uint32_t newBumpId) {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
++  if (log)
++    log->Printf("NativeProcessNetBSD::%s(newBumpId=%" PRIu32 ") called",
++                __FUNCTION__, newBumpId);
++
++  if (log)
++    log->Printf("NativeProcessNetBSD::%s clearing %" PRIu64
++                " entries from the cache",
++                __FUNCTION__, static_cast<uint64_t>(m_mem_region_cache.size()));
++  m_mem_region_cache.clear();
++}
++
++Error NativeProcessNetBSD::AllocateMemory(size_t size, uint32_t permissions,
++                                         lldb::addr_t &addr) {
++// FIXME implementing this requires the equivalent of
++// InferiorCallPOSIX::InferiorCallMmap, which depends on
++// functional ThreadPlans working with Native*Protocol.
++#if 1
++  return Error("not implemented yet");
++#else
++  addr = LLDB_INVALID_ADDRESS;
++
++  unsigned prot = 0;
++  if (permissions & lldb::ePermissionsReadable)
++    prot |= eMmapProtRead;
++  if (permissions & lldb::ePermissionsWritable)
++    prot |= eMmapProtWrite;
++  if (permissions & lldb::ePermissionsExecutable)
++    prot |= eMmapProtExec;
++
++  // TODO implement this directly in NativeProcessNetBSD
++  // (and lift to NativeProcessPOSIX if/when that class is
++  // refactored out).
++  if (InferiorCallMmap(this, addr, 0, size, prot,
++                       eMmapFlagsAnon | eMmapFlagsPrivate, -1, 0)) {
++    m_addr_to_mmap_size[addr] = size;
++    return Error();
++  } else {
++    addr = LLDB_INVALID_ADDRESS;
++    return Error("unable to allocate %" PRIu64
++                 " bytes of memory with permissions %s",
++                 size, GetPermissionsAsCString(permissions));
++  }
++#endif
++}
++
++Error NativeProcessNetBSD::DeallocateMemory(lldb::addr_t addr) {
++  // FIXME see comments in AllocateMemory - required lower-level
++  // bits not in place yet (ThreadPlans)
++  return Error("not implemented");
++}
++
++lldb::addr_t NativeProcessNetBSD::GetSharedLibraryInfoAddress() {
++  // punt on this for now
++  return LLDB_INVALID_ADDRESS;
++}
++
++size_t NativeProcessNetBSD::UpdateThreads() {
++  // The NativeProcessNetBSD monitoring threads are always up to date
++  // with respect to thread state and they keep the thread list
++  // populated properly. All this method needs to do is return the
++  // thread count.
++  return m_threads.size();
++}
++
++bool NativeProcessNetBSD::GetArchitecture(ArchSpec &arch) const {
++  arch = m_arch;
++  return true;
++}
++
++Error NativeProcessNetBSD::SetBreakpoint(lldb::addr_t addr, uint32_t size,
++                                        bool hardware) {
++  if (hardware)
++    return Error("NativeProcessNetBSD does not support hardware breakpoints");
++  else
++    return SetSoftwareBreakpoint(addr, size);
++}
++
++Error NativeProcessNetBSD::GetSoftwareBreakpointTrapOpcode(
++    size_t trap_opcode_size_hint, size_t &actual_opcode_size,
++    const uint8_t *&trap_opcode_bytes) {
++  return Error();
++}
++
++Error NativeProcessNetBSD::ReadMemory(lldb::addr_t addr, void *buf, size_t size,
++                                     size_t &bytes_read) {
++  unsigned char *dst = static_cast<unsigned char *>(buf);
++  struct ptrace_io_desc io;
++
++  Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_ALL));
++  if (log)
++    ProcessPOSIXLog::IncNestLevel();
++  if (log && ProcessPOSIXLog::AtTopNestLevel() &&
++      log->GetMask().Test(POSIX_LOG_MEMORY))
++    log->Printf("NativeProcessNetBSD::%s(%p, %p, %zd, _)", __FUNCTION__,
++                (void *)addr, buf, size);
++
++  bytes_read = 0;
++  io.piod_op = PIOD_READ_D;
++  io.piod_len = size;
++
++  do {
++    io.piod_offs = (void *)(addr + bytes_read);
++    io.piod_offs = dst + bytes_read;
++
++    Error error = NativeProcessNetBSD::PtraceWrapper(
++        PT_IO, GetID(), &io);
++    if (error.Fail()) {
++      if (log)
++        ProcessPOSIXLog::DecNestLevel();
++      return error;
++    }
++
++    bytes_read = io.piod_len;
++    io.piod_len = size - bytes_read;
++  } while(bytes_read < size);
++
++  if (log)
++    ProcessPOSIXLog::DecNestLevel();
++  return Error();
++}
++
++Error NativeProcessNetBSD::ReadMemoryWithoutTrap(lldb::addr_t addr, void *buf,
++                                                size_t size,
++                                                size_t &bytes_read) {
++  Error error = ReadMemory(addr, buf, size, bytes_read);
++  if (error.Fail())
++    return error;
++  return m_breakpoint_list.RemoveTrapsFromBuffer(addr, buf, size);
++}
++
++Error NativeProcessNetBSD::WriteMemory(lldb::addr_t addr, const void *buf,
++                                      size_t size, size_t &bytes_written) {
++  const unsigned char *src = static_cast<const unsigned char *>(buf);
++  Error error;
++  struct ptrace_io_desc io;
++
++  Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_ALL));
++  if (log)
++    ProcessPOSIXLog::IncNestLevel();
++  if (log && ProcessPOSIXLog::AtTopNestLevel() &&
++      log->GetMask().Test(POSIX_LOG_MEMORY))
++    log->Printf("NativeProcessNetBSD::%s(0x%" PRIx64 ", %p, %zu)", __FUNCTION__,
++                addr, buf, size);
++
++  bytes_written = 0;
++  io.piod_op = PIOD_WRITE_D;
++  io.piod_len = size;
++
++  do {
++    io.piod_offs = (void *)(src + bytes_written);
++    io.piod_offs = (void *)(addr + bytes_written);
++
++    Error error = NativeProcessNetBSD::PtraceWrapper(
++        PT_IO, GetID(), &io);
++    if (error.Fail()) {
++      if (log)
++        ProcessPOSIXLog::DecNestLevel();
++      return error;
++    }
++
++    bytes_written = io.piod_len;
++    io.piod_len = size - bytes_written;
++  } while(bytes_written < size);
++
++  if (log)
++    ProcessPOSIXLog::DecNestLevel();
++  return error;
++}
++
++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(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
++
++  if (log) {
++    log->Printf("NativeProcessNetBSD::%s pid %" PRIu64
++                " adding thread with tid %" PRIu64,
++                __FUNCTION__, GetID(), thread_id);
++  }
++
++  assert(!HasThreadNoLock(thread_id) &&
++         "attempted to add a thread by id that already exists");
++
++  // If this is the first thread, save it as the current thread
++  if (m_threads.empty())
++    SetCurrentThreadID(thread_id);
++
++  auto thread_sp = std::make_shared<NativeThreadNetBSD>(this, thread_id);
++  m_threads.push_back(thread_sp);
++  return thread_sp;
++}
++
++Error NativeProcessNetBSD::GetLoadedModuleFileSpec(const char *module_path,
++                                                  FileSpec &file_spec) {
++  FileSpec module_file_spec(module_path, true);
++
++  bool found = false;
++  file_spec.Clear();
++
++  if (!found)
++    return Error("Module file (%s) not found in /proc/%" PRIu64 "/maps file!",
++                 module_file_spec.GetFilename().AsCString(), GetID());
++
++  return Error();
++}
++
++Error NativeProcessNetBSD::GetFileLoadAddress(const llvm::StringRef &file_name,
++                                             lldb::addr_t &load_addr) {
++  load_addr = LLDB_INVALID_ADDRESS;
++  return Error();
++}
++
++NativeThreadNetBSDSP NativeProcessNetBSD::GetThreadByID(lldb::tid_t tid) {
++  return std::static_pointer_cast<NativeThreadNetBSD>(
++      NativeProcessProtocol::GetThreadByID(tid));
++}
++
++//===----------------------------------------------------------------------===//
++
++void NativeProcessNetBSD::SigchldHandler() {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
++  // Process all pending waitpid notifications.
++  int status;
++  ::pid_t wait_pid = waitpid(WAIT_ANY, &status, WALLSIG | WNOHANG);
++
++  if (wait_pid == 0)
++    return; // We are done.
++
++  if (wait_pid == -1) {
++    if (errno == EINTR)
++      return;
++
++    Error error(errno, eErrorTypePOSIX);
++    if (log)
++      log->Printf("NativeProcessNetBSD::%s waitpid (WAIT_ANY, &status, "
++                  "WALLSIG | WNOHANG) failed: %s", __FUNCTION__,
++                  error.AsCString());
++  }
++
++  bool exited = false;
++  int signal = 0;
++  int exit_status = 0;
++  const char *status_cstr = nullptr;
++  if (WIFSTOPPED(status)) {
++    signal = WSTOPSIG(status);
++    status_cstr = "STOPPED";
++  } else if (WIFEXITED(status)) {
++    exit_status = WEXITSTATUS(status);
++    status_cstr = "EXITED";
++    exited = true;
++  } else if (WIFSIGNALED(status)) {
++    signal = WTERMSIG(status);
++    status_cstr = "SIGNALED";
++    if (wait_pid == static_cast<::pid_t>(GetID())) {
++      exited = true;
++      exit_status = -1;
++    }
++  } else
++    status_cstr = "(\?\?\?)";
++
++  if (log)
++    log->Printf("NativeProcessNetBSD::%s: waitpid (WAIT_ANY, &status, "
++                "WALLSIG | WNOHANG) => pid = %" PRIi32
++                ", status = 0x%8.8x (%s), signal = %i, exit_state = %i",
++                __FUNCTION__, wait_pid, status, status_cstr, signal,
++                exit_status);
++
++  MonitorCallback(wait_pid, exited, signal, exit_status);
++}
++
++// Wrapper for ptrace to catch errors and log calls.
++// Note that ptrace sets errno on error because -1 can be a valid result (i.e.
++// for PT_READ*)
++Error NativeProcessNetBSD::PtraceWrapper(int req, lldb::pid_t pid, void *addr,
++                                        int data, int *result) {
++  Error error;
++  int ret;
++
++  Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PTRACE));
++
++  PtraceDisplayBytes(req, addr, data);
++
++  errno = 0;
++  ret = ptrace(req, static_cast<::pid_t>(pid), addr, data);
++
++  if (ret == -1)
++    error.SetErrorToErrno();
++
++  if (result)
++    *result = ret;
++
++  if (log)
++    log->Printf("ptrace(%d, %d, %p, %d, %d)=%lX", req, pid, addr,
++                data, ret);
++
++  if (log && error.GetError() != 0) {
++    const char *str;
++    switch (error.GetError()) {
++    case ESRCH:
++      str = "ESRCH";
++      break;
++    case EINVAL:
++      str = "EINVAL";
++      break;
++    case EBUSY:
++      str = "EBUSY";
++      break;
++    case EPERM:
++      str = "EPERM";
++      break;
++    default:
++      str = error.AsCString();
++    }
++    log->Printf("ptrace() failed; errno=%d (%s)", error.GetError(), str);
++  }
++
++  return error;
++}
diff --git a/lldb-netbsd/patches/patch-NativeProcessNetBSD.h b/lldb-netbsd/patches/patch-NativeProcessNetBSD.h
new file mode 100644
index 0000000..7bb06ae
--- /dev/null
+++ b/lldb-netbsd/patches/patch-NativeProcessNetBSD.h
@@ -0,0 +1,188 @@
+$NetBSD$
+
+--- NativeProcessNetBSD.h.orig	2017-01-31 17:49:05.519860045 +0000
++++ NativeProcessNetBSD.h
+@@ -0,0 +1,183 @@
++//===-- NativeProcessNetBSD.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_NativeProcessNetBSD_H_
++#define liblldb_NativeProcessNetBSD_H_
++
++// C++ Includes
++#include <unordered_set>
++
++// Other libraries and framework includes
++#include "lldb/Core/ArchSpec.h"
++#include "lldb/Host/Debug.h"
++#include "lldb/Host/FileSpec.h"
++#include "lldb/Host/HostThread.h"
++#include "lldb/Target/MemoryRegionInfo.h"
++#include "lldb/lldb-types.h"
++
++#include "NativeThreadNetBSD.h"
++#include "lldb/Host/common/NativeProcessProtocol.h"
++
++namespace lldb_private {
++class Error;
++class Scalar;
++
++namespace process_netbsd {
++/// @class NativeProcessNetBSD
++/// @brief Manages communication with the inferior (debugee) process.
++///
++/// Upon construction, this class prepares and launches an inferior process for
++/// debugging.
++///
++/// Changes in the inferior process state are broadcasted.
++class NativeProcessNetBSD : public NativeProcessProtocol {
++  friend Error NativeProcessProtocol::Launch(
++      ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate,
++      MainLoop &mainloop, NativeProcessProtocolSP &process_sp);
++
++  friend Error NativeProcessProtocol::Attach(
++      lldb::pid_t pid, NativeProcessProtocol::NativeDelegate &native_delegate,
++      MainLoop &mainloop, NativeProcessProtocolSP &process_sp);
++
++public:
++  // ---------------------------------------------------------------------
++  // NativeProcessProtocol Interface
++  // ---------------------------------------------------------------------
++  Error Resume(const ResumeActionList &resume_actions) override;
++
++  Error Halt() override;
++
++  Error Detach() override;
++
++  Error Signal(int signo) override;
++
++  Error Interrupt() override;
++
++  Error Kill() override;
++
++  Error GetMemoryRegionInfo(lldb::addr_t load_addr,
++                            MemoryRegionInfo &range_info) override;
++
++  Error ReadMemory(lldb::addr_t addr, void *buf, size_t size,
++                   size_t &bytes_read) override;
++
++  Error ReadMemoryWithoutTrap(lldb::addr_t addr, void *buf, size_t size,
++                              size_t &bytes_read) override;
++
++  Error WriteMemory(lldb::addr_t addr, const void *buf, size_t size,
++                    size_t &bytes_written) override;
++
++  Error AllocateMemory(size_t size, uint32_t permissions,
++                       lldb::addr_t &addr) override;
++
++  Error DeallocateMemory(lldb::addr_t addr) override;
++
++  lldb::addr_t GetSharedLibraryInfoAddress() override;
++
++  size_t UpdateThreads() override;
++
++  bool GetArchitecture(ArchSpec &arch) const override;
++
++  Error SetBreakpoint(lldb::addr_t addr, uint32_t size, bool hardware) override;
++
++  void DoStopIDBumped(uint32_t newBumpId) override;
++
++  Error GetLoadedModuleFileSpec(const char *module_path,
++                                FileSpec &file_spec) override;
++
++  Error GetFileLoadAddress(const llvm::StringRef &file_name,
++                           lldb::addr_t &load_addr) override;
++
++  NativeThreadNetBSDSP GetThreadByID(lldb::tid_t id);
++
++  // ---------------------------------------------------------------------
++  // Interface used by NativeRegisterContext-derived classes.
++  // ---------------------------------------------------------------------
++  static Error PtraceWrapper(int req, lldb::pid_t pid, void *addr = nullptr,
++                             int data = 0, int *result = nullptr);
++
++protected:
++  // ---------------------------------------------------------------------
++  // NativeProcessProtocol protected interface
++  // ---------------------------------------------------------------------
++
++  Error
++  GetSoftwareBreakpointTrapOpcode(size_t trap_opcode_size_hint,
++                                  size_t &actual_opcode_size,
++                                  const uint8_t *&trap_opcode_bytes) override;
++
++private:
++  MainLoop::SignalHandleUP m_sigchld_handle;
++  ArchSpec m_arch;
++
++  LazyBool m_supports_mem_region;
++  std::vector<MemoryRegionInfo> m_mem_region_cache;
++
++  lldb::tid_t m_pending_notification_tid;
++
++  // List of thread ids stepping with a breakpoint with the address of
++  // the relevan breakpoint
++  std::map<lldb::tid_t, lldb::addr_t> m_threads_stepping_with_breakpoint;
++
++  // ---------------------------------------------------------------------
++  // Private Instance Methods
++  // ---------------------------------------------------------------------
++  NativeProcessNetBSD();
++
++  Error LaunchInferior(MainLoop &mainloop, ProcessLaunchInfo &launch_info);
++
++  /// Attaches to an existing process.  Forms the
++  /// implementation of Process::DoAttach
++  void AttachToInferior(MainLoop &mainloop, lldb::pid_t pid, Error &error);
++
++  ::pid_t Attach(lldb::pid_t pid, Error &error);
++
++  static Error SetDefaultPtraceOpts(const lldb::pid_t);
++
++  static void *MonitorThread(void *baton);
++
++  void MonitorCallback(lldb::pid_t pid, bool exited, int signal, int status);
++
++  void MonitorSIGTRAP(const siginfo_t &info, NativeThreadNetBSD &thread);
++
++  Error SetupSoftwareSingleStepping(NativeThreadNetBSD &thread);
++
++
++  bool HasThreadNoLock(lldb::tid_t thread_id);
++
++  NativeThreadNetBSDSP AddThread(lldb::tid_t thread_id);
++
++  Error GetSoftwareBreakpointPCOffset(uint32_t &actual_opcode_size);
++
++  Error FixupBreakpointPCAsNeeded(NativeThreadNetBSD &thread);
++
++  /// Writes a siginfo_t structure corresponding to the given thread ID to the
++  /// memory region pointed to by @p siginfo.
++  Error GetSignalInfo(lldb::tid_t tid, void *siginfo);
++
++  void NotifyThreadDeath(lldb::tid_t tid);
++
++  Error Detach(lldb::tid_t tid);
++
++  // Notify the delegate if all threads have stopped.
++  void SignalIfAllThreadsStopped();
++
++  // Resume the given thread, optionally passing it the given signal. The type
++  // of resume
++  // operation (continue, single-step) depends on the state parameter.
++  Error ResumeThread(NativeThreadNetBSD &thread, lldb::StateType state,
++                     int signo);
++
++  void SigchldHandler();
++};
++
++} // namespace process_netbsd
++} // namespace lldb_private
++
++#endif // #ifndef liblldb_NativeProcessNetBSD_H_
diff --git a/lldb-netbsd/patches/patch-NativeThreadNetBSD.cpp b/lldb-netbsd/patches/patch-NativeThreadNetBSD.cpp
new file mode 100644
index 0000000..931552b
--- /dev/null
+++ b/lldb-netbsd/patches/patch-NativeThreadNetBSD.cpp
@@ -0,0 +1,393 @@
+$NetBSD$
+
+--- NativeThreadNetBSD.cpp.orig	2017-01-31 17:49:05.520048081 +0000
++++ NativeThreadNetBSD.cpp
+@@ -0,0 +1,388 @@
++//===-- NativeThreadNetBSD.cpp --------------------------------- -*- C++ -*-===//
++//
++//                     The LLVM Compiler Infrastructure
++//
++// This file is distributed under the University of Illinois Open Source
++// License. See LICENSE.TXT for details.
++//
++//===----------------------------------------------------------------------===//
++
++#include "NativeThreadNetBSD.h"
++
++#include <signal.h>
++#include <sstream>
++
++#include "NativeProcessNetBSD.h"
++
++#include "lldb/Core/Log.h"
++#include "lldb/Core/State.h"
++#include "lldb/Host/HostNativeThread.h"
++#include "lldb/Utility/LLDBAssert.h"
++#include "lldb/lldb-enumerations.h"
++
++#include "llvm/ADT/SmallString.h"
++
++#include "Plugins/Process/POSIX/CrashReason.h"
++
++#include <sys/ptrace.h>
++#include <sys/syscall.h>
++#include <poll.h>
++
++using namespace lldb;
++using namespace lldb_private;
++using namespace lldb_private::process_netbsd;
++
++namespace {
++void LogThreadStopInfo(Log &log, const ThreadStopInfo &stop_info,
++                       const char *const header) {
++  switch (stop_info.reason) {
++  case eStopReasonNone:
++    log.Printf("%s: %s no stop reason", __FUNCTION__, header);
++    return;
++  case eStopReasonTrace:
++    log.Printf("%s: %s trace, stopping signal 0x%" PRIx32, __FUNCTION__, header,
++               stop_info.details.signal.signo);
++    return;
++  case eStopReasonBreakpoint:
++    log.Printf("%s: %s breakpoint, stopping signal 0x%" PRIx32, __FUNCTION__,
++               header, stop_info.details.signal.signo);
++    return;
++  case eStopReasonSignal:
++    log.Printf("%s: %s signal 0x%02" PRIx32, __FUNCTION__, header,
++               stop_info.details.signal.signo);
++    return;
++  case eStopReasonException:
++    log.Printf("%s: %s exception type 0x%02" PRIx64, __FUNCTION__, header,
++               stop_info.details.exception.type);
++    return;
++  case eStopReasonExec:
++    log.Printf("%s: %s exec, stopping signal 0x%" PRIx32, __FUNCTION__, header,
++               stop_info.details.signal.signo);
++    return;
++  case eStopReasonPlanComplete:
++    log.Printf("%s: %s plan complete", __FUNCTION__, header);
++    return;
++  case eStopReasonThreadExiting:
++    log.Printf("%s: %s thread exiting", __FUNCTION__, header);
++    return;
++  case eStopReasonInstrumentation:
++    log.Printf("%s: %s instrumentation", __FUNCTION__, header);
++    return;
++  default:
++    log.Printf("%s: %s invalid stop reason %" PRIu32, __FUNCTION__, header,
++               static_cast<uint32_t>(stop_info.reason));
++  }
++}
++}
++
++NativeThreadNetBSD::NativeThreadNetBSD(NativeProcessNetBSD *process,
++                                     lldb::tid_t tid)
++    : NativeThreadProtocol(process, tid), m_state(StateType::eStateInvalid),
++      m_stop_info(), m_reg_context_sp(), m_stop_description() {}
++
++std::string NativeThreadNetBSD::GetName() {
++  NativeProcessProtocolSP process_sp = m_process_wp.lock();
++  if (!process_sp)
++    return "<unknown: no process>";
++
++  // const NativeProcessNetBSD *const process =
++  // reinterpret_cast<NativeProcessNetBSD*> (process_sp->get ());
++  llvm::SmallString<32> thread_name;
++  HostNativeThread::GetName(GetID(), thread_name);
++  return thread_name.c_str();
++}
++
++lldb::StateType NativeThreadNetBSD::GetState() { return m_state; }
++
++bool NativeThreadNetBSD::GetStopReason(ThreadStopInfo &stop_info,
++                                      std::string &description) {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
++
++  description.clear();
++
++  switch (m_state) {
++  case eStateStopped:
++  case eStateCrashed:
++  case eStateExited:
++  case eStateSuspended:
++  case eStateUnloaded:
++    if (log)
++      LogThreadStopInfo(*log, m_stop_info, "m_stop_info in thread:");
++    stop_info = m_stop_info;
++    description = m_stop_description;
++    if (log)
++      LogThreadStopInfo(*log, stop_info, "returned stop_info:");
++
++    return true;
++
++  case eStateInvalid:
++  case eStateConnected:
++  case eStateAttaching:
++  case eStateLaunching:
++  case eStateRunning:
++  case eStateStepping:
++  case eStateDetached:
++    if (log) {
++      log->Printf("NativeThreadNetBSD::%s tid %" PRIu64
++                  " in state %s cannot answer stop reason",
++                  __FUNCTION__, GetID(), StateAsCString(m_state));
++    }
++    return false;
++  }
++  llvm_unreachable("unhandled StateType!");
++}
++
++NativeRegisterContextSP NativeThreadNetBSD::GetRegisterContext() {
++  return m_reg_context_sp; /* XXX: dummy */
++}
++
++Error NativeThreadNetBSD::SetWatchpoint(lldb::addr_t addr, size_t size,
++                                       uint32_t watch_flags, bool hardware) {
++  return Error();
++}
++
++Error NativeThreadNetBSD::RemoveWatchpoint(lldb::addr_t addr) {
++  return Error();
++}
++
++void NativeThreadNetBSD::SetStoppedBySignal(uint32_t signo,
++                                            const siginfo_t *info) {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
++  if (log)
++    log->Printf("NativeThreadNetBSD::%s called with signal %s (value 0x%02" PRIx32 ")",
++                __FUNCTION__, strsignal(signo), signo);
++
++  m_state = eStateStopped;
++
++  m_stop_info.reason = StopReason::eStopReasonSignal;
++  m_stop_info.details.signal.signo = signo;
++
++  std::ostringstream stringStream;
++
++  if (!info) {
++    stringStream << "The signal " << strsignal(signo) << " was caught";
++    m_stop_description = stringStream.str();
++    return;
++  }
++
++  switch(info->si_code) {
++  case SI_USER:
++    stringStream << "The signal " << strsignal(signo) << " was generated via kill(2) from pid="
++                 << info->si_pid << ", uid=" << info->si_uid;
++    break;
++  case SI_QUEUE:
++    stringStream << "The signal " << strsignal(signo) << " was generated via sigqueue(2)";
++    break;
++  case SI_TIMER:
++    stringStream << "The signal " << strsignal(signo) << " was generated because a timer set by timer_settime(2) has expired"
++                 << " with si_value set to sival_int=" << info->si_value.sival_int << " and "
++                 << "sival_ptr=" << info->si_value.sival_ptr;
++    break;
++  case SI_ASYNCIO:
++    stringStream << "The signal " << strsignal(signo) << " was generated by completion of an asynchronous I/O operation with "
++                 << info->si_fd << " file descriptor number on which the operation was completed "
++                 << " and side and priority of the operation set to ";
++    switch (info->si_band) {
++    case POLLIN | POLLRDNORM:
++      stringStream << "normal read ";
++      break;
++    case POLLPRI | POLLRDNORM:
++      stringStream << "out-of-band read ";
++      break;
++    case POLLOUT | POLLWRNORM:
++      stringStream << "normal write ";
++      break;
++    case POLLPRI | POLLWRBAND:
++      stringStream << "normal write ";
++      break;
++    default:
++      stringStream << "unspecified value ";
++    }
++    stringStream << std::hex << std::showbase << info->si_band;
++  case SI_MESGQ:
++    stringStream << "The signal " << strsignal(signo) << " was generated by arrival of a message on an empty message queue "
++                 << "with si_value set to sival_int=" << info->si_value.sival_int << " and "
++                 << "sival_ptr=" << info->si_value.sival_ptr;
++  case SI_LWP:
++    stringStream << "The signal " << strsignal(signo) << " was generated via _lwp_kill(2) from pid="
++                 << info->si_pid << ", uid=" << info->si_uid;
++    break;
++  case SI_NOINFO:
++    stringStream << "The signal " << strsignal(signo) << " was generated with no signal specific info available";
++    break;
++  default:
++    switch (info->si_signo) {
++    case SIGTRAP:
++      stringStream << "SIGTRAP has been caught with ";
++      switch (info->si_code) {
++      case TRAP_BRKPT:
++        stringStream << "Process Breakpoint type";
++        break;
++      case TRAP_TRACE:
++        stringStream << "Process Trace Trap type";
++        break;
++      case TRAP_EXEC:
++        stringStream << "Process Exec Trap type";
++        break;
++      case TRAP_CHLD:
++        stringStream << "Process Child Trap type";
++        break;
++      case TRAP_LWP:
++        stringStream << "Process LWP Trap type";
++        break;
++      default:
++        stringStream << "unknown si_code value " << std::hex << std::showbase
++                     << info->si_code;
++      }
++      break;
++    case SIGCHLD:
++      stringStream << "SIGCHLD has been caught with ";
++      switch (info->si_code) {
++      case CLD_EXITED:
++        stringStream << "Child Has Exited type";
++        break;
++      case CLD_KILLED:
++        stringStream << "Child Has Terminated Abnormally "
++                        "(without a core file) type";
++        break;
++      case CLD_DUMPED:
++        stringStream << "Child Has Terminated Abnormally "
++                     << "(with a core file) type";
++        break;
++      case CLD_TRAPPED:
++        stringStream << "Child Has Trapped type";
++        break;
++      case CLD_STOPPED:
++        stringStream << "Child Has Stopped type";
++        break;
++      case CLD_CONTINUED:
++        stringStream << "Child Has Continued type";
++        break;
++      default:
++        stringStream << "unknown si_code value " << std::hex << std::showbase
++                     << info->si_code;
++      }
++      stringStream << "with pid=" << std::dec << info->si_pid << " of the process who's status "
++                   << "changed, user id=" << info->si_uid << " of that process, "
++                   << std::hex << std::showbase << ((info->si_code == CLD_EXITED) ?
++                   "exit code of the process " : "signal number received by the process ")
++                   << std::dec << info->si_status << ", user process accounting time "
++                   << info->si_utime << ", system process accounting time " << info->si_stime;
++      break;
++    case SIGIO:
++      stringStream << "SIGIO has been caught with ";
++      switch (info->si_code) {
++      case POLL_IN:
++        stringStream << "Data Input Available type";
++        break;
++      case POLL_OUT:
++        stringStream << "Output Buffers Available type";
++        break;
++      case POLL_MSG:
++        stringStream << "Input Message type";
++        break;
++      case POLL_ERR:
++        stringStream << "I/O Error type";
++        break;
++      case POLL_PRI:
++        stringStream << "High Priority Input Available type";
++        break;
++      case POLL_HUP:
++        stringStream << "Device Disconnected type";
++        break;
++      default:
++        stringStream << "unknown si_code value " << std::hex << std::showbase
++                     << info->si_code;
++      }
++      stringStream << "with " << std::dec << info->si_fd << " file descriptor number on which the "
++                   << "operation was completed and side and priority of the operation set to ";
++      switch (info->si_band) {
++      case POLLIN | POLLRDNORM:
++        stringStream << "normal read ";
++        break;
++      case POLLPRI | POLLRDNORM:
++        stringStream << "out-of-band read ";
++        break;
++      case POLLOUT | POLLWRNORM:
++        stringStream << "normal write ";
++        break;
++      case POLLPRI | POLLWRBAND:
++        stringStream << "normal write ";
++        break;
++      default:
++        stringStream << "unspecified value ";
++      }
++      stringStream << std::hex << std::showbase << info->si_band;
++
++      break;
++    /* The following signals are defined by POSIX common platform code */
++    case SIGSEGV:
++    case SIGBUS:
++    case SIGFPE:
++    case SIGILL:
++      stringStream << GetCrashReasonString(GetCrashReason(*info), *info);
++      break;
++    default:
++      stringStream << "The signal " << strsignal(info->si_signo) << " was caught";
++    }
++  }
++  m_stop_description = stringStream.str();
++}
++
++void NativeThreadNetBSD::SetStopped() {
++  const StateType new_state = StateType::eStateStopped;
++  m_state = new_state;
++  m_stop_description.clear();
++}
++
++void NativeThreadNetBSD::SetStoppedByExec() {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
++  if (log)
++    log->Printf("NativeThreadNetBSD::%s()", __FUNCTION__);
++  SetStopped();
++  m_stop_info.reason = StopReason::eStopReasonExec;
++  m_stop_info.details.signal.signo = SIGTRAP;
++}
++
++void NativeThreadNetBSD::SetRunning() {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
++  if (log)
++    log->Printf("NativeThreadNetBSD::%s()", __FUNCTION__);
++
++  m_state = StateType::eStateRunning;
++  m_stop_info.reason = StopReason::eStopReasonNone;
++}
++
++void NativeThreadNetBSD::SetStepping() {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
++  if (log)
++    log->Printf("NativeThreadNetBSD::%s()", __FUNCTION__);
++
++  m_state = StateType::eStateStepping;
++  m_stop_info.reason = StopReason::eStopReasonNone;
++}
++
++void NativeThreadNetBSD::SetStoppedByTrace() {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
++  if (log)
++    log->Printf("NativeThreadNetBSD::%s()", __FUNCTION__);
++  SetStopped();
++  m_stop_info.reason = StopReason::eStopReasonTrace;
++  m_stop_info.details.signal.signo = SIGTRAP;
++}
++
++void NativeThreadNetBSD::SetStoppedByBreakpoint() {
++  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
++  if (log)
++    log->Printf("NativeThreadNetBSD::%s()", __FUNCTION__);
++  SetStopped();
++  m_stop_info.reason = StopReason::eStopReasonBreakpoint;
++  m_stop_info.details.signal.signo = SIGTRAP;
++}
++
++NativeProcessNetBSD &NativeThreadNetBSD::GetProcess() {
++  auto process_sp = std::static_pointer_cast<NativeProcessNetBSD>(
++      NativeThreadProtocol::GetProcess());
++  assert(process_sp);
++  return *process_sp;
++}
diff --git a/lldb-netbsd/patches/patch-NativeThreadNetBSD.h b/lldb-netbsd/patches/patch-NativeThreadNetBSD.h
new file mode 100644
index 0000000..f0f829e
--- /dev/null
+++ b/lldb-netbsd/patches/patch-NativeThreadNetBSD.h
@@ -0,0 +1,92 @@
+$NetBSD$
+
+--- NativeThreadNetBSD.h.orig	2017-01-31 17:49:05.520300433 +0000
++++ NativeThreadNetBSD.h
+@@ -0,0 +1,87 @@
++//===-- NativeThreadNetBSD.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_NativeThreadNetBSD_H_
++#define liblldb_NativeThreadNetBSD_H_
++
++#include "lldb/Host/common/NativeThreadProtocol.h"
++#include "lldb/lldb-private-forward.h"
++
++#include <sched.h>
++
++#include <map>
++#include <memory>
++#include <string>
++
++namespace lldb_private {
++namespace process_netbsd {
++
++class NativeProcessNetBSD;
++
++class NativeThreadNetBSD : public NativeThreadProtocol {
++  friend class NativeProcessNetBSD;
++
++public:
++  NativeThreadNetBSD(NativeProcessNetBSD *process, lldb::tid_t tid);
++
++  // ---------------------------------------------------------------------
++  // NativeThreadProtocol Interface
++  // ---------------------------------------------------------------------
++  std::string GetName() override;
++
++  lldb::StateType GetState() override;
++
++  bool GetStopReason(ThreadStopInfo &stop_info,
++                     std::string &description) override;
++
++  NativeRegisterContextSP GetRegisterContext() override;
++
++  Error SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags,
++                      bool hardware) override;
++
++  Error RemoveWatchpoint(lldb::addr_t addr) override;
++
++private:
++  // ---------------------------------------------------------------------
++  // Interface for friend classes
++  // ---------------------------------------------------------------------
++
++  void SetStoppedBySignal(uint32_t signo, const siginfo_t *info = nullptr);
++
++  void SetStoppedByExec();
++
++  void SetStoppedByTrace();
++
++  void SetStoppedByBreakpoint();
++
++  void SetRunning();
++
++  void SetStepping();
++
++  // ---------------------------------------------------------------------
++  // Private interface
++  // ---------------------------------------------------------------------
++  NativeProcessNetBSD &GetProcess();
++
++  void SetStopped();
++
++  // ---------------------------------------------------------------------
++  // Member Variables
++  // ---------------------------------------------------------------------
++  lldb::StateType m_state;
++  ThreadStopInfo m_stop_info;
++  NativeRegisterContextSP m_reg_context_sp;
++  std::string m_stop_description;
++};
++
++typedef std::shared_ptr<NativeThreadNetBSD> NativeThreadNetBSDSP;
++} // namespace process_netbsd
++} // namespace lldb_private
++
++#endif // #ifndef liblldb_NativeThreadNetBSD_H_
diff --git a/lldb-netbsd/patches/patch-cmake_LLDBDependencies.cmake b/lldb-netbsd/patches/patch-cmake_LLDBDependencies.cmake
index 5ff4868..1cfb22a 100644
--- a/lldb-netbsd/patches/patch-cmake_LLDBDependencies.cmake
+++ b/lldb-netbsd/patches/patch-cmake_LLDBDependencies.cmake
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- cmake/LLDBDependencies.cmake.orig	2016-12-17 10:34:01.000000000 +0000
+--- cmake/LLDBDependencies.cmake.orig	2017-01-31 17:20:58.000000000 +0000
 +++ cmake/LLDBDependencies.cmake
 @@ -115,6 +115,7 @@ endif ()
  # NetBSD-only libraries
diff --git a/lldb-netbsd/patches/patch-cmake_modules_AddLLDB.cmake b/lldb-netbsd/patches/patch-cmake_modules_AddLLDB.cmake
deleted file mode 100644
index 60727e4..0000000
--- a/lldb-netbsd/patches/patch-cmake_modules_AddLLDB.cmake
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD$
-
---- cmake/modules/AddLLDB.cmake.orig	2016-12-17 10:34:01.000000000 +0000
-+++ cmake/modules/AddLLDB.cmake
-@@ -142,6 +142,12 @@ function(add_lldb_executable name)
-         endif()
-       endif()
-     endif()
-+  else()
-+    if(ARG_GENERATE_INSTALL)
-+      install(TARGETS ${name}
-+            COMPONENT ${name}
-+            RUNTIME DESTINATION ${install_dir})
-+    endif()
-   endif()
- 
-   if(ARG_INCLUDE_IN_FRAMEWORK AND LLDB_BUILD_FRAMEWORK)
diff --git a/lldb-netbsd/patches/patch-include_lldb_Host_netbsd_ProcessLauncherNetBSD.h b/lldb-netbsd/patches/patch-include_lldb_Host_netbsd_ProcessLauncherNetBSD.h
index 6dc6481..9514ae4 100644
--- a/lldb-netbsd/patches/patch-include_lldb_Host_netbsd_ProcessLauncherNetBSD.h
+++ b/lldb-netbsd/patches/patch-include_lldb_Host_netbsd_ProcessLauncherNetBSD.h
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- include/lldb/Host/netbsd/ProcessLauncherNetBSD.h.orig	2016-12-26 05:32:46.084693165 +0000
+--- include/lldb/Host/netbsd/ProcessLauncherNetBSD.h.orig	2017-01-31 17:38:38.919303170 +0000
 +++ include/lldb/Host/netbsd/ProcessLauncherNetBSD.h
 @@ -0,0 +1,25 @@
 +//===-- ProcessLauncherNetBSD.h --------------------------------*- C++ -*-===//
diff --git a/lldb-netbsd/patches/patch-source_Commands_CommandObjectPlatform.cpp b/lldb-netbsd/patches/patch-source_Commands_CommandObjectPlatform.cpp
index cd4884a..0ec7a76 100644
--- a/lldb-netbsd/patches/patch-source_Commands_CommandObjectPlatform.cpp
+++ b/lldb-netbsd/patches/patch-source_Commands_CommandObjectPlatform.cpp
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Commands/CommandObjectPlatform.cpp.orig	2016-12-17 10:29:27.000000000 +0000
 +++ source/Commands/CommandObjectPlatform.cpp
-@@ -30,9 +30,11 @@
+@@ -30,6 +30,7 @@
  #include "lldb/Utility/Utils.h"
  
  #include "llvm/ADT/SmallString.h"
@@ -10,11 +10,7 @@ $NetBSD$
  
  using namespace lldb;
  using namespace lldb_private;
-+using namespace llvm;
- 
- static mode_t ParsePermissionString(const char *) = delete;
- 
-@@ -1249,8 +1251,8 @@ protected:
+@@ -1249,8 +1250,8 @@ protected:
    public:
      CommandOptions()
          : Options(), match_info(), show_args(false), verbose(false) {
diff --git a/lldb-netbsd/patches/patch-source_Core_ConstString.cpp b/lldb-netbsd/patches/patch-source_Core_ConstString.cpp
index a885e19..37798cd 100644
--- a/lldb-netbsd/patches/patch-source_Core_ConstString.cpp
+++ b/lldb-netbsd/patches/patch-source_Core_ConstString.cpp
@@ -2,29 +2,20 @@ $NetBSD$
 
 --- source/Core/ConstString.cpp.orig	2016-12-17 10:30:30.000000000 +0000
 +++ source/Core/ConstString.cpp
-@@ -19,10 +19,15 @@
+@@ -18,6 +18,7 @@
+ #include "llvm/ADT/StringExtras.h"
  #include "llvm/ADT/StringMap.h"
  #include "llvm/Support/RWMutex.h"
++#include "llvm/Support/Threading.h"
  
-+#include "llvm/Support/Atomic.h"
-+
  // Project includes
  #include "lldb/Core/Stream.h"
- 
- using namespace lldb_private;
-+//
-+using namespace llvm;
-+//using namespace sys;
- 
- class Pool {
- public:
-@@ -190,11 +195,11 @@ protected:
- // global destructor chain is run, and trying to make sure no destructors
+@@ -191,10 +192,10 @@ protected:
  // touch ConstStrings is difficult.  So we leak the pool instead.
  //----------------------------------------------------------------------
-+LLVM_DEFINE_ONCE_FLAG(g_pool_initialization_flag);
  static Pool &StringPool() {
 -  static std::once_flag g_pool_initialization_flag;
++  LLVM_DEFINE_ONCE_FLAG(g_pool_initialization_flag);
    static Pool *g_string_pool = nullptr;
  
 -  std::call_once(g_pool_initialization_flag,
diff --git a/lldb-netbsd/patches/patch-source_Core_Debugger.cpp b/lldb-netbsd/patches/patch-source_Core_Debugger.cpp
index f382549..f1df293 100644
--- a/lldb-netbsd/patches/patch-source_Core_Debugger.cpp
+++ b/lldb-netbsd/patches/patch-source_Core_Debugger.cpp
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- source/Core/Debugger.cpp.orig	2016-12-17 10:30:30.000000000 +0000
+--- source/Core/Debugger.cpp.orig	2017-01-31 17:20:57.000000000 +0000
 +++ source/Core/Debugger.cpp
 @@ -61,8 +61,11 @@
  #include "lldb/Utility/AnsiTerminal.h"
diff --git a/lldb-netbsd/patches/patch-source_Core_ModuleList.cpp b/lldb-netbsd/patches/patch-source_Core_ModuleList.cpp
index 6adbdfe..1d145f7 100644
--- a/lldb-netbsd/patches/patch-source_Core_ModuleList.cpp
+++ b/lldb-netbsd/patches/patch-source_Core_ModuleList.cpp
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Core/ModuleList.cpp.orig	2016-12-17 10:30:30.000000000 +0000
 +++ source/Core/ModuleList.cpp
-@@ -26,8 +26,11 @@
+@@ -26,6 +26,8 @@
  #include "lldb/Symbol/SymbolFile.h"
  #include "lldb/Symbol/VariableList.h"
  
@@ -10,11 +10,8 @@ $NetBSD$
 +
  using namespace lldb;
  using namespace lldb_private;
-+using namespace llvm;
  
- ModuleList::ModuleList()
-     : m_modules(), m_modules_mutex(), m_notifier(nullptr) {}
-@@ -644,8 +647,8 @@ size_t ModuleList::GetIndexForModule(con
+@@ -644,8 +646,8 @@ size_t ModuleList::GetIndexForModule(con
  
  static ModuleList &GetSharedModuleList() {
    static ModuleList *g_shared_module_list = nullptr;
diff --git a/lldb-netbsd/patches/patch-source_Host_CMakeLists.txt b/lldb-netbsd/patches/patch-source_Host_CMakeLists.txt
index e299a1d..8c12ff1 100644
--- a/lldb-netbsd/patches/patch-source_Host_CMakeLists.txt
+++ b/lldb-netbsd/patches/patch-source_Host_CMakeLists.txt
@@ -1,8 +1,8 @@
 $NetBSD$
 
---- source/Host/CMakeLists.txt.orig	2016-12-17 10:30:35.000000000 +0000
+--- source/Host/CMakeLists.txt.orig	2017-01-31 17:20:57.000000000 +0000
 +++ source/Host/CMakeLists.txt
-@@ -141,6 +141,7 @@ else()
+@@ -140,6 +140,7 @@ else()
        netbsd/HostInfoNetBSD.cpp
        netbsd/HostThreadNetBSD.cpp
        netbsd/ThisThread.cpp
diff --git a/lldb-netbsd/patches/patch-source_Host_common_Editline.cpp b/lldb-netbsd/patches/patch-source_Host_common_Editline.cpp
index 4bd372f..bfb3805 100644
--- a/lldb-netbsd/patches/patch-source_Host_common_Editline.cpp
+++ b/lldb-netbsd/patches/patch-source_Host_common_Editline.cpp
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- source/Host/common/Editline.cpp.orig	2016-12-17 10:30:38.000000000 +0000
+--- source/Host/common/Editline.cpp.orig	2017-01-31 17:20:57.000000000 +0000
 +++ source/Host/common/Editline.cpp
 @@ -24,6 +24,7 @@
  
@@ -10,7 +10,7 @@ $NetBSD$
  
  // Workaround for what looks like an OS X-specific issue, but other platforms
  // may benefit from something similar if issues arise.  The libedit library
-@@ -1160,8 +1161,8 @@ Editline::Editline(const char *editline_
+@@ -1151,8 +1152,8 @@ Editline::Editline(const char *editline_
      if (term_fd != -1) {
        static std::mutex *g_init_terminal_fds_mutex_ptr = nullptr;
        static std::set<int> *g_init_terminal_fds_ptr = nullptr;
diff --git a/lldb-netbsd/patches/patch-source_Host_common_Host.cpp b/lldb-netbsd/patches/patch-source_Host_common_Host.cpp
index 6dbef1a..2fd3159 100644
--- a/lldb-netbsd/patches/patch-source_Host_common_Host.cpp
+++ b/lldb-netbsd/patches/patch-source_Host_common_Host.cpp
@@ -1,19 +1,8 @@
 $NetBSD$
 
---- source/Host/common/Host.cpp.orig	2016-12-17 10:30:38.000000000 +0000
+--- source/Host/common/Host.cpp.orig	2017-01-31 17:20:57.000000000 +0000
 +++ source/Host/common/Host.cpp
-@@ -40,6 +40,10 @@
- #include <pthread_np.h>
- #endif
- 
-+#if defined(__NetBSD__)
-+#include <lwp.h>
-+#endif
-+
- // C++ Includes
- 
- // Other libraries and framework includes
-@@ -69,6 +73,8 @@
+@@ -73,6 +73,8 @@
  #include "lldb/Host/windows/ProcessLauncherWindows.h"
  #elif defined(__linux__)
  #include "lldb/Host/linux/ProcessLauncherLinux.h"
@@ -22,16 +11,7 @@ $NetBSD$
  #else
  #include "lldb/Host/posix/ProcessLauncherPosix.h"
  #endif
-@@ -324,6 +330,8 @@ lldb::tid_t Host::GetCurrentThreadID() {
-   return lldb::tid_t(gettid());
- #elif defined(__linux__)
-   return lldb::tid_t(syscall(SYS_gettid));
-+#elif defined(__NetBSD__)
-+  return lldb::tid_t(_lwp_self());
- #else
-   return lldb::tid_t(pthread_self());
- #endif
-@@ -617,7 +625,7 @@ Error Host::RunShellCommand(const Args &
+@@ -623,7 +625,7 @@ Error Host::RunShellCommand(const Args &
    return error;
  }
  
@@ -40,7 +20,7 @@ $NetBSD$
  // systems
  
  #if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) ||        \
-@@ -694,7 +702,7 @@ Error Host::LaunchProcessPosixSpawn(cons
+@@ -700,7 +702,7 @@ Error Host::LaunchProcessPosixSpawn(cons
    sigemptyset(&no_signals);
    sigfillset(&all_signals);
    ::posix_spawnattr_setsigmask(&attr, &no_signals);
@@ -49,7 +29,7 @@ $NetBSD$
    ::posix_spawnattr_setsigdefault(&attr, &no_signals);
  #else
    ::posix_spawnattr_setsigdefault(&attr, &all_signals);
-@@ -971,6 +979,8 @@ Error Host::LaunchProcess(ProcessLaunchI
+@@ -977,6 +979,8 @@ Error Host::LaunchProcess(ProcessLaunchI
    delegate_launcher.reset(new ProcessLauncherWindows());
  #elif defined(__linux__)
    delegate_launcher.reset(new ProcessLauncherLinux());
diff --git a/lldb-netbsd/patches/patch-source_Host_common_HostInfoBase.cpp b/lldb-netbsd/patches/patch-source_Host_common_HostInfoBase.cpp
index 6fe5d64..e833153 100644
--- a/lldb-netbsd/patches/patch-source_Host_common_HostInfoBase.cpp
+++ b/lldb-netbsd/patches/patch-source_Host_common_HostInfoBase.cpp
@@ -10,15 +10,7 @@ $NetBSD$
  #include "llvm/Support/raw_ostream.h"
  
  #include <mutex> // std::once
-@@ -29,6 +30,7 @@
- 
- using namespace lldb;
- using namespace lldb_private;
-+using namespace llvm;
- 
- namespace {
- //----------------------------------------------------------------------
-@@ -79,8 +81,8 @@ void HostInfoBase::Terminate() {
+@@ -79,8 +80,8 @@ void HostInfoBase::Terminate() {
  }
  
  uint32_t HostInfoBase::GetNumberCPUS() {
@@ -29,7 +21,7 @@ $NetBSD$
      g_fields->m_number_cpus = std::thread::hardware_concurrency();
    });
    return g_fields->m_number_cpus;
-@@ -89,8 +91,8 @@ uint32_t HostInfoBase::GetNumberCPUS() {
+@@ -89,8 +90,8 @@ uint32_t HostInfoBase::GetNumberCPUS() {
  uint32_t HostInfoBase::GetMaxThreadNameLength() { return 0; }
  
  llvm::StringRef HostInfoBase::GetVendorString() {
@@ -40,7 +32,7 @@ $NetBSD$
      g_fields->m_vendor_string =
          HostInfo::GetArchitecture().GetTriple().getVendorName().str();
    });
-@@ -98,8 +100,8 @@ llvm::StringRef HostInfoBase::GetVendorS
+@@ -98,8 +99,8 @@ llvm::StringRef HostInfoBase::GetVendorS
  }
  
  llvm::StringRef HostInfoBase::GetOSString() {
@@ -51,7 +43,7 @@ $NetBSD$
      g_fields->m_os_string =
          std::move(HostInfo::GetArchitecture().GetTriple().getOSName());
    });
-@@ -107,8 +109,8 @@ llvm::StringRef HostInfoBase::GetOSStrin
+@@ -107,8 +108,8 @@ llvm::StringRef HostInfoBase::GetOSStrin
  }
  
  llvm::StringRef HostInfoBase::GetTargetTriple() {
@@ -62,7 +54,7 @@ $NetBSD$
      g_fields->m_host_triple =
          HostInfo::GetArchitecture().GetTriple().getTriple();
    });
-@@ -116,8 +118,8 @@ llvm::StringRef HostInfoBase::GetTargetT
+@@ -116,8 +117,8 @@ llvm::StringRef HostInfoBase::GetTargetT
  }
  
  const ArchSpec &HostInfoBase::GetArchitecture(ArchitectureKind arch_kind) {
@@ -73,7 +65,7 @@ $NetBSD$
      HostInfo::ComputeHostArchitectureSupport(g_fields->m_host_arch_32,
                                               g_fields->m_host_arch_64);
    });
-@@ -144,9 +146,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
+@@ -144,9 +145,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
    FileSpec *result = nullptr;
    switch (type) {
    case lldb::ePathTypeLLDBShlibDir: {
@@ -85,7 +77,7 @@ $NetBSD$
        success =
            HostInfo::ComputeSharedLibraryDirectory(g_fields->m_lldb_so_dir);
        Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
-@@ -158,9 +160,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
+@@ -158,9 +159,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
        result = &g_fields->m_lldb_so_dir;
    } break;
    case lldb::ePathTypeSupportExecutableDir: {
@@ -97,7 +89,7 @@ $NetBSD$
        success = HostInfo::ComputeSupportExeDirectory(
            g_fields->m_lldb_support_exe_dir);
        Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
-@@ -173,9 +175,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
+@@ -173,9 +174,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
        result = &g_fields->m_lldb_support_exe_dir;
    } break;
    case lldb::ePathTypeHeaderDir: {
@@ -109,7 +101,7 @@ $NetBSD$
        success = HostInfo::ComputeHeaderDirectory(g_fields->m_lldb_headers_dir);
        Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
        if (log)
-@@ -186,9 +188,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
+@@ -186,9 +187,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
        result = &g_fields->m_lldb_headers_dir;
    } break;
    case lldb::ePathTypePythonDir: {
@@ -121,7 +113,7 @@ $NetBSD$
        success = HostInfo::ComputePythonDirectory(g_fields->m_lldb_python_dir);
        Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
        if (log)
-@@ -199,9 +201,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
+@@ -199,9 +200,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
        result = &g_fields->m_lldb_python_dir;
    } break;
    case lldb::ePathTypeClangDir: {
@@ -133,7 +125,7 @@ $NetBSD$
        success =
            HostInfo::ComputeClangDirectory(g_fields->m_lldb_clang_resource_dir);
        Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
-@@ -214,9 +216,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
+@@ -214,9 +215,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
        result = &g_fields->m_lldb_clang_resource_dir;
    } break;
    case lldb::ePathTypeLLDBSystemPlugins: {
@@ -145,7 +137,7 @@ $NetBSD$
        success = HostInfo::ComputeSystemPluginsDirectory(
            g_fields->m_lldb_system_plugin_dir);
        Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
-@@ -229,9 +231,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
+@@ -229,9 +230,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
        result = &g_fields->m_lldb_system_plugin_dir;
    } break;
    case lldb::ePathTypeLLDBUserPlugins: {
@@ -157,7 +149,7 @@ $NetBSD$
        success = HostInfo::ComputeUserPluginsDirectory(
            g_fields->m_lldb_user_plugin_dir);
        Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
-@@ -244,9 +246,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
+@@ -244,9 +245,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
        result = &g_fields->m_lldb_user_plugin_dir;
    } break;
    case lldb::ePathTypeLLDBTempSystemDir: {
@@ -169,7 +161,7 @@ $NetBSD$
        success = HostInfo::ComputeProcessTempFileDirectory(
            g_fields->m_lldb_process_tmp_dir);
        Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
-@@ -259,9 +261,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
+@@ -259,9 +260,9 @@ bool HostInfoBase::GetLLDBPath(lldb::Pat
        result = &g_fields->m_lldb_process_tmp_dir;
    } break;
    case lldb::ePathTypeGlobalLLDBTempSystemDir: {
diff --git a/lldb-netbsd/patches/patch-source_Host_linux_HostInfoLinux.cpp b/lldb-netbsd/patches/patch-source_Host_linux_HostInfoLinux.cpp
index 5fbfd7c..a7c3bc1 100644
--- a/lldb-netbsd/patches/patch-source_Host_linux_HostInfoLinux.cpp
+++ b/lldb-netbsd/patches/patch-source_Host_linux_HostInfoLinux.cpp
@@ -2,15 +2,7 @@ $NetBSD$
 
 --- source/Host/linux/HostInfoLinux.cpp.orig	2016-12-17 10:30:35.000000000 +0000
 +++ source/Host/linux/HostInfoLinux.cpp
-@@ -19,6 +19,7 @@
- #include <mutex> // std::once
- 
- using namespace lldb_private;
-+using namespace llvm;
- 
- namespace {
- struct HostInfoLinuxFields {
-@@ -44,8 +45,8 @@ uint32_t HostInfoLinux::GetMaxThreadName
+@@ -44,8 +44,8 @@ uint32_t HostInfoLinux::GetMaxThreadName
  bool HostInfoLinux::GetOSVersion(uint32_t &major, uint32_t &minor,
                                   uint32_t &update) {
    static bool success = false;
@@ -21,7 +13,7 @@ $NetBSD$
  
      struct utsname un;
      if (uname(&un) == 0) {
-@@ -100,8 +101,8 @@ bool HostInfoLinux::GetOSKernelDescripti
+@@ -100,8 +100,8 @@ bool HostInfoLinux::GetOSKernelDescripti
  llvm::StringRef HostInfoLinux::GetDistributionId() {
    // Try to run 'lbs_release -i', and use that response
    // for the distribution id.
diff --git a/lldb-netbsd/patches/patch-source_Host_netbsd_HostInfoNetBSD.cpp b/lldb-netbsd/patches/patch-source_Host_netbsd_HostInfoNetBSD.cpp
deleted file mode 100644
index 12f3448..0000000
--- a/lldb-netbsd/patches/patch-source_Host_netbsd_HostInfoNetBSD.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-$NetBSD$
-
---- source/Host/netbsd/HostInfoNetBSD.cpp.orig	2016-12-17 10:30:35.000000000 +0000
-+++ source/Host/netbsd/HostInfoNetBSD.cpp
-@@ -85,15 +85,15 @@ FileSpec HostInfoNetBSD::GetProgramFileS
-   static FileSpec g_program_filespec;
- 
-   if (!g_program_filespec) {
--    ssize_t len;
--    static char buf[PATH_MAX];
--    char name[PATH_MAX];
-+    static const int name[] = {
-+        CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME,
-+    };
-+    char path[MAXPATHLEN];
-+    size_t len;
- 
--    ::snprintf(name, PATH_MAX, "/proc/%d/exe", ::getpid());
--    len = ::readlink(name, buf, PATH_MAX - 1);
--    if (len != -1) {
--      buf[len] = '\0';
--      g_program_filespec.SetFile(buf, false);
-+    len = sizeof(path);
-+    if (sysctl(name, __arraycount(name), path, &len, NULL, 0) != -1) {
-+        g_program_filespec.SetFile(path, false);
-     }
-   }
-   return g_program_filespec;
diff --git a/lldb-netbsd/patches/patch-source_Host_netbsd_ProcessLauncherNetBSD.cpp b/lldb-netbsd/patches/patch-source_Host_netbsd_ProcessLauncherNetBSD.cpp
index dc5981b..f607aa9 100644
--- a/lldb-netbsd/patches/patch-source_Host_netbsd_ProcessLauncherNetBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Host_netbsd_ProcessLauncherNetBSD.cpp
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- source/Host/netbsd/ProcessLauncherNetBSD.cpp.orig	2016-12-20 12:45:58.410690935 +0000
+--- source/Host/netbsd/ProcessLauncherNetBSD.cpp.orig	2017-01-31 17:46:22.072872642 +0000
 +++ source/Host/netbsd/ProcessLauncherNetBSD.cpp
 @@ -0,0 +1,170 @@
 +//===-- ProcessLauncherNetBSD.cpp --------------------------------*- C++ -*-===//
diff --git a/lldb-netbsd/patches/patch-source_Host_windows_HostInfoWindows.cpp b/lldb-netbsd/patches/patch-source_Host_windows_HostInfoWindows.cpp
index cfe8ea3..5fc2487 100644
--- a/lldb-netbsd/patches/patch-source_Host_windows_HostInfoWindows.cpp
+++ b/lldb-netbsd/patches/patch-source_Host_windows_HostInfoWindows.cpp
@@ -2,15 +2,7 @@ $NetBSD$
 
 --- source/Host/windows/HostInfoWindows.cpp.orig	2016-12-17 10:30:35.000000000 +0000
 +++ source/Host/windows/HostInfoWindows.cpp
-@@ -21,6 +21,7 @@
- #include "llvm/Support/raw_ostream.h"
- 
- using namespace lldb_private;
-+using namespace llvm;
- 
- FileSpec HostInfoWindows::m_program_filespec;
- 
-@@ -90,8 +91,8 @@ bool HostInfoWindows::GetHostname(std::s
+@@ -90,8 +90,8 @@ bool HostInfoWindows::GetHostname(std::s
  }
  
  FileSpec HostInfoWindows::GetProgramFileSpec() {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_ExpressionParser_Clang_ClangModulesDeclVendor.cpp b/lldb-netbsd/patches/patch-source_Plugins_ExpressionParser_Clang_ClangModulesDeclVendor.cpp
index 3be51a5..8085ee1 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_ExpressionParser_Clang_ClangModulesDeclVendor.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_ExpressionParser_Clang_ClangModulesDeclVendor.cpp
@@ -1,16 +1,8 @@
 $NetBSD$
 
---- source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp.orig	2016-12-17 10:29:53.000000000 +0000
+--- source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp.orig	2017-01-31 17:20:57.000000000 +0000
 +++ source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
-@@ -35,6 +35,7 @@
- #include "lldb/Utility/LLDBAssert.h"
- 
- using namespace lldb_private;
-+using namespace llvm;
- 
- namespace {
- // Any Clang compiler requires a consumer for diagnostics.  This one stores them
-@@ -143,9 +144,9 @@ void StoringDiagnosticConsumer::DumpDiag
+@@ -143,9 +143,9 @@ void StoringDiagnosticConsumer::DumpDiag
  static FileSpec GetResourceDir() {
    static FileSpec g_cached_resource_dir;
  
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Language_CPlusPlus_CPlusPlusLanguage.cpp b/lldb-netbsd/patches/patch-source_Plugins_Language_CPlusPlus_CPlusPlusLanguage.cpp
index aa00d33..060c770 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Language_CPlusPlus_CPlusPlusLanguage.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Language_CPlusPlus_CPlusPlusLanguage.cpp
@@ -1,8 +1,8 @@
 $NetBSD$
 
---- source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp.orig	2016-12-17 10:29:29.000000000 +0000
+--- source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp.orig	2017-01-31 17:20:57.000000000 +0000
 +++ source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
-@@ -28,6 +28,7 @@
+@@ -33,6 +33,7 @@
  #include "lldb/DataFormatters/DataVisualization.h"
  #include "lldb/DataFormatters/FormattersHelpers.h"
  #include "lldb/DataFormatters/VectorType.h"
@@ -10,15 +10,7 @@ $NetBSD$
  
  #include "BlockPointer.h"
  #include "CxxStringTypes.h"
-@@ -38,6 +39,7 @@
- using namespace lldb;
- using namespace lldb_private;
- using namespace lldb_private::formatters;
-+using namespace llvm;
- 
- void CPlusPlusLanguage::Initialize() {
-   PluginManager::RegisterPlugin(GetPluginNameStatic(), "C++ Language",
-@@ -936,10 +938,10 @@ std::unique_ptr<Language::TypeScavenger>
+@@ -1036,10 +1037,10 @@ std::unique_ptr<Language::TypeScavenger>
  }
  
  lldb::TypeCategoryImplSP CPlusPlusLanguage::GetFormatters() {
@@ -31,7 +23,7 @@ $NetBSD$
      DataVisualization::Categories::GetCategory(GetPluginName(), g_category);
      if (g_category) {
        LoadLibCxxFormatters(g_category);
-@@ -952,11 +954,11 @@ lldb::TypeCategoryImplSP CPlusPlusLangua
+@@ -1052,11 +1053,11 @@ lldb::TypeCategoryImplSP CPlusPlusLangua
  
  HardcodedFormatters::HardcodedSummaryFinder
  CPlusPlusLanguage::GetHardcodedSummaries() {
@@ -45,7 +37,7 @@ $NetBSD$
      g_formatters.push_back(
          [](lldb_private::ValueObject &valobj, lldb::DynamicValueType,
             FormatManager &) -> TypeSummaryImpl::SharedPointer {
-@@ -1016,11 +1018,11 @@ CPlusPlusLanguage::GetHardcodedSummaries
+@@ -1116,11 +1117,11 @@ CPlusPlusLanguage::GetHardcodedSummaries
  
  HardcodedFormatters::HardcodedSyntheticFinder
  CPlusPlusLanguage::GetHardcodedSynthetics() {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Language_Go_GoLanguage.cpp b/lldb-netbsd/patches/patch-source_Plugins_Language_Go_GoLanguage.cpp
index 91ccf75..84c9533 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Language_Go_GoLanguage.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Language_Go_GoLanguage.cpp
@@ -2,15 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Language/Go/GoLanguage.cpp.orig	2016-12-17 10:29:28.000000000 +0000
 +++ source/Plugins/Language/Go/GoLanguage.cpp
-@@ -27,6 +27,7 @@
- using namespace lldb;
- using namespace lldb_private;
- using namespace lldb_private::formatters;
-+using namespace llvm;
- 
- void GoLanguage::Initialize() {
-   PluginManager::RegisterPlugin(GetPluginNameStatic(), "Go Language",
-@@ -62,10 +63,10 @@ Language *GoLanguage::CreateInstance(lld
+@@ -62,10 +62,10 @@ Language *GoLanguage::CreateInstance(lld
  
  HardcodedFormatters::HardcodedSummaryFinder
  GoLanguage::GetHardcodedSummaries() {
@@ -23,7 +15,7 @@ $NetBSD$
      g_formatters.push_back(
          [](lldb_private::ValueObject &valobj, lldb::DynamicValueType,
             FormatManager &) -> TypeSummaryImpl::SharedPointer {
-@@ -104,10 +105,10 @@ GoLanguage::GetHardcodedSummaries() {
+@@ -104,10 +104,10 @@ GoLanguage::GetHardcodedSummaries() {
  
  HardcodedFormatters::HardcodedSyntheticFinder
  GoLanguage::GetHardcodedSynthetics() {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Language_Java_JavaLanguage.cpp b/lldb-netbsd/patches/patch-source_Plugins_Language_Java_JavaLanguage.cpp
index 24333c1..7afafd2 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Language_Java_JavaLanguage.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Language_Java_JavaLanguage.cpp
@@ -10,15 +10,7 @@ $NetBSD$
  
  // Project includes
  #include "JavaFormatterFunctions.h"
-@@ -28,6 +29,7 @@
- using namespace lldb;
- using namespace lldb_private;
- using namespace lldb_private::formatters;
-+using namespace llvm;
- 
- void JavaLanguage::Initialize() {
-   PluginManager::RegisterPlugin(GetPluginNameStatic(), "Java Language",
-@@ -64,10 +66,10 @@ bool JavaLanguage::IsNilReference(ValueO
+@@ -64,10 +65,10 @@ bool JavaLanguage::IsNilReference(ValueO
  }
  
  lldb::TypeCategoryImplSP JavaLanguage::GetFormatters() {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Language_ObjC_ObjCLanguage.cpp b/lldb-netbsd/patches/patch-source_Plugins_Language_ObjC_ObjCLanguage.cpp
index 80c5916..84a6133 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Language_ObjC_ObjCLanguage.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Language_ObjC_ObjCLanguage.cpp
@@ -2,15 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Language/ObjC/ObjCLanguage.cpp.orig	2016-12-17 10:29:29.000000000 +0000
 +++ source/Plugins/Language/ObjC/ObjCLanguage.cpp
-@@ -36,6 +36,7 @@
- using namespace lldb;
- using namespace lldb_private;
- using namespace lldb_private::formatters;
-+using namespace llvm;
- 
- void ObjCLanguage::Initialize() {
-   PluginManager::RegisterPlugin(GetPluginNameStatic(), "Objective-C Language",
-@@ -857,10 +858,10 @@ static void LoadCoreMediaFormatters(Type
+@@ -857,10 +857,10 @@ static void LoadCoreMediaFormatters(Type
  }
  
  lldb::TypeCategoryImplSP ObjCLanguage::GetFormatters() {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Platform_MacOSX_PlatformDarwin.cpp b/lldb-netbsd/patches/patch-source_Plugins_Platform_MacOSX_PlatformDarwin.cpp
index e824ccf..595be23 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Platform_MacOSX_PlatformDarwin.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Platform_MacOSX_PlatformDarwin.cpp
@@ -10,15 +10,7 @@ $NetBSD$
  
  #if defined(__APPLE__)
  #include <TargetConditionals.h> // for TARGET_OS_TV, TARGET_OS_WATCH
-@@ -47,6 +48,7 @@
- 
- using namespace lldb;
- using namespace lldb_private;
-+using namespace llvm;
- 
- //------------------------------------------------------------------
- /// Default Constructor
-@@ -1452,8 +1454,8 @@ static FileSpec CheckPathForXcode(const 
+@@ -1452,8 +1453,8 @@ static FileSpec CheckPathForXcode(const 
  
  static FileSpec GetXcodeContentsPath() {
    static FileSpec g_xcode_filespec;
@@ -29,7 +21,7 @@ $NetBSD$
  
      FileSpec fspec;
  
-@@ -1835,8 +1837,8 @@ lldb_private::FileSpec PlatformDarwin::L
+@@ -1835,8 +1836,8 @@ lldb_private::FileSpec PlatformDarwin::L
  
    // Find the global list of directories that we will search for
    // executables once so we don't keep doing the work over and over.
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_CMakeLists.txt b/lldb-netbsd/patches/patch-source_Plugins_Process_CMakeLists.txt
index af967f1..e76d204 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_CMakeLists.txt
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_CMakeLists.txt
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- source/Plugins/Process/CMakeLists.txt.orig	2016-12-17 10:30:06.000000000 +0000
+--- source/Plugins/Process/CMakeLists.txt.orig	2017-01-31 17:20:57.000000000 +0000
 +++ source/Plugins/Process/CMakeLists.txt
 @@ -5,6 +5,7 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "FreeB
    add_subdirectory(FreeBSD)
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_FreeBSD_ProcessFreeBSD.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_FreeBSD_ProcessFreeBSD.cpp
index 21f4497..762186b 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_FreeBSD_ProcessFreeBSD.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_FreeBSD_ProcessFreeBSD.cpp
@@ -1,16 +1,8 @@
 $NetBSD$
 
---- source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp.orig	2016-12-17 10:30:05.000000000 +0000
+--- source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp.orig	2017-01-31 17:20:57.000000000 +0000
 +++ source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
-@@ -47,6 +47,7 @@
- 
- using namespace lldb;
- using namespace lldb_private;
-+using namespace llvm;
- 
- namespace {
- UnixSignalsSP &GetFreeBSDSignals() {
-@@ -70,9 +71,9 @@ ProcessFreeBSD::CreateInstance(lldb::Tar
+@@ -71,9 +71,9 @@ ProcessFreeBSD::CreateInstance(lldb::Tar
  }
  
  void ProcessFreeBSD::Initialize() {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_Linux_NativeProcessLinux.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_Linux_NativeProcessLinux.cpp
index 258a744..33b7575 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_Linux_NativeProcessLinux.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_Linux_NativeProcessLinux.cpp
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- source/Plugins/Process/Linux/NativeProcessLinux.cpp.orig	2016-12-17 10:30:08.000000000 +0000
+--- source/Plugins/Process/Linux/NativeProcessLinux.cpp.orig	2017-01-31 17:20:57.000000000 +0000
 +++ source/Plugins/Process/Linux/NativeProcessLinux.cpp
 @@ -75,9 +75,9 @@ using namespace llvm;
  
@@ -11,6 +11,6 @@ $NetBSD$
  
 -  std::call_once(flag, [] {
 +  llvm::call_once(flag, [] {
-     Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
+     Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS));
  
      uint32_t source = 0x47424742;
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_MacOSX-Kernel_ProcessKDP.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_MacOSX-Kernel_ProcessKDP.cpp
index 3d6e548..4f87fc0 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_MacOSX-Kernel_ProcessKDP.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_MacOSX-Kernel_ProcessKDP.cpp
@@ -1,16 +1,8 @@
 $NetBSD$
 
---- source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp.orig	2016-12-17 10:30:04.000000000 +0000
+--- source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp.orig	2017-01-31 17:20:57.000000000 +0000
 +++ source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
-@@ -50,6 +50,7 @@
- 
- using namespace lldb;
- using namespace lldb_private;
-+using namespace llvm;
- 
- namespace {
- 
-@@ -719,9 +720,9 @@ Error ProcessKDP::DoSignal(int signo) {
+@@ -718,9 +718,9 @@ Error ProcessKDP::DoSignal(int signo) {
  }
  
  void ProcessKDP::Initialize() {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_CMakeLists.txt b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_CMakeLists.txt
deleted file mode 100644
index b941fb3..0000000
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD$
-
---- source/Plugins/Process/NetBSD/CMakeLists.txt.orig	2016-12-19 01:22:58.074182561 +0000
-+++ source/Plugins/Process/NetBSD/CMakeLists.txt
-@@ -0,0 +1,8 @@
-+include_directories(.)
-+include_directories(../POSIX)
-+include_directories(../Utility)
-+
-+add_lldb_library(lldbPluginProcessNetBSD
-+  NativeProcessNetBSD.cpp
-+  NativeThreadNetBSD.cpp
-+  )
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
deleted file mode 100644
index 26a804c..0000000
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.cpp
+++ /dev/null
@@ -1,1392 +0,0 @@
-$NetBSD$
-
---- source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp.orig	2017-01-21 18:35:30.311662060 +0000
-+++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
-@@ -0,0 +1,1387 @@
-+//===-- 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
-+#include <errno.h>
-+#include <stdint.h>
-+#include <string.h>
-+#include <unistd.h>
-+
-+// C++ Includes
-+#include <fstream>
-+#include <mutex>
-+#include <sstream>
-+#include <string>
-+#include <unordered_map>
-+
-+
-+// Other libraries and framework includes
-+#include "lldb/Core/EmulateInstruction.h"
-+#include "lldb/Core/Error.h"
-+#include "lldb/Core/ModuleSpec.h"
-+#include "lldb/Core/RegisterValue.h"
-+#include "lldb/Core/State.h"
-+#include "lldb/Host/Host.h"
-+#include "lldb/Host/HostProcess.h"
-+#include "lldb/Host/ThreadLauncher.h"
-+#include "lldb/Host/common/NativeBreakpoint.h"
-+#include "lldb/Host/common/NativeRegisterContext.h"
-+#include "lldb/Host/netbsd/ProcessLauncherNetBSD.h"
-+#include "lldb/Symbol/ObjectFile.h"
-+#include "lldb/Target/Process.h"
-+#include "lldb/Target/ProcessLaunchInfo.h"
-+#include "lldb/Target/Target.h"
-+#include "lldb/Utility/LLDBAssert.h"
-+#include "lldb/Utility/PseudoTerminal.h"
-+#include "lldb/Utility/StringExtractor.h"
-+
-+#include "NativeThreadNetBSD.h"
-+#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
-+#include <sys/socket.h>
-+
-+#include <sys/ptrace.h>
-+#include <sys/syscall.h>
-+#include <sys/types.h>
-+#include <sys/user.h>
-+#include <sys/wait.h>
-+
-+using namespace lldb;
-+using namespace lldb_private;
-+using namespace lldb_private::process_netbsd;
-+using namespace llvm;
-+
-+namespace {
-+void MaybeLogLaunchInfo(const ProcessLaunchInfo &info) {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
-+  if (!log)
-+    return;
-+
-+  if (const FileAction *action = info.GetFileActionForFD(STDIN_FILENO))
-+    log->Printf("%s: setting STDIN to '%s'", __FUNCTION__,
-+                action->GetFileSpec().GetCString());
-+  else
-+    log->Printf("%s leaving STDIN as is", __FUNCTION__);
-+
-+  if (const FileAction *action = info.GetFileActionForFD(STDOUT_FILENO))
-+    log->Printf("%s setting STDOUT to '%s'", __FUNCTION__,
-+                action->GetFileSpec().GetCString());
-+  else
-+    log->Printf("%s leaving STDOUT as is", __FUNCTION__);
-+
-+  if (const FileAction *action = info.GetFileActionForFD(STDERR_FILENO))
-+    log->Printf("%s setting STDERR to '%s'", __FUNCTION__,
-+                action->GetFileSpec().GetCString());
-+  else
-+    log->Printf("%s leaving STDERR as is", __FUNCTION__);
-+
-+  int i = 0;
-+  for (const char **args = info.GetArguments().GetConstArgumentVector(); *args;
-+       ++args, ++i)
-+    log->Printf("%s arg %d: \"%s\"", __FUNCTION__, i,
-+                *args ? *args : "nullptr");
-+}
-+
-+void DisplayBytes(StreamString &s, void *bytes, uint32_t count) {
-+  uint8_t *ptr = (uint8_t *)bytes;
-+  const uint32_t loop_count = count;
-+  for (uint32_t i = 0; i < loop_count; i++) {
-+    s.Printf("[%x]", *ptr);
-+    ptr++;
-+  }
-+}
-+
-+void PtraceDisplayBytes(int &req, void *addr, int data) {
-+  StreamString buf;
-+  Log *verbose_log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(
-+      POSIX_LOG_PTRACE | POSIX_LOG_VERBOSE));
-+
-+  if (verbose_log) {
-+    switch (req) {
-+    case PT_WRITE_I: {
-+      DisplayBytes(buf, &data, sizeof(int));
-+      verbose_log->Printf("PT_WRITE_I %s", buf.GetData());
-+      break;
-+    }
-+    case PT_WRITE_D: {
-+      DisplayBytes(buf, &data, sizeof(int));
-+      verbose_log->Printf("PT_WRITE_I %s", buf.GetData());
-+      break;
-+    }
-+#ifdef PT_SETREGS
-+    case PT_SETREGS: {
-+      DisplayBytes(buf, addr, sizeof(struct reg));
-+      verbose_log->Printf("PT_SETREGS %s", buf.GetData());
-+      break;
-+    }
-+#endif
-+#ifdef PT_SETFPREGS
-+    case PT_SETFPREGS: {
-+      DisplayBytes(buf, addr, sizeof(struct fpreg));
-+      verbose_log->Printf("PT_SETFPREGS %s", buf.GetData());
-+      break;
-+    }
-+#endif
-+#ifdef PT_SETXMMREGS
-+    case PT_SETXMMREGS: {
-+      DisplayBytes(buf, addr, sizeof(struct xmmregs));
-+      verbose_log->Printf("PT_SETXMMREGS %s", buf.GetData());
-+      break;
-+    }
-+#endif
-+#ifdef PT_SETVECREGS
-+    case PT_SETVECREGS: {
-+      DisplayBytes(buf, addr, sizeof(struct vreg));
-+      verbose_log->Printf("PT_SETVECREGS %s", buf.GetData());
-+      break;
-+    }
-+#endif
-+    default: {}
-+    }
-+  }
-+}
-+
-+static constexpr unsigned k_ptrace_word_size = sizeof(void *);
-+static_assert(sizeof(long) >= k_ptrace_word_size,
-+              "Size of long must be larger than ptrace word size");
-+} // end of anonymous namespace
-+
-+// Simple helper function to ensure flags are enabled on the given file
-+// descriptor.
-+static Error EnsureFDFlags(int fd, int flags) {
-+  Error error;
-+
-+  int status = fcntl(fd, F_GETFL);
-+  if (status == -1) {
-+    error.SetErrorToErrno();
-+    return error;
-+  }
-+
-+  if (fcntl(fd, F_SETFL, status | flags) == -1) {
-+    error.SetErrorToErrno();
-+    return error;
-+  }
-+
-+  return error;
-+}
-+
-+// -----------------------------------------------------------------------------
-+// Public Static Methods
-+// -----------------------------------------------------------------------------
-+
-+Error NativeProcessProtocol::Launch(
-+    ProcessLaunchInfo &launch_info,
-+    NativeProcessProtocol::NativeDelegate &native_delegate, MainLoop &mainloop,
-+    NativeProcessProtocolSP &native_process_sp) {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
-+
-+  Error error;
-+
-+  // Verify the working directory is valid if one was specified.
-+  FileSpec working_dir{launch_info.GetWorkingDirectory()};
-+  if (working_dir &&
-+      (!working_dir.ResolvePath() ||
-+       working_dir.GetFileType() != FileSpec::eFileTypeDirectory)) {
-+    error.SetErrorStringWithFormat("No such file or directory: %s",
-+                                   working_dir.GetCString());
-+    return error;
-+  }
-+
-+  // Create the NativeProcessNetBSD in launch mode.
-+  native_process_sp.reset(new NativeProcessNetBSD());
-+
-+  if (!native_process_sp->RegisterNativeDelegate(native_delegate)) {
-+    native_process_sp.reset();
-+    error.SetErrorStringWithFormat("failed to register the native delegate");
-+    return error;
-+  }
-+
-+  error = std::static_pointer_cast<NativeProcessNetBSD>(native_process_sp)
-+              ->LaunchInferior(mainloop, launch_info);
-+
-+  if (error.Fail()) {
-+    native_process_sp.reset();
-+    if (log)
-+      log->Printf("NativeProcessNetBSD::%s failed to launch process: %s",
-+                  __FUNCTION__, error.AsCString());
-+    return error;
-+  }
-+
-+  launch_info.SetProcessID(native_process_sp->GetID());
-+
-+  return error;
-+}
-+
-+Error NativeProcessProtocol::Attach(
-+    lldb::pid_t pid, NativeProcessProtocol::NativeDelegate &native_delegate,
-+    MainLoop &mainloop, NativeProcessProtocolSP &native_process_sp) {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
-+  if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))
-+    log->Printf("NativeProcessNetBSD::%s(pid = %" PRIi64 ")", __FUNCTION__, pid);
-+
-+  // Retrieve the architecture for the running process.
-+  ArchSpec process_arch;
-+  Error error = ResolveProcessArchitecture(pid, process_arch);
-+  if (!error.Success())
-+    return error;
-+
-+  std::shared_ptr<NativeProcessNetBSD> native_process_netbsd_sp(
-+      new NativeProcessNetBSD());
-+
-+  if (!native_process_netbsd_sp->RegisterNativeDelegate(native_delegate)) {
-+    error.SetErrorStringWithFormat("failed to register the native delegate");
-+    return error;
-+  }
-+
-+  native_process_netbsd_sp->AttachToInferior(mainloop, pid, error);
-+  if (!error.Success())
-+    return error;
-+
-+  native_process_sp = native_process_netbsd_sp;
-+  return error;
-+}
-+
-+// -----------------------------------------------------------------------------
-+// Public Instance Methods
-+// -----------------------------------------------------------------------------
-+
-+NativeProcessNetBSD::NativeProcessNetBSD()
-+    : NativeProcessProtocol(LLDB_INVALID_PROCESS_ID), m_arch(),
-+      m_supports_mem_region(eLazyBoolCalculate), m_mem_region_cache(),
-+      m_pending_notification_tid(LLDB_INVALID_THREAD_ID) {}
-+
-+void NativeProcessNetBSD::AttachToInferior(MainLoop &mainloop, lldb::pid_t pid,
-+                                          Error &error) {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
-+  if (log)
-+    log->Printf("NativeProcessNetBSD::%s (pid = %" PRIi64 ")", __FUNCTION__,
-+                pid);
-+
-+  m_sigchld_handle = mainloop.RegisterSignal(
-+      SIGCHLD, [this](MainLoopBase &) { SigchldHandler(); }, error);
-+  if (!m_sigchld_handle)
-+    return;
-+
-+  error = ResolveProcessArchitecture(pid, m_arch);
-+  if (!error.Success())
-+    return;
-+
-+  // Set the architecture to the exe architecture.
-+  if (log)
-+    log->Printf("NativeProcessNetBSD::%s (pid = %" PRIi64
-+                ") detected architecture %s",
-+                __FUNCTION__, pid, m_arch.GetArchitectureName());
-+
-+  m_pid = pid;
-+  SetState(eStateAttaching);
-+
-+  Attach(pid, error);
-+}
-+
-+Error NativeProcessNetBSD::LaunchInferior(MainLoop &mainloop,
-+                                         ProcessLaunchInfo &launch_info) {
-+  Error error;
-+  m_sigchld_handle = mainloop.RegisterSignal(
-+      SIGCHLD, [this](MainLoopBase &) { SigchldHandler(); }, error);
-+  if (!m_sigchld_handle)
-+    return error;
-+
-+  SetState(eStateLaunching);
-+
-+  MaybeLogLaunchInfo(launch_info);
-+
-+  ::pid_t pid =
-+      ProcessLauncherNetBSD().LaunchProcess(launch_info, error).GetProcessId();
-+  if (error.Fail())
-+    return error;
-+
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
-+
-+  // Wait for the child process to trap on its call to execve.
-+  ::pid_t wpid;
-+  int status;
-+  if ((wpid = waitpid(pid, &status, 0)) < 0) {
-+    error.SetErrorToErrno();
-+    if (log)
-+      log->Printf("NativeProcessNetBSD::%s waitpid for inferior failed with %s",
-+                  __FUNCTION__, error.AsCString());
-+
-+    // Mark the inferior as invalid.
-+    // FIXME this could really use a new state - eStateLaunchFailure.  For now,
-+    // using eStateInvalid.
-+    SetState(StateType::eStateInvalid);
-+
-+    return error;
-+  }
-+  assert(WIFSTOPPED(status) && (wpid == static_cast<::pid_t>(pid)) &&
-+         "Could not sync with inferior process.");
-+
-+  if (log)
-+    log->Printf("NativeProcessNetBSD::%s inferior started, now in stopped state",
-+                __FUNCTION__);
-+
-+  SetDefaultPtraceOpts(pid);
-+
-+  // Release the master terminal descriptor and pass it off to the
-+  // NativeProcessNetBSD instance.  Similarly stash the inferior pid.
-+  m_terminal_fd = launch_info.GetPTY().ReleaseMasterFileDescriptor();
-+  m_pid = pid;
-+  launch_info.SetProcessID(pid);
-+
-+  if (m_terminal_fd != -1) {
-+    error = EnsureFDFlags(m_terminal_fd, O_NONBLOCK);
-+    if (error.Fail()) {
-+      if (log)
-+        log->Printf("NativeProcessNetBSD::%s inferior EnsureFDFlags failed for "
-+                    "ensuring terminal O_NONBLOCK setting: %s",
-+                    __FUNCTION__, error.AsCString());
-+
-+      // Mark the inferior as invalid.
-+      // FIXME this could really use a new state - eStateLaunchFailure.  For
-+      // now, using eStateInvalid.
-+      SetState(StateType::eStateInvalid);
-+
-+      return error;
-+    }
-+  }
-+
-+  if (log)
-+    log->Printf("NativeProcessNetBSD::%s() adding pid = %" PRIu64, __FUNCTION__,
-+                uint64_t(pid));
-+
-+  ResolveProcessArchitecture(m_pid, m_arch);
-+
-+  /* Initialize threads */
-+  struct ptrace_lwpinfo info = {};
-+  error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info));
-+  if (error.Fail()) {
-+    SetState(StateType::eStateInvalid);
-+    return error;
-+  }
-+  while (info.pl_lwpid != 0) {
-+    NativeThreadNetBSDSP thread_sp = AddThread(info.pl_lwpid);
-+    thread_sp->SetStoppedBySignal(SIGSTOP);
-+    error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info));
-+    if (error.Fail()) {
-+      SetState(StateType::eStateInvalid);
-+      return error;
-+    }
-+  }
-+
-+  /* Set process stopped */
-+  SetState(StateType::eStateStopped);
-+
-+  if (log) {
-+    if (error.Success())
-+      log->Printf("NativeProcessNetBSD::%s inferior launching succeeded",
-+                  __FUNCTION__);
-+    else
-+      log->Printf("NativeProcessNetBSD::%s inferior launching failed: %s",
-+                  __FUNCTION__, error.AsCString());
-+  }
-+  return error;
-+}
-+
-+::pid_t NativeProcessNetBSD::Attach(lldb::pid_t pid, Error &error) {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
-+
-+  // Use a map to keep track of the threads which we have attached/need to
-+  // attach.
-+  Host::TidMap tids_to_attach;
-+  if (pid <= 1) {
-+    error.SetErrorToGenericError();
-+    error.SetErrorString("Attaching to process 1 is not allowed.");
-+    return -1;
-+  }
-+
-+  // Attach to the requested process.
-+  // An attach will cause the thread to stop with a SIGSTOP.
-+  error = PtraceWrapper(PT_ATTACH, pid);
-+  if (error.Fail())
-+    return -1;
-+
-+  int status;
-+  // Need to use WALLSIG otherwise we receive an error with errno=ECHLD
-+  // At this point we should have a thread stopped if waitpid succeeds.
-+  if ((status = waitpid(pid, NULL, WALLSIG)) < 0)
-+    return -1;
-+
-+  SetDefaultPtraceOpts(pid);
-+
-+  m_pid = pid;
-+
-+  /* Initialize threads */
-+  struct ptrace_lwpinfo info = {};
-+  error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info));
-+  if (error.Fail()) {
-+    SetState(StateType::eStateInvalid);
-+    return -1;
-+  }
-+  while (info.pl_lwpid != 0) {
-+    NativeThreadNetBSDSP thread_sp = AddThread(info.pl_lwpid);
-+    thread_sp->SetStoppedBySignal(SIGSTOP);
-+    error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info));
-+    if (error.Fail()) {
-+      SetState(StateType::eStateInvalid);
-+      return -1;
-+    }
-+  }
-+
-+  // Let our process instance know the thread has stopped.
-+  SetState(StateType::eStateStopped);
-+
-+  return pid;
-+}
-+
-+Error NativeProcessNetBSD::SetDefaultPtraceOpts(lldb::pid_t pid) {
-+  ptrace_event_t event = {};
-+
-+#if notyet
-+  // Report forks
-+  event.pe_set_event |= PTRACE_FORK;
-+
-+  // Report vforks
-+  // TODO: Currently unsupported in NetBSD
-+  event.pe_set_event |= PTRACE_VFORK;
-+
-+  // Report finished vforks - the parent unblocked after execve(2) or exit(2) of the child
-+  event.pe_set_event |= PTRACE_VFORK_DONE;
-+#endif
-+
-+  // Report LWP (thread) creation
-+  event.pe_set_event |= PTRACE_LWP_CREATE;
-+
-+  // Report LWP (thread) termination
-+  event.pe_set_event |= PTRACE_LWP_EXIT;
-+
-+  return PtraceWrapper(PT_SET_EVENT_MASK, pid, &event, sizeof(struct ptrace_event));
-+}
-+
-+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 status) {
-+  if (WIFEXITED(status))
-+    return WEXITSTATUS(status);
-+  else if (WIFSIGNALED(status))
-+    return WTERMSIG(status);
-+  else if (WIFSTOPPED(status))
-+    return WSTOPSIG(status);
-+  else {
-+    // We don't know what this is.
-+    return ExitType::eExitTypeInvalid;
-+  }
-+}
-+
-+// Handles all waitpid events from the inferior process.
-+void NativeProcessNetBSD::MonitorCallback(lldb::pid_t pid, bool exited,
-+                                         int signal, int status) {
-+  Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
-+
-+  // Handle when the process exits.
-+  if (exited) {
-+    if (log)
-+      log->Printf(
-+          "NativeProcessNetBSD::%s() got exit signal(%d) , pid = %d",
-+          __FUNCTION__, signal, pid);
-+
-+    /* Stop Tracking All Threads attached to Process */
-+    m_threads.clear();
-+
-+    SetExitStatus(convert_pid_status_to_exit_type(status),
-+                  convert_pid_status_to_return_code(status), nullptr, true);
-+
-+    // Notify delegate that our process has exited.
-+    SetState(StateType::eStateExited, true);
-+
-+    return;
-+  }
-+
-+  ptrace_siginfo_t info;
-+  const auto siginfo_err = PtraceWrapper(PT_GET_SIGINFO, pid, &info, sizeof(info));
-+
-+  ptrace_state_t state;
-+  const auto state_err = PtraceWrapper(PT_GET_PROCESS_STATE, pid, &state, sizeof(state));
-+
-+  printf("Signal received signo=%d errno=%d code=%d\n", info.psi_siginfo.si_signo,
-+    info.psi_siginfo.si_errno, info.psi_siginfo.si_code);
-+
-+  // Get details on the signal raised.
-+  if (siginfo_err.Success() && state_err.Success()) {
-+    switch (info.psi_siginfo.si_signo) {
-+    case SIGTRAP:
-+      switch (info.psi_siginfo.si_code) {
-+      case TRAP_BRKPT:
-+        for (const auto &thread_sp : m_threads) {
-+          static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedByBreakpoint();
-+        }
-+        SetState(StateType::eStateStopped, true);
-+        break;
-+      case TRAP_TRACE:
-+        for (const auto &thread_sp : m_threads) {
-+          static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedByTrace();
-+        }
-+        SetState(StateType::eStateStopped, true);
-+        break;
-+      case TRAP_EXEC:
-+        {
-+        // Clear old threads
-+        m_threads.clear();
-+
-+        // Initialize new thread
-+        struct ptrace_lwpinfo info = {};
-+        Error error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info));
-+        if (error.Fail()) {
-+          SetState(StateType::eStateInvalid);
-+          return;
-+        }
-+
-+        // Reinitialize from scratch threads and register them in process
-+        while (info.pl_lwpid != 0) {
-+          NativeThreadNetBSDSP thread_sp = AddThread(info.pl_lwpid);
-+          thread_sp->SetStoppedByExec();
-+          error = PtraceWrapper(PT_LWPINFO, pid, &info, sizeof(info));
-+          if (error.Fail()) {
-+            SetState(StateType::eStateInvalid);
-+            return;
-+          }
-+        }
-+
-+        // Let our delegate know we have just exec'd.
-+        NotifyDidExec();
-+
-+        SetState(StateType::eStateStopped, true);
-+        }
-+        break;
-+      case TRAP_CHLD:
-+        {
-+        // fork(2)
-+        if ((state.pe_report_event & PTRACE_FORK) != 0)
-+          printf("Fork reported\n");
-+        // vfork(2)
-+        else if ((state.pe_report_event & PTRACE_VFORK) != 0)
-+          printf("VFork reported\n");
-+        // vfork(2) done
-+        else if ((state.pe_report_event & PTRACE_VFORK_DONE) != 0)
-+          printf("VFork Done reported\n");
-+        }
-+        break;
-+      case TRAP_LWP:
-+        {
-+        // _lwp_create(2)
-+        if ((state.pe_report_event & PTRACE_LWP_CREATE) != 0) {
-+          AddThread(state.pe_lwp);
-+          for (const auto &thread_sp : m_threads) {
-+            static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(info.psi_siginfo.si_signo, &info.psi_siginfo);
-+          }
-+        }
-+        // _lwp_exit(2)
-+        if ((state.pe_report_event & PTRACE_LWP_EXIT) != 0)
-+          for (size_t i; i < m_threads.size(); i++) {
-+            if (static_pointer_cast<NativeThreadNetBSD>(m_threads[i])->GetID() == state.pe_lwp) {
-+              m_threads.erase(m_threads.begin() + i);
-+              break;
-+            }
-+          }
-+          for (const auto &thread_sp : m_threads) {
-+            static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(info.psi_siginfo.si_signo, &info.psi_siginfo);
-+          }
-+        }
-+        SetState(StateType::eStateStopped, true);
-+        break;
-+      case TRAP_HWWPT:
-+        printf("hw watchpoint reported\n");
-+        break;
-+      }
-+    case SIGSTOP:
-+      // Handle SIGSTOP from LLGS (LLDB GDB Server)
-+      if (info.psi_siginfo.si_code == SI_USER && info.psi_siginfo.si_pid == ::getpid()) {
-+        /* Stop Tracking All Threads attached to Process */
-+        for (const auto &thread_sp : m_threads) {
-+          static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(SIGSTOP, &info.psi_siginfo);
-+        }
-+      }
-+    default:
-+      // Other signals
-+      for (const auto &thread_sp : m_threads) {
-+        static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStoppedBySignal(info.psi_siginfo.si_signo, &info.psi_siginfo);
-+      }
-+      SetState(StateType::eStateStopped, true);
-+    }
-+  }
-+}
-+
-+namespace {
-+
-+struct EmulatorBaton {
-+  NativeProcessNetBSD *m_process;
-+  NativeRegisterContext *m_reg_context;
-+
-+  // eRegisterKindDWARF -> RegsiterValue
-+  std::unordered_map<uint32_t, RegisterValue> m_register_values;
-+
-+  EmulatorBaton(NativeProcessNetBSD *process, NativeRegisterContext *reg_context)
-+      : m_process(process), m_reg_context(reg_context) {}
-+};
-+
-+} // anonymous namespace
-+
-+static size_t ReadMemoryCallback(EmulateInstruction *instruction, void *baton,
-+                                 const EmulateInstruction::Context &context,
-+                                 lldb::addr_t addr, void *dst, size_t length) {
-+  EmulatorBaton *emulator_baton = static_cast<EmulatorBaton *>(baton);
-+
-+  size_t bytes_read;
-+  emulator_baton->m_process->ReadMemory(addr, dst, length, bytes_read);
-+  return bytes_read;
-+}
-+
-+static bool ReadRegisterCallback(EmulateInstruction *instruction, void *baton,
-+                                 const RegisterInfo *reg_info,
-+                                 RegisterValue &reg_value) {
-+  EmulatorBaton *emulator_baton = static_cast<EmulatorBaton *>(baton);
-+
-+  auto it = emulator_baton->m_register_values.find(
-+      reg_info->kinds[eRegisterKindDWARF]);
-+  if (it != emulator_baton->m_register_values.end()) {
-+    reg_value = it->second;
-+    return true;
-+  }
-+
-+  // The emulator only fill in the dwarf regsiter numbers (and in some case
-+  // the generic register numbers). Get the full register info from the
-+  // register context based on the dwarf register numbers.
-+  const RegisterInfo *full_reg_info =
-+      emulator_baton->m_reg_context->GetRegisterInfo(
-+          eRegisterKindDWARF, reg_info->kinds[eRegisterKindDWARF]);
-+
-+  Error error =
-+      emulator_baton->m_reg_context->ReadRegister(full_reg_info, reg_value);
-+  if (error.Success())
-+    return true;
-+
-+  return false;
-+}
-+
-+static bool WriteRegisterCallback(EmulateInstruction *instruction, void *baton,
-+                                  const EmulateInstruction::Context &context,
-+                                  const RegisterInfo *reg_info,
-+                                  const RegisterValue &reg_value) {
-+  EmulatorBaton *emulator_baton = static_cast<EmulatorBaton *>(baton);
-+  emulator_baton->m_register_values[reg_info->kinds[eRegisterKindDWARF]] =
-+      reg_value;
-+  return true;
-+}
-+
-+static size_t WriteMemoryCallback(EmulateInstruction *instruction, void *baton,
-+                                  const EmulateInstruction::Context &context,
-+                                  lldb::addr_t addr, const void *dst,
-+                                  size_t length) {
-+  return length;
-+}
-+
-+static lldb::addr_t ReadFlags(NativeRegisterContext *regsiter_context) {
-+  const RegisterInfo *flags_info = regsiter_context->GetRegisterInfo(
-+      eRegisterKindGeneric, LLDB_REGNUM_GENERIC_FLAGS);
-+  return regsiter_context->ReadRegisterAsUnsigned(flags_info,
-+                                                  LLDB_INVALID_ADDRESS);
-+}
-+
-+Error NativeProcessNetBSD::Resume(const ResumeActionList &resume_actions) {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_THREAD));
-+  if (log)
-+    log->Printf("NativeProcessNetBSD::%s called: pid %d", __FUNCTION__,
-+                GetID());
-+
-+  const auto &thread_sp = m_threads[0];
-+  const ResumeAction *const action = resume_actions.GetActionForThread(thread_sp->GetID(), true);
-+
-+  if (action == nullptr) {
-+    if (log)
-+      log->Printf("NativeProcessLinux::%s no action specified for pid %" PRIu64 " tid %" PRIu64,
-+                  __FUNCTION__, GetID(), thread_sp->GetID());
-+     return Error();
-+  }
-+
-+  switch (action->state) {
-+  case eStateRunning: {
-+    // Run the thread, possibly feeding it the signal.
-+    Error error = NativeProcessNetBSD::PtraceWrapper(PT_CONTINUE, GetID(),(void *)1, action->signal);
-+    if (!error.Success())
-+      return error;
-+    for (const auto &thread_sp : m_threads) {
-+      static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetRunning();
-+    }
-+    SetState(eStateRunning, true);
-+    break;
-+  }
-+  case eStateStepping: {
-+    // Run the thread, possibly feeding it the signal.
-+    Error error = NativeProcessNetBSD::PtraceWrapper(PT_STEP, GetID(),(void *)1, action->signal);
-+    if (!error.Success())
-+      return error;
-+    for (const auto &thread_sp : m_threads) {
-+      static_pointer_cast<NativeThreadNetBSD>(thread_sp)->SetStepping();
-+    }
-+    SetState(eStateStepping, true);
-+    break;
-+  }
-+
-+  case eStateSuspended:
-+  case eStateStopped:
-+    lldbassert(0 && "Unexpected state");
-+ 
-+  default:
-+    return Error("NativeProcessLinux::%s (): unexpected state %s specified "
-+                 "for pid %" PRIu64 ", tid %" PRIu64,
-+                 __FUNCTION__, StateAsCString(action->state), GetID(),
-+                 thread_sp->GetID());
-+  }
-+
-+  return Error();
-+}
-+
-+Error NativeProcessNetBSD::Halt() {
-+  Error error;
-+
-+  if (kill(GetID(), SIGSTOP) != 0)
-+    error.SetErrorToErrno();
-+
-+  return error;
-+}
-+
-+Error NativeProcessNetBSD::Detach() {
-+  Error error;
-+
-+  // Stop monitoring the inferior.
-+  m_sigchld_handle.reset();
-+
-+  // Tell ptrace to detach from the process.
-+  if (GetID() == LLDB_INVALID_PROCESS_ID)
-+    return error;
-+
-+  return PtraceWrapper(PT_DETACH, GetID());
-+}
-+
-+Error NativeProcessNetBSD::Signal(int signo) {
-+  Error error;
-+
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
-+  if (log)
-+    log->Printf(
-+        "NativeProcessNetBSD::%s: sending signal %d (%s) to pid %" PRIu64,
-+        __FUNCTION__, signo, Host::GetSignalAsCString(signo), GetID());
-+
-+  if (kill(GetID(), signo))
-+    error.SetErrorToErrno();
-+
-+  return error;
-+}
-+
-+Error NativeProcessNetBSD::Interrupt() {
-+  // Pick a running thread (or if none, a not-dead stopped thread) as
-+  // the chosen thread that will be the stop-reason thread.
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
-+
-+  NativeThreadProtocolSP running_thread_sp;
-+  NativeThreadProtocolSP stopped_thread_sp;
-+
-+  if (log)
-+    log->Printf(
-+        "NativeProcessNetBSD::%s selecting running thread for interrupt target",
-+        __FUNCTION__);
-+
-+  for (auto thread_sp : m_threads) {
-+    // The thread shouldn't be null but lets just cover that here.
-+    if (!thread_sp)
-+      continue;
-+
-+    // If we have a running or stepping thread, we'll call that the
-+    // target of the interrupt.
-+    const auto thread_state = thread_sp->GetState();
-+    if (thread_state == eStateRunning || thread_state == eStateStepping) {
-+      running_thread_sp = thread_sp;
-+      break;
-+    } else if (!stopped_thread_sp && StateIsStoppedState(thread_state, true)) {
-+      // Remember the first non-dead stopped thread.  We'll use that as a backup
-+      // if there are no running threads.
-+      stopped_thread_sp = thread_sp;
-+    }
-+  }
-+
-+  if (!running_thread_sp && !stopped_thread_sp) {
-+    Error error("found no running/stepping or live stopped threads as target "
-+                "for interrupt");
-+    if (log)
-+      log->Printf("NativeProcessNetBSD::%s skipping due to error: %s",
-+                  __FUNCTION__, error.AsCString());
-+
-+    return error;
-+  }
-+
-+  NativeThreadProtocolSP deferred_signal_thread_sp =
-+      running_thread_sp ? running_thread_sp : stopped_thread_sp;
-+
-+  if (log)
-+    log->Printf("NativeProcessNetBSD::%s pid %" PRIu64 " %s tid %" PRIu64
-+                " chosen for interrupt target",
-+                __FUNCTION__, GetID(),
-+                running_thread_sp ? "running" : "stopped",
-+                deferred_signal_thread_sp->GetID());
-+
-+  return Error();
-+}
-+
-+Error NativeProcessNetBSD::Kill() {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
-+  if (log)
-+    log->Printf("NativeProcessNetBSD::%s called for PID %" PRIu64, __FUNCTION__,
-+                GetID());
-+
-+  Error error;
-+
-+  switch (m_state) {
-+  case StateType::eStateInvalid:
-+  case StateType::eStateExited:
-+  case StateType::eStateCrashed:
-+  case StateType::eStateDetached:
-+  case StateType::eStateUnloaded:
-+    // Nothing to do - the process is already dead.
-+    if (log)
-+      log->Printf("NativeProcessNetBSD::%s ignored for PID %" PRIu64
-+                  " due to current state: %s",
-+                  __FUNCTION__, GetID(), StateAsCString(m_state));
-+    return error;
-+
-+  case StateType::eStateConnected:
-+  case StateType::eStateAttaching:
-+  case StateType::eStateLaunching:
-+  case StateType::eStateStopped:
-+  case StateType::eStateRunning:
-+  case StateType::eStateStepping:
-+  case StateType::eStateSuspended:
-+    // We can try to kill a process in these states.
-+    break;
-+  }
-+
-+  if (kill(GetID(), SIGKILL) != 0) {
-+    error.SetErrorToErrno();
-+    return error;
-+  }
-+
-+  return error;
-+}
-+
-+static Error
-+ParseMemoryRegionInfoFromProcMapsLine(const std::string &maps_line,
-+                                      MemoryRegionInfo &memory_region_info) {
-+  memory_region_info.Clear();
-+
-+  StringExtractor line_extractor(maps_line.c_str());
-+
-+  // Format: {address_start_hex}-{address_end_hex} perms offset  dev   inode
-+  // pathname
-+  // perms: rwxp   (letter is present if set, '-' if not, final character is
-+  // p=private, s=shared).
-+
-+  // Parse out the starting address
-+  lldb::addr_t start_address = line_extractor.GetHexMaxU64(false, 0);
-+
-+  // Parse out hyphen separating start and end address from range.
-+  if (!line_extractor.GetBytesLeft() || (line_extractor.GetChar() != '-'))
-+    return Error(
-+        "malformed /proc/{pid}/maps entry, missing dash between address range");
-+
-+  // Parse out the ending address
-+  lldb::addr_t end_address = line_extractor.GetHexMaxU64(false, start_address);
-+
-+  // Parse out the space after the address.
-+  if (!line_extractor.GetBytesLeft() || (line_extractor.GetChar() != ' '))
-+    return Error("malformed /proc/{pid}/maps entry, missing space after range");
-+
-+  // Save the range.
-+  memory_region_info.GetRange().SetRangeBase(start_address);
-+  memory_region_info.GetRange().SetRangeEnd(end_address);
-+
-+  // Any memory region in /proc/{pid}/maps is by definition mapped into the
-+  // process.
-+  memory_region_info.SetMapped(MemoryRegionInfo::OptionalBool::eYes);
-+
-+  // Parse out each permission entry.
-+  if (line_extractor.GetBytesLeft() < 4)
-+    return Error("malformed /proc/{pid}/maps entry, missing some portion of "
-+                 "permissions");
-+
-+  // Handle read permission.
-+  const char read_perm_char = line_extractor.GetChar();
-+  if (read_perm_char == 'r')
-+    memory_region_info.SetReadable(MemoryRegionInfo::OptionalBool::eYes);
-+  else if (read_perm_char == '-')
-+    memory_region_info.SetReadable(MemoryRegionInfo::OptionalBool::eNo);
-+  else
-+    return Error("unexpected /proc/{pid}/maps read permission char");
-+
-+  // Handle write permission.
-+  const char write_perm_char = line_extractor.GetChar();
-+  if (write_perm_char == 'w')
-+    memory_region_info.SetWritable(MemoryRegionInfo::OptionalBool::eYes);
-+  else if (write_perm_char == '-')
-+    memory_region_info.SetWritable(MemoryRegionInfo::OptionalBool::eNo);
-+  else
-+    return Error("unexpected /proc/{pid}/maps write permission char");
-+
-+  // Handle execute permission.
-+  const char exec_perm_char = line_extractor.GetChar();
-+  if (exec_perm_char == 'x')
-+    memory_region_info.SetExecutable(MemoryRegionInfo::OptionalBool::eYes);
-+  else if (exec_perm_char == '-')
-+    memory_region_info.SetExecutable(MemoryRegionInfo::OptionalBool::eNo);
-+  else
-+    return Error("unexpected /proc/{pid}/maps exec permission char");
-+
-+  line_extractor.GetChar();              // Read the private bit
-+  line_extractor.SkipSpaces();           // Skip the separator
-+  line_extractor.GetHexMaxU64(false, 0); // Read the offset
-+  line_extractor.GetHexMaxU64(false, 0); // Read the major device number
-+  line_extractor.GetChar();              // Read the device id separator
-+  line_extractor.GetHexMaxU64(false, 0); // Read the major device number
-+  line_extractor.SkipSpaces();           // Skip the separator
-+  line_extractor.GetU64(0, 10);          // Read the inode number
-+
-+  line_extractor.SkipSpaces();
-+  const char *name = line_extractor.Peek();
-+  if (name)
-+    memory_region_info.SetName(name);
-+
-+  return Error();
-+}
-+
-+Error NativeProcessNetBSD::GetMemoryRegionInfo(lldb::addr_t load_addr,
-+                                              MemoryRegionInfo &range_info) {
-+  // FIXME review that the final memory region returned extends to the end of
-+  // the virtual address space,
-+  // with no perms if it is not mapped.
-+
-+  // Use an approach that reads memory regions from /proc/{pid}/maps.
-+  // Assume proc maps entries are in ascending order.
-+  // FIXME assert if we find differently.
-+
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
-+  Error error;
-+
-+  if (m_supports_mem_region == LazyBool::eLazyBoolNo) {
-+    // We're done.
-+    error.SetErrorString("unsupported");
-+    return error;
-+  }
-+
-+ {
-+    if (log)
-+      log->Printf("NativeProcessNetBSD::%s reusing %" PRIu64
-+                  " cached memory region entries",
-+                  __FUNCTION__,
-+                  static_cast<uint64_t>(m_mem_region_cache.size()));
-+  }
-+
-+  lldb::addr_t prev_base_address = 0;
-+
-+  // FIXME start by finding the last region that is <= target address using
-+  // binary search.  Data is sorted.
-+  // There can be a ton of regions on pthreads apps with lots of threads.
-+  for (auto it = m_mem_region_cache.begin(); it != m_mem_region_cache.end();
-+       ++it) {
-+    MemoryRegionInfo &proc_entry_info = *it;
-+
-+    // Sanity check assumption that /proc/{pid}/maps entries are ascending.
-+    assert((proc_entry_info.GetRange().GetRangeBase() >= prev_base_address) &&
-+           "descending /proc/pid/maps entries detected, unexpected");
-+    prev_base_address = proc_entry_info.GetRange().GetRangeBase();
-+
-+    // If the target address comes before this entry, indicate distance to next
-+    // region.
-+    if (load_addr < proc_entry_info.GetRange().GetRangeBase()) {
-+      range_info.GetRange().SetRangeBase(load_addr);
-+      range_info.GetRange().SetByteSize(
-+          proc_entry_info.GetRange().GetRangeBase() - load_addr);
-+      range_info.SetReadable(MemoryRegionInfo::OptionalBool::eNo);
-+      range_info.SetWritable(MemoryRegionInfo::OptionalBool::eNo);
-+      range_info.SetExecutable(MemoryRegionInfo::OptionalBool::eNo);
-+      range_info.SetMapped(MemoryRegionInfo::OptionalBool::eNo);
-+
-+      return error;
-+    } else if (proc_entry_info.GetRange().Contains(load_addr)) {
-+      // The target address is within the memory region we're processing here.
-+      range_info = proc_entry_info;
-+      return error;
-+    }
-+
-+    // The target memory address comes somewhere after the region we just
-+    // parsed.
-+  }
-+
-+  // If we made it here, we didn't find an entry that contained the given
-+  // address. Return the
-+  // load_addr as start and the amount of bytes betwwen load address and the end
-+  // of the memory as
-+  // size.
-+  range_info.GetRange().SetRangeBase(load_addr);
-+  range_info.GetRange().SetRangeEnd(LLDB_INVALID_ADDRESS);
-+  range_info.SetReadable(MemoryRegionInfo::OptionalBool::eNo);
-+  range_info.SetWritable(MemoryRegionInfo::OptionalBool::eNo);
-+  range_info.SetExecutable(MemoryRegionInfo::OptionalBool::eNo);
-+  range_info.SetMapped(MemoryRegionInfo::OptionalBool::eNo);
-+  return error;
-+}
-+
-+void NativeProcessNetBSD::DoStopIDBumped(uint32_t newBumpId) {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
-+  if (log)
-+    log->Printf("NativeProcessNetBSD::%s(newBumpId=%" PRIu32 ") called",
-+                __FUNCTION__, newBumpId);
-+
-+  if (log)
-+    log->Printf("NativeProcessNetBSD::%s clearing %" PRIu64
-+                " entries from the cache",
-+                __FUNCTION__, static_cast<uint64_t>(m_mem_region_cache.size()));
-+  m_mem_region_cache.clear();
-+}
-+
-+Error NativeProcessNetBSD::AllocateMemory(size_t size, uint32_t permissions,
-+                                         lldb::addr_t &addr) {
-+// FIXME implementing this requires the equivalent of
-+// InferiorCallPOSIX::InferiorCallMmap, which depends on
-+// functional ThreadPlans working with Native*Protocol.
-+#if 1
-+  return Error("not implemented yet");
-+#else
-+  addr = LLDB_INVALID_ADDRESS;
-+
-+  unsigned prot = 0;
-+  if (permissions & lldb::ePermissionsReadable)
-+    prot |= eMmapProtRead;
-+  if (permissions & lldb::ePermissionsWritable)
-+    prot |= eMmapProtWrite;
-+  if (permissions & lldb::ePermissionsExecutable)
-+    prot |= eMmapProtExec;
-+
-+  // TODO implement this directly in NativeProcessNetBSD
-+  // (and lift to NativeProcessPOSIX if/when that class is
-+  // refactored out).
-+  if (InferiorCallMmap(this, addr, 0, size, prot,
-+                       eMmapFlagsAnon | eMmapFlagsPrivate, -1, 0)) {
-+    m_addr_to_mmap_size[addr] = size;
-+    return Error();
-+  } else {
-+    addr = LLDB_INVALID_ADDRESS;
-+    return Error("unable to allocate %" PRIu64
-+                 " bytes of memory with permissions %s",
-+                 size, GetPermissionsAsCString(permissions));
-+  }
-+#endif
-+}
-+
-+Error NativeProcessNetBSD::DeallocateMemory(lldb::addr_t addr) {
-+  // FIXME see comments in AllocateMemory - required lower-level
-+  // bits not in place yet (ThreadPlans)
-+  return Error("not implemented");
-+}
-+
-+lldb::addr_t NativeProcessNetBSD::GetSharedLibraryInfoAddress() {
-+  // punt on this for now
-+  return LLDB_INVALID_ADDRESS;
-+}
-+
-+size_t NativeProcessNetBSD::UpdateThreads() {
-+  // The NativeProcessNetBSD monitoring threads are always up to date
-+  // with respect to thread state and they keep the thread list
-+  // populated properly. All this method needs to do is return the
-+  // thread count.
-+  return m_threads.size();
-+}
-+
-+bool NativeProcessNetBSD::GetArchitecture(ArchSpec &arch) const {
-+  arch = m_arch;
-+  return true;
-+}
-+
-+Error NativeProcessNetBSD::SetBreakpoint(lldb::addr_t addr, uint32_t size,
-+                                        bool hardware) {
-+  if (hardware)
-+    return Error("NativeProcessNetBSD does not support hardware breakpoints");
-+  else
-+    return SetSoftwareBreakpoint(addr, size);
-+}
-+
-+Error NativeProcessNetBSD::GetSoftwareBreakpointTrapOpcode(
-+    size_t trap_opcode_size_hint, size_t &actual_opcode_size,
-+    const uint8_t *&trap_opcode_bytes) {
-+  return Error();
-+}
-+
-+Error NativeProcessNetBSD::ReadMemory(lldb::addr_t addr, void *buf, size_t size,
-+                                     size_t &bytes_read) {
-+  unsigned char *dst = static_cast<unsigned char *>(buf);
-+  struct ptrace_io_desc io;
-+
-+  Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_ALL));
-+  if (log)
-+    ProcessPOSIXLog::IncNestLevel();
-+  if (log && ProcessPOSIXLog::AtTopNestLevel() &&
-+      log->GetMask().Test(POSIX_LOG_MEMORY))
-+    log->Printf("NativeProcessNetBSD::%s(%p, %p, %zd, _)", __FUNCTION__,
-+                (void *)addr, buf, size);
-+
-+  bytes_read = 0;
-+  io.piod_op = PIOD_READ_D;
-+  io.piod_len = size;
-+
-+  do {
-+    io.piod_offs = (void *)(addr + bytes_read);
-+    io.piod_offs = dst + bytes_read;
-+
-+    Error error = NativeProcessNetBSD::PtraceWrapper(
-+        PT_IO, GetID(), &io);
-+    if (error.Fail()) {
-+      if (log)
-+        ProcessPOSIXLog::DecNestLevel();
-+      return error;
-+    }
-+
-+    bytes_read = io.piod_len;
-+    io.piod_len = size - bytes_read;
-+  } while(bytes_read < size);
-+
-+  if (log)
-+    ProcessPOSIXLog::DecNestLevel();
-+  return Error();
-+}
-+
-+Error NativeProcessNetBSD::ReadMemoryWithoutTrap(lldb::addr_t addr, void *buf,
-+                                                size_t size,
-+                                                size_t &bytes_read) {
-+  Error error = ReadMemory(addr, buf, size, bytes_read);
-+  if (error.Fail())
-+    return error;
-+  return m_breakpoint_list.RemoveTrapsFromBuffer(addr, buf, size);
-+}
-+
-+Error NativeProcessNetBSD::WriteMemory(lldb::addr_t addr, const void *buf,
-+                                      size_t size, size_t &bytes_written) {
-+  const unsigned char *src = static_cast<const unsigned char *>(buf);
-+  Error error;
-+  struct ptrace_io_desc io;
-+
-+  Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_ALL));
-+  if (log)
-+    ProcessPOSIXLog::IncNestLevel();
-+  if (log && ProcessPOSIXLog::AtTopNestLevel() &&
-+      log->GetMask().Test(POSIX_LOG_MEMORY))
-+    log->Printf("NativeProcessNetBSD::%s(0x%" PRIx64 ", %p, %zu)", __FUNCTION__,
-+                addr, buf, size);
-+
-+  bytes_written = 0;
-+  io.piod_op = PIOD_WRITE_D;
-+  io.piod_len = size;
-+
-+  do {
-+    io.piod_offs = (void *)(src + bytes_written);
-+    io.piod_offs = (void *)(addr + bytes_written);
-+
-+    Error error = NativeProcessNetBSD::PtraceWrapper(
-+        PT_IO, GetID(), &io);
-+    if (error.Fail()) {
-+      if (log)
-+        ProcessPOSIXLog::DecNestLevel();
-+      return error;
-+    }
-+
-+    bytes_written = io.piod_len;
-+    io.piod_len = size - bytes_written;
-+  } while(bytes_written < size);
-+
-+  if (log)
-+    ProcessPOSIXLog::DecNestLevel();
-+  return error;
-+}
-+
-+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(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
-+
-+  if (log) {
-+    log->Printf("NativeProcessNetBSD::%s pid %" PRIu64
-+                " adding thread with tid %" PRIu64,
-+                __FUNCTION__, GetID(), thread_id);
-+  }
-+
-+  assert(!HasThreadNoLock(thread_id) &&
-+         "attempted to add a thread by id that already exists");
-+
-+  // If this is the first thread, save it as the current thread
-+  if (m_threads.empty())
-+    SetCurrentThreadID(thread_id);
-+
-+  auto thread_sp = std::make_shared<NativeThreadNetBSD>(this, thread_id);
-+  m_threads.push_back(thread_sp);
-+  return thread_sp;
-+}
-+
-+Error NativeProcessNetBSD::GetLoadedModuleFileSpec(const char *module_path,
-+                                                  FileSpec &file_spec) {
-+  FileSpec module_file_spec(module_path, true);
-+
-+  bool found = false;
-+  file_spec.Clear();
-+
-+  if (!found)
-+    return Error("Module file (%s) not found in /proc/%" PRIu64 "/maps file!",
-+                 module_file_spec.GetFilename().AsCString(), GetID());
-+
-+  return Error();
-+}
-+
-+Error NativeProcessNetBSD::GetFileLoadAddress(const llvm::StringRef &file_name,
-+                                             lldb::addr_t &load_addr) {
-+  load_addr = LLDB_INVALID_ADDRESS;
-+  return Error();
-+}
-+
-+NativeThreadNetBSDSP NativeProcessNetBSD::GetThreadByID(lldb::tid_t tid) {
-+  return std::static_pointer_cast<NativeThreadNetBSD>(
-+      NativeProcessProtocol::GetThreadByID(tid));
-+}
-+
-+//===----------------------------------------------------------------------===//
-+
-+void NativeProcessNetBSD::SigchldHandler() {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
-+  // Process all pending waitpid notifications.
-+  int status;
-+  ::pid_t wait_pid = waitpid(WAIT_ANY, &status, WALLSIG | WNOHANG);
-+
-+  if (wait_pid == 0)
-+    return; // We are done.
-+
-+  if (wait_pid == -1) {
-+    if (errno == EINTR)
-+      return;
-+
-+    Error error(errno, eErrorTypePOSIX);
-+    if (log)
-+      log->Printf("NativeProcessNetBSD::%s waitpid (WAIT_ANY, &status, "
-+                  "WALLSIG | WNOHANG) failed: %s", __FUNCTION__,
-+                  error.AsCString());
-+  }
-+
-+  bool exited = false;
-+  int signal = 0;
-+  int exit_status = 0;
-+  const char *status_cstr = nullptr;
-+  if (WIFSTOPPED(status)) {
-+    signal = WSTOPSIG(status);
-+    status_cstr = "STOPPED";
-+  } else if (WIFEXITED(status)) {
-+    exit_status = WEXITSTATUS(status);
-+    status_cstr = "EXITED";
-+    exited = true;
-+  } else if (WIFSIGNALED(status)) {
-+    signal = WTERMSIG(status);
-+    status_cstr = "SIGNALED";
-+    if (wait_pid == static_cast<::pid_t>(GetID())) {
-+      exited = true;
-+      exit_status = -1;
-+    }
-+  } else
-+    status_cstr = "(\?\?\?)";
-+
-+  if (log)
-+    log->Printf("NativeProcessNetBSD::%s: waitpid (WAIT_ANY, &status, "
-+                "WALLSIG | WNOHANG) => pid = %" PRIi32
-+                ", status = 0x%8.8x (%s), signal = %i, exit_state = %i",
-+                __FUNCTION__, wait_pid, status, status_cstr, signal,
-+                exit_status);
-+
-+  MonitorCallback(wait_pid, exited, signal, exit_status);
-+}
-+
-+// Wrapper for ptrace to catch errors and log calls.
-+// Note that ptrace sets errno on error because -1 can be a valid result (i.e.
-+// for PT_READ*)
-+Error NativeProcessNetBSD::PtraceWrapper(int req, lldb::pid_t pid, void *addr,
-+                                        int data, int *result) {
-+  Error error;
-+  int ret;
-+
-+  Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PTRACE));
-+
-+  PtraceDisplayBytes(req, addr, data);
-+
-+  errno = 0;
-+  ret = ptrace(req, static_cast<::pid_t>(pid), addr, data);
-+
-+  if (ret == -1)
-+    error.SetErrorToErrno();
-+
-+  if (result)
-+    *result = ret;
-+
-+  if (log)
-+    log->Printf("ptrace(%d, %d, %p, %d, %d)=%lX", req, pid, addr,
-+                data, ret);
-+
-+  if (log && error.GetError() != 0) {
-+    const char *str;
-+    switch (error.GetError()) {
-+    case ESRCH:
-+      str = "ESRCH";
-+      break;
-+    case EINVAL:
-+      str = "EINVAL";
-+      break;
-+    case EBUSY:
-+      str = "EBUSY";
-+      break;
-+    case EPERM:
-+      str = "EPERM";
-+      break;
-+    default:
-+      str = error.AsCString();
-+    }
-+    log->Printf("ptrace() failed; errno=%d (%s)", error.GetError(), str);
-+  }
-+
-+  return error;
-+}
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
deleted file mode 100644
index b9ba86b..0000000
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeProcessNetBSD.h
+++ /dev/null
@@ -1,188 +0,0 @@
-$NetBSD$
-
---- source/Plugins/Process/NetBSD/NativeProcessNetBSD.h.orig	2017-01-20 20:30:48.337095578 +0000
-+++ source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
-@@ -0,0 +1,183 @@
-+//===-- NativeProcessNetBSD.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_NativeProcessNetBSD_H_
-+#define liblldb_NativeProcessNetBSD_H_
-+
-+// C++ Includes
-+#include <unordered_set>
-+
-+// Other libraries and framework includes
-+#include "lldb/Core/ArchSpec.h"
-+#include "lldb/Host/Debug.h"
-+#include "lldb/Host/FileSpec.h"
-+#include "lldb/Host/HostThread.h"
-+#include "lldb/Target/MemoryRegionInfo.h"
-+#include "lldb/lldb-types.h"
-+
-+#include "NativeThreadNetBSD.h"
-+#include "lldb/Host/common/NativeProcessProtocol.h"
-+
-+namespace lldb_private {
-+class Error;
-+class Scalar;
-+
-+namespace process_netbsd {
-+/// @class NativeProcessNetBSD
-+/// @brief Manages communication with the inferior (debugee) process.
-+///
-+/// Upon construction, this class prepares and launches an inferior process for
-+/// debugging.
-+///
-+/// Changes in the inferior process state are broadcasted.
-+class NativeProcessNetBSD : public NativeProcessProtocol {
-+  friend Error NativeProcessProtocol::Launch(
-+      ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate,
-+      MainLoop &mainloop, NativeProcessProtocolSP &process_sp);
-+
-+  friend Error NativeProcessProtocol::Attach(
-+      lldb::pid_t pid, NativeProcessProtocol::NativeDelegate &native_delegate,
-+      MainLoop &mainloop, NativeProcessProtocolSP &process_sp);
-+
-+public:
-+  // ---------------------------------------------------------------------
-+  // NativeProcessProtocol Interface
-+  // ---------------------------------------------------------------------
-+  Error Resume(const ResumeActionList &resume_actions) override;
-+
-+  Error Halt() override;
-+
-+  Error Detach() override;
-+
-+  Error Signal(int signo) override;
-+
-+  Error Interrupt() override;
-+
-+  Error Kill() override;
-+
-+  Error GetMemoryRegionInfo(lldb::addr_t load_addr,
-+                            MemoryRegionInfo &range_info) override;
-+
-+  Error ReadMemory(lldb::addr_t addr, void *buf, size_t size,
-+                   size_t &bytes_read) override;
-+
-+  Error ReadMemoryWithoutTrap(lldb::addr_t addr, void *buf, size_t size,
-+                              size_t &bytes_read) override;
-+
-+  Error WriteMemory(lldb::addr_t addr, const void *buf, size_t size,
-+                    size_t &bytes_written) override;
-+
-+  Error AllocateMemory(size_t size, uint32_t permissions,
-+                       lldb::addr_t &addr) override;
-+
-+  Error DeallocateMemory(lldb::addr_t addr) override;
-+
-+  lldb::addr_t GetSharedLibraryInfoAddress() override;
-+
-+  size_t UpdateThreads() override;
-+
-+  bool GetArchitecture(ArchSpec &arch) const override;
-+
-+  Error SetBreakpoint(lldb::addr_t addr, uint32_t size, bool hardware) override;
-+
-+  void DoStopIDBumped(uint32_t newBumpId) override;
-+
-+  Error GetLoadedModuleFileSpec(const char *module_path,
-+                                FileSpec &file_spec) override;
-+
-+  Error GetFileLoadAddress(const llvm::StringRef &file_name,
-+                           lldb::addr_t &load_addr) override;
-+
-+  NativeThreadNetBSDSP GetThreadByID(lldb::tid_t id);
-+
-+  // ---------------------------------------------------------------------
-+  // Interface used by NativeRegisterContext-derived classes.
-+  // ---------------------------------------------------------------------
-+  static Error PtraceWrapper(int req, lldb::pid_t pid, void *addr = nullptr,
-+                             int data = 0, int *result = nullptr);
-+
-+protected:
-+  // ---------------------------------------------------------------------
-+  // NativeProcessProtocol protected interface
-+  // ---------------------------------------------------------------------
-+
-+  Error
-+  GetSoftwareBreakpointTrapOpcode(size_t trap_opcode_size_hint,
-+                                  size_t &actual_opcode_size,
-+                                  const uint8_t *&trap_opcode_bytes) override;
-+
-+private:
-+  MainLoop::SignalHandleUP m_sigchld_handle;
-+  ArchSpec m_arch;
-+
-+  LazyBool m_supports_mem_region;
-+  std::vector<MemoryRegionInfo> m_mem_region_cache;
-+
-+  lldb::tid_t m_pending_notification_tid;
-+
-+  // List of thread ids stepping with a breakpoint with the address of
-+  // the relevan breakpoint
-+  std::map<lldb::tid_t, lldb::addr_t> m_threads_stepping_with_breakpoint;
-+
-+  // ---------------------------------------------------------------------
-+  // Private Instance Methods
-+  // ---------------------------------------------------------------------
-+  NativeProcessNetBSD();
-+
-+  Error LaunchInferior(MainLoop &mainloop, ProcessLaunchInfo &launch_info);
-+
-+  /// Attaches to an existing process.  Forms the
-+  /// implementation of Process::DoAttach
-+  void AttachToInferior(MainLoop &mainloop, lldb::pid_t pid, Error &error);
-+
-+  ::pid_t Attach(lldb::pid_t pid, Error &error);
-+
-+  static Error SetDefaultPtraceOpts(const lldb::pid_t);
-+
-+  static void *MonitorThread(void *baton);
-+
-+  void MonitorCallback(lldb::pid_t pid, bool exited, int signal, int status);
-+
-+  void MonitorSIGTRAP(const siginfo_t &info, NativeThreadNetBSD &thread);
-+
-+  Error SetupSoftwareSingleStepping(NativeThreadNetBSD &thread);
-+
-+
-+  bool HasThreadNoLock(lldb::tid_t thread_id);
-+
-+  NativeThreadNetBSDSP AddThread(lldb::tid_t thread_id);
-+
-+  Error GetSoftwareBreakpointPCOffset(uint32_t &actual_opcode_size);
-+
-+  Error FixupBreakpointPCAsNeeded(NativeThreadNetBSD &thread);
-+
-+  /// Writes a siginfo_t structure corresponding to the given thread ID to the
-+  /// memory region pointed to by @p siginfo.
-+  Error GetSignalInfo(lldb::tid_t tid, void *siginfo);
-+
-+  void NotifyThreadDeath(lldb::tid_t tid);
-+
-+  Error Detach(lldb::tid_t tid);
-+
-+  // Notify the delegate if all threads have stopped.
-+  void SignalIfAllThreadsStopped();
-+
-+  // Resume the given thread, optionally passing it the given signal. The type
-+  // of resume
-+  // operation (continue, single-step) depends on the state parameter.
-+  Error ResumeThread(NativeThreadNetBSD &thread, lldb::StateType state,
-+                     int signo);
-+
-+  void SigchldHandler();
-+};
-+
-+} // namespace process_netbsd
-+} // namespace lldb_private
-+
-+#endif // #ifndef liblldb_NativeProcessNetBSD_H_
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
deleted file mode 100644
index 90f318d..0000000
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.cpp
+++ /dev/null
@@ -1,393 +0,0 @@
-$NetBSD$
-
---- source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp.orig	2017-01-20 20:30:48.343442890 +0000
-+++ source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
-@@ -0,0 +1,388 @@
-+//===-- NativeThreadNetBSD.cpp --------------------------------- -*- C++ -*-===//
-+//
-+//                     The LLVM Compiler Infrastructure
-+//
-+// This file is distributed under the University of Illinois Open Source
-+// License. See LICENSE.TXT for details.
-+//
-+//===----------------------------------------------------------------------===//
-+
-+#include "NativeThreadNetBSD.h"
-+
-+#include <signal.h>
-+#include <sstream>
-+
-+#include "NativeProcessNetBSD.h"
-+
-+#include "lldb/Core/Log.h"
-+#include "lldb/Core/State.h"
-+#include "lldb/Host/HostNativeThread.h"
-+#include "lldb/Utility/LLDBAssert.h"
-+#include "lldb/lldb-enumerations.h"
-+
-+#include "llvm/ADT/SmallString.h"
-+
-+#include "Plugins/Process/POSIX/CrashReason.h"
-+
-+#include <sys/ptrace.h>
-+#include <sys/syscall.h>
-+#include <poll.h>
-+
-+using namespace lldb;
-+using namespace lldb_private;
-+using namespace lldb_private::process_netbsd;
-+
-+namespace {
-+void LogThreadStopInfo(Log &log, const ThreadStopInfo &stop_info,
-+                       const char *const header) {
-+  switch (stop_info.reason) {
-+  case eStopReasonNone:
-+    log.Printf("%s: %s no stop reason", __FUNCTION__, header);
-+    return;
-+  case eStopReasonTrace:
-+    log.Printf("%s: %s trace, stopping signal 0x%" PRIx32, __FUNCTION__, header,
-+               stop_info.details.signal.signo);
-+    return;
-+  case eStopReasonBreakpoint:
-+    log.Printf("%s: %s breakpoint, stopping signal 0x%" PRIx32, __FUNCTION__,
-+               header, stop_info.details.signal.signo);
-+    return;
-+  case eStopReasonSignal:
-+    log.Printf("%s: %s signal 0x%02" PRIx32, __FUNCTION__, header,
-+               stop_info.details.signal.signo);
-+    return;
-+  case eStopReasonException:
-+    log.Printf("%s: %s exception type 0x%02" PRIx64, __FUNCTION__, header,
-+               stop_info.details.exception.type);
-+    return;
-+  case eStopReasonExec:
-+    log.Printf("%s: %s exec, stopping signal 0x%" PRIx32, __FUNCTION__, header,
-+               stop_info.details.signal.signo);
-+    return;
-+  case eStopReasonPlanComplete:
-+    log.Printf("%s: %s plan complete", __FUNCTION__, header);
-+    return;
-+  case eStopReasonThreadExiting:
-+    log.Printf("%s: %s thread exiting", __FUNCTION__, header);
-+    return;
-+  case eStopReasonInstrumentation:
-+    log.Printf("%s: %s instrumentation", __FUNCTION__, header);
-+    return;
-+  default:
-+    log.Printf("%s: %s invalid stop reason %" PRIu32, __FUNCTION__, header,
-+               static_cast<uint32_t>(stop_info.reason));
-+  }
-+}
-+}
-+
-+NativeThreadNetBSD::NativeThreadNetBSD(NativeProcessNetBSD *process,
-+                                     lldb::tid_t tid)
-+    : NativeThreadProtocol(process, tid), m_state(StateType::eStateInvalid),
-+      m_stop_info(), m_reg_context_sp(), m_stop_description() {}
-+
-+std::string NativeThreadNetBSD::GetName() {
-+  NativeProcessProtocolSP process_sp = m_process_wp.lock();
-+  if (!process_sp)
-+    return "<unknown: no process>";
-+
-+  // const NativeProcessNetBSD *const process =
-+  // reinterpret_cast<NativeProcessNetBSD*> (process_sp->get ());
-+  llvm::SmallString<32> thread_name;
-+  HostNativeThread::GetName(GetID(), thread_name);
-+  return thread_name.c_str();
-+}
-+
-+lldb::StateType NativeThreadNetBSD::GetState() { return m_state; }
-+
-+bool NativeThreadNetBSD::GetStopReason(ThreadStopInfo &stop_info,
-+                                      std::string &description) {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
-+
-+  description.clear();
-+
-+  switch (m_state) {
-+  case eStateStopped:
-+  case eStateCrashed:
-+  case eStateExited:
-+  case eStateSuspended:
-+  case eStateUnloaded:
-+    if (log)
-+      LogThreadStopInfo(*log, m_stop_info, "m_stop_info in thread:");
-+    stop_info = m_stop_info;
-+    description = m_stop_description;
-+    if (log)
-+      LogThreadStopInfo(*log, stop_info, "returned stop_info:");
-+
-+    return true;
-+
-+  case eStateInvalid:
-+  case eStateConnected:
-+  case eStateAttaching:
-+  case eStateLaunching:
-+  case eStateRunning:
-+  case eStateStepping:
-+  case eStateDetached:
-+    if (log) {
-+      log->Printf("NativeThreadNetBSD::%s tid %" PRIu64
-+                  " in state %s cannot answer stop reason",
-+                  __FUNCTION__, GetID(), StateAsCString(m_state));
-+    }
-+    return false;
-+  }
-+  llvm_unreachable("unhandled StateType!");
-+}
-+
-+NativeRegisterContextSP NativeThreadNetBSD::GetRegisterContext() {
-+  return m_reg_context_sp; /* XXX: dummy */
-+}
-+
-+Error NativeThreadNetBSD::SetWatchpoint(lldb::addr_t addr, size_t size,
-+                                       uint32_t watch_flags, bool hardware) {
-+  return Error();
-+}
-+
-+Error NativeThreadNetBSD::RemoveWatchpoint(lldb::addr_t addr) {
-+  return Error();
-+}
-+
-+void NativeThreadNetBSD::SetStoppedBySignal(uint32_t signo,
-+                                            const siginfo_t *info) {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
-+  if (log)
-+    log->Printf("NativeThreadNetBSD::%s called with signal %s (value 0x%02" PRIx32 ")",
-+                __FUNCTION__, strsignal(signo), signo);
-+
-+  m_state = eStateStopped;
-+
-+  m_stop_info.reason = StopReason::eStopReasonSignal;
-+  m_stop_info.details.signal.signo = signo;
-+
-+  std::ostringstream stringStream;
-+
-+  if (!info) {
-+    stringStream << "The signal " << strsignal(signo) << " was caught";
-+    m_stop_description = stringStream.str();
-+    return;
-+  }
-+
-+  switch(info->si_code) {
-+  case SI_USER:
-+    stringStream << "The signal " << strsignal(signo) << " was generated via kill(2) from pid="
-+                 << info->si_pid << ", uid=" << info->si_uid;
-+    break;
-+  case SI_QUEUE:
-+    stringStream << "The signal " << strsignal(signo) << " was generated via sigqueue(2)";
-+    break;
-+  case SI_TIMER:
-+    stringStream << "The signal " << strsignal(signo) << " was generated because a timer set by timer_settime(2) has expired"
-+                 << " with si_value set to sival_int=" << info->si_value.sival_int << " and "
-+                 << "sival_ptr=" << info->si_value.sival_ptr;
-+    break;
-+  case SI_ASYNCIO:
-+    stringStream << "The signal " << strsignal(signo) << " was generated by completion of an asynchronous I/O operation with "
-+                 << info->si_fd << " file descriptor number on which the operation was completed "
-+                 << " and side and priority of the operation set to ";
-+    switch (info->si_band) {
-+    case POLLIN | POLLRDNORM:
-+      stringStream << "normal read ";
-+      break;
-+    case POLLPRI | POLLRDNORM:
-+      stringStream << "out-of-band read ";
-+      break;
-+    case POLLOUT | POLLWRNORM:
-+      stringStream << "normal write ";
-+      break;
-+    case POLLPRI | POLLWRBAND:
-+      stringStream << "normal write ";
-+      break;
-+    default:
-+      stringStream << "unspecified value ";
-+    }
-+    stringStream << std::hex << std::showbase << info->si_band;
-+  case SI_MESGQ:
-+    stringStream << "The signal " << strsignal(signo) << " was generated by arrival of a message on an empty message queue "
-+                 << "with si_value set to sival_int=" << info->si_value.sival_int << " and "
-+                 << "sival_ptr=" << info->si_value.sival_ptr;
-+  case SI_LWP:
-+    stringStream << "The signal " << strsignal(signo) << " was generated via _lwp_kill(2) from pid="
-+                 << info->si_pid << ", uid=" << info->si_uid;
-+    break;
-+  case SI_NOINFO:
-+    stringStream << "The signal " << strsignal(signo) << " was generated with no signal specific info available";
-+    break;
-+  default:
-+    switch (info->si_signo) {
-+    case SIGTRAP:
-+      stringStream << "SIGTRAP has been caught with ";
-+      switch (info->si_code) {
-+      case TRAP_BRKPT:
-+        stringStream << "Process Breakpoint type";
-+        break;
-+      case TRAP_TRACE:
-+        stringStream << "Process Trace Trap type";
-+        break;
-+      case TRAP_EXEC:
-+        stringStream << "Process Exec Trap type";
-+        break;
-+      case TRAP_CHLD:
-+        stringStream << "Process Child Trap type";
-+        break;
-+      case TRAP_LWP:
-+        stringStream << "Process LWP Trap type";
-+        break;
-+      default:
-+        stringStream << "unknown si_code value " << std::hex << std::showbase
-+                     << info->si_code;
-+      }
-+      break;
-+    case SIGCHLD:
-+      stringStream << "SIGCHLD has been caught with ";
-+      switch (info->si_code) {
-+      case CLD_EXITED:
-+        stringStream << "Child Has Exited type";
-+        break;
-+      case CLD_KILLED:
-+        stringStream << "Child Has Terminated Abnormally "
-+                        "(without a core file) type";
-+        break;
-+      case CLD_DUMPED:
-+        stringStream << "Child Has Terminated Abnormally "
-+                     << "(with a core file) type";
-+        break;
-+      case CLD_TRAPPED:
-+        stringStream << "Child Has Trapped type";
-+        break;
-+      case CLD_STOPPED:
-+        stringStream << "Child Has Stopped type";
-+        break;
-+      case CLD_CONTINUED:
-+        stringStream << "Child Has Continued type";
-+        break;
-+      default:
-+        stringStream << "unknown si_code value " << std::hex << std::showbase
-+                     << info->si_code;
-+      }
-+      stringStream << "with pid=" << std::dec << info->si_pid << " of the process who's status "
-+                   << "changed, user id=" << info->si_uid << " of that process, "
-+                   << std::hex << std::showbase << ((info->si_code == CLD_EXITED) ?
-+                   "exit code of the process " : "signal number received by the process ")
-+                   << std::dec << info->si_status << ", user process accounting time "
-+                   << info->si_utime << ", system process accounting time " << info->si_stime;
-+      break;
-+    case SIGIO:
-+      stringStream << "SIGIO has been caught with ";
-+      switch (info->si_code) {
-+      case POLL_IN:
-+        stringStream << "Data Input Available type";
-+        break;
-+      case POLL_OUT:
-+        stringStream << "Output Buffers Available type";
-+        break;
-+      case POLL_MSG:
-+        stringStream << "Input Message type";
-+        break;
-+      case POLL_ERR:
-+        stringStream << "I/O Error type";
-+        break;
-+      case POLL_PRI:
-+        stringStream << "High Priority Input Available type";
-+        break;
-+      case POLL_HUP:
-+        stringStream << "Device Disconnected type";
-+        break;
-+      default:
-+        stringStream << "unknown si_code value " << std::hex << std::showbase
-+                     << info->si_code;
-+      }
-+      stringStream << "with " << std::dec << info->si_fd << " file descriptor number on which the "
-+                   << "operation was completed and side and priority of the operation set to ";
-+      switch (info->si_band) {
-+      case POLLIN | POLLRDNORM:
-+        stringStream << "normal read ";
-+        break;
-+      case POLLPRI | POLLRDNORM:
-+        stringStream << "out-of-band read ";
-+        break;
-+      case POLLOUT | POLLWRNORM:
-+        stringStream << "normal write ";
-+        break;
-+      case POLLPRI | POLLWRBAND:
-+        stringStream << "normal write ";
-+        break;
-+      default:
-+        stringStream << "unspecified value ";
-+      }
-+      stringStream << std::hex << std::showbase << info->si_band;
-+
-+      break;
-+    /* The following signals are defined by POSIX common platform code */
-+    case SIGSEGV:
-+    case SIGBUS:
-+    case SIGFPE:
-+    case SIGILL:
-+      stringStream << GetCrashReasonString(GetCrashReason(*info), *info);
-+      break;
-+    default:
-+      stringStream << "The signal " << strsignal(info->si_signo) << " was caught";
-+    }
-+  }
-+  m_stop_description = stringStream.str();
-+}
-+
-+void NativeThreadNetBSD::SetStopped() {
-+  const StateType new_state = StateType::eStateStopped;
-+  m_state = new_state;
-+  m_stop_description.clear();
-+}
-+
-+void NativeThreadNetBSD::SetStoppedByExec() {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
-+  if (log)
-+    log->Printf("NativeThreadNetBSD::%s()", __FUNCTION__);
-+  SetStopped();
-+  m_stop_info.reason = StopReason::eStopReasonExec;
-+  m_stop_info.details.signal.signo = SIGTRAP;
-+}
-+
-+void NativeThreadNetBSD::SetRunning() {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
-+  if (log)
-+    log->Printf("NativeThreadNetBSD::%s()", __FUNCTION__);
-+
-+  m_state = StateType::eStateRunning;
-+  m_stop_info.reason = StopReason::eStopReasonNone;
-+}
-+
-+void NativeThreadNetBSD::SetStepping() {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
-+  if (log)
-+    log->Printf("NativeThreadNetBSD::%s()", __FUNCTION__);
-+
-+  m_state = StateType::eStateStepping;
-+  m_stop_info.reason = StopReason::eStopReasonNone;
-+}
-+
-+void NativeThreadNetBSD::SetStoppedByTrace() {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
-+  if (log)
-+    log->Printf("NativeThreadNetBSD::%s()", __FUNCTION__);
-+  SetStopped();
-+  m_stop_info.reason = StopReason::eStopReasonTrace;
-+  m_stop_info.details.signal.signo = SIGTRAP;
-+}
-+
-+void NativeThreadNetBSD::SetStoppedByBreakpoint() {
-+  Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
-+  if (log)
-+    log->Printf("NativeThreadNetBSD::%s()", __FUNCTION__);
-+  SetStopped();
-+  m_stop_info.reason = StopReason::eStopReasonBreakpoint;
-+  m_stop_info.details.signal.signo = SIGTRAP;
-+}
-+
-+NativeProcessNetBSD &NativeThreadNetBSD::GetProcess() {
-+  auto process_sp = std::static_pointer_cast<NativeProcessNetBSD>(
-+      NativeThreadProtocol::GetProcess());
-+  assert(process_sp);
-+  return *process_sp;
-+}
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h b/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h
deleted file mode 100644
index 0a44210..0000000
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_NetBSD_NativeThreadNetBSD.h
+++ /dev/null
@@ -1,92 +0,0 @@
-$NetBSD$
-
---- source/Plugins/Process/NetBSD/NativeThreadNetBSD.h.orig	2017-01-20 20:30:48.349697339 +0000
-+++ source/Plugins/Process/NetBSD/NativeThreadNetBSD.h
-@@ -0,0 +1,87 @@
-+//===-- NativeThreadNetBSD.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_NativeThreadNetBSD_H_
-+#define liblldb_NativeThreadNetBSD_H_
-+
-+#include "lldb/Host/common/NativeThreadProtocol.h"
-+#include "lldb/lldb-private-forward.h"
-+
-+#include <sched.h>
-+
-+#include <map>
-+#include <memory>
-+#include <string>
-+
-+namespace lldb_private {
-+namespace process_netbsd {
-+
-+class NativeProcessNetBSD;
-+
-+class NativeThreadNetBSD : public NativeThreadProtocol {
-+  friend class NativeProcessNetBSD;
-+
-+public:
-+  NativeThreadNetBSD(NativeProcessNetBSD *process, lldb::tid_t tid);
-+
-+  // ---------------------------------------------------------------------
-+  // NativeThreadProtocol Interface
-+  // ---------------------------------------------------------------------
-+  std::string GetName() override;
-+
-+  lldb::StateType GetState() override;
-+
-+  bool GetStopReason(ThreadStopInfo &stop_info,
-+                     std::string &description) override;
-+
-+  NativeRegisterContextSP GetRegisterContext() override;
-+
-+  Error SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags,
-+                      bool hardware) override;
-+
-+  Error RemoveWatchpoint(lldb::addr_t addr) override;
-+
-+private:
-+  // ---------------------------------------------------------------------
-+  // Interface for friend classes
-+  // ---------------------------------------------------------------------
-+
-+  void SetStoppedBySignal(uint32_t signo, const siginfo_t *info = nullptr);
-+
-+  void SetStoppedByExec();
-+
-+  void SetStoppedByTrace();
-+
-+  void SetStoppedByBreakpoint();
-+
-+  void SetRunning();
-+
-+  void SetStepping();
-+
-+  // ---------------------------------------------------------------------
-+  // Private interface
-+  // ---------------------------------------------------------------------
-+  NativeProcessNetBSD &GetProcess();
-+
-+  void SetStopped();
-+
-+  // ---------------------------------------------------------------------
-+  // Member Variables
-+  // ---------------------------------------------------------------------
-+  lldb::StateType m_state;
-+  ThreadStopInfo m_stop_info;
-+  NativeRegisterContextSP m_reg_context_sp;
-+  std::string m_stop_description;
-+};
-+
-+typedef std::shared_ptr<NativeThreadNetBSD> NativeThreadNetBSDSP;
-+} // namespace process_netbsd
-+} // namespace lldb_private
-+
-+#endif // #ifndef liblldb_NativeThreadNetBSD_H_
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_POSIX_ProcessPOSIXLog.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_POSIX_ProcessPOSIXLog.cpp
index 6076d5c..8467984 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_POSIX_ProcessPOSIXLog.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_POSIX_ProcessPOSIXLog.cpp
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp.orig	2016-12-17 10:29:54.000000000 +0000
 +++ source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp
-@@ -15,10 +15,13 @@
+@@ -15,6 +15,8 @@
  #include "lldb/Core/StreamFile.h"
  #include "lldb/Interpreter/Args.h"
  
@@ -11,12 +11,7 @@ $NetBSD$
  #include "ProcessPOSIXLog.h"
  
  using namespace lldb;
- using namespace lldb_private;
-+using namespace llvm;
- 
- // We want to avoid global constructors where code needs to be run so here we
- // control access to our static g_log_sp by hiding it in a singleton function
-@@ -33,9 +36,9 @@ static Log *GetLog() {
+@@ -33,9 +35,9 @@ static Log *GetLog() {
  }
  
  void ProcessPOSIXLog::Initialize(ConstString name) {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_Utility_NetBSDSignals.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_Utility_NetBSDSignals.cpp
deleted file mode 100644
index 972773b..0000000
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_Utility_NetBSDSignals.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-$NetBSD$
-
---- source/Plugins/Process/Utility/NetBSDSignals.cpp.orig	2016-12-17 10:29:59.000000000 +0000
-+++ source/Plugins/Process/Utility/NetBSDSignals.cpp
-@@ -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");
- }
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_Windows_Common_ProcessWindows.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_Windows_Common_ProcessWindows.cpp
index b8be93f..813fb55 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_Windows_Common_ProcessWindows.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_Windows_Common_ProcessWindows.cpp
@@ -2,15 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Process/Windows/Common/ProcessWindows.cpp.orig	2016-12-17 10:30:06.000000000 +0000
 +++ source/Plugins/Process/Windows/Common/ProcessWindows.cpp
-@@ -41,6 +41,7 @@
- 
- using namespace lldb;
- using namespace lldb_private;
-+using namespace llvm;
- 
- namespace {
- std::string GetProcessExecutableName(HANDLE process_handle) {
-@@ -102,9 +103,9 @@ ProcessSP ProcessWindows::CreateInstance
+@@ -102,9 +102,9 @@ ProcessSP ProcessWindows::CreateInstance
  }
  
  void ProcessWindows::Initialize() {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_Windows_Common_ProcessWindowsLog.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_Windows_Common_ProcessWindowsLog.cpp
index 8fd38a6..97d7dc4 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_Windows_Common_ProcessWindowsLog.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_Windows_Common_ProcessWindowsLog.cpp
@@ -2,15 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Process/Windows/Common/ProcessWindowsLog.cpp.orig	2016-12-17 10:30:06.000000000 +0000
 +++ source/Plugins/Process/Windows/Common/ProcessWindowsLog.cpp
-@@ -17,6 +17,7 @@
- 
- using namespace lldb;
- using namespace lldb_private;
-+using namespace llvm;
- 
- // We want to avoid global constructors where code needs to be run so here we
- // control access to our static g_log_sp by hiding it in a singleton function
-@@ -25,12 +26,12 @@ using namespace lldb_private;
+@@ -25,12 +25,12 @@ using namespace lldb_private;
  static bool g_log_enabled = false;
  static Log *g_log = nullptr;
  
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_elf-core_ProcessElfCore.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_elf-core_ProcessElfCore.cpp
index a70a2d4..c9132a9 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_elf-core_ProcessElfCore.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_elf-core_ProcessElfCore.cpp
@@ -10,15 +10,7 @@ $NetBSD$
  
  #include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h"
  #include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
-@@ -36,6 +37,7 @@
- #include "ThreadElfCore.h"
- 
- using namespace lldb_private;
-+using namespace llvm;
- 
- ConstString ProcessElfCore::GetPluginNameStatic() {
-   static ConstString g_name("elf-core");
-@@ -398,9 +400,9 @@ void ProcessElfCore::Clear() {
+@@ -398,9 +399,9 @@ void ProcessElfCore::Clear() {
  }
  
  void ProcessElfCore::Initialize() {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_gdb-remote_GDBRemoteCommunicationServerPlatform.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_gdb-remote_GDBRemoteCommunicationServerPlatform.cpp
index deabbd2..5f2e871 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_gdb-remote_GDBRemoteCommunicationServerPlatform.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_gdb-remote_GDBRemoteCommunicationServerPlatform.cpp
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp.orig	2016-12-17 10:30:03.000000000 +0000
+--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp.orig	2017-01-31 17:20:57.000000000 +0000
 +++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
 @@ -36,6 +36,8 @@
  #include "lldb/Target/UnixSignals.h"
@@ -11,15 +11,7 @@ $NetBSD$
  // Project includes
  #include "Utility/StringExtractorGDBRemote.h"
  #include "Utility/UriParser.h"
-@@ -43,6 +45,7 @@
- using namespace lldb;
- using namespace lldb_private;
- using namespace lldb_private::process_gdb_remote;
-+using namespace llvm;
- 
- //----------------------------------------------------------------------
- // GDBRemoteCommunicationServerPlatform constructor
-@@ -532,9 +535,9 @@ bool GDBRemoteCommunicationServerPlatfor
+@@ -528,9 +530,9 @@ bool GDBRemoteCommunicationServerPlatfor
  
  const FileSpec &GDBRemoteCommunicationServerPlatform::GetDomainSocketDir() {
    static FileSpec g_domainsocket_dir;
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_gdb-remote_ProcessGDBRemote.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_gdb-remote_ProcessGDBRemote.cpp
index 8e6a7ef..e4e4f7a 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_gdb-remote_ProcessGDBRemote.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_gdb-remote_ProcessGDBRemote.cpp
@@ -1,8 +1,8 @@
 $NetBSD$
 
---- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp.orig	2016-12-17 10:30:03.000000000 +0000
+--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp.orig	2017-01-31 17:20:57.000000000 +0000
 +++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
-@@ -81,11 +81,13 @@
+@@ -81,6 +81,7 @@
  
  #include "llvm/ADT/StringSwitch.h"
  #include "llvm/Support/raw_ostream.h"
@@ -10,13 +10,7 @@ $NetBSD$
  
  #define DEBUGSERVER_BASENAME "debugserver"
  using namespace lldb;
- using namespace lldb_private;
- using namespace lldb_private::process_gdb_remote;
-+using namespace llvm;
- 
- namespace lldb {
- // Provide a function that can easily dump the packet history if we know a
-@@ -3427,9 +3429,9 @@ void ProcessGDBRemote::KillDebugserverPr
+@@ -3434,9 +3435,9 @@ void ProcessGDBRemote::KillDebugserverPr
  }
  
  void ProcessGDBRemote::Initialize() {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_gdb-remote_ProcessGDBRemoteLog.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_gdb-remote_ProcessGDBRemoteLog.cpp
index 588b7f5..8dc47a9 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_gdb-remote_ProcessGDBRemoteLog.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_gdb-remote_ProcessGDBRemoteLog.cpp
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp.orig	2016-12-17 10:30:03.000000000 +0000
 +++ source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
-@@ -14,11 +14,14 @@
+@@ -14,6 +14,8 @@
  #include "lldb/Core/StreamFile.h"
  #include "lldb/Interpreter/Args.h"
  
@@ -11,13 +11,7 @@ $NetBSD$
  #include "ProcessGDBRemote.h"
  
  using namespace lldb;
- using namespace lldb_private;
- using namespace lldb_private::process_gdb_remote;
-+using namespace llvm;
- 
- // We want to avoid global constructors where code needs to be run so here we
- // control access to our static g_log_sp by hiding it in a singleton function
-@@ -34,9 +37,9 @@ static Log *GetLog() {
+@@ -34,9 +36,9 @@ static Log *GetLog() {
  
  void ProcessGDBRemoteLog::Initialize() {
    static ConstString g_name("gdb-remote");
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_mach-core_ProcessMachCore.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_mach-core_ProcessMachCore.cpp
index caf174d..e94e597 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_mach-core_ProcessMachCore.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_mach-core_ProcessMachCore.cpp
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Process/mach-core/ProcessMachCore.cpp.orig	2016-12-17 10:30:06.000000000 +0000
 +++ source/Plugins/Process/mach-core/ProcessMachCore.cpp
-@@ -39,12 +39,15 @@
+@@ -39,6 +39,8 @@
  // Needed for the plug-in names for the dynamic loaders.
  #include "lldb/Utility/SafeMachO.h"
  
@@ -11,14 +11,7 @@ $NetBSD$
  #include "Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h"
  #include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h"
  #include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
- 
- using namespace lldb;
- using namespace lldb_private;
-+using namespace llvm;
- 
- ConstString ProcessMachCore::GetPluginNameStatic() {
-   static ConstString g_name("mach-o-core");
-@@ -579,9 +582,9 @@ Error ProcessMachCore::GetMemoryRegionIn
+@@ -579,9 +581,9 @@ Error ProcessMachCore::GetMemoryRegionIn
  void ProcessMachCore::Clear() { m_thread_list.Clear(); }
  
  void ProcessMachCore::Initialize() {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_Process_minidump_ProcessMinidump.cpp b/lldb-netbsd/patches/patch-source_Plugins_Process_minidump_ProcessMinidump.cpp
index 1996095..136a402 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_Process_minidump_ProcessMinidump.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_Process_minidump_ProcessMinidump.cpp
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Plugins/Process/minidump/ProcessMinidump.cpp.orig	2016-12-17 10:29:54.000000000 +0000
 +++ source/Plugins/Process/minidump/ProcessMinidump.cpp
-@@ -25,11 +25,14 @@
+@@ -25,6 +25,8 @@
  #include "lldb/Target/UnixSignals.h"
  #include "lldb/Utility/LLDBAssert.h"
  
@@ -11,13 +11,7 @@ $NetBSD$
  // C includes
  // C++ includes
  
- using namespace lldb_private;
- using namespace minidump;
-+using namespace llvm;
- 
- ConstString ProcessMinidump::GetPluginNameStatic() {
-   static ConstString g_name("minidump");
-@@ -92,9 +95,9 @@ ProcessMinidump::~ProcessMinidump() {
+@@ -92,9 +94,9 @@ ProcessMinidump::~ProcessMinidump() {
  }
  
  void ProcessMinidump::Initialize() {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_ScriptInterpreter_None_ScriptInterpreterNone.cpp b/lldb-netbsd/patches/patch-source_Plugins_ScriptInterpreter_None_ScriptInterpreterNone.cpp
index fc5fc5c..1a29262 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_ScriptInterpreter_None_ScriptInterpreterNone.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_ScriptInterpreter_None_ScriptInterpreterNone.cpp
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp.orig	2016-12-17 10:29:35.000000000 +0000
 +++ source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
-@@ -15,10 +15,13 @@
+@@ -15,6 +15,8 @@
  #include "lldb/Core/StringList.h"
  #include "lldb/Interpreter/CommandInterpreter.h"
  
@@ -11,12 +11,7 @@ $NetBSD$
  #include <mutex>
  
  using namespace lldb;
- using namespace lldb_private;
-+using namespace llvm;
- 
- ScriptInterpreterNone::ScriptInterpreterNone(CommandInterpreter &interpreter)
-     : ScriptInterpreter(interpreter, eScriptLanguageNone) {}
-@@ -39,9 +42,9 @@ void ScriptInterpreterNone::ExecuteInter
+@@ -39,9 +41,9 @@ void ScriptInterpreterNone::ExecuteInter
  }
  
  void ScriptInterpreterNone::Initialize() {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_ScriptInterpreter_Python_ScriptInterpreterPython.cpp b/lldb-netbsd/patches/patch-source_Plugins_ScriptInterpreter_Python_ScriptInterpreterPython.cpp
index 12f8e16..85e9ae3 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_ScriptInterpreter_Python_ScriptInterpreterPython.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_ScriptInterpreter_Python_ScriptInterpreterPython.cpp
@@ -1,8 +1,8 @@
 $NetBSD$
 
---- source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp.orig	2016-12-17 10:29:36.000000000 +0000
+--- source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp.orig	2017-01-31 17:20:57.000000000 +0000
 +++ source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
-@@ -51,9 +51,11 @@
+@@ -51,6 +51,7 @@
  
  #include "llvm/ADT/STLExtras.h"
  #include "llvm/ADT/StringRef.h"
@@ -10,11 +10,7 @@ $NetBSD$
  
  using namespace lldb;
  using namespace lldb_private;
-+using namespace llvm;
- 
- static ScriptInterpreterPython::SWIGInitCallback g_swig_init_callback = nullptr;
- static ScriptInterpreterPython::SWIGBreakpointCallbackFunction
-@@ -338,9 +340,9 @@ ScriptInterpreterPython::~ScriptInterpre
+@@ -338,9 +339,9 @@ ScriptInterpreterPython::~ScriptInterpre
  }
  
  void ScriptInterpreterPython::Initialize() {
diff --git a/lldb-netbsd/patches/patch-source_Plugins_SymbolFile_DWARF_SymbolFileDWARF.cpp b/lldb-netbsd/patches/patch-source_Plugins_SymbolFile_DWARF_SymbolFileDWARF.cpp
index a23210b..b003093 100644
--- a/lldb-netbsd/patches/patch-source_Plugins_SymbolFile_DWARF_SymbolFileDWARF.cpp
+++ b/lldb-netbsd/patches/patch-source_Plugins_SymbolFile_DWARF_SymbolFileDWARF.cpp
@@ -2,27 +2,22 @@ $NetBSD$
 
 --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp.orig	2016-12-17 10:29:45.000000000 +0000
 +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
-@@ -87,6 +87,7 @@
+@@ -11,6 +11,7 @@
  
- using namespace lldb;
- using namespace lldb_private;
-+using namespace llvm;
+ // Other libraries and framework includes
+ #include "llvm/Support/Casting.h"
++#include "llvm/Support/Threading.h"
+ 
+ #include "lldb/Core/ArchSpec.h"
+ #include "lldb/Core/Module.h"
+@@ -553,8 +554,8 @@ uint32_t SymbolFileDWARF::CalculateAbili
+ const DWARFDataExtractor &
+ SymbolFileDWARF::GetCachedSectionData(lldb::SectionType sect_type,
+                                       DWARFDataSegment &data_segment) {
+-  std::call_once(data_segment.m_flag, &SymbolFileDWARF::LoadSectionData, this,
+-                 sect_type, std::ref(data_segment.m_data));
++  LLVM_DEFINE_ONCE_FLAG(m_flag);
++  llvm::call_once(m_flag,  [this, sect_type, &data_segment]{ this->LoadSectionData(sect_type, std::ref(data_segment.m_data));});
+   return data_segment.m_data;
+ }
  
- // static inline bool
- // child_requires_parent_class_union_or_struct_to_be_completed (dw_tag_t tag)
-@@ -1630,13 +1631,13 @@ SymbolFileDWARF::GlobalVariableMap &Symb
-               VariableSP var_sp = globals_sp->GetVariableAtIndex(g);
-               if (var_sp && !var_sp->GetLocationIsConstantValueData()) {
-                 const DWARFExpression &location = var_sp->LocationExpression();
--                Value location_result;
-+                lldb_private::Value location_result;
-                 Error error;
-                 if (location.Evaluate(nullptr, nullptr, nullptr,
-                                       LLDB_INVALID_ADDRESS, nullptr, nullptr,
-                                       location_result, &error)) {
-                   if (location_result.GetValueType() ==
--                      Value::eValueTypeFileAddress) {
-+                      lldb_private::Value::eValueTypeFileAddress) {
-                     lldb::addr_t file_addr =
-                         location_result.GetScalar().ULongLong();
-                     lldb::addr_t byte_size = 1;
diff --git a/lldb-netbsd/patches/patch-source_Plugins_SymbolFile_DWARF_SymbolFileDWARF.h b/lldb-netbsd/patches/patch-source_Plugins_SymbolFile_DWARF_SymbolFileDWARF.h
new file mode 100644
index 0000000..ed496b8
--- /dev/null
+++ b/lldb-netbsd/patches/patch-source_Plugins_SymbolFile_DWARF_SymbolFileDWARF.h
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h.orig	2016-12-17 10:29:45.000000000 +0000
++++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+@@ -305,7 +305,6 @@ protected:
+   typedef llvm::DenseMap<lldb::opaque_compiler_type_t, DIERef> ClangTypeToDIE;
+ 
+   struct DWARFDataSegment {
+-    std::once_flag m_flag;
+     lldb_private::DWARFDataExtractor m_data;
+   };
+ 
diff --git a/lldb-netbsd/patches/patch-source_Symbol_ClangASTContext.cpp b/lldb-netbsd/patches/patch-source_Symbol_ClangASTContext.cpp
index c259aa8..f770377 100644
--- a/lldb-netbsd/patches/patch-source_Symbol_ClangASTContext.cpp
+++ b/lldb-netbsd/patches/patch-source_Symbol_ClangASTContext.cpp
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- source/Symbol/ClangASTContext.cpp.orig	2016-12-17 10:30:17.000000000 +0000
+--- source/Symbol/ClangASTContext.cpp.orig	2017-01-31 17:20:57.000000000 +0000
 +++ source/Symbol/ClangASTContext.cpp
 @@ -127,8 +127,8 @@ typedef lldb_private::ThreadSafeDenseMap
  
diff --git a/lldb-netbsd/patches/patch-source_Symbol_GoASTContext.cpp b/lldb-netbsd/patches/patch-source_Symbol_GoASTContext.cpp
index b7f8f02..8dd0486 100644
--- a/lldb-netbsd/patches/patch-source_Symbol_GoASTContext.cpp
+++ b/lldb-netbsd/patches/patch-source_Symbol_GoASTContext.cpp
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Symbol/GoASTContext.cpp.orig	2016-12-17 10:30:17.000000000 +0000
 +++ source/Symbol/GoASTContext.cpp
-@@ -25,10 +25,13 @@
+@@ -25,6 +25,8 @@
  #include "lldb/Target/ExecutionContext.h"
  #include "lldb/Target/Target.h"
  
@@ -11,12 +11,7 @@ $NetBSD$
  #include "Plugins/ExpressionParser/Go/GoUserExpression.h"
  #include "Plugins/SymbolFile/DWARF/DWARFASTParserGo.h"
  
- using namespace lldb;
-+using namespace llvm;
- 
- namespace lldb_private {
- class GoArray;
-@@ -593,8 +596,8 @@ GoASTContext::GetBasicTypeEnumeration(ll
+@@ -593,8 +595,8 @@ GoASTContext::GetBasicTypeEnumeration(ll
    if (name) {
      typedef UniqueCStringMap<lldb::BasicType> TypeNameToBasicTypeMap;
      static TypeNameToBasicTypeMap g_type_map;
diff --git a/lldb-netbsd/patches/patch-source_Target_Language.cpp b/lldb-netbsd/patches/patch-source_Target_Language.cpp
index 6d5517d..916cecc 100644
--- a/lldb-netbsd/patches/patch-source_Target_Language.cpp
+++ b/lldb-netbsd/patches/patch-source_Target_Language.cpp
@@ -2,7 +2,7 @@ $NetBSD$
 
 --- source/Target/Language.cpp.orig	2016-12-17 10:30:23.000000000 +0000
 +++ source/Target/Language.cpp
-@@ -20,18 +20,21 @@
+@@ -20,6 +20,8 @@
  #include "lldb/Symbol/TypeList.h"
  #include "lldb/Target/Target.h"
  
@@ -11,10 +11,7 @@ $NetBSD$
  using namespace lldb;
  using namespace lldb_private;
  using namespace lldb_private::formatters;
-+using namespace llvm;
- 
- typedef std::unique_ptr<Language> LanguageUP;
- typedef std::map<lldb::LanguageType, LanguageUP> LanguagesMap;
+@@ -29,9 +31,9 @@ typedef std::map<lldb::LanguageType, Lan
  
  static LanguagesMap &GetLanguagesMap() {
    static LanguagesMap *g_map = nullptr;
@@ -26,7 +23,7 @@ $NetBSD$
      g_map = new LanguagesMap(); // NOTE: INTENTIONAL LEAK due to global
                                  // destructor chain
    });
-@@ -40,9 +43,9 @@ static LanguagesMap &GetLanguagesMap() {
+@@ -40,9 +42,9 @@ static LanguagesMap &GetLanguagesMap() {
  }
  static std::mutex &GetLanguagesMutex() {
    static std::mutex *g_mutex = nullptr;
diff --git a/lldb-netbsd/patches/patch-tools_debugserver_source_MacOSX_DarwinLog_DarwinLogCollector.cpp b/lldb-netbsd/patches/patch-tools_debugserver_source_MacOSX_DarwinLog_DarwinLogCollector.cpp
index 8758089..c0b0930 100644
--- a/lldb-netbsd/patches/patch-tools_debugserver_source_MacOSX_DarwinLog_DarwinLogCollector.cpp
+++ b/lldb-netbsd/patches/patch-tools_debugserver_source_MacOSX_DarwinLog_DarwinLogCollector.cpp
@@ -1,26 +1,17 @@
 $NetBSD$
 
---- tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp.orig	2016-12-17 10:30:47.000000000 +0000
+--- tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp.orig	2017-01-31 17:20:57.000000000 +0000
 +++ tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
-@@ -28,6 +28,8 @@
- #include "RNBDefs.h"
- #include "RNBRemote.h"
- 
-+using namespace llvm;
-+
- // Use an anonymous namespace for variables and methods that have no
- // reason to leak out through the interface.
- namespace {
-@@ -46,10 +48,10 @@ static os_activity_stream_set_event_hand
+@@ -46,10 +46,10 @@ static os_activity_stream_set_event_hand
      s_os_activity_stream_set_event_handler;
  
  bool LookupSPICalls() {
 -  static std::once_flag s_once_flag;
-+  LLVM_DEFINE_ONCE_FLAG(g_once_flag);
++  LLVM_DEFINE_ONCE_FLAG(s_once_flag);
    static bool s_has_spi;
  
 -  std::call_once(s_once_flag, [] {
 +  llvm::call_once(s_once_flag, [] {
+     dlopen ("/System/Library/PrivateFrameworks/LoggingSupport.framework/LoggingSupport", RTLD_NOW);
      s_os_activity_stream_for_pid = (os_activity_stream_for_pid_t)dlsym(
          RTLD_DEFAULT, "os_activity_stream_for_pid");
-     s_os_activity_stream_resume = (os_activity_stream_resume_t)dlsym(
diff --git a/lldb-netbsd/patches/patch-tools_lldb-mi_MICmnBase.cpp b/lldb-netbsd/patches/patch-tools_lldb-mi_MICmnBase.cpp
deleted file mode 100644
index f30ad21..0000000
--- a/lldb-netbsd/patches/patch-tools_lldb-mi_MICmnBase.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD$
-
---- tools/lldb-mi/MICmnBase.cpp.orig	2016-09-10 17:36:23.000000000 +0000
-+++ tools/lldb-mi/MICmnBase.cpp
-@@ -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);
diff --git a/lldb-netbsd/patches/patch-tools_lldb-mi_MICmnBase.h b/lldb-netbsd/patches/patch-tools_lldb-mi_MICmnBase.h
deleted file mode 100644
index 6212245..0000000
--- a/lldb-netbsd/patches/patch-tools_lldb-mi_MICmnBase.h
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD$
-
---- tools/lldb-mi/MICmnBase.h.orig	2016-09-10 17:36:23.000000000 +0000
-+++ tools/lldb-mi/MICmnBase.h
-@@ -28,7 +28,7 @@ public:
-   bool HaveErrorDescription() const;
-   const CMIUtilString &GetErrorDescription() const;
-   void SetErrorDescription(const CMIUtilString &vrTxt) const;
--  void SetErrorDescriptionn(const CMIUtilString vFormat, ...) const;
-+  void SetErrorDescriptionn(const char *vFormat, ...) const;
-   void SetErrorDescriptionNoLog(const CMIUtilString &vrTxt) const;
-   void ClrErrorDescription() const;
- 
diff --git a/lldb-netbsd/patches/patch-tools_lldb-mi_MIDriver.cpp b/lldb-netbsd/patches/patch-tools_lldb-mi_MIDriver.cpp
deleted file mode 100644
index a96e7fa..0000000
--- a/lldb-netbsd/patches/patch-tools_lldb-mi_MIDriver.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD$
-
---- tools/lldb-mi/MIDriver.cpp.orig	2016-09-10 17:36:23.000000000 +0000
-+++ tools/lldb-mi/MIDriver.cpp
-@@ -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);
-+    SetErrorDescriptionn(errMsg.c_str());
-     return MIstatus::failure;
-   }
- 
diff --git a/lldb-netbsd/patches/patch-tools_lldb-mi_MIUtilString.cpp b/lldb-netbsd/patches/patch-tools_lldb-mi_MIUtilString.cpp
deleted file mode 100644
index 2df0237..0000000
--- a/lldb-netbsd/patches/patch-tools_lldb-mi_MIUtilString.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD$
-
---- tools/lldb-mi/MIUtilString.cpp.orig	2016-09-10 17:36:23.000000000 +0000
-+++ tools/lldb-mi/MIUtilString.cpp
-@@ -156,7 +156,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);
diff --git a/lldb-netbsd/patches/patch-tools_lldb-mi_MIUtilString.h b/lldb-netbsd/patches/patch-tools_lldb-mi_MIUtilString.h
deleted file mode 100644
index c352662..0000000
--- a/lldb-netbsd/patches/patch-tools_lldb-mi_MIUtilString.h
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD$
-
---- tools/lldb-mi/MIUtilString.h.orig	2016-09-10 17:36:23.000000000 +0000
-+++ tools/lldb-mi/MIUtilString.h
-@@ -30,7 +30,7 @@ public:
- 
-   // Static method:
- public:
--  static CMIUtilString Format(const CMIUtilString vFormating, ...);
-+  static CMIUtilString Format(const char *vFormating, ...);
-   static CMIUtilString FormatBinary(const MIuint64 vnDecimal);
-   static CMIUtilString FormatValist(const CMIUtilString &vrFormating,
-                                     va_list vArgs);
diff --git a/lldb-netbsd/patches/patch-tools_lldb-server_CMakeLists.txt b/lldb-netbsd/patches/patch-tools_lldb-server_CMakeLists.txt
index 2aa63f5..44321c3 100644
--- a/lldb-netbsd/patches/patch-tools_lldb-server_CMakeLists.txt
+++ b/lldb-netbsd/patches/patch-tools_lldb-server_CMakeLists.txt
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- tools/lldb-server/CMakeLists.txt.orig	2016-12-17 10:30:54.000000000 +0000
+--- tools/lldb-server/CMakeLists.txt.orig	2017-01-31 17:20:57.000000000 +0000
 +++ tools/lldb-server/CMakeLists.txt
 @@ -17,6 +17,7 @@ endif ()
  if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
@@ -10,7 +10,7 @@ $NetBSD$
    ../../source/Plugins/Process/POSIX
    )
  endif ()
-@@ -84,6 +85,14 @@ if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
+@@ -84,6 +85,14 @@ if ( CMAKE_SYSTEM_NAME MATCHES "Linux|An
     )
  endif ()
  


Home | Main Index | Thread Index | Old Index