[lldb] [llgs server] Support creating core dumps on NetBSD
authorMichał Górny <mgorny@moritz.systems>
Mon, 26 Apr 2021 11:47:02 +0000 (13:47 +0200)
committerMichał Górny <mgorny@moritz.systems>
Mon, 6 Sep 2021 10:16:14 +0000 (12:16 +0200)
commit37cbd817d3e2b8c673862e2eb262cad6dd3dd244
tree57262d6e7bbc9c8d89a3a88be8887c0b64fee23d
parentfae0dfa6421ea6c02f86ba7292fa782e1e2b69d1
[lldb] [llgs server] Support creating core dumps on NetBSD

Add a new SaveCore() process method that can be used to request a core
dump.  This is currently implemented on NetBSD via the PT_DUMPCORE
ptrace(2) request, and enabled via 'savecore' extension.

Protocol-wise, a new qSaveCore packet is introduced.  It accepts zero
or more semicolon-separated key:value options, invokes the core dump
and returns a key:value response.  Currently the only option supported
is "path-hint", and the return value contains the "path" actually used.
The support for the feature is exposed via qSaveCore qSupported feature.

Differential Revision: https://reviews.llvm.org/D101285
lldb/include/lldb/Host/common/NativeProcessProtocol.h
lldb/include/lldb/Utility/StringExtractorGDBRemote.h
lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
lldb/source/Utility/StringExtractorGDBRemote.cpp
lldb/test/API/tools/lldb-server/TestGdbRemoteSaveCore.py [new file with mode: 0644]