tech-toolchain archive

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

[PATCH 2/7] Backport multiple fixes to LLDB needed for NetBSD



Backport a number of patches to LLDB since imported commit.  These are
mostly mine and Kamil's patches improving NetBSD support and updating
for newer API.  There are also two lldbCore file renames that are
necessary to avoid basename conflicts in our Makefiles.
---
 .../register_command/TestRegisters.py         |   1 -
 .../hello_watchlocation/TestWatchLocation.py  |   1 -
 .../TestWatchpointMultipleThreads.py          |   2 -
 .../TestWatchLocationWithWatchSet.py          |   1 -
 ...rentBreakpointOneDelayBreakpointThreads.py |   1 -
 ...eakpointsDelayedBreakpointOneWatchpoint.py |   1 -
 .../TestConcurrentCrashWithBreak.py           |   1 -
 .../TestConcurrentCrashWithSignal.py          |   1 -
 .../TestConcurrentCrashWithWatchpoint.py      |   1 -
 ...rentCrashWithWatchpointBreakpointSignal.py |   1 -
 .../TestConcurrentDelaySignalBreak.py         |   1 -
 .../TestConcurrentDelaySignalWatch.py         |   1 -
 .../TestConcurrentDelayWatchBreak.py          |   1 -
 ...currentDelayedCrashWithBreakpointSignal.py |   1 -
 ...entDelayedCrashWithBreakpointWatchpoint.py |   1 -
 .../TestConcurrentManyBreakpoints.py          |   1 -
 .../TestConcurrentManyCrash.py                |   1 -
 .../TestConcurrentManyWatchpoints.py          |   1 -
 .../TestConcurrentNWatchNBreak.py             |   1 -
 .../TestConcurrentSignalBreak.py              |   1 -
 .../TestConcurrentSignalWatch.py              |   1 -
 .../TestConcurrentTwoBreakpointThreads.py     |   1 -
 ...stConcurrentTwoBreakpointsOneWatchpoint.py |   1 -
 .../TestConcurrentTwoWatchpointThreads.py     |   1 -
 ...stConcurrentTwoWatchpointsOneBreakpoint.py |   1 -
 ...currentTwoWatchpointsOneDelayBreakpoint.py |   1 -
 .../TestConcurrentWatchBreak.py               |   1 -
 .../TestConcurrentWatchBreakDelay.py          |   1 -
 ...tWatchpointDelayWatchpointOneBreakpoint.py |   1 -
 ...entWatchpointWithDelayWatchpointThreads.py |   1 -
 .../exit_during_break/TestExitDuringBreak.py  |   1 -
 .../exit_during_step/TestExitDuringStep.py    |   3 -
 .../thread/num_threads/TestNumThreads.py      |   1 -
 .../thread/thread_exit/TestThreadExit.py      |   1 -
 .../TestThreadSpecificBreakpoint.py           |   2 -
 .../lldbutil/iter/TestLLDBIterator.py         |   1 -
 .../watchlocation/TestSetWatchlocation.py     |   1 -
 .../watchlocation/TestTargetWatchAddress.py   |   1 -
 .../lldb-server/TestGdbRemote_vContThreads.py | 149 ++++
 .../tools/lldb-server/thread-name/main.cpp    |   2 +-
 .../llvm/dist/lldb/source/Host/CMakeLists.txt |   4 +-
 .../Host/netbsd/{Host.cpp => HostNetBSD.cpp}  |  32 +-
 .../{FileSystem.cpp => FileSystemPosix.cpp}   |   0
 .../Process/NetBSD/NativeProcessNetBSD.cpp    | 333 +++++---
 .../Process/NetBSD/NativeProcessNetBSD.h      |   3 +
 .../NetBSD/NativeRegisterContextNetBSD.cpp    |   2 +
 .../NetBSD/NativeRegisterContextNetBSD.h      |   7 +-
 .../NativeRegisterContextNetBSD_x86_64.cpp    | 742 ++++++++++++++----
 .../NativeRegisterContextNetBSD_x86_64.h      |  22 +-
 .../Process/NetBSD/NativeThreadNetBSD.cpp     | 108 ++-
 .../Process/NetBSD/NativeThreadNetBSD.h       |  13 +-
 .../Plugins/Process/Utility/CMakeLists.txt    |   1 +
 .../Utility/RegisterContextNetBSD_i386.cpp    |  96 +++
 .../Utility/RegisterContextNetBSD_i386.h      |  25 +
 .../Utility/RegisterContextNetBSD_x86_64.cpp  |  57 +-
 .../Utility/RegisterContextNetBSD_x86_64.h    |   3 +
 .../Process/Utility/RegisterInfos_i386.h      |   2 +-
 .../Process/Utility/lldb-x86-register-enums.h |  10 +-
 .../Shell/Watchpoint/Inputs/thread-dbreg.c    |  23 +
 .../Shell/Watchpoint/netbsd-nouserdbregs.test |  22 +
 .../llvm/dist/lldb/test/Shell/lit.cfg.py      |  15 +
 61 files changed, 1394 insertions(+), 319 deletions(-)
 create mode 100644 external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_vContThreads.py
 rename external/apache2/llvm/dist/lldb/source/Host/netbsd/{Host.cpp => HostNetBSD.cpp} (87%)
 rename external/apache2/llvm/dist/lldb/source/Host/posix/{FileSystem.cpp => FileSystemPosix.cpp} (100%)
 create mode 100644 external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_i386.cpp
 create mode 100644 external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_i386.h
 create mode 100644 external/apache2/llvm/dist/lldb/test/Shell/Watchpoint/Inputs/thread-dbreg.c
 create mode 100644 external/apache2/llvm/dist/lldb/test/Shell/Watchpoint/netbsd-nouserdbregs.test

diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/register/register/register_command/TestRegisters.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/register/register/register_command/TestRegisters.py
index f9b187bc2b41..01d2367c8550 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/register/register/register_command/TestRegisters.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/register/register/register_command/TestRegisters.py
@@ -59,7 +59,6 @@ class RegisterCommandsTestCase(TestBase):
     @skipIfTargetAndroid(archs=["i386"])
     @skipIf(archs=no_match(['amd64', 'arm', 'i386', 'x86_64']))
     @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr37995")
-    @expectedFailureNetBSD
     def test_fp_register_write(self):
         """Test commands that write to registers, in particular floating-point registers."""
         self.build()
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/watchpoints/hello_watchlocation/TestWatchLocation.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/watchpoints/hello_watchlocation/TestWatchLocation.py
index 7a8b07b0425e..33127bf51e24 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/watchpoints/hello_watchlocation/TestWatchLocation.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/watchpoints/hello_watchlocation/TestWatchLocation.py
@@ -36,7 +36,6 @@ class HelloWatchLocationTestCase(TestBase):
     @expectedFailureAll(triple=re.compile('^mips'))
     # SystemZ and PowerPC also currently supports only one H/W watchpoint
     @expectedFailureAll(archs=['powerpc64le', 's390x'])
-    @expectedFailureNetBSD
     @skipIfDarwin
     def test_hello_watchlocation(self):
         """Test watching a location with '-s size' option."""
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/watchpoints/multiple_threads/TestWatchpointMultipleThreads.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/watchpoints/multiple_threads/TestWatchpointMultipleThreads.py
index e02cce661297..3e6329eb91fb 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/watchpoints/multiple_threads/TestWatchpointMultipleThreads.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/watchpoints/multiple_threads/TestWatchpointMultipleThreads.py
@@ -18,12 +18,10 @@ class WatchpointForMultipleThreadsTestCase(TestBase):
     NO_DEBUG_INFO_TESTCASE = True
     main_spec = lldb.SBFileSpec("main.cpp", False)
 
-    @expectedFailureNetBSD
     def test_watchpoint_before_thread_start(self):
         """Test that we can hit a watchpoint we set before starting another thread"""
         self.do_watchpoint_test("Before running the thread")
 
-    @expectedFailureNetBSD
     def test_watchpoint_after_thread_start(self):
         """Test that we can hit a watchpoint we set after starting another thread"""
         self.do_watchpoint_test("After running the thread")
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/watchpoints/watchpoint_set_command/TestWatchLocationWithWatchSet.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/watchpoints/watchpoint_set_command/TestWatchLocationWithWatchSet.py
index b69736bb30bd..7953dabebfd9 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/watchpoints/watchpoint_set_command/TestWatchLocationWithWatchSet.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/commands/watchpoints/watchpoint_set_command/TestWatchLocationWithWatchSet.py
@@ -34,7 +34,6 @@ class WatchLocationUsingWatchpointSetTestCase(TestBase):
             'aarch64',
             'arm'],
         bugnumber="llvm.org/pr26031")
