diff options
author | Michał Górny <mgorny@moritz.systems> | 2020-09-10 08:24:15 +0200 |
---|---|---|
committer | Michał Górny <mgorny@moritz.systems> | 2020-10-08 16:03:00 +0200 |
commit | 1a600266c3ad1193d41ebb08a5a87c00cf726b1b (patch) | |
tree | aa9b802b0f3c39d4dd5702bbc9d1b83be0758894 /lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp | |
parent | e547b1e2431f9b6175470ff703cf6e1988031cda (diff) | |
download | llvm-1a600266c3ad1193d41ebb08a5a87c00cf726b1b.zip llvm-1a600266c3ad1193d41ebb08a5a87c00cf726b1b.tar.gz llvm-1a600266c3ad1193d41ebb08a5a87c00cf726b1b.tar.bz2 |
[lldb] Initial version of FreeBSD remote process plugin
Add a new FreeBSD Process plugin using client/server model. This plugin
is based on the one used by NetBSD. It currently supports a subset
of functionality for amd64. It is automatically used when spawning
lldb-server. It can also be used by lldb client by setting
FREEBSD_REMOTE_PLUGIN environment variable (to any value).
The code is capable of debugging simple single-threaded programs. It
supports general purpose, debug and FPU registers (up to XMM) of amd64,
basic signalling, software breakpoints.
Adding the support for the plugin involves removing some dead code
from FreeBSDPlatform plugin (that was not ever used because
CanDebugProcess() returned false), and replacing it with appropriate
code from NetBSD platform support.
Differential Revision: https://reviews.llvm.org/D88796
Diffstat (limited to 'lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp index 67a18bd..d87b01b 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp @@ -79,12 +79,14 @@ ProcessFreeBSD::CreateInstance(lldb::TargetSP target_sp, } void ProcessFreeBSD::Initialize() { - static llvm::once_flag g_once_flag; + if (!getenv("FREEBSD_REMOTE_PLUGIN")) { + static llvm::once_flag g_once_flag; - llvm::call_once(g_once_flag, []() { - PluginManager::RegisterPlugin(GetPluginNameStatic(), - GetPluginDescriptionStatic(), CreateInstance); - }); + llvm::call_once(g_once_flag, []() { + PluginManager::RegisterPlugin(GetPluginNameStatic(), + GetPluginDescriptionStatic(), CreateInstance); + }); + } } lldb_private::ConstString ProcessFreeBSD::GetPluginNameStatic() { |