-    @expectedFailureNetBSD
     def test_watchlocation_using_watchpoint_set(self):
         """Test watching a location with 'watchpoint set expression -w write -s size' option."""
         self.build()
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointOneDelayBreakpointThreads.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointOneDelayBreakpointThreads.py
index fd62edbf43e6..8712342e5811 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointOneDelayBreakpointThreads.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointOneDelayBreakpointThreads.py
@@ -15,7 +15,6 @@ class ConcurrentBreakpointOneDelayBreakpointThreads(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     def test(self):
         """Test threads that trigger a breakpoint where one thread has a 1 second delay. """
         self.build(dictionary=self.getBuildFlags())
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py
index 1d85dd046c37..275d54d2149c 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py
@@ -16,7 +16,6 @@ class ConcurrentBreakpointsDelayedBreakpointOneWatchpoint(
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """Test a breakpoint, a delayed breakpoint, and one watchpoint thread. """
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithBreak.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithBreak.py
index 9ce89e8947e9..33d1074211ee 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithBreak.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithBreak.py
@@ -15,7 +15,6 @@ class ConcurrentCrashWithBreak(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     def test(self):
         """ Test a thread that crashes while another thread hits a breakpoint."""
         self.build(dictionary=self.getBuildFlags())
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithSignal.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithSignal.py
index 715c55da1637..560c79ed8a8f 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithSignal.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithSignal.py
@@ -15,7 +15,6 @@ class ConcurrentCrashWithSignal(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     def test(self):
         """ Test a thread that crashes while another thread generates a signal."""
         self.build(dictionary=self.getBuildFlags())
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpoint.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpoint.py
index bf92488babc0..c9cc6db96004 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpoint.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpoint.py
@@ -15,7 +15,6 @@ class ConcurrentCrashWithWatchpoint(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """ Test a thread that crashes while another thread hits a watchpoint."""
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpointBreakpointSignal.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpointBreakpointSignal.py
index 5f4a19c161de..d99107b6e9b6 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpointBreakpointSignal.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpointBreakpointSignal.py
@@ -15,7 +15,6 @@ class ConcurrentCrashWithWatchpointBreakpointSignal(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """ Test a thread that crashes while other threads generate a signal and hit a watchpoint and breakpoint. """
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelaySignalBreak.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelaySignalBreak.py
index 3c5249a388e5..442134f4a0c7 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelaySignalBreak.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelaySignalBreak.py
@@ -15,7 +15,6 @@ class ConcurrentDelaySignalBreak(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     def test(self):
         """Test (1-second delay) signal and a breakpoint in multiple threads."""
         self.build(dictionary=self.getBuildFlags())
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelaySignalWatch.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelaySignalWatch.py
index 84565bf98bc2..28c5c68d4506 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelaySignalWatch.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelaySignalWatch.py
@@ -15,7 +15,6 @@ class ConcurrentDelaySignalWatch(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """Test a watchpoint and a (1 second delay) signal in multiple threads."""
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayWatchBreak.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayWatchBreak.py
index cd67116f3181..2d7c984e0e1c 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayWatchBreak.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayWatchBreak.py
@@ -15,7 +15,6 @@ class ConcurrentDelayWatchBreak(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """Test (1-second delay) watchpoint and a breakpoint in multiple threads."""
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayedCrashWithBreakpointSignal.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayedCrashWithBreakpointSignal.py
index 7461cd60b041..2b7e1b457268 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayedCrashWithBreakpointSignal.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayedCrashWithBreakpointSignal.py
@@ -15,7 +15,6 @@ class ConcurrentDelayedCrashWithBreakpointSignal(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     def test(self):
         """ Test a thread with a delayed crash while other threads generate a signal and hit a breakpoint. """
         self.build(dictionary=self.getBuildFlags())
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py
index 504e757ac90d..0564c86dfcbd 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py
@@ -15,7 +15,6 @@ class ConcurrentDelayedCrashWithBreakpointWatchpoint(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """ Test a thread with a delayed crash while other threads hit a watchpoint and a breakpoint. """
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyBreakpoints.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyBreakpoints.py
index 0ceaed937a93..18379f168727 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyBreakpoints.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyBreakpoints.py
@@ -14,7 +14,6 @@ class ConcurrentManyBreakpoints(ConcurrentEventsBase):
 
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @skipIfOutOfTreeDebugserver
     def test(self):
         """Test 100 breakpoints from 100 threads."""
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyCrash.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyCrash.py
index 945b1b9a3405..8d16267acb48 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyCrash.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyCrash.py
@@ -14,7 +14,6 @@ class ConcurrentManyCrash(ConcurrentEventsBase):
 
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @skipIfOutOfTreeDebugserver
     def test(self):
         """Test 100 threads that cause a segfault."""
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyWatchpoints.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyWatchpoints.py
index cce537ac77ae..55c7d3f7521b 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyWatchpoints.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyWatchpoints.py
@@ -14,7 +14,6 @@ class ConcurrentManyWatchpoints(ConcurrentEventsBase):
 
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     @skipIfOutOfTreeDebugserver
     def test(self):
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentNWatchNBreak.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentNWatchNBreak.py
index 84a4ac6f7a34..b921ac04ccc5 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentNWatchNBreak.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentNWatchNBreak.py
@@ -15,7 +15,6 @@ class ConcurrentNWatchNBreak(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """Test with 5 watchpoint and breakpoint threads."""
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalBreak.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalBreak.py
index 9af391851bb0..b8819f286984 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalBreak.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalBreak.py
@@ -15,7 +15,6 @@ class ConcurrentSignalBreak(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     def test(self):
         """Test signal and a breakpoint in multiple threads."""
         self.build(dictionary=self.getBuildFlags())
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalWatch.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalWatch.py
index 508084cac0c5..0fbaf364045d 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalWatch.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalWatch.py
@@ -15,7 +15,6 @@ class ConcurrentSignalWatch(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """Test a watchpoint and a signal in multiple threads."""
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointThreads.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointThreads.py
index 10316a369277..4e6bed2d5cbc 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointThreads.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointThreads.py
@@ -15,7 +15,6 @@ class ConcurrentTwoBreakpointThreads(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     def test(self):
         """Test two threads that trigger a breakpoint. """
         self.build(dictionary=self.getBuildFlags())
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneWatchpoint.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneWatchpoint.py
index 762b23c89a8d..687be17ddc5a 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneWatchpoint.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneWatchpoint.py
@@ -15,7 +15,6 @@ class ConcurrentTwoBreakpointsOneWatchpoint(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """Test two threads that trigger a breakpoint and one watchpoint thread. """
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointThreads.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointThreads.py
index 62eac557cfcc..025d91169451 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointThreads.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointThreads.py
@@ -15,7 +15,6 @@ class ConcurrentTwoWatchpointThreads(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """Test two threads that trigger a watchpoint. """
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneBreakpoint.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneBreakpoint.py
index 31d6e425a627..5e95531ae09a 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneBreakpoint.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneBreakpoint.py
@@ -15,7 +15,6 @@ class ConcurrentTwoWatchpointsOneBreakpoint(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """Test two threads that trigger a watchpoint and one breakpoint thread. """
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py
index 16584472c975..aa57e816bb58 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py
@@ -15,7 +15,6 @@ class ConcurrentTwoWatchpointsOneDelayBreakpoint(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """Test two threads that trigger a watchpoint and one (1 second delay) breakpoint thread. """
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchBreak.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchBreak.py
index cf86df9b324b..241ea5b64a03 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchBreak.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchBreak.py
@@ -15,7 +15,6 @@ class ConcurrentWatchBreak(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """Test watchpoint and a breakpoint in multiple threads."""
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchBreakDelay.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchBreakDelay.py
index 1cef5936ad1f..79a54b620e53 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchBreakDelay.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchBreakDelay.py
@@ -15,7 +15,6 @@ class ConcurrentWatchBreakDelay(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """Test watchpoint and a (1 second delay) breakpoint in multiple threads."""
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py
index adbd2b036d8c..6a37abdbcbb8 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py
@@ -15,7 +15,6 @@ class ConcurrentWatchpointDelayWatchpointOneBreakpoint(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """Test two threads that trigger a watchpoint (one with a 1 second delay) and one breakpoint thread. """
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchpointWithDelayWatchpointThreads.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchpointWithDelayWatchpointThreads.py
index 357982271281..67ac92b853cd 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchpointWithDelayWatchpointThreads.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchpointWithDelayWatchpointThreads.py
@@ -15,7 +15,6 @@ class ConcurrentWatchpointWithDelayWatchpointThreads(ConcurrentEventsBase):
     @skipIfFreeBSD  # timing out on buildbot
     # Atomic sequences are not supported yet for MIPS in LLDB.
     @skipIf(triple='^mips')
-    @expectedFailureNetBSD
     @add_test_categories(["watchpoint"])
     def test(self):
         """Test two threads that trigger a watchpoint where one thread has a 1 second delay. """
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
index 585c2ea2a533..279eec8c4044 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
@@ -21,7 +21,6 @@ class ExitDuringBreakpointTestCase(TestBase):
         # Find the line number for our breakpoint.
         self.breakpoint = line_number('main.cpp', '// Set breakpoint here')
 
-    @expectedFailureNetBSD
     def test(self):
         """Test thread exit during breakpoint handling."""
         self.build(dictionary=self.getBuildFlags())
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
index 23b5a29a9a19..c7e66bd7726b 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
@@ -17,7 +17,6 @@ class ExitDuringStepTestCase(TestBase):
 
     @skipIfFreeBSD  # llvm.org/pr21411: test is hanging
     @skipIfWindows # This is flakey on Windows: llvm.org/pr38373
-    @expectedFailureNetBSD
     def test(self):
         """Test thread exit during step handling."""
         self.build(dictionary=self.getBuildFlags())
@@ -28,7 +27,6 @@ class ExitDuringStepTestCase(TestBase):
 
     @skipIfFreeBSD  # llvm.org/pr21411: test is hanging
     @skipIfWindows # This is flakey on Windows: llvm.org/pr38373
-    @expectedFailureNetBSD
     def test_step_over(self):
         """Test thread exit during step-over handling."""
         self.build(dictionary=self.getBuildFlags())
@@ -39,7 +37,6 @@ class ExitDuringStepTestCase(TestBase):
 
     @skipIfFreeBSD  # llvm.org/pr21411: test is hanging
     @skipIfWindows # This is flakey on Windows: llvm.org/pr38373
-    @expectedFailureNetBSD
     def test_step_in(self):
         """Test thread exit during step-in handling."""
         self.build(dictionary=self.getBuildFlags())
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py
index 2913f891d767..a6f05337716e 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py
@@ -23,7 +23,6 @@ class NumberOfThreadsTestCase(TestBase):
         self.thread3_notify_all_line = line_number('main.cpp', '// Set thread3 break point on notify_all at this line.')
         self.thread3_before_lock_line = line_number('main.cpp', '// thread3-before-lock')
 
-    @expectedFailureNetBSD
     def test_number_of_threads(self):
         """Test number of threads."""
         self.build()
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py
index 8eb8b22e54e2..5ad379d6a793 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py
@@ -25,7 +25,6 @@ class ThreadExitTestCase(TestBase):
         self.break_4 = line_number('main.cpp', '// Set fourth breakpoint here')
 
     @skipIfWindows # This is flakey on Windows: llvm.org/pr38373
-    @expectedFailureNetBSD
     def test(self):
         """Test thread exit handling."""
         self.build(dictionary=self.getBuildFlags())
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py
index 236f8cc96406..66811c2573c1 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py
@@ -25,13 +25,11 @@ class ThreadSpecificBreakTestCase(TestBase):
     @add_test_categories(['pyapi'])
 
     @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], archs=['armv7', 'armv7k'], bugnumber='rdar://problem/34563920') # armv7 ios problem - breakpoint with tid qualifier isn't working
-    @expectedFailureNetBSD
     def test_thread_id(self):
         self.do_test(set_thread_id)
 
     @skipUnlessDarwin
     @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], archs=['armv7', 'armv7k'], bugnumber='rdar://problem/34563920') # armv7 ios problem - breakpoint with tid qualifier isn't working
-    @expectedFailureNetBSD
     def test_thread_name(self):
         self.do_test(set_thread_name)
 
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py
index 52daaf5dc583..050ec87fb2b9 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py
@@ -91,7 +91,6 @@ class LLDBIteratorTestCase(TestBase):
             self.assertTrue(yours[i] == mine[i],
                             "ID of yours[{0}] and mine[{0}] matches".format(i))
 
-    @expectedFailureNetBSD
     @add_test_categories(['pyapi'])
     def test_lldb_iter_frame(self):
         """Test iterator works correctly for SBProcess->SBThread->SBFrame."""
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
index 28e18620ab11..97559212b17d 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
@@ -28,7 +28,6 @@ class SetWatchlocationAPITestCase(TestBase):
         self.violating_func = "do_bad_thing_with_location"
 
     @add_test_categories(['pyapi'])
-    @expectedFailureNetBSD
     def test_watch_location(self):
         """Exercise SBValue.WatchPointee() API to set a watchpoint."""
         self.build()
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
index 6d4ccf0db4bb..b963768ae6b5 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
@@ -27,7 +27,6 @@ class TargetWatchAddressAPITestCase(TestBase):
         self.violating_func = "do_bad_thing_with_location"
 
     @add_test_categories(['pyapi'])
-    @expectedFailureNetBSD
     def test_watch_address(self):
         """Exercise SBTarget.WatchAddress() API to set a watchpoint."""
         self.build()
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_vContThreads.py b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_vContThreads.py
new file mode 100644
index 000000000000..48b1bb089a11
--- /dev/null
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_vContThreads.py
@@ -0,0 +1,149 @@
+from __future__ import print_function
+
+import json
+import re
+
+import gdbremote_testcase
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestGdbRemote_vContThreads(gdbremote_testcase.GdbRemoteTestCaseBase):
+    mydir = TestBase.compute_mydir(__file__)
+
+    def start_threads(self, num):
+        procs = self.prep_debug_monitor_and_inferior(
+            inferior_args=['thread:new'] * num + ['@started'])
+        # start the process and wait for output
+        self.test_sequence.add_log_lines([
+            "read packet: $c#63",
+            {"type": "output_match", "regex": self.maybe_strict_output_regex(
+                r"@started\r\n")},
+        ], True)
+        # then interrupt it
+        self.add_interrupt_packets()
+        self.add_threadinfo_collection_packets()
+
+        context = self.expect_gdbremote_sequence()
+        self.assertIsNotNone(context)
+        threads = self.parse_threadinfo_packets(context)
+        self.assertIsNotNone(threads)
+        self.assertEqual(len(threads), num + 1)
+
+        self.reset_test_sequence()
+        return threads
+
+    def signal_one_thread(self):
+        threads = self.start_threads(1)
+        # try sending a signal to one of the two threads
+        self.test_sequence.add_log_lines([
+            "read packet: $vCont;C{0:x}:{1:x};c#00".format(
+                lldbutil.get_signal_number('SIGUSR1'), threads[0]),
+            {"direction": "send", "regex": r"^\$W00#b7$"},
+        ], True)
+
+        context = self.expect_gdbremote_sequence()
+        self.assertIsNotNone(context)
+
+    @skipUnlessPlatform(["netbsd"])
+    @debugserver_test
+    def test_signal_one_thread_debugserver(self):
+        self.init_debugserver_test()
+        self.build()
+        self.set_inferior_startup_launch()
+        self.signal_one_thread()
+
+    @skipUnlessPlatform(["netbsd"])
+    @llgs_test
+    def test_signal_one_thread_llgs(self):
+        self.init_llgs_test()
+        self.build()
+        self.set_inferior_startup_launch()
+        self.signal_one_thread()
+
+    def signal_all_threads(self):
+        threads = self.start_threads(1)
+        # try sending a signal to two threads (= the process)
+        self.test_sequence.add_log_lines([
+            "read packet: $vCont;C{0:x}:{1:x};C{0:x}:{2:x}#00".format(
+                lldbutil.get_signal_number('SIGUSR1'),
+                threads[0], threads[1]),
+            {"direction": "send", "regex": r"^\$W00#b7$"},
+        ], True)
+
+        context = self.expect_gdbremote_sequence()
+        self.assertIsNotNone(context)
+
+    @skipUnlessPlatform(["netbsd"])
+    @debugserver_test
+    def test_signal_all_threads_debugserver(self):
+        self.init_debugserver_test()
+        self.build()
+        self.set_inferior_startup_launch()
+        self.signal_all_threads()
+
+    @skipUnlessPlatform(["netbsd"])
+    @llgs_test
+    def test_signal_all_threads_llgs(self):
+        self.init_llgs_test()
+        self.build()
+        self.set_inferior_startup_launch()
+        self.signal_all_threads()
+
+    def signal_two_of_three_threads(self):
+        threads = self.start_threads(2)
+        # try sending a signal to 2 out of 3 threads
+        self.test_sequence.add_log_lines([
+            "read packet: $vCont;C{0:x}:{1:x};C{0:x}:{2:x};c#00".format(
+                lldbutil.get_signal_number('SIGUSR1'),
+                threads[1], threads[2]),
+            {"direction": "send", "regex": r"^\$E1e#db$"},
+        ], True)
+
+        context = self.expect_gdbremote_sequence()
+        self.assertIsNotNone(context)
+
+    @skipUnlessPlatform(["netbsd"])
+    @debugserver_test
+    def test_signal_two_of_three_threads_debugserver(self):
+        self.init_debugserver_test()
+        self.build()
+        self.set_inferior_startup_launch()
+        self.signal_two_of_three_threads()
+
+    @skipUnlessPlatform(["netbsd"])
+    @llgs_test
+    def test_signal_two_of_three_threads_llgs(self):
+        self.init_llgs_test()
+        self.build()
+        self.set_inferior_startup_launch()
+        self.signal_two_of_three_threads()
+
+    def signal_two_signals(self):
+        threads = self.start_threads(1)
+        # try sending two different signals to two threads
+        self.test_sequence.add_log_lines([
+            "read packet: $vCont;C{0:x}:{1:x};C{2:x}:{3:x}#00".format(
+                lldbutil.get_signal_number('SIGUSR1'), threads[0],
+                lldbutil.get_signal_number('SIGUSR2'), threads[1]),
+            {"direction": "send", "regex": r"^\$E1e#db$"},
+        ], True)
+
+        context = self.expect_gdbremote_sequence()
+        self.assertIsNotNone(context)
+
+    @skipUnlessPlatform(["netbsd"])
+    @debugserver_test
+    def test_signal_two_signals_debugserver(self):
+        self.init_debugserver_test()
+        self.build()
+        self.set_inferior_startup_launch()
+        self.signal_two_signals()
+
+    @skipUnlessPlatform(["netbsd"])
+    @llgs_test
+    def test_signal_two_signals_llgs(self):
+        self.init_llgs_test()
+        self.build()
+        self.set_inferior_startup_launch()
+        self.signal_two_signals()
diff --git a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/tools/lldb-server/thread-name/main.cpp b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/tools/lldb-server/thread-name/main.cpp
index 0403031143ba..898e9a35e9ac 100644
--- a/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/tools/lldb-server/thread-name/main.cpp
+++ b/external/apache2/llvm/dist/lldb/packages/Python/lldbsuite/test/tools/lldb-server/thread-name/main.cpp
@@ -9,7 +9,7 @@ void set_thread_name(const char *name) {
 #elif defined(__linux__)
   ::pthread_setname_np(::pthread_self(), name);
 #elif defined(__NetBSD__)
-  ::pthread_setname_np(::pthread_self(), "%s", name);
+  ::pthread_setname_np(::pthread_self(), "%s", const_cast<char *>(name));
 #endif
 }
 
diff --git a/external/apache2/llvm/dist/lldb/source/Host/CMakeLists.txt b/external/apache2/llvm/dist/lldb/source/Host/CMakeLists.txt
index aa409bf24c9b..2ab54e3764ae 100644
--- a/external/apache2/llvm/dist/lldb/source/Host/CMakeLists.txt
+++ b/external/apache2/llvm/dist/lldb/source/Host/CMakeLists.txt
@@ -80,7 +80,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows")
 else()
   add_host_subdirectory(posix
     posix/DomainSocket.cpp
-    posix/FileSystem.cpp
+    posix/FileSystemPosix.cpp
     posix/HostInfoPosix.cpp
     posix/HostProcessPosix.cpp
     posix/HostThreadPosix.cpp
@@ -129,7 +129,7 @@ else()
 
   elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
     add_host_subdirectory(netbsd
-      netbsd/Host.cpp
+      netbsd/HostNetBSD.cpp
       netbsd/HostInfoNetBSD.cpp
       )
 
diff --git a/external/apache2/llvm/dist/lldb/source/Host/netbsd/Host.cpp b/external/apache2/llvm/dist/lldb/source/Host/netbsd/HostNetBSD.cpp
similarity index 87%
rename from external/apache2/llvm/dist/lldb/source/Host/netbsd/Host.cpp
rename to external/apache2/llvm/dist/lldb/source/Host/netbsd/HostNetBSD.cpp
index 20f3db3c22c1..552500fb99bf 100644
--- a/external/apache2/llvm/dist/lldb/source/Host/netbsd/Host.cpp
+++ b/external/apache2/llvm/dist/lldb/source/Host/netbsd/HostNetBSD.cpp
@@ -1,4 +1,4 @@
-//===-- source/Host/netbsd/Host.cpp -----------------------------*- C++ -*-===//
+//===-- source/Host/netbsd/HostNetBSD.cpp ---------------------------------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -15,11 +15,11 @@
 
 #include <limits.h>
 
-#include <elf.h>
 #include <kvm.h>
 #include <sys/exec.h>
 #include <sys/ptrace.h>
 
+#include "lldb/Host/FileSystem.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Utility/DataBufferHeap.h"
@@ -31,6 +31,7 @@
 #include "lldb/Utility/Status.h"
 #include "lldb/Utility/StreamString.h"
 
+#include "llvm/Object/ELF.h"
 #include "llvm/Support/Host.h"
 
 extern "C" {
@@ -100,10 +101,31 @@ static bool GetNetBSDProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr,
 }
 
 static bool GetNetBSDProcessCPUType(ProcessInstanceInfo &process_info) {
+  Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+
   if (process_info.ProcessIDIsValid()) {
-    process_info.GetArchitecture() =
-        HostInfo::GetArchitecture(HostInfo::eArchKindDefault);
-    return true;
+    auto buffer_sp = FileSystem::Instance().CreateDataBuffer(
+        process_info.GetExecutableFile(), 0x20, 0);
+    if (buffer_sp) {
+      uint8_t exe_class =
+          llvm::object::getElfArchType(
+              {buffer_sp->GetChars(), size_t(buffer_sp->GetByteSize())})
+              .first;
+
+      switch (exe_class) {
+      case llvm::ELF::ELFCLASS32:
+        process_info.GetArchitecture() =
+            HostInfo::GetArchitecture(HostInfo::eArchKind32);
+        return true;
+      case llvm::ELF::ELFCLASS64:
+        process_info.GetArchitecture() =
+            HostInfo::GetArchitecture(HostInfo::eArchKind64);
+        return true;
+      default:
+        LLDB_LOG(log, "Unknown elf class ({0}) in file {1}", exe_class,
+                 process_info.GetExecutableFile());
+      }
+    }
   }
   process_info.GetArchitecture().Clear();
   return false;
diff --git a/external/apache2/llvm/dist/lldb/source/Host/posix/FileSystem.cpp b/external/apache2/llvm/dist/lldb/source/Host/posix/FileSystemPosix.cpp
similarity index 100%
rename from external/apache2/llvm/dist/lldb/source/Host/posix/FileSystem.cpp
rename to external/apache2/llvm/dist/lldb/source/Host/posix/FileSystemPosix.cpp
diff --git a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
index 8b6f9fbc33c3..4313d27e11e9 100644
--- a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
+++ b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
@@ -8,8 +8,7 @@
 
 #include "NativeProcessNetBSD.h"
 
-
-
+#include "Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h"
 #include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
 #include "lldb/Host/HostProcess.h"
 #include "lldb/Host/common/NativeRegisterContext.h"
@@ -99,6 +98,17 @@ NativeProcessNetBSD::Factory::Launch(ProcessLaunchInfo &launch_info,
       pid, launch_info.GetPTY().ReleaseMasterFileDescriptor(), native_delegate,
       Info.GetArchitecture(), mainloop));
 
+  // Enable event reporting
+  ptrace_event_t events;
+  status = PtraceWrapper(PT_GET_EVENT_MASK, pid, &events, sizeof(events));
+  if (status.Fail())
+    return status.ToError();
+  // TODO: PTRACE_FORK | PTRACE_VFORK | PTRACE_POSIX_SPAWN?
+  events.pe_set_event |= PTRACE_LWP_CREATE | PTRACE_LWP_EXIT;
+  status = PtraceWrapper(PT_SET_EVENT_MASK, pid, &events, sizeof(events));
+  if (status.Fail())
+    return status.ToError();
+
   status = process_up->ReinitializeThreads();
   if (status.Fail())
     return status.ToError();
@@ -211,17 +221,32 @@ void NativeProcessNetBSD::MonitorSIGTRAP(lldb::pid_t pid) {
     return;
   }
 
+  NativeThreadNetBSD* thread = nullptr;
+  if (info.psi_lwpid > 0) {
+    for (const auto &t : m_threads) {
+      if (t->GetID() == static_cast<lldb::tid_t>(info.psi_lwpid)) {
+        thread = static_cast<NativeThreadNetBSD *>(t.get());
+        break;
+      }
+      static_cast<NativeThreadNetBSD *>(t.get())->SetStoppedWithNoReason();
+    }
+    if (!thread)
+      LLDB_LOG(log,
+               "thread not found in m_threads, pid = {0}, LWP = {1}", pid,
+               info.psi_lwpid);
+  }
+
   switch (info.psi_siginfo.si_code) {
   case TRAP_BRKPT:
-    for (const auto &thread : m_threads) {
-      static_cast<NativeThreadNetBSD &>(*thread).SetStoppedByBreakpoint();
-      FixupBreakpointPCAsNeeded(static_cast<NativeThreadNetBSD &>(*thread));
+    if (thread) {
+      thread->SetStoppedByBreakpoint();
+      FixupBreakpointPCAsNeeded(*thread);
     }
     SetState(StateType::eStateStopped, true);
     break;
   case TRAP_TRACE:
-    for (const auto &thread : m_threads)
-      static_cast<NativeThreadNetBSD &>(*thread).SetStoppedByTrace();
+    if (thread)
+      thread->SetStoppedByTrace();
     SetState(StateType::eStateStopped, true);
     break;
   case TRAP_EXEC: {
@@ -238,54 +263,66 @@ void NativeProcessNetBSD::MonitorSIGTRAP(lldb::pid_t pid) {
       static_cast<NativeThreadNetBSD &>(*thread).SetStoppedByExec();
     SetState(StateType::eStateStopped, true);
   } break;
-  case TRAP_DBREG: {
-    // Find the thread.
-    NativeThreadNetBSD* thread = nullptr;
-    for (const auto &t : m_threads) {
-      if (t->GetID() == info.psi_lwpid) {
-        thread = static_cast<NativeThreadNetBSD *>(t.get());
+  case TRAP_LWP: {
+    ptrace_state_t pst;
+    Status error = PtraceWrapper(PT_GET_PROCESS_STATE, pid, &pst, sizeof(pst));
+    if (error.Fail()) {
+      SetState(StateType::eStateInvalid);
+      return;
+    }
+
+    switch (pst.pe_report_event) {
+      case PTRACE_LWP_CREATE: {
+        LLDB_LOG(log,
+                 "monitoring new thread, pid = {0}, LWP = {1}", pid,
+                 pst.pe_lwp);
+        NativeThreadNetBSD& t = AddThread(pst.pe_lwp);
+        error = t.CopyWatchpointsFrom(
+            static_cast<NativeThreadNetBSD &>(*GetCurrentThread()));
+        if (error.Fail()) {
+          LLDB_LOG(log,
+                   "failed to copy watchpoints to new thread {0}: {1}",
+                   pst.pe_lwp, error);
+          SetState(StateType::eStateInvalid);
+          return;
+        }
+      } break;
+      case PTRACE_LWP_EXIT:
+        LLDB_LOG(log,
+                 "removing exited thread, pid = {0}, LWP = {1}", pid,
+                 pst.pe_lwp);
+        RemoveThread(pst.pe_lwp);
         break;
-      }
     }
-    if (!thread) {
-      LLDB_LOG(log,
-               "thread not found in m_threads, pid = {0}, LWP = {1}",
-               GetID(), info.psi_lwpid);
-      break;
+
+    error = PtraceWrapper(PT_CONTINUE, pid, reinterpret_cast<void*>(1), 0);
+    if (error.Fail()) {
+      SetState(StateType::eStateInvalid);
+      return;
     }
+  } break;
+  case TRAP_DBREG: {
+    if (!thread)
+      break;
 
-    // If a watchpoint was hit, report it
+    auto &regctx = static_cast<NativeRegisterContextNetBSD &>(
+        thread->GetRegisterContext());
     uint32_t wp_index = LLDB_INVALID_INDEX32;
-    Status error = thread->GetRegisterContext().GetWatchpointHitIndex(
-        wp_index, (uintptr_t)info.psi_siginfo.si_addr);
+    Status error = regctx.GetWatchpointHitIndex(wp_index,
+        (uintptr_t)info.psi_siginfo.si_addr);
     if (error.Fail())
       LLDB_LOG(log,
                "received error while checking for watchpoint hits, pid = "
-               "{0}, LWP = {1}, error = {2}",
-               GetID(), info.psi_lwpid, error);
+               "{0}, LWP = {1}, error = {2}", pid, info.psi_lwpid, error);
     if (wp_index != LLDB_INVALID_INDEX32) {
-      for (const auto &thread : m_threads)
-        static_cast<NativeThreadNetBSD &>(*thread).SetStoppedByWatchpoint(
-            wp_index);
+      thread->SetStoppedByWatchpoint(wp_index);
+      regctx.ClearWatchpointHit(wp_index);
       SetState(StateType::eStateStopped, true);
       break;
     }
 
-    // If a breakpoint was hit, report it
-    uint32_t bp_index = LLDB_INVALID_INDEX32;
-    error = thread->GetRegisterContext().GetHardwareBreakHitIndex(
-        bp_index, (uintptr_t)info.psi_siginfo.si_addr);
-    if (error.Fail())
-      LLDB_LOG(log,
-               "received error while checking for hardware "
-               "breakpoint hits, pid = {0}, LWP = {1}, error = {2}",
-               GetID(), info.psi_lwpid, error);
-    if (bp_index != LLDB_INVALID_INDEX32) {
-      for (const auto &thread : m_threads)
-        static_cast<NativeThreadNetBSD &>(*thread).SetStoppedByBreakpoint();
-      SetState(StateType::eStateStopped, true);
-      break;
-    }
+    thread->SetStoppedByTrace();
+    SetState(StateType::eStateStopped, true);
   } break;
   }
 }
@@ -295,9 +332,14 @@ void NativeProcessNetBSD::MonitorSignal(lldb::pid_t pid, int signal) {
   const auto siginfo_err =
       PtraceWrapper(PT_GET_SIGINFO, pid, &info, sizeof(info));
 
-  for (const auto &thread : m_threads) {
-    static_cast<NativeThreadNetBSD &>(*thread).SetStoppedBySignal(
-        info.psi_siginfo.si_signo, &info.psi_siginfo);
+  for (const auto &abs_thread : m_threads) {
+    NativeThreadNetBSD &thread = static_cast<NativeThreadNetBSD &>(*abs_thread);
+    assert(info.psi_lwpid >= 0);
+    if (info.psi_lwpid == 0 ||
+        static_cast<lldb::tid_t>(info.psi_lwpid) == thread.GetID())
+      thread.SetStoppedBySignal(info.psi_siginfo.si_signo, &info.psi_siginfo);
+    else
+      thread.SetStoppedWithNoReason();
   }
   SetState(StateType::eStateStopped, true);
 }
@@ -325,68 +367,137 @@ Status NativeProcessNetBSD::PtraceWrapper(int req, lldb::pid_t pid, void *addr,
   return error;
 }
 
+static llvm::Expected<ptrace_siginfo_t> ComputeSignalInfo(
+    const std::vector<std::unique_ptr<NativeThreadProtocol>> &threads,
+    const ResumeActionList &resume_actions) {
+  // We need to account for three possible scenarios:
+  // 1. no signal being sent.
+  // 2. a signal being sent to one thread.
+  // 3. a signal being sent to the whole process.
+
+  // Count signaled threads.  While at it, determine which signal is being sent
+  // and ensure there's only one.
+  size_t signaled_threads = 0;
+  int signal = LLDB_INVALID_SIGNAL_NUMBER;
+  lldb::tid_t signaled_lwp;
+  for (const auto &thread : threads) {
+    assert(thread && "thread list should not contain NULL threads");
+    const ResumeAction *action =
+        resume_actions.GetActionForThread(thread->GetID(), true);
+    if (action) {
+      if (action->signal != LLDB_INVALID_SIGNAL_NUMBER) {
+        signaled_threads++;
+        if (action->signal != signal) {
+          if (signal != LLDB_INVALID_SIGNAL_NUMBER)
+            return Status("NetBSD does not support passing multiple signals "
+                          "simultaneously")
+                .ToError();
+          signal = action->signal;
+          signaled_lwp = thread->GetID();
+        }
+      }
+    }
+  }
+
+  if (signaled_threads == 0) {
+    ptrace_siginfo_t siginfo;
+    siginfo.psi_siginfo.si_signo = LLDB_INVALID_SIGNAL_NUMBER;
+    return siginfo;
+  }
+
+  if (signaled_threads > 1 && signaled_threads < threads.size())
+    return Status("NetBSD does not support passing signal to 1<i<all threads")
+        .ToError();
+
+  ptrace_siginfo_t siginfo;
+  siginfo.psi_siginfo.si_signo = signal;
+  siginfo.psi_siginfo.si_code = SI_USER;
+  siginfo.psi_siginfo.si_pid = getpid();
+  siginfo.psi_siginfo.si_uid = getuid();
+  if (signaled_threads == 1)
+    siginfo.psi_lwpid = signaled_lwp;
+  else // signal for the whole process
+    siginfo.psi_lwpid = 0;
+  return siginfo;
+}
+
 Status NativeProcessNetBSD::Resume(const ResumeActionList &resume_actions) {
   Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS));
   LLDB_LOG(log, "pid {0}", GetID());
 
-  const auto &thread = m_threads[0];
-  const ResumeAction *const action =
-      resume_actions.GetActionForThread(thread->GetID(), true);
+  Status ret;
 
-  if (action == nullptr) {
-    LLDB_LOG(log, "no action specified for pid {0} tid {1}", GetID(),
-             thread->GetID());
-    return Status();
-  }
+  Expected<ptrace_siginfo_t> siginfo =
+      ComputeSignalInfo(m_threads, resume_actions);
+  if (!siginfo)
+    return Status(siginfo.takeError());
 
-  Status error;
-  int signal =
-      action->signal != LLDB_INVALID_SIGNAL_NUMBER ? action->signal : 0;
-
-  switch (action->state) {
-  case eStateRunning: {
-    // Run the thread, possibly feeding it the signal.
-    error = NativeProcessNetBSD::PtraceWrapper(PT_CONTINUE, GetID(), (void *)1,
-                                               signal);
-    if (!error.Success())
-      return error;
-    for (const auto &thread : m_threads)
-      static_cast<NativeThreadNetBSD &>(*thread).SetRunning();
-    SetState(eStateRunning, true);
-    break;
-  }
-  case eStateStepping:
-    // Run the thread, possibly feeding it the signal.
-    error = NativeProcessNetBSD::PtraceWrapper(PT_STEP, GetID(), (void *)1,
-                                               signal);
-    if (!error.Success())
-      return error;
-    for (const auto &thread : m_threads)
-      static_cast<NativeThreadNetBSD &>(*thread).SetStepping();
-    SetState(eStateStepping, true);
-    break;
+  for (const auto &abs_thread : m_threads) {
+    assert(abs_thread && "thread list should not contain NULL threads");
+    NativeThreadNetBSD &thread = static_cast<NativeThreadNetBSD &>(*abs_thread);
 
-  case eStateSuspended:
-  case eStateStopped:
-    llvm_unreachable("Unexpected state");
+    const ResumeAction *action =
+        resume_actions.GetActionForThread(thread.GetID(), true);
+    // we need to explicit issue suspend requests, so it is simpler to map it
+    // into proper action
+    ResumeAction suspend_action{thread.GetID(), eStateSuspended,
+                                LLDB_INVALID_SIGNAL_NUMBER};
 
-  default:
-    return Status("NativeProcessNetBSD::%s (): unexpected state %s specified "
-                  "for pid %" PRIu64 ", tid %" PRIu64,
-                  __FUNCTION__, StateAsCString(action->state), GetID(),
-                  thread->GetID());
+    if (action == nullptr) {
+      LLDB_LOG(log, "no action specified for pid {0} tid {1}", GetID(),
+               thread.GetID());
+      action = &suspend_action;
+    }
+
+    LLDB_LOG(
+        log,
+        "processing resume action state {0} signal {1} for pid {2} tid {3}",
+        action->state, action->signal, GetID(), thread.GetID());
+
+    switch (action->state) {
+    case eStateRunning:
+      ret = thread.Resume();
+      break;
+    case eStateStepping:
+      ret = thread.SingleStep();
+      break;
+    case eStateSuspended:
+    case eStateStopped:
+      if (action->signal != LLDB_INVALID_SIGNAL_NUMBER)
+        return Status("Passing signal to suspended thread unsupported");
+
+      ret = thread.Suspend();
+      break;
+
+    default:
+      return Status("NativeProcessNetBSD::%s (): unexpected state %s specified "
+                    "for pid %" PRIu64 ", tid %" PRIu64,
+                    __FUNCTION__, StateAsCString(action->state), GetID(),
+                    thread.GetID());
+    }
+
+    if (!ret.Success())
+      return ret;
   }
 
-  return Status();
+  int signal = 0;
+  if (siginfo->psi_siginfo.si_signo != LLDB_INVALID_SIGNAL_NUMBER) {
+    ret = PtraceWrapper(PT_SET_SIGINFO, GetID(), &siginfo.get(),
+                        sizeof(*siginfo));
+    if (!ret.Success())
+      return ret;
+    signal = siginfo->psi_siginfo.si_signo;
+  }
+
+  ret = PtraceWrapper(PT_CONTINUE, GetID(), reinterpret_cast<void *>(1),
+                      signal);
+  if (ret.Success())
+    SetState(eStateRunning, true);
+  return ret;
 }
 
 Status NativeProcessNetBSD::Halt() {
-  Status error;
-
-  if (kill(GetID(), SIGSTOP) != 0)
-    error.SetErrorToErrno();
-
-  return error;
+  return PtraceWrapper(PT_STOP, GetID());
 }
 
 Status NativeProcessNetBSD::Detach() {
@@ -411,6 +522,10 @@ Status NativeProcessNetBSD::Signal(int signo) {
   return error;
 }
 
+Status NativeProcessNetBSD::Interrupt() {
+  return PtraceWrapper(PT_STOP, GetID());
+}
+
 Status NativeProcessNetBSD::Kill() {
   Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS));
   LLDB_LOG(log, "pid {0}", GetID());
@@ -650,10 +765,10 @@ bool NativeProcessNetBSD::HasThreadNoLock(lldb::tid_t thread_id) {
 }
 
 NativeThreadNetBSD &NativeProcessNetBSD::AddThread(lldb::tid_t thread_id) {
-
   Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_THREAD));
   LLDB_LOG(log, "pid {0} adding thread with tid {1}", GetID(), thread_id);
 
+  assert(thread_id > 0);
   assert(!HasThreadNoLock(thread_id) &&
          "attempted to add a thread by id that already exists");
 
@@ -665,6 +780,22 @@ NativeThreadNetBSD &NativeProcessNetBSD::AddThread(lldb::tid_t thread_id) {
   return static_cast<NativeThreadNetBSD &>(*m_threads.back());
 }
 
+void NativeProcessNetBSD::RemoveThread(lldb::tid_t thread_id) {
+  Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_THREAD));
+  LLDB_LOG(log, "pid {0} removing thread with tid {1}", GetID(), thread_id);
+
+  assert(thread_id > 0);
+  assert(HasThreadNoLock(thread_id) &&
+         "attempted to remove a thread that does not exist");
+
+  for (auto it = m_threads.begin(); it != m_threads.end(); ++it) {
+    if ((*it)->GetID() == thread_id) {
+      m_threads.erase(it);
+      break;
+    }
+  }
+}
+
 Status NativeProcessNetBSD::Attach() {
   // Attach to the requested process.
   // An attach will cause the thread to stop with a SIGSTOP.
@@ -783,15 +914,23 @@ Status NativeProcessNetBSD::ReinitializeThreads() {
   m_threads.clear();
 
   // Initialize new thread
+#ifdef PT_LWPSTATUS
+  struct ptrace_lwpstatus info = {};
+  int op = PT_LWPNEXT;
+#else
   struct ptrace_lwpinfo info = {};
-  Status error = PtraceWrapper(PT_LWPINFO, GetID(), &info, sizeof(info));
+  int op = PT_LWPINFO;
+#endif
+
+  Status error = PtraceWrapper(op, GetID(), &info, sizeof(info));
+
   if (error.Fail()) {
     return error;
   }
   // Reinitialize from scratch threads and register them in process
   while (info.pl_lwpid != 0) {
     AddThread(info.pl_lwpid);
-    error = PtraceWrapper(PT_LWPINFO, GetID(), &info, sizeof(info));
+    error = PtraceWrapper(op, GetID(), &info, sizeof(info));
     if (error.Fail()) {
       return error;
     }
diff --git a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
index 4e7f0a1c13ab..6a06773f40a8 100644
--- a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
+++ b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
@@ -47,6 +47,8 @@ public:
 
   Status Signal(int signo) override;
 
+  Status Interrupt() override;
+
   Status Kill() override;
 
   Status GetMemoryRegionInfo(lldb::addr_t load_addr,
@@ -98,6 +100,7 @@ private:
   bool HasThreadNoLock(lldb::tid_t thread_id);
 
   NativeThreadNetBSD &AddThread(lldb::tid_t thread_id);
+  void RemoveThread(lldb::tid_t thread_id);
 
   void MonitorCallback(lldb::pid_t pid, int signal);
   void MonitorExited(lldb::pid_t pid, WaitStatus status);
diff --git a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.cpp b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.cpp
index 3a9caaad74c8..a8afa0b20305 100644
--- a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.cpp
+++ b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.cpp
@@ -8,6 +8,8 @@
 
 #include "NativeRegisterContextNetBSD.h"
 
+#include "Plugins/Process/NetBSD/NativeProcessNetBSD.h"
+
 #include "lldb/Host/common/NativeProcessProtocol.h"
 
 using namespace lldb_private;
diff --git a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h
index f5dd0c33b677..13e023d856d2 100644
--- a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h
+++ b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h
@@ -11,12 +11,13 @@
 
 #include "lldb/Host/common/NativeThreadProtocol.h"
 
-#include "Plugins/Process/NetBSD/NativeProcessNetBSD.h"
 #include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h"
 
 namespace lldb_private {
 namespace process_netbsd {
 
+class NativeProcessNetBSD;
+
 class NativeRegisterContextNetBSD : public NativeRegisterContextRegisterInfo {
 public:
   NativeRegisterContextNetBSD(NativeThreadProtocol &native_thread,
@@ -30,6 +31,10 @@ public:
   static NativeRegisterContextNetBSD *
   CreateHostNativeRegisterContextNetBSD(const ArchSpec &target_arch,
                                         NativeThreadProtocol &native_thread);
+  virtual Status
+  CopyHardwareWatchpointsFrom(NativeRegisterContextNetBSD &source) = 0;
+
+  virtual Status ClearWatchpointHit(uint32_t wp_index) = 0;
 
 protected:
   Status DoRegisterSet(int req, void *buf);
diff --git a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
index 6cc2810fa235..2ebb69020dce 100644
--- a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
+++ b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#if defined(__x86_64__)
+#if defined(__i386__) || defined(__x86_64__)
 
 #include "NativeRegisterContextNetBSD_x86_64.h"
 
@@ -16,6 +16,7 @@
 #include "lldb/Utility/RegisterValue.h"
 #include "lldb/Utility/Status.h"
 
+#include "Plugins/Process/Utility/RegisterContextNetBSD_i386.h"
 #include "Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h"
 
 // clang-format off
@@ -84,13 +85,146 @@ static_assert((sizeof(g_gpr_regnums_x86_64) / sizeof(g_gpr_regnums_x86_64[0])) -
                   k_num_gpr_registers_x86_64,
               "g_gpr_regnums_x86_64 has wrong number of register infos");
 
+// x86 64-bit floating point registers.
+static const uint32_t g_fpu_regnums_x86_64[] = {
+    lldb_fctrl_x86_64,     lldb_fstat_x86_64, lldb_ftag_x86_64,
+    lldb_fop_x86_64,       lldb_fiseg_x86_64, lldb_fioff_x86_64,
+    lldb_foseg_x86_64,     lldb_fooff_x86_64, lldb_mxcsr_x86_64,
+    lldb_mxcsrmask_x86_64, lldb_st0_x86_64,   lldb_st1_x86_64,
+    lldb_st2_x86_64,       lldb_st3_x86_64,   lldb_st4_x86_64,
+    lldb_st5_x86_64,       lldb_st6_x86_64,   lldb_st7_x86_64,
+    lldb_mm0_x86_64,       lldb_mm1_x86_64,   lldb_mm2_x86_64,
+    lldb_mm3_x86_64,       lldb_mm4_x86_64,   lldb_mm5_x86_64,
+    lldb_mm6_x86_64,       lldb_mm7_x86_64,   lldb_xmm0_x86_64,
+    lldb_xmm1_x86_64,      lldb_xmm2_x86_64,  lldb_xmm3_x86_64,
+    lldb_xmm4_x86_64,      lldb_xmm5_x86_64,  lldb_xmm6_x86_64,
+    lldb_xmm7_x86_64,      lldb_xmm8_x86_64,  lldb_xmm9_x86_64,
+    lldb_xmm10_x86_64,     lldb_xmm11_x86_64, lldb_xmm12_x86_64,
+    lldb_xmm13_x86_64,     lldb_xmm14_x86_64, lldb_xmm15_x86_64,
+    LLDB_INVALID_REGNUM // register sets need to end with this flag
+};
+static_assert((sizeof(g_fpu_regnums_x86_64) / sizeof(g_fpu_regnums_x86_64[0])) -
+                      1 ==
+                  k_num_fpr_registers_x86_64,
+              "g_fpu_regnums_x86_64 has wrong number of register infos");
+
+// x86 64-bit registers available via XState.
+static const uint32_t g_xstate_regnums_x86_64[] = {
+    lldb_ymm0_x86_64,   lldb_ymm1_x86_64,  lldb_ymm2_x86_64,  lldb_ymm3_x86_64,
+    lldb_ymm4_x86_64,   lldb_ymm5_x86_64,  lldb_ymm6_x86_64,  lldb_ymm7_x86_64,
+    lldb_ymm8_x86_64,   lldb_ymm9_x86_64,  lldb_ymm10_x86_64, lldb_ymm11_x86_64,
+    lldb_ymm12_x86_64,  lldb_ymm13_x86_64, lldb_ymm14_x86_64, lldb_ymm15_x86_64,
+    // Note: we currently do not provide them but this is needed to avoid
+    // unnamed groups in SBFrame::GetRegisterContext().
+    lldb_bnd0_x86_64,    lldb_bnd1_x86_64,    lldb_bnd2_x86_64,
+    lldb_bnd3_x86_64,    lldb_bndcfgu_x86_64, lldb_bndstatus_x86_64,
+    LLDB_INVALID_REGNUM // register sets need to end with this flag
+};
+static_assert((sizeof(g_xstate_regnums_x86_64) / sizeof(g_xstate_regnums_x86_64[0])) -
+                      1 ==
+                  k_num_avx_registers_x86_64 + k_num_mpx_registers_x86_64,
+              "g_xstate_regnums_x86_64 has wrong number of register infos");
+
+// x86 debug registers.
+static const uint32_t g_dbr_regnums_x86_64[] = {
+    lldb_dr0_x86_64,   lldb_dr1_x86_64,  lldb_dr2_x86_64,  lldb_dr3_x86_64,
+    lldb_dr4_x86_64,   lldb_dr5_x86_64,  lldb_dr6_x86_64,  lldb_dr7_x86_64,
+    LLDB_INVALID_REGNUM // register sets need to end with this flag
+};
+static_assert((sizeof(g_dbr_regnums_x86_64) / sizeof(g_dbr_regnums_x86_64[0])) -
+                      1 ==
+                  k_num_dbr_registers_x86_64,
+              "g_dbr_regnums_x86_64 has wrong number of register infos");
+
+// x86 32-bit general purpose registers.
+const uint32_t g_gpr_regnums_i386[] = {
+    lldb_eax_i386,      lldb_ebx_i386,    lldb_ecx_i386, lldb_edx_i386,
+    lldb_edi_i386,      lldb_esi_i386,    lldb_ebp_i386, lldb_esp_i386,
+    lldb_eip_i386,      lldb_eflags_i386, lldb_cs_i386,  lldb_fs_i386,
+    lldb_gs_i386,       lldb_ss_i386,     lldb_ds_i386,  lldb_es_i386,
+    lldb_ax_i386,       lldb_bx_i386,     lldb_cx_i386,  lldb_dx_i386,
+    lldb_di_i386,       lldb_si_i386,     lldb_bp_i386,  lldb_sp_i386,
+    lldb_ah_i386,       lldb_bh_i386,     lldb_ch_i386,  lldb_dh_i386,
+    lldb_al_i386,       lldb_bl_i386,     lldb_cl_i386,  lldb_dl_i386,
+    LLDB_INVALID_REGNUM // register sets need to end with this flag
+};
+static_assert((sizeof(g_gpr_regnums_i386) / sizeof(g_gpr_regnums_i386[0])) -
+                      1 ==
+                  k_num_gpr_registers_i386,
+              "g_gpr_regnums_i386 has wrong number of register infos");
+
+// x86 32-bit floating point registers.
+const uint32_t g_fpu_regnums_i386[] = {
+    lldb_fctrl_i386,    lldb_fstat_i386,     lldb_ftag_i386,  lldb_fop_i386,
+    lldb_fiseg_i386,    lldb_fioff_i386,     lldb_foseg_i386, lldb_fooff_i386,
+    lldb_mxcsr_i386,    lldb_mxcsrmask_i386, lldb_st0_i386,   lldb_st1_i386,
+    lldb_st2_i386,      lldb_st3_i386,       lldb_st4_i386,   lldb_st5_i386,
+    lldb_st6_i386,      lldb_st7_i386,       lldb_mm0_i386,   lldb_mm1_i386,
+    lldb_mm2_i386,      lldb_mm3_i386,       lldb_mm4_i386,   lldb_mm5_i386,
+    lldb_mm6_i386,      lldb_mm7_i386,       lldb_xmm0_i386,  lldb_xmm1_i386,
+    lldb_xmm2_i386,     lldb_xmm3_i386,      lldb_xmm4_i386,  lldb_xmm5_i386,
+    lldb_xmm6_i386,     lldb_xmm7_i386,
+    LLDB_INVALID_REGNUM // register sets need to end with this flag
+};
+static_assert((sizeof(g_fpu_regnums_i386) / sizeof(g_fpu_regnums_i386[0])) -
+                      1 ==
+                  k_num_fpr_registers_i386,
+              "g_fpu_regnums_i386 has wrong number of register infos");
+
+// x86 64-bit registers available via XState.
+static const uint32_t g_xstate_regnums_i386[] = {
+    lldb_ymm0_i386,     lldb_ymm1_i386,  lldb_ymm2_i386,  lldb_ymm3_i386,
+    lldb_ymm4_i386,     lldb_ymm5_i386,  lldb_ymm6_i386,  lldb_ymm7_i386,
+    // Note: we currently do not provide them but this is needed to avoid
+    // unnamed groups in SBFrame::GetRegisterContext().
+    lldb_bnd0_i386,      lldb_bnd1_i386,    lldb_bnd2_i386,
+    lldb_bnd3_i386,      lldb_bndcfgu_i386, lldb_bndstatus_i386,
+    LLDB_INVALID_REGNUM // register sets need to end with this flag
+};
+static_assert((sizeof(g_xstate_regnums_i386) / sizeof(g_xstate_regnums_i386[0])) -
+                      1 ==
+                  k_num_avx_registers_i386 + k_num_mpx_registers_i386,
+              "g_xstate_regnums_i386 has wrong number of register infos");
+
+// x86 debug registers.
+static const uint32_t g_dbr_regnums_i386[] = {
+    lldb_dr0_i386,   lldb_dr1_i386,  lldb_dr2_i386,  lldb_dr3_i386,
+    lldb_dr4_i386,   lldb_dr5_i386,  lldb_dr6_i386,  lldb_dr7_i386,
+    LLDB_INVALID_REGNUM // register sets need to end with this flag
+};
+static_assert((sizeof(g_dbr_regnums_i386) / sizeof(g_dbr_regnums_i386[0])) -
+                      1 ==
+                  k_num_dbr_registers_i386,
+              "g_dbr_regnums_i386 has wrong number of register infos");
+
+
 // Number of register sets provided by this context.
-enum { k_num_extended_register_sets = 2, k_num_register_sets = 4 };
+enum { k_num_register_sets = 4 };
+
+// Register sets for x86 32-bit.
+static const RegisterSet g_reg_sets_i386[k_num_register_sets] = {
+    {"General Purpose Registers", "gpr", k_num_gpr_registers_i386,
+     g_gpr_regnums_i386},
+    {"Floating Point Registers", "fpu", k_num_fpr_registers_i386,
+     g_fpu_regnums_i386},
+    {"Extended State Registers", "xstate",
+     k_num_avx_registers_i386 + k_num_mpx_registers_i386,
+     g_xstate_regnums_i386},
+    {"Debug Registers", "dbr", k_num_dbr_registers_i386,
+     g_dbr_regnums_i386},
+};
 
 // Register sets for x86 64-bit.
 static const RegisterSet g_reg_sets_x86_64[k_num_register_sets] = {
     {"General Purpose Registers", "gpr", k_num_gpr_registers_x86_64,
      g_gpr_regnums_x86_64},
+    {"Floating Point Registers", "fpu", k_num_fpr_registers_x86_64,
+     g_fpu_regnums_x86_64},
+    {"Extended State Registers", "xstate",
+     k_num_avx_registers_x86_64 + k_num_mpx_registers_x86_64,
+     g_xstate_regnums_x86_64},
+    {"Debug Registers", "dbr", k_num_dbr_registers_x86_64,
+     g_dbr_regnums_x86_64},
 };
 
 #define REG_CONTEXT_SIZE (GetRegisterInfoInterface().GetGPRSize())
@@ -106,18 +240,23 @@ NativeRegisterContextNetBSD::CreateHostNativeRegisterContextNetBSD(
 
 static RegisterInfoInterface *
 CreateRegisterInfoInterface(const ArchSpec &target_arch) {
-  assert((HostInfo::GetArchitecture().GetAddressByteSize() == 8) &&
-         "Register setting path assumes this is a 64-bit host");
-  // X86_64 hosts know how to work with 64-bit and 32-bit EXEs using the x86_64
-  // register context.
-  return new RegisterContextNetBSD_x86_64(target_arch);
+  if (HostInfo::GetArchitecture().GetAddressByteSize() == 4) {
+    // 32-bit hosts run with a RegisterContextNetBSD_i386 context.
+    return new RegisterContextNetBSD_i386(target_arch);
+  } else {
+    assert((HostInfo::GetArchitecture().GetAddressByteSize() == 8) &&
+           "Register setting path assumes this is a 64-bit host");
+    // X86_64 hosts know how to work with 64-bit and 32-bit EXEs using the x86_64
+    // register context.
+    return new RegisterContextNetBSD_x86_64(target_arch);
+  }
 }
 
 NativeRegisterContextNetBSD_x86_64::NativeRegisterContextNetBSD_x86_64(
     const ArchSpec &target_arch, NativeThreadProtocol &native_thread)
     : NativeRegisterContextNetBSD(native_thread,
                                   CreateRegisterInfoInterface(target_arch)),
-      m_gpr_x86_64(), m_fpr_x86_64(), m_dbr_x86_64() {}
+      m_gpr(), m_fpr(), m_dbr() {}
 
 // CONSIDER after local and llgs debugging are merged, register set support can
 // be moved into a base x86-64 class with IsRegisterSetAvailable made virtual.
@@ -134,6 +273,8 @@ uint32_t NativeRegisterContextNetBSD_x86_64::GetRegisterSetCount() const {
 const RegisterSet *
 NativeRegisterContextNetBSD_x86_64::GetRegisterSet(uint32_t set_index) const {
   switch (GetRegisterInfoInterface().GetTargetArchitecture().GetMachine()) {
+  case llvm::Triple::x86:
+    return &g_reg_sets_i386[set_index];
   case llvm::Triple::x86_64:
     return &g_reg_sets_x86_64[set_index];
   default:
@@ -144,36 +285,162 @@ NativeRegisterContextNetBSD_x86_64::GetRegisterSet(uint32_t set_index) const {
   return nullptr;
 }
 
+static constexpr int RegNumX86ToX86_64(int regnum) {
+  switch (regnum) {
+  case lldb_eax_i386:
+    return lldb_rax_x86_64;
+  case lldb_ebx_i386:
+    return lldb_rbx_x86_64;
+  case lldb_ecx_i386:
+    return lldb_rcx_x86_64;
+  case lldb_edx_i386:
+    return lldb_rdx_x86_64;
+  case lldb_edi_i386:
+    return lldb_rdi_x86_64;
+  case lldb_esi_i386:
+    return lldb_rsi_x86_64;
+  case lldb_ebp_i386:
+    return lldb_rbp_x86_64;
+  case lldb_esp_i386:
+    return lldb_rsp_x86_64;
+  case lldb_eip_i386:
+    return lldb_rip_x86_64;
+  case lldb_eflags_i386:
+    return lldb_rflags_x86_64;
+  case lldb_cs_i386:
+    return lldb_cs_x86_64;
+  case lldb_fs_i386:
+    return lldb_fs_x86_64;
+  case lldb_gs_i386:
+    return lldb_gs_x86_64;
+  case lldb_ss_i386:
+    return lldb_ss_x86_64;
+  case lldb_ds_i386:
+    return lldb_ds_x86_64;
+  case lldb_es_i386:
+    return lldb_es_x86_64;
+  case lldb_fctrl_i386:
+    return lldb_fctrl_x86_64;
+  case lldb_fstat_i386:
+    return lldb_fstat_x86_64;
+  case lldb_ftag_i386:
+    return lldb_fstat_x86_64;
+  case lldb_fop_i386:
+    return lldb_fop_x86_64;
+  case lldb_fiseg_i386:
+    return lldb_fiseg_x86_64;
+  case lldb_fioff_i386:
+    return lldb_fioff_x86_64;
+  case lldb_foseg_i386:
+    return lldb_foseg_x86_64;
+  case lldb_fooff_i386:
+    return lldb_fooff_x86_64;
+  case lldb_mxcsr_i386:
+    return lldb_mxcsr_x86_64;
+  case lldb_mxcsrmask_i386:
+    return lldb_mxcsrmask_x86_64;
+  case lldb_st0_i386:
+  case lldb_st1_i386:
+  case lldb_st2_i386:
+  case lldb_st3_i386:
+  case lldb_st4_i386:
+  case lldb_st5_i386:
+  case lldb_st6_i386:
+  case lldb_st7_i386:
+    return lldb_st0_x86_64 + regnum - lldb_st0_i386;
+  case lldb_mm0_i386:
+  case lldb_mm1_i386:
+  case lldb_mm2_i386:
+  case lldb_mm3_i386:
+  case lldb_mm4_i386:
+  case lldb_mm5_i386:
+  case lldb_mm6_i386:
+  case lldb_mm7_i386:
+    return lldb_mm0_x86_64 + regnum - lldb_mm0_i386;
+  case lldb_xmm0_i386:
+  case lldb_xmm1_i386:
+  case lldb_xmm2_i386:
+  case lldb_xmm3_i386:
+  case lldb_xmm4_i386:
+  case lldb_xmm5_i386:
+  case lldb_xmm6_i386:
+  case lldb_xmm7_i386:
+    return lldb_xmm0_x86_64 + regnum - lldb_xmm0_i386;
+  case lldb_ymm0_i386:
+  case lldb_ymm1_i386:
+  case lldb_ymm2_i386:
+  case lldb_ymm3_i386:
+  case lldb_ymm4_i386:
+  case lldb_ymm5_i386:
+  case lldb_ymm6_i386:
+  case lldb_ymm7_i386:
+    return lldb_ymm0_x86_64 + regnum - lldb_ymm0_i386;
+  case lldb_dr0_i386:
+  case lldb_dr1_i386:
+  case lldb_dr2_i386:
+  case lldb_dr3_i386:
+  case lldb_dr4_i386:
+  case lldb_dr5_i386:
+  case lldb_dr6_i386:
+  case lldb_dr7_i386:
+    return lldb_dr0_x86_64 + regnum - lldb_dr0_i386;
+  default:
+    assert(false && "Unhandled i386 register.");
+    return 0;
+  }
+}
+
 int NativeRegisterContextNetBSD_x86_64::GetSetForNativeRegNum(
     int reg_num) const {
-  if (reg_num <= k_last_gpr_x86_64)
-    return GPRegSet;
-  else if (reg_num <= k_last_fpr_x86_64)
-    return FPRegSet;
-  else if (reg_num <= k_last_avx_x86_64)
-    return XStateRegSet; // AVX
-  else if (reg_num <= k_last_mpxr_x86_64)
-    return -1; // MPXR
-  else if (reg_num <= k_last_mpxc_x86_64)
-    return -1; // MPXC
-  else if (reg_num <= lldb_dr7_x86_64)
-    return DBRegSet; // DBR
-  else
+  switch (GetRegisterInfoInterface().GetTargetArchitecture().GetMachine()) {
+  case llvm::Triple::x86:
+    if (reg_num <= k_last_gpr_i386)
+      return GPRegSet;
+    else if (reg_num <= k_last_fpr_i386)
+      return FPRegSet;
+    else if (reg_num <= k_last_avx_i386)
+      return XStateRegSet; // AVX
+    else if (reg_num <= lldb_dr7_i386)
+      return DBRegSet; // DBR
+    else
+      return -1;
+  case llvm::Triple::x86_64:
+    if (reg_num <= k_last_gpr_x86_64)
+      return GPRegSet;
+    else if (reg_num <= k_last_fpr_x86_64)
+      return FPRegSet;
+    else if (reg_num <= k_last_avx_x86_64)
+      return XStateRegSet; // AVX
+    else if (reg_num <= k_last_mpxr_x86_64)
+      return -1; // MPXR
+    else if (reg_num <= k_last_mpxc_x86_64)
+      return -1; // MPXC
+    else if (reg_num <= lldb_dr7_x86_64)
+      return DBRegSet; // DBR
+    else
+      return -1;
+  default:
+    assert(false && "Unhandled target architecture.");
     return -1;
+  }
 }
 
 Status NativeRegisterContextNetBSD_x86_64::ReadRegisterSet(uint32_t set) {
   switch (set) {
   case GPRegSet:
-    return DoRegisterSet(PT_GETREGS, &m_gpr_x86_64);
+    return DoRegisterSet(PT_GETREGS, &m_gpr);
   case FPRegSet:
-    return DoRegisterSet(PT_GETFPREGS, &m_fpr_x86_64);
+#if defined(__x86_64__)
+    return DoRegisterSet(PT_GETFPREGS, &m_fpr);
+#else
+    return DoRegisterSet(PT_GETXMMREGS, &m_fpr);
+#endif
   case DBRegSet:
-    return DoRegisterSet(PT_GETDBREGS, &m_dbr_x86_64);
+    return DoRegisterSet(PT_GETDBREGS, &m_dbr);
   case XStateRegSet:
 #ifdef HAVE_XSTATE
     {
-      struct iovec iov = {&m_xstate_x86_64, sizeof(m_xstate_x86_64)};
+      struct iovec iov = {&m_xstate, sizeof(m_xstate)};
       return DoRegisterSet(PT_GETXSTATE, &iov);
     }
 #else
@@ -186,15 +453,19 @@ Status NativeRegisterContextNetBSD_x86_64::ReadRegisterSet(uint32_t set) {
 Status NativeRegisterContextNetBSD_x86_64::WriteRegisterSet(uint32_t set) {
   switch (set) {
   case GPRegSet:
-    return DoRegisterSet(PT_SETREGS, &m_gpr_x86_64);
+    return DoRegisterSet(PT_SETREGS, &m_gpr);
   case FPRegSet:
-    return DoRegisterSet(PT_SETFPREGS, &m_fpr_x86_64);
+#if defined(__x86_64__)
+    return DoRegisterSet(PT_SETFPREGS, &m_fpr);
+#else
+    return DoRegisterSet(PT_SETXMMREGS, &m_fpr);
+#endif
   case DBRegSet:
-    return DoRegisterSet(PT_SETDBREGS, &m_dbr_x86_64);
+    return DoRegisterSet(PT_SETDBREGS, &m_dbr);
   case XStateRegSet:
 #ifdef HAVE_XSTATE
     {
-      struct iovec iov = {&m_xstate_x86_64, sizeof(m_xstate_x86_64)};
+      struct iovec iov = {&m_xstate, sizeof(m_xstate)};
       return DoRegisterSet(PT_SETXSTATE, &iov);
     }
 #else
@@ -214,7 +485,7 @@ NativeRegisterContextNetBSD_x86_64::ReadRegister(const RegisterInfo *reg_info,
     return error;
   }
 
-  const uint32_t reg = reg_info->kinds[lldb::eRegisterKindLLDB];
+  uint32_t reg = reg_info->kinds[lldb::eRegisterKindLLDB];
   if (reg == LLDB_INVALID_REGNUM) {
     // This is likely an internal register for lldb use only and should not be
     // directly queried.
@@ -233,112 +504,175 @@ NativeRegisterContextNetBSD_x86_64::ReadRegister(const RegisterInfo *reg_info,
     return error;
   }
 
+  switch (GetRegisterInfoInterface().GetTargetArchitecture().GetMachine()) {
+  case llvm::Triple::x86_64:
+    break;
+  case llvm::Triple::x86:
+    reg = RegNumX86ToX86_64(reg);
+    break;
+  default:
+    assert(false && "Unhandled target architecture.");
+    error.SetErrorString("Unhandled target architecture.");
+    return error;
+  }
+
   error = ReadRegisterSet(set);
   if (error.Fail())
     return error;
 
   switch (reg) {
+#if defined(__x86_64__)
   case lldb_rax_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_RAX];
+    reg_value = (uint64_t)m_gpr.regs[_REG_RAX];
     break;
   case lldb_rbx_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_RBX];
+    reg_value = (uint64_t)m_gpr.regs[_REG_RBX];
     break;
   case lldb_rcx_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_RCX];
+    reg_value = (uint64_t)m_gpr.regs[_REG_RCX];
     break;
   case lldb_rdx_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_RDX];
+    reg_value = (uint64_t)m_gpr.regs[_REG_RDX];
     break;
   case lldb_rdi_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_RDI];
+    reg_value = (uint64_t)m_gpr.regs[_REG_RDI];
     break;
   case lldb_rsi_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_RSI];
+    reg_value = (uint64_t)m_gpr.regs[_REG_RSI];
     break;
   case lldb_rbp_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_RBP];
+    reg_value = (uint64_t)m_gpr.regs[_REG_RBP];
     break;
   case lldb_rsp_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_RSP];
+    reg_value = (uint64_t)m_gpr.regs[_REG_RSP];
     break;
   case lldb_r8_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_R8];
+    reg_value = (uint64_t)m_gpr.regs[_REG_R8];
     break;
   case lldb_r9_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_R9];
+    reg_value = (uint64_t)m_gpr.regs[_REG_R9];
     break;
   case lldb_r10_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_R10];
+    reg_value = (uint64_t)m_gpr.regs[_REG_R10];
     break;
   case lldb_r11_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_R11];
+    reg_value = (uint64_t)m_gpr.regs[_REG_R11];
     break;
   case lldb_r12_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_R12];
+    reg_value = (uint64_t)m_gpr.regs[_REG_R12];
     break;
   case lldb_r13_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_R13];
+    reg_value = (uint64_t)m_gpr.regs[_REG_R13];
     break;
   case lldb_r14_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_R14];
+    reg_value = (uint64_t)m_gpr.regs[_REG_R14];
     break;
   case lldb_r15_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_R15];
+    reg_value = (uint64_t)m_gpr.regs[_REG_R15];
+    break;
+  case lldb_rip_x86_64:
+    reg_value = (uint64_t)m_gpr.regs[_REG_RIP];
+    break;
+  case lldb_rflags_x86_64:
+    reg_value = (uint64_t)m_gpr.regs[_REG_RFLAGS];
+    break;
+  case lldb_cs_x86_64:
+    reg_value = (uint64_t)m_gpr.regs[_REG_CS];
+    break;
+  case lldb_fs_x86_64:
+    reg_value = (uint64_t)m_gpr.regs[_REG_FS];
+    break;
+  case lldb_gs_x86_64:
+    reg_value = (uint64_t)m_gpr.regs[_REG_GS];
+    break;
+  case lldb_ss_x86_64:
+    reg_value = (uint64_t)m_gpr.regs[_REG_SS];
+    break;
+  case lldb_ds_x86_64:
+    reg_value = (uint64_t)m_gpr.regs[_REG_DS];
+    break;
+  case lldb_es_x86_64:
+    reg_value = (uint64_t)m_gpr.regs[_REG_ES];
+    break;
+#else
+  case lldb_rax_x86_64:
+    reg_value = (uint32_t)m_gpr.r_eax;
+    break;
+  case lldb_rbx_x86_64:
+    reg_value = (uint32_t)m_gpr.r_ebx;
+    break;
+  case lldb_rcx_x86_64:
+    reg_value = (uint32_t)m_gpr.r_ecx;
+    break;
+  case lldb_rdx_x86_64:
+    reg_value = (uint32_t)m_gpr.r_edx;
+    break;
+  case lldb_rdi_x86_64:
+    reg_value = (uint32_t)m_gpr.r_edi;
+    break;
+  case lldb_rsi_x86_64:
+    reg_value = (uint32_t)m_gpr.r_esi;
+    break;
+  case lldb_rsp_x86_64:
+    reg_value = (uint32_t)m_gpr.r_esp;
+    break;
+  case lldb_rbp_x86_64:
+    reg_value = (uint32_t)m_gpr.r_ebp;
     break;
   case lldb_rip_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_RIP];
+    reg_value = (uint32_t)m_gpr.r_eip;
     break;
   case lldb_rflags_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_RFLAGS];
+    reg_value = (uint32_t)m_gpr.r_eflags;
     break;
   case lldb_cs_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_CS];
+    reg_value = (uint32_t)m_gpr.r_cs;
     break;
   case lldb_fs_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_FS];
+    reg_value = (uint32_t)m_gpr.r_fs;
     break;
   case lldb_gs_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_GS];
+    reg_value = (uint32_t)m_gpr.r_gs;
     break;
   case lldb_ss_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_SS];
+    reg_value = (uint32_t)m_gpr.r_ss;
     break;
   case lldb_ds_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_DS];
+    reg_value = (uint32_t)m_gpr.r_ds;
     break;
   case lldb_es_x86_64:
-    reg_value = (uint64_t)m_gpr_x86_64.regs[_REG_ES];
+    reg_value = (uint32_t)m_gpr.r_es;
     break;
+#endif
   case lldb_fctrl_x86_64:
-    reg_value = (uint16_t)m_fpr_x86_64.fxstate.fx_cw;
+    reg_value = (uint16_t)m_fpr.fxstate.fx_cw;
     break;
   case lldb_fstat_x86_64:
-    reg_value = (uint16_t)m_fpr_x86_64.fxstate.fx_sw;
+    reg_value = (uint16_t)m_fpr.fxstate.fx_sw;
     break;
   case lldb_ftag_x86_64:
-    reg_value = (uint8_t)m_fpr_x86_64.fxstate.fx_tw;
+    reg_value = (uint8_t)m_fpr.fxstate.fx_tw;
     break;
   case lldb_fop_x86_64:
-    reg_value = (uint64_t)m_fpr_x86_64.fxstate.fx_opcode;
+    reg_value = (uint64_t)m_fpr.fxstate.fx_opcode;
     break;
   case lldb_fiseg_x86_64:
-    reg_value = (uint64_t)m_fpr_x86_64.fxstate.fx_ip.fa_64;
+    reg_value = (uint64_t)m_fpr.fxstate.fx_ip.fa_64;
     break;
   case lldb_fioff_x86_64:
-    reg_value = (uint32_t)m_fpr_x86_64.fxstate.fx_ip.fa_32.fa_off;
+    reg_value = (uint32_t)m_fpr.fxstate.fx_ip.fa_32.fa_off;
     break;
   case lldb_foseg_x86_64:
-    reg_value = (uint64_t)m_fpr_x86_64.fxstate.fx_dp.fa_64;
+    reg_value = (uint64_t)m_fpr.fxstate.fx_dp.fa_64;
     break;
   case lldb_fooff_x86_64:
-    reg_value = (uint32_t)m_fpr_x86_64.fxstate.fx_dp.fa_32.fa_off;
+    reg_value = (uint32_t)m_fpr.fxstate.fx_dp.fa_32.fa_off;
     break;
   case lldb_mxcsr_x86_64:
-    reg_value = (uint32_t)m_fpr_x86_64.fxstate.fx_mxcsr;
+    reg_value = (uint32_t)m_fpr.fxstate.fx_mxcsr;
     break;
   case lldb_mxcsrmask_x86_64:
-    reg_value = (uint32_t)m_fpr_x86_64.fxstate.fx_mxcsr_mask;
+    reg_value = (uint32_t)m_fpr.fxstate.fx_mxcsr_mask;
     break;
   case lldb_st0_x86_64:
   case lldb_st1_x86_64:
@@ -348,7 +682,7 @@ NativeRegisterContextNetBSD_x86_64::ReadRegister(const RegisterInfo *reg_info,
   case lldb_st5_x86_64:
   case lldb_st6_x86_64:
   case lldb_st7_x86_64:
-    reg_value.SetBytes(&m_fpr_x86_64.fxstate.fx_87_ac[reg - lldb_st0_x86_64],
+    reg_value.SetBytes(&m_fpr.fxstate.fx_87_ac[reg - lldb_st0_x86_64],
                        reg_info->byte_size, endian::InlHostByteOrder());
     break;
   case lldb_mm0_x86_64:
@@ -359,7 +693,7 @@ NativeRegisterContextNetBSD_x86_64::ReadRegister(const RegisterInfo *reg_info,
   case lldb_mm5_x86_64:
   case lldb_mm6_x86_64:
   case lldb_mm7_x86_64:
-    reg_value.SetBytes(&m_fpr_x86_64.fxstate.fx_87_ac[reg - lldb_mm0_x86_64],
+    reg_value.SetBytes(&m_fpr.fxstate.fx_87_ac[reg - lldb_mm0_x86_64],
                        reg_info->byte_size, endian::InlHostByteOrder());
     break;
   case lldb_xmm0_x86_64:
@@ -378,7 +712,7 @@ NativeRegisterContextNetBSD_x86_64::ReadRegister(const RegisterInfo *reg_info,
   case lldb_xmm13_x86_64:
   case lldb_xmm14_x86_64:
   case lldb_xmm15_x86_64:
-    reg_value.SetBytes(&m_fpr_x86_64.fxstate.fx_xmm[reg - lldb_xmm0_x86_64],
+    reg_value.SetBytes(&m_fpr.fxstate.fx_xmm[reg - lldb_xmm0_x86_64],
                        reg_info->byte_size, endian::InlHostByteOrder());
     break;
   case lldb_ymm0_x86_64:
@@ -398,15 +732,15 @@ NativeRegisterContextNetBSD_x86_64::ReadRegister(const RegisterInfo *reg_info,
   case lldb_ymm14_x86_64:
   case lldb_ymm15_x86_64:
 #ifdef HAVE_XSTATE
-    if (!(m_xstate_x86_64.xs_rfbm & XCR0_SSE) ||
-        !(m_xstate_x86_64.xs_rfbm & XCR0_YMM_Hi128)) {
+    if (!(m_xstate.xs_rfbm & XCR0_SSE) ||
+        !(m_xstate.xs_rfbm & XCR0_YMM_Hi128)) {
       error.SetErrorStringWithFormat("register \"%s\" not supported by CPU/kernel",
                                      reg_info->name);
     } else {
       uint32_t reg_index = reg - lldb_ymm0_x86_64;
       YMMReg ymm = XStateToYMM(
-          m_xstate_x86_64.xs_fxsave.fx_xmm[reg_index].xmm_bytes,
-          m_xstate_x86_64.xs_ymm_hi128.xs_ymm[reg_index].ymm_bytes);
+          m_xstate.xs_fxsave.fx_xmm[reg_index].xmm_bytes,
+          m_xstate.xs_ymm_hi128.xs_ymm[reg_index].ymm_bytes);
       reg_value.SetBytes(ymm.bytes, reg_info->byte_size,
                          endian::InlHostByteOrder());
     }
@@ -422,7 +756,7 @@ NativeRegisterContextNetBSD_x86_64::ReadRegister(const RegisterInfo *reg_info,
   case lldb_dr5_x86_64:
   case lldb_dr6_x86_64:
   case lldb_dr7_x86_64:
-    reg_value = (uint64_t)m_dbr_x86_64.dr[reg - lldb_dr0_x86_64];
+    reg_value = (uint64_t)m_dbr.dr[reg - lldb_dr0_x86_64];
     break;
   }
 
@@ -439,7 +773,7 @@ Status NativeRegisterContextNetBSD_x86_64::WriteRegister(
     return error;
   }
 
-  const uint32_t reg = reg_info->kinds[lldb::eRegisterKindLLDB];
+  uint32_t reg = reg_info->kinds[lldb::eRegisterKindLLDB];
   if (reg == LLDB_INVALID_REGNUM) {
     // This is likely an internal register for lldb use only and should not be
     // directly queried.
@@ -458,112 +792,175 @@ Status NativeRegisterContextNetBSD_x86_64::WriteRegister(
     return error;
   }
 
+  switch (GetRegisterInfoInterface().GetTargetArchitecture().GetMachine()) {
+  case llvm::Triple::x86_64:
+    break;
+  case llvm::Triple::x86:
+    reg = RegNumX86ToX86_64(reg);
+    break;
+  default:
+    assert(false && "Unhandled target architecture.");
+    error.SetErrorString("Unhandled target architecture.");
+    return error;
+  }
+
   error = ReadRegisterSet(set);
   if (error.Fail())
     return error;
 
   switch (reg) {
+#if defined(__x86_64__)
   case lldb_rax_x86_64:
-    m_gpr_x86_64.regs[_REG_RAX] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_RAX] = reg_value.GetAsUInt64();
     break;
   case lldb_rbx_x86_64:
-    m_gpr_x86_64.regs[_REG_RBX] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_RBX] = reg_value.GetAsUInt64();
     break;
   case lldb_rcx_x86_64:
-    m_gpr_x86_64.regs[_REG_RCX] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_RCX] = reg_value.GetAsUInt64();
     break;
   case lldb_rdx_x86_64:
-    m_gpr_x86_64.regs[_REG_RDX] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_RDX] = reg_value.GetAsUInt64();
     break;
   case lldb_rdi_x86_64:
-    m_gpr_x86_64.regs[_REG_RDI] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_RDI] = reg_value.GetAsUInt64();
     break;
   case lldb_rsi_x86_64:
-    m_gpr_x86_64.regs[_REG_RSI] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_RSI] = reg_value.GetAsUInt64();
     break;
   case lldb_rbp_x86_64:
-    m_gpr_x86_64.regs[_REG_RBP] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_RBP] = reg_value.GetAsUInt64();
     break;
   case lldb_rsp_x86_64:
-    m_gpr_x86_64.regs[_REG_RSP] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_RSP] = reg_value.GetAsUInt64();
     break;
   case lldb_r8_x86_64:
-    m_gpr_x86_64.regs[_REG_R8] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_R8] = reg_value.GetAsUInt64();
     break;
   case lldb_r9_x86_64:
-    m_gpr_x86_64.regs[_REG_R9] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_R9] = reg_value.GetAsUInt64();
     break;
   case lldb_r10_x86_64:
-    m_gpr_x86_64.regs[_REG_R10] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_R10] = reg_value.GetAsUInt64();
     break;
   case lldb_r11_x86_64:
-    m_gpr_x86_64.regs[_REG_R11] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_R11] = reg_value.GetAsUInt64();
     break;
   case lldb_r12_x86_64:
-    m_gpr_x86_64.regs[_REG_R12] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_R12] = reg_value.GetAsUInt64();
     break;
   case lldb_r13_x86_64:
-    m_gpr_x86_64.regs[_REG_R13] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_R13] = reg_value.GetAsUInt64();
     break;
   case lldb_r14_x86_64:
-    m_gpr_x86_64.regs[_REG_R14] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_R14] = reg_value.GetAsUInt64();
     break;
   case lldb_r15_x86_64:
-    m_gpr_x86_64.regs[_REG_R15] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_R15] = reg_value.GetAsUInt64();
     break;
   case lldb_rip_x86_64:
-    m_gpr_x86_64.regs[_REG_RIP] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_RIP] = reg_value.GetAsUInt64();
     break;
   case lldb_rflags_x86_64:
-    m_gpr_x86_64.regs[_REG_RFLAGS] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_RFLAGS] = reg_value.GetAsUInt64();
     break;
   case lldb_cs_x86_64:
-    m_gpr_x86_64.regs[_REG_CS] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_CS] = reg_value.GetAsUInt64();
     break;
   case lldb_fs_x86_64:
-    m_gpr_x86_64.regs[_REG_FS] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_FS] = reg_value.GetAsUInt64();
     break;
   case lldb_gs_x86_64:
-    m_gpr_x86_64.regs[_REG_GS] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_GS] = reg_value.GetAsUInt64();
     break;
   case lldb_ss_x86_64:
-    m_gpr_x86_64.regs[_REG_SS] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_SS] = reg_value.GetAsUInt64();
     break;
   case lldb_ds_x86_64:
-    m_gpr_x86_64.regs[_REG_DS] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_DS] = reg_value.GetAsUInt64();
     break;
   case lldb_es_x86_64:
-    m_gpr_x86_64.regs[_REG_ES] = reg_value.GetAsUInt64();
+    m_gpr.regs[_REG_ES] = reg_value.GetAsUInt64();
+    break;
+#else
+  case lldb_rax_x86_64:
+    m_gpr.r_eax = reg_value.GetAsUInt32();
+    break;
+  case lldb_rbx_x86_64:
+    m_gpr.r_ebx = reg_value.GetAsUInt32();
+    break;
+  case lldb_rcx_x86_64:
+    m_gpr.r_ecx = reg_value.GetAsUInt32();
+    break;
+  case lldb_rdx_x86_64:
+    m_gpr.r_edx = reg_value.GetAsUInt32();
+    break;
+  case lldb_rdi_x86_64:
+    m_gpr.r_edi = reg_value.GetAsUInt32();
+    break;
+  case lldb_rsi_x86_64:
+    m_gpr.r_esi = reg_value.GetAsUInt32();
+    break;
+  case lldb_rsp_x86_64:
+    m_gpr.r_esp = reg_value.GetAsUInt32();
+    break;
+  case lldb_rbp_x86_64:
+    m_gpr.r_ebp = reg_value.GetAsUInt32();
+    break;
+  case lldb_rip_x86_64:
+    m_gpr.r_eip = reg_value.GetAsUInt32();
+    break;
+  case lldb_rflags_x86_64:
+    m_gpr.r_eflags = reg_value.GetAsUInt32();
+    break;
+  case lldb_cs_x86_64:
+    m_gpr.r_cs = reg_value.GetAsUInt32();
+    break;
+  case lldb_fs_x86_64:
+    m_gpr.r_fs = reg_value.GetAsUInt32();
+    break;
+  case lldb_gs_x86_64:
+    m_gpr.r_gs = reg_value.GetAsUInt32();
+    break;
+  case lldb_ss_x86_64:
+    m_gpr.r_ss = reg_value.GetAsUInt32();
+    break;
+  case lldb_ds_x86_64:
+    m_gpr.r_ds = reg_value.GetAsUInt32();
     break;
+  case lldb_es_x86_64:
+    m_gpr.r_es = reg_value.GetAsUInt32();
+    break;
+#endif
   case lldb_fctrl_x86_64:
-    m_fpr_x86_64.fxstate.fx_cw = reg_value.GetAsUInt16();
+    m_fpr.fxstate.fx_cw = reg_value.GetAsUInt16();
     break;
   case lldb_fstat_x86_64:
-    m_fpr_x86_64.fxstate.fx_sw = reg_value.GetAsUInt16();
+    m_fpr.fxstate.fx_sw = reg_value.GetAsUInt16();
     break;
   case lldb_ftag_x86_64:
-    m_fpr_x86_64.fxstate.fx_tw = reg_value.GetAsUInt8();
+    m_fpr.fxstate.fx_tw = reg_value.GetAsUInt8();
     break;
   case lldb_fop_x86_64:
-    m_fpr_x86_64.fxstate.fx_opcode = reg_value.GetAsUInt16();
+    m_fpr.fxstate.fx_opcode = reg_value.GetAsUInt16();
     break;
   case lldb_fiseg_x86_64:
-    m_fpr_x86_64.fxstate.fx_ip.fa_64 = reg_value.GetAsUInt64();
+    m_fpr.fxstate.fx_ip.fa_64 = reg_value.GetAsUInt64();
     break;
   case lldb_fioff_x86_64:
-    m_fpr_x86_64.fxstate.fx_ip.fa_32.fa_off = reg_value.GetAsUInt32();
+    m_fpr.fxstate.fx_ip.fa_32.fa_off = reg_value.GetAsUInt32();
     break;
   case lldb_foseg_x86_64:
-    m_fpr_x86_64.fxstate.fx_dp.fa_64 = reg_value.GetAsUInt64();
+    m_fpr.fxstate.fx_dp.fa_64 = reg_value.GetAsUInt64();
     break;
   case lldb_fooff_x86_64:
-    m_fpr_x86_64.fxstate.fx_dp.fa_32.fa_off = reg_value.GetAsUInt32();
+    m_fpr.fxstate.fx_dp.fa_32.fa_off = reg_value.GetAsUInt32();
     break;
   case lldb_mxcsr_x86_64:
-    m_fpr_x86_64.fxstate.fx_mxcsr = reg_value.GetAsUInt32();
+    m_fpr.fxstate.fx_mxcsr = reg_value.GetAsUInt32();
     break;
   case lldb_mxcsrmask_x86_64:
-    m_fpr_x86_64.fxstate.fx_mxcsr_mask = reg_value.GetAsUInt32();
+    m_fpr.fxstate.fx_mxcsr_mask = reg_value.GetAsUInt32();
     break;
   case lldb_st0_x86_64:
   case lldb_st1_x86_64:
@@ -573,7 +970,7 @@ Status NativeRegisterContextNetBSD_x86_64::WriteRegister(
   case lldb_st5_x86_64:
   case lldb_st6_x86_64:
   case lldb_st7_x86_64:
-    ::memcpy(&m_fpr_x86_64.fxstate.fx_87_ac[reg - lldb_st0_x86_64],
+    ::memcpy(&m_fpr.fxstate.fx_87_ac[reg - lldb_st0_x86_64],
              reg_value.GetBytes(), reg_value.GetByteSize());
     break;
   case lldb_mm0_x86_64:
@@ -584,7 +981,7 @@ Status NativeRegisterContextNetBSD_x86_64::WriteRegister(
   case lldb_mm5_x86_64:
   case lldb_mm6_x86_64:
   case lldb_mm7_x86_64:
-    ::memcpy(&m_fpr_x86_64.fxstate.fx_87_ac[reg - lldb_mm0_x86_64],
+    ::memcpy(&m_fpr.fxstate.fx_87_ac[reg - lldb_mm0_x86_64],
              reg_value.GetBytes(), reg_value.GetByteSize());
     break;
   case lldb_xmm0_x86_64:
@@ -603,7 +1000,7 @@ Status NativeRegisterContextNetBSD_x86_64::WriteRegister(
   case lldb_xmm13_x86_64:
   case lldb_xmm14_x86_64:
   case lldb_xmm15_x86_64:
-    ::memcpy(&m_fpr_x86_64.fxstate.fx_xmm[reg - lldb_xmm0_x86_64],
+    ::memcpy(&m_fpr.fxstate.fx_xmm[reg - lldb_xmm0_x86_64],
              reg_value.GetBytes(), reg_value.GetByteSize());
     break;
   case lldb_ymm0_x86_64:
@@ -623,8 +1020,8 @@ Status NativeRegisterContextNetBSD_x86_64::WriteRegister(
   case lldb_ymm14_x86_64:
   case lldb_ymm15_x86_64:
 #ifdef HAVE_XSTATE
-    if (!(m_xstate_x86_64.xs_rfbm & XCR0_SSE) ||
-        !(m_xstate_x86_64.xs_rfbm & XCR0_YMM_Hi128)) {
+    if (!(m_xstate.xs_rfbm & XCR0_SSE) ||
+        !(m_xstate.xs_rfbm & XCR0_YMM_Hi128)) {
       error.SetErrorStringWithFormat("register \"%s\" not supported by CPU/kernel",
                                      reg_info->name);
     } else {
@@ -632,8 +1029,8 @@ Status NativeRegisterContextNetBSD_x86_64::WriteRegister(
       YMMReg ymm;
       ::memcpy(ymm.bytes, reg_value.GetBytes(), reg_value.GetByteSize());
       YMMToXState(ymm,
-          m_xstate_x86_64.xs_fxsave.fx_xmm[reg_index].xmm_bytes,
-          m_xstate_x86_64.xs_ymm_hi128.xs_ymm[reg_index].ymm_bytes);
+          m_xstate.xs_fxsave.fx_xmm[reg_index].xmm_bytes,
+          m_xstate.xs_ymm_hi128.xs_ymm[reg_index].ymm_bytes);
     }
 #else
     error.SetErrorString("XState not supported by the kernel");
@@ -647,7 +1044,7 @@ Status NativeRegisterContextNetBSD_x86_64::WriteRegister(
   case lldb_dr5_x86_64:
   case lldb_dr6_x86_64:
   case lldb_dr7_x86_64:
-    m_dbr_x86_64.dr[reg - lldb_dr0_x86_64] = reg_value.GetAsUInt64();
+    m_dbr.dr[reg - lldb_dr0_x86_64] = reg_value.GetAsUInt64();
     break;
   }
 
@@ -664,14 +1061,9 @@ Status NativeRegisterContextNetBSD_x86_64::ReadAllRegisterValues(
     return error;
 
   uint8_t *dst = data_sp->GetBytes();
-  ::memcpy(dst, &m_gpr_x86_64, GetRegisterInfoInterface().GetGPRSize());
+  ::memcpy(dst, &m_gpr, GetRegisterInfoInterface().GetGPRSize());
   dst += GetRegisterInfoInterface().GetGPRSize();
 
-  RegisterValue value((uint64_t)-1);
-  const RegisterInfo *reg_info =
-      GetRegisterInfoInterface().GetDynamicRegisterInfo("orig_eax");
-  if (reg_info == nullptr)
-    reg_info = GetRegisterInfoInterface().GetDynamicRegisterInfo("orig_rax");
   return error;
 }
 
@@ -689,7 +1081,7 @@ Status NativeRegisterContextNetBSD_x86_64::WriteAllRegisterValues(
   if (data_sp->GetByteSize() != REG_CONTEXT_SIZE) {
     error.SetErrorStringWithFormat(
         "NativeRegisterContextNetBSD_x86_64::%s data_sp contained mismatched "
-        "data size, expected %" PRIu64 ", actual %" PRIu64,
+        "data size, expected %zu, actual %" PRIu64,
         __FUNCTION__, REG_CONTEXT_SIZE, data_sp->GetByteSize());
     return error;
   }
@@ -702,7 +1094,7 @@ Status NativeRegisterContextNetBSD_x86_64::WriteAllRegisterValues(
                                    __FUNCTION__);
     return error;
   }
-  ::memcpy(&m_gpr_x86_64, src, GetRegisterInfoInterface().GetGPRSize());
+  ::memcpy(&m_gpr, src, GetRegisterInfoInterface().GetGPRSize());
 
   error = WriteRegisterSet(GPRegSet);
   if (error.Fail())
@@ -712,13 +1104,25 @@ Status NativeRegisterContextNetBSD_x86_64::WriteAllRegisterValues(
   return error;
 }
 
+int NativeRegisterContextNetBSD_x86_64::GetDR(int num) const {
+  assert(num >= 0 && num <= 7);
+  switch (GetRegisterInfoInterface().GetTargetArchitecture().GetMachine()) {
+  case llvm::Triple::x86:
+    return lldb_dr0_i386 + num;
+  case llvm::Triple::x86_64:
+    return lldb_dr0_x86_64 + num;
+  default:
+    return -1;
+  }
+}
+
 Status NativeRegisterContextNetBSD_x86_64::IsWatchpointHit(uint32_t wp_index,
                                                            bool &is_hit) {
   if (wp_index >= NumSupportedHardwareWatchpoints())
     return Status("Watchpoint index out of range");
 
   RegisterValue reg_value;
-  const RegisterInfo *const reg_info = GetRegisterInfoAtIndex(lldb_dr6_x86_64);
+  const RegisterInfo *const reg_info = GetRegisterInfoAtIndex(GetDR(6));
   Status error = ReadRegister(reg_info, reg_value);
   if (error.Fail()) {
     is_hit = false;
@@ -755,7 +1159,7 @@ Status NativeRegisterContextNetBSD_x86_64::IsWatchpointVacant(uint32_t wp_index,
     return Status("Watchpoint index out of range");
 
   RegisterValue reg_value;
-  const RegisterInfo *const reg_info = GetRegisterInfoAtIndex(lldb_dr7_x86_64);
+  const RegisterInfo *const reg_info = GetRegisterInfoAtIndex(GetDR(7));
   Status error = ReadRegister(reg_info, reg_value);
   if (error.Fail()) {
     is_vacant = false;
@@ -795,10 +1199,9 @@ Status NativeRegisterContextNetBSD_x86_64::SetHardwareWatchpointWithIndex(
   if (!is_vacant)
     return Status("Watchpoint index not vacant");
 
-  RegisterValue reg_value;
-  const RegisterInfo *const reg_info_dr7 =
-      GetRegisterInfoAtIndex(lldb_dr7_x86_64);
-  error = ReadRegister(reg_info_dr7, reg_value);
+  const RegisterInfo *const reg_info_dr7 = GetRegisterInfoAtIndex(GetDR(7));
+  RegisterValue dr7_value;
+  error = ReadRegister(reg_info_dr7, dr7_value);
   if (error.Fail())
     return error;
 
@@ -816,16 +1219,28 @@ Status NativeRegisterContextNetBSD_x86_64::SetHardwareWatchpointWithIndex(
 
   uint64_t bit_mask = (0x3 << (2 * wp_index)) | (0xF << (16 + 4 * wp_index));
 
-  uint64_t control_bits = reg_value.GetAsUInt64() & ~bit_mask;
+  uint64_t control_bits = dr7_value.GetAsUInt64() & ~bit_mask;
 
   control_bits |= enable_bit | rw_bits | size_bits;
 
   const RegisterInfo *const reg_info_drN =
-      GetRegisterInfoAtIndex(lldb_dr0_x86_64 + wp_index);
-  error = WriteRegister(reg_info_drN, RegisterValue(addr));
+      GetRegisterInfoAtIndex(GetDR(wp_index));
+  RegisterValue drN_value;
+  error = ReadRegister(reg_info_drN, drN_value);
   if (error.Fail())
     return error;
 
+  // clear dr6 if address or bits changed (i.e. we're not reenabling the same
+  // watchpoint)
+  if (drN_value.GetAsUInt64() != addr ||
+      (dr7_value.GetAsUInt64() & bit_mask) != (rw_bits | size_bits)) {
+    ClearWatchpointHit(wp_index);
+
+    error = WriteRegister(reg_info_drN, RegisterValue(addr));
+    if (error.Fail())
+      return error;
+  }
+
   error = WriteRegister(reg_info_dr7, RegisterValue(control_bits));
   if (error.Fail())
     return error;
@@ -839,40 +1254,41 @@ bool NativeRegisterContextNetBSD_x86_64::ClearHardwareWatchpoint(
   if (wp_index >= NumSupportedHardwareWatchpoints())
     return false;
 
+  // for watchpoints 0, 1, 2, or 3, respectively, clear bits 0-1, 2-3, 4-5
+  // or 6-7 of the debug control register (DR7)
+  const RegisterInfo *const reg_info_dr7 = GetRegisterInfoAtIndex(GetDR(7));
   RegisterValue reg_value;
+  Status error = ReadRegister(reg_info_dr7, reg_value);
+  if (error.Fail())
+    return false;
+  uint64_t bit_mask = 0x3 << (2 * wp_index);
+  uint64_t control_bits = reg_value.GetAsUInt64() & ~bit_mask;
+
+  return WriteRegister(reg_info_dr7, RegisterValue(control_bits)).Success();
+}
+
+Status NativeRegisterContextNetBSD_x86_64::ClearWatchpointHit(uint32_t wp_index) {
+  if (wp_index >= NumSupportedHardwareWatchpoints())
+    return Status("Watchpoint index out of range");
 
-  // for watchpoints 0, 1, 2, or 3, respectively, clear bits 0, 1, 2, or 3 of
+  // for watchpoints 0, 1, 2, or 3, respectively, check bits 0, 1, 2, or 3 of
   // the debug status register (DR6)
-  const RegisterInfo *const reg_info_dr6 =
-      GetRegisterInfoAtIndex(lldb_dr6_x86_64);
+  const RegisterInfo *const reg_info_dr6 = GetRegisterInfoAtIndex(GetDR(6));
+  RegisterValue reg_value;
   Status error = ReadRegister(reg_info_dr6, reg_value);
   if (error.Fail())
-    return false;
+    return error;
+
   uint64_t bit_mask = 1 << wp_index;
   uint64_t status_bits = reg_value.GetAsUInt64() & ~bit_mask;
-  error = WriteRegister(reg_info_dr6, RegisterValue(status_bits));
-  if (error.Fail())
-    return false;
-
-  // for watchpoints 0, 1, 2, or 3, respectively, clear bits {0-1,16-19},
-  // {2-3,20-23}, {4-5,24-27}, or {6-7,28-31} of the debug control register
-  // (DR7)
-  const RegisterInfo *const reg_info_dr7 =
-      GetRegisterInfoAtIndex(lldb_dr7_x86_64);
-  error = ReadRegister(reg_info_dr7, reg_value);
-  if (error.Fail())
-    return false;
-  bit_mask = (0x3 << (2 * wp_index)) | (0xF << (16 + 4 * wp_index));
-  uint64_t control_bits = reg_value.GetAsUInt64() & ~bit_mask;
-  return WriteRegister(reg_info_dr7, RegisterValue(control_bits)).Success();
+  return WriteRegister(reg_info_dr6, RegisterValue(status_bits));
 }
 
 Status NativeRegisterContextNetBSD_x86_64::ClearAllHardwareWatchpoints() {
   RegisterValue reg_value;
 
   // clear bits {0-4} of the debug status register (DR6)
-  const RegisterInfo *const reg_info_dr6 =
-      GetRegisterInfoAtIndex(lldb_dr6_x86_64);
+  const RegisterInfo *const reg_info_dr6 = GetRegisterInfoAtIndex(GetDR(6));
   Status error = ReadRegister(reg_info_dr6, reg_value);
   if (error.Fail())
     return error;
@@ -883,8 +1299,7 @@ Status NativeRegisterContextNetBSD_x86_64::ClearAllHardwareWatchpoints() {
     return error;
 
   // clear bits {0-7,16-31} of the debug control register (DR7)
-  const RegisterInfo *const reg_info_dr7 =
-      GetRegisterInfoAtIndex(lldb_dr7_x86_64);
+  const RegisterInfo *const reg_info_dr7 = GetRegisterInfoAtIndex(GetDR(7));
   error = ReadRegister(reg_info_dr7, reg_value);
   if (error.Fail())
     return error;
@@ -919,7 +1334,7 @@ NativeRegisterContextNetBSD_x86_64::GetWatchpointAddress(uint32_t wp_index) {
     return LLDB_INVALID_ADDRESS;
   RegisterValue reg_value;
   const RegisterInfo *const reg_info_drN =
-      GetRegisterInfoAtIndex(lldb_dr0_x86_64 + wp_index);
+      GetRegisterInfoAtIndex(GetDR(wp_index));
   if (ReadRegister(reg_info_drN, reg_value).Fail())
     return LLDB_INVALID_ADDRESS;
   return reg_value.GetAsUInt64();
@@ -930,4 +1345,19 @@ uint32_t NativeRegisterContextNetBSD_x86_64::NumSupportedHardwareWatchpoints() {
   return 4;
 }
 
+Status NativeRegisterContextNetBSD_x86_64::CopyHardwareWatchpointsFrom(
+    NativeRegisterContextNetBSD &source) {
+  auto &r_source = static_cast<NativeRegisterContextNetBSD_x86_64&>(source);
+  Status res = r_source.ReadRegisterSet(DBRegSet);
+  if (!res.Fail()) {
+    // copy dbregs only if any watchpoints were set
+    if ((r_source.m_dbr.dr[7] & 0xFF) == 0)
+      return res;
+
+    m_dbr = r_source.m_dbr;
+    res = WriteRegisterSet(DBRegSet);
+  }
+  return res;
+}
+
 #endif // defined(__x86_64__)
diff --git a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h
index 0fed16542a95..6c0632f3bce8 100644
--- a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h
+++ b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h
@@ -6,7 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#if defined(__x86_64__)
+#if defined(__i386__) || defined(__x86_64__)
 
 #ifndef lldb_NativeRegisterContextNetBSD_x86_64_h
 #define lldb_NativeRegisterContextNetBSD_x86_64_h
@@ -58,6 +58,8 @@ public:
 
   bool ClearHardwareWatchpoint(uint32_t wp_index) override;
 
+  Status ClearWatchpointHit(uint32_t wp_index) override;
+
   Status ClearAllHardwareWatchpoints() override;
 
   Status SetHardwareWatchpointWithIndex(lldb::addr_t addr, size_t size,
@@ -71,19 +73,27 @@ public:
 
   uint32_t NumSupportedHardwareWatchpoints() override;
 
+  Status
+  CopyHardwareWatchpointsFrom(NativeRegisterContextNetBSD &source) override;
+
 private:
   // Private member types.
-  enum { GPRegSet, FPRegSet, DBRegSet, XStateRegSet };
+  enum { GPRegSet, FPRegSet, XStateRegSet, DBRegSet };
 
   // Private member variables.
-  struct reg m_gpr_x86_64;
-  struct fpreg m_fpr_x86_64;
-  struct dbreg m_dbr_x86_64;
+  struct reg m_gpr;
+#if defined(__x86_64__)
+  struct fpreg m_fpr;
+#else
+  struct xmmregs m_fpr;
+#endif
+  struct dbreg m_dbr;
 #ifdef HAVE_XSTATE
-  struct xstate m_xstate_x86_64;
+  struct xstate m_xstate;
 #endif
 
   int GetSetForNativeRegNum(int reg_num) const;
+  int GetDR(int num) const;
 
   Status ReadRegisterSet(uint32_t set);
   Status WriteRegisterSet(uint32_t set);
diff --git a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
index e25975c93446..dd2745d9330e 100644
--- a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
+++ b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
@@ -16,9 +16,20 @@
 #include "lldb/Utility/LLDBAssert.h"
 #include "lldb/Utility/RegisterValue.h"
 #include "lldb/Utility/State.h"
+#include "llvm/Support/Errno.h"
+
+// clang-format off
+#include <sys/types.h>
+#include <sys/ptrace.h>
+// clang-format on
 
 #include <sstream>
 
+// clang-format off
+#include <sys/types.h>
+#include <sys/sysctl.h>
+// clang-format on
+
 using namespace lldb;
 using namespace lldb_private;
 using namespace lldb_private::process_netbsd;
@@ -30,6 +41,38 @@ NativeThreadNetBSD::NativeThreadNetBSD(NativeProcessNetBSD &process,
 NativeRegisterContextNetBSD::CreateHostNativeRegisterContextNetBSD(process.GetArchitecture(), *this)
 ), m_stop_description() {}
 
+Status NativeThreadNetBSD::Resume() {
+  Status ret = NativeProcessNetBSD::PtraceWrapper(PT_RESUME, m_process.GetID(),
+                                                  nullptr, GetID());
+  if (!ret.Success())
+    return ret;
+  ret = NativeProcessNetBSD::PtraceWrapper(PT_CLEARSTEP, m_process.GetID(),
+                                           nullptr, GetID());
+  if (ret.Success())
+    SetRunning();
+  return ret;
+}
+
+Status NativeThreadNetBSD::SingleStep() {
+  Status ret = NativeProcessNetBSD::PtraceWrapper(PT_RESUME, m_process.GetID(),
+                                                  nullptr, GetID());
+  if (!ret.Success())
+    return ret;
+  ret = NativeProcessNetBSD::PtraceWrapper(PT_SETSTEP, m_process.GetID(),
+                                           nullptr, GetID());
+  if (ret.Success())
+    SetStepping();
+  return ret;
+}
+
+Status NativeThreadNetBSD::Suspend() {
+  Status ret = NativeProcessNetBSD::PtraceWrapper(PT_SUSPEND, m_process.GetID(),
+                                                  nullptr, GetID());
+  if (ret.Success())
+    SetStopped();
+  return ret;
+}
+
 void NativeThreadNetBSD::SetStoppedBySignal(uint32_t signo,
                                             const siginfo_t *info) {
   Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_THREAD));
@@ -89,6 +132,13 @@ void NativeThreadNetBSD::SetStoppedByWatchpoint(uint32_t wp_index) {
   m_stop_info.details.signal.signo = SIGTRAP;
 }
 
+void NativeThreadNetBSD::SetStoppedWithNoReason() {
+  SetStopped();
+
+  m_stop_info.reason = StopReason::eStopReasonNone;
+  m_stop_info.details.signal.signo = 0;
+}
+
 void NativeThreadNetBSD::SetStopped() {
   const StateType new_state = StateType::eStateStopped;
   m_state = new_state;
@@ -105,7 +155,49 @@ void NativeThreadNetBSD::SetStepping() {
   m_stop_info.reason = StopReason::eStopReasonNone;
 }
 
-std::string NativeThreadNetBSD::GetName() { return std::string(""); }
+std::string NativeThreadNetBSD::GetName() {
+  Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_THREAD));
+
+#ifdef PT_LWPSTATUS
+  struct ptrace_lwpstatus info = {};
+  info.pl_lwpid = m_tid;
+  Status error = NativeProcessNetBSD::PtraceWrapper(
+      PT_LWPSTATUS, static_cast<int>(m_process.GetID()), &info, sizeof(info));
+  if (error.Fail()) {
+    return "";
+  }
+  return info.pl_name;
+#else
+  std::vector<struct kinfo_lwp> infos;
+  int mib[5] = {CTL_KERN, KERN_LWP, static_cast<int>(m_process.GetID()),
+                sizeof(struct kinfo_lwp), 0};
+  size_t size;
+
+  if (::sysctl(mib, 5, nullptr, &size, nullptr, 0) == -1 || size == 0) {
+    LLDB_LOG(log, "sysctl() for LWP info size failed: {0}",
+             llvm::sys::StrError());
+    return "";
+  }
+
+  mib[4] = size / sizeof(size_t);
+  infos.resize(size / sizeof(struct kinfo_lwp));
+
+  if (sysctl(mib, 5, infos.data(), &size, NULL, 0) == -1 || size == 0) {
+    LLDB_LOG(log, "sysctl() for LWP info failed: {0}", llvm::sys::StrError());
+    return "";
+  }
+
+  size_t nlwps = size / sizeof(struct kinfo_lwp);
+  for (size_t i = 0; i < nlwps; i++) {
+    if (static_cast<lldb::tid_t>(infos[i].l_lid) == m_tid) {
+      return infos[i].l_name;
+    }
+  }
+
+  LLDB_LOG(log, "unable to find lwp {0} in LWP infos", m_tid);
+  return "";
+#endif
+}
 
 lldb::StateType NativeThreadNetBSD::GetState() { return m_state; }
 
@@ -140,9 +232,9 @@ bool NativeThreadNetBSD::GetStopReason(ThreadStopInfo &stop_info,
   llvm_unreachable("unhandled StateType!");
 }
 
-NativeRegisterContext& NativeThreadNetBSD::GetRegisterContext() {
+NativeRegisterContextNetBSD &NativeThreadNetBSD::GetRegisterContext() {
   assert(m_reg_context_up);
-return  *m_reg_context_up;
+  return *m_reg_context_up;
 }
 
 Status NativeThreadNetBSD::SetWatchpoint(lldb::addr_t addr, size_t size,
@@ -203,3 +295,13 @@ Status NativeThreadNetBSD::RemoveHardwareBreakpoint(lldb::addr_t addr) {
 
   return Status("Clearing hardware breakpoint failed.");
 }
+
+Status NativeThreadNetBSD::CopyWatchpointsFrom(NativeThreadNetBSD &source) {
+  Status s = GetRegisterContext().CopyHardwareWatchpointsFrom(
+      source.GetRegisterContext());
+  if (!s.Fail()) {
+    m_watchpoint_index_map = source.m_watchpoint_index_map;
+    m_hw_break_index_map = source.m_hw_break_index_map;
+  }
+  return s;
+}
diff --git a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h
index 015d8995db34..89b61ef86722 100644
--- a/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h
+++ b/external/apache2/llvm/dist/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h
@@ -11,6 +11,8 @@
 
 #include "lldb/Host/common/NativeThreadProtocol.h"
 
+#include "Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h"
+
 #include <csignal>
 #include <map>
 #include <string>
@@ -34,7 +36,7 @@ public:
   bool GetStopReason(ThreadStopInfo &stop_info,
                      std::string &description) override;
 
-  NativeRegisterContext& GetRegisterContext() override;
+  NativeRegisterContextNetBSD &GetRegisterContext() override;
 
   Status SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags,
                        bool hardware) override;
@@ -48,19 +50,26 @@ public:
 private:
   // Interface for friend classes
 
+  Status Resume();
+  Status SingleStep();
+  Status Suspend();
+
   void SetStoppedBySignal(uint32_t signo, const siginfo_t *info = nullptr);
   void SetStoppedByBreakpoint();
   void SetStoppedByTrace();
   void SetStoppedByExec();
   void SetStoppedByWatchpoint(uint32_t wp_index);
+  void SetStoppedWithNoReason();
   void SetStopped();
   void SetRunning();
   void SetStepping();
 
+  Status CopyWatchpointsFrom(NativeThreadNetBSD& source);
+
   // Member Variables
   lldb::StateType m_state;
   ThreadStopInfo m_stop_info;
-  std::unique_ptr<NativeRegisterContext> m_reg_context_up;
+  std::unique_ptr<NativeRegisterContextNetBSD> m_reg_context_up;
   std::string m_stop_description;
   using WatchpointIndexMap = std::map<lldb::addr_t, uint32_t>;
   WatchpointIndexMap m_watchpoint_index_map;
diff --git a/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/CMakeLists.txt b/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/CMakeLists.txt
index 91838d0a8d4a..55746b04c39f 100644
--- a/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/CMakeLists.txt
+++ b/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/CMakeLists.txt
@@ -32,6 +32,7 @@ add_lldb_library(lldbPluginProcessUtility PLUGIN
   RegisterContextMach_i386.cpp
   RegisterContextMach_x86_64.cpp
   RegisterContextMemory.cpp
+  RegisterContextNetBSD_i386.cpp
   RegisterContextNetBSD_x86_64.cpp
   RegisterContextOpenBSD_i386.cpp
   RegisterContextOpenBSD_x86_64.cpp
diff --git a/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_i386.cpp b/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_i386.cpp
new file mode 100644
index 000000000000..bd7830e42b42
--- /dev/null
+++ b/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_i386.cpp
@@ -0,0 +1,96 @@
+//===-- RegisterContextNetBSD_i386.cpp -------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===---------------------------------------------------------------------===//
+
+#include "RegisterContextNetBSD_i386.h"
+#include "RegisterContextPOSIX_x86.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+// this needs to match 'struct reg'
+struct GPR {
+  uint32_t eax;
+  uint32_t ecx;
+  uint32_t edx;
+  uint32_t ebx;
+  uint32_t esp;
+  uint32_t ebp;
+  uint32_t esi;
+  uint32_t edi;
+  uint32_t eip;
+  uint32_t eflags;
+  uint32_t cs;
+  uint32_t ss;
+  uint32_t ds;
+  uint32_t es;
+  uint32_t fs;
+  uint32_t gs;
+};
+
+struct FPR_i386 {
+  uint16_t fctrl;     // FPU Control Word (fcw)
+  uint16_t fstat;     // FPU Status Word (fsw)
+  uint16_t ftag;      // FPU Tag Word (ftw)
+  uint16_t fop;       // Last Instruction Opcode (fop)
+  union {
+    struct {
+      uint64_t fip; // Instruction Pointer
+      uint64_t fdp; // Data Pointer
+    } x86_64;
+    struct {
+      uint32_t fioff; // FPU IP Offset (fip)
+      uint32_t fiseg; // FPU IP Selector (fcs)
+      uint32_t fooff; // FPU Operand Pointer Offset (foo)
+      uint32_t foseg; // FPU Operand Pointer Selector (fos)
+    } i386_; // Added _ in the end to avoid error with gcc defining i386 in some
+             // cases
+  } ptr;
+  uint32_t mxcsr;     // MXCSR Register State
+  uint32_t mxcsrmask; // MXCSR Mask
+  MMSReg stmm[8];     // 8*16 bytes for each FP-reg = 128 bytes
+  XMMReg xmm[8];      // 8*16 bytes for each XMM-reg = 128 bytes
+  uint32_t padding[56];
+};
+
+struct UserArea {
+  GPR gpr;
+  FPR_i386 i387;
+  uint32_t u_debugreg[8]; // Debug registers (DR0 - DR7).
+  uint32_t tlsbase;
+};
+
+#define DR_SIZE sizeof(((UserArea *)NULL)->u_debugreg[0])
+#define DR_OFFSET(reg_index)                                                   \
+  (LLVM_EXTENSION offsetof(UserArea, u_debugreg[reg_index]))
+
+// Include RegisterInfos_i386 to declare our g_register_infos_i386 structure.
+#define DECLARE_REGISTER_INFOS_I386_STRUCT
+#include "RegisterInfos_i386.h"
+#undef DECLARE_REGISTER_INFOS_I386_STRUCT
+
+RegisterContextNetBSD_i386::RegisterContextNetBSD_i386(
+    const ArchSpec &target_arch)
+    : RegisterInfoInterface(target_arch) {}
+
+size_t RegisterContextNetBSD_i386::GetGPRSize() const { return sizeof(GPR); }
+
+const RegisterInfo *RegisterContextNetBSD_i386::GetRegisterInfo() const {
+  switch (m_target_arch.GetMachine()) {
+  case llvm::Triple::x86:
+  case llvm::Triple::x86_64:
+    return g_register_infos_i386;
+  default:
+    assert(false && "Unhandled target architecture.");
+    return nullptr;
+  }
+}
+
+uint32_t RegisterContextNetBSD_i386::GetRegisterCount() const {
+  return static_cast<uint32_t>(sizeof(g_register_infos_i386) /
+                               sizeof(g_register_infos_i386[0]));
+}
diff --git a/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_i386.h b/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_i386.h
new file mode 100644
index 000000000000..060d98f809bb
--- /dev/null
+++ b/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_i386.h
@@ -0,0 +1,25 @@
+//===-- RegisterContextNetBSD_i386.h ----------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_RegisterContextNetBSD_i386_H_
+#define liblldb_RegisterContextNetBSD_i386_H_
+
+#include "RegisterInfoInterface.h"
+
+class RegisterContextNetBSD_i386 : public lldb_private::RegisterInfoInterface {
+public:
+  RegisterContextNetBSD_i386(const lldb_private::ArchSpec &target_arch);
+
+  size_t GetGPRSize() const override;
+
+  const lldb_private::RegisterInfo *GetRegisterInfo() const override;
+
+  uint32_t GetRegisterCount() const override;
+};
+
+#endif
diff --git a/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp b/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp
index e620ff66c922..699992c823b8 100644
--- a/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp
+++ b/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "RegisterContextNetBSD_x86_64.h"
+#include "RegisterContextNetBSD_i386.h"
 #include "RegisterContextPOSIX_x86.h"
 #include "llvm/ADT/Triple.h"
 #include "llvm/Support/Compiler.h"
@@ -83,9 +84,40 @@ struct UserArea {
 #include "RegisterInfos_x86_64.h"
 #undef DECLARE_REGISTER_INFOS_X86_64_STRUCT
 
+static std::vector<lldb_private::RegisterInfo> &GetPrivateRegisterInfoVector() {
+  static std::vector<lldb_private::RegisterInfo> g_register_infos;
+  return g_register_infos;
+}
+
+static const RegisterInfo *
+GetRegisterInfo_i386(const lldb_private::ArchSpec &arch) {
+  std::vector<lldb_private::RegisterInfo> &g_register_infos =
+      GetPrivateRegisterInfoVector();
+
+  // Allocate RegisterInfo only once
+  if (g_register_infos.empty()) {
+    // Copy the register information from base class
+    std::unique_ptr<RegisterContextNetBSD_i386> reg_interface(
+        new RegisterContextNetBSD_i386(arch));
+    const RegisterInfo *base_info = reg_interface->GetRegisterInfo();
+    g_register_infos.insert(g_register_infos.end(), &base_info[0],
+                            &base_info[k_num_registers_i386]);
+
+// Include RegisterInfos_x86_64 to update the g_register_infos structure
+//  with x86_64 offsets.
+#define UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
+#include "RegisterInfos_x86_64.h"
+#undef UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS
+  }
+
+  return &g_register_infos[0];
+}
+
 static const RegisterInfo *
 PrivateGetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch) {
   switch (target_arch.GetMachine()) {
+  case llvm::Triple::x86:
+    return GetRegisterInfo_i386(target_arch);
   case llvm::Triple::x86_64:
     return g_register_infos_x86_64;
   default:
@@ -97,6 +129,11 @@ PrivateGetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch) {
 static uint32_t
 PrivateGetRegisterCount(const lldb_private::ArchSpec &target_arch) {
   switch (target_arch.GetMachine()) {
+  case llvm::Triple::x86: {
+    assert(!GetPrivateRegisterInfoVector().empty() &&
+           "i386 register info not yet filled.");
+    return static_cast<uint32_t>(GetPrivateRegisterInfoVector().size());
+  }
   case llvm::Triple::x86_64:
     return static_cast<uint32_t>(sizeof(g_register_infos_x86_64) /
                                  sizeof(g_register_infos_x86_64[0]));
@@ -106,11 +143,25 @@ PrivateGetRegisterCount(const lldb_private::ArchSpec &target_arch) {
   }
 }
 
+static uint32_t
+PrivateGetUserRegisterCount(const lldb_private::ArchSpec &target_arch) {
+  switch (target_arch.GetMachine()) {
+  case llvm::Triple::x86:
+    return static_cast<uint32_t>(k_num_user_registers_i386);
+  case llvm::Triple::x86_64:
+    return static_cast<uint32_t>(k_num_user_registers_x86_64);
+  default:
+    assert(false && "Unhandled target architecture.");
+    return 0;
+  }
+}
+
 RegisterContextNetBSD_x86_64::RegisterContextNetBSD_x86_64(
     const ArchSpec &target_arch)
     : lldb_private::RegisterInfoInterface(target_arch),
       m_register_info_p(PrivateGetRegisterInfoPtr(target_arch)),
-      m_register_count(PrivateGetRegisterCount(target_arch)) {}
+      m_register_count(PrivateGetRegisterCount(target_arch)),
+      m_user_register_count(PrivateGetUserRegisterCount(target_arch)) {}
 
 size_t RegisterContextNetBSD_x86_64::GetGPRSize() const { return sizeof(GPR); }
 
@@ -121,3 +172,7 @@ const RegisterInfo *RegisterContextNetBSD_x86_64::GetRegisterInfo() const {
 uint32_t RegisterContextNetBSD_x86_64::GetRegisterCount() const {
   return m_register_count;
 }
+
+uint32_t RegisterContextNetBSD_x86_64::GetUserRegisterCount() const {
+  return m_user_register_count;
+}
diff --git a/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h b/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h
index 4820ef8d17ba..7cba7816ed37 100644
--- a/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h
+++ b/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h
@@ -22,9 +22,12 @@ public:
 
   uint32_t GetRegisterCount() const override;
 
+  uint32_t GetUserRegisterCount() const override;
+
 private:
   const lldb_private::RegisterInfo *m_register_info_p;
   const uint32_t m_register_count;
+  const uint32_t m_user_register_count;
 };
 
 #endif
diff --git a/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterInfos_i386.h b/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterInfos_i386.h
index 72ff904520ad..343579cd2657 100644
--- a/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterInfos_i386.h
+++ b/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/RegisterInfos_i386.h
@@ -145,7 +145,7 @@
         DR_OFFSET(i), eEncodingUint, eFormatHex,                               \
                   {LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,                   \
                    LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,                   \
-                   LLDB_INVALID_REGNUM },                                      \
+                   lldb_##reg##i##_i386 },                                     \
                    nullptr, nullptr, nullptr, 0                                \
   }
 
diff --git a/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h b/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h
index 0d2149c83573..44d049a1050f 100644
--- a/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h
+++ b/external/apache2/llvm/dist/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h
@@ -113,7 +113,8 @@ enum {
   lldb_bndstatus_i386,
   k_last_mpxc_i386 = lldb_bndstatus_i386,
 
-  lldb_dr0_i386,
+  k_first_dbr_i386,
+  lldb_dr0_i386 = k_first_dbr_i386,
   lldb_dr1_i386,
   lldb_dr2_i386,
   lldb_dr3_i386,
@@ -121,6 +122,7 @@ enum {
   lldb_dr5_i386,
   lldb_dr6_i386,
   lldb_dr7_i386,
+  k_last_dbr_i386 = lldb_dr7_i386,
 
   k_num_registers_i386,
   k_num_gpr_registers_i386 = k_last_gpr_i386 - k_first_gpr_i386 + 1,
@@ -131,6 +133,7 @@ enum {
                               k_num_fpr_registers_i386 +
                               k_num_avx_registers_i386 +
                               k_num_mpx_registers_i386,
+  k_num_dbr_registers_i386 = k_last_dbr_i386 - k_first_dbr_i386 + 1,
 };
 
 // Internal codes for all x86_64 registers.
@@ -294,7 +297,8 @@ enum {
   lldb_bndstatus_x86_64,
   k_last_mpxc_x86_64 = lldb_bndstatus_x86_64,
 
-  lldb_dr0_x86_64,
+  k_first_dbr_x86_64,
+  lldb_dr0_x86_64 = k_first_dbr_x86_64,
   lldb_dr1_x86_64,
   lldb_dr2_x86_64,
   lldb_dr3_x86_64,
@@ -302,6 +306,7 @@ enum {
   lldb_dr5_x86_64,
   lldb_dr6_x86_64,
   lldb_dr7_x86_64,
+  k_last_dbr_x86_64 = lldb_dr7_x86_64,
 
   k_num_registers_x86_64,
   k_num_gpr_registers_x86_64 = k_last_gpr_x86_64 - k_first_gpr_x86_64 + 1,
@@ -312,6 +317,7 @@ enum {
                                 k_num_fpr_registers_x86_64 +
                                 k_num_avx_registers_x86_64 +
                                 k_num_mpx_registers_x86_64,
+  k_num_dbr_registers_x86_64 = k_last_dbr_x86_64 - k_first_dbr_x86_64 + 1,
 };
 }
 
diff --git a/external/apache2/llvm/dist/lldb/test/Shell/Watchpoint/Inputs/thread-dbreg.c b/external/apache2/llvm/dist/lldb/test/Shell/Watchpoint/Inputs/thread-dbreg.c
new file mode 100644
index 000000000000..14f3474789af
--- /dev/null
+++ b/external/apache2/llvm/dist/lldb/test/Shell/Watchpoint/Inputs/thread-dbreg.c
@@ -0,0 +1,23 @@
+#include <pthread.h>
+
+int g_watchme = 0;
+
+void *thread_func(void *arg) {
+  /* watchpoint trigger from subthread */
+  g_watchme = 2;
+  return 0;
+}
+
+int main() {
+  pthread_t thread;
+  if (pthread_create(&thread, 0, thread_func, 0))
+    return 1;
+
+  /* watchpoint trigger from main thread */
+  g_watchme = 1;
+
+  if (pthread_join(thread, 0))
+    return 2;
+
+  return 0;
+}
diff --git a/external/apache2/llvm/dist/lldb/test/Shell/Watchpoint/netbsd-nouserdbregs.test b/external/apache2/llvm/dist/lldb/test/Shell/Watchpoint/netbsd-nouserdbregs.test
new file mode 100644
index 000000000000..884636c7cdf8
--- /dev/null
+++ b/external/apache2/llvm/dist/lldb/test/Shell/Watchpoint/netbsd-nouserdbregs.test
@@ -0,0 +1,22 @@
+# Check that 'watchpoint set' errors out gracefully when we can't set dbregs
+# and that new threads are monitored correctly even though we can't copy dbregs.
+
+# REQUIRES: system-netbsd && (target-x86 || target-x86_64) && !dbregs-set
+# RUN: %clang_host %p/Inputs/thread-dbreg.c -pthread -g -o %t.out
+# RUN: %lldb -b -o 'settings set interpreter.stop-command-source-on-error false' -s %s %t.out 2>&1 | FileCheck %s
+
+settings show interpreter.stop-command-source-on-error
+# CHECK: interpreter.stop-command-source-on-error (boolean) = false
+
+b main
+# CHECK: Breakpoint {{[0-9]+}}: where = {{.*}}`main
+b thread_func
+# CHECK: Breakpoint {{[0-9]+}}: where = {{.*}}`thread_func
+run
+# CHECK: stop reason = breakpoint
+watchpoint set variable g_watchme
+# CHECK: error: Watchpoint creation failed
+cont
+# CHECK: stop reason = breakpoint
+cont
+# CHECK: Process {{[0-9]+}} exited with status = 0
diff --git a/external/apache2/llvm/dist/lldb/test/Shell/lit.cfg.py b/external/apache2/llvm/dist/lldb/test/Shell/lit.cfg.py
index cc54234faf78..84c5b730dd31 100644
--- a/external/apache2/llvm/dist/lldb/test/Shell/lit.cfg.py
+++ b/external/apache2/llvm/dist/lldb/test/Shell/lit.cfg.py
@@ -5,6 +5,7 @@ import platform
 import re
 import shutil
 import site
+import subprocess
 import sys
 
 import lit.formats
@@ -103,3 +104,17 @@ if config.lldb_enable_lzma:
 
 if find_executable('xz') != None:
     config.available_features.add('xz')
+
+# NetBSD permits setting dbregs either if one is root
+# or if user_set_dbregs is enabled
+can_set_dbregs = True
+if platform.system() == 'NetBSD' and os.geteuid() != 0:
+    try:
+        output = subprocess.check_output(["/sbin/sysctl", "-n",
+          "security.models.extensions.user_set_dbregs"]).decode().strip()
+        if output != "1":
+            can_set_dbregs = False
+    except subprocess.CalledProcessError:
+        can_set_dbregs = False
+if can_set_dbregs:
+    config.available_features.add('dbregs-set')
-- 
2.26.0





Home | Main Index | Thread Index | Old Index