aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
diff options
context:
space:
mode:
authorMichał Górny <mgorny@moritz.systems>2021-08-14 23:22:29 +0200
committerMichał Górny <mgorny@moritz.systems>2021-11-10 09:38:55 +0100
commit3f1372365ac6c860ff6ecc4cfd3ba131bdf81698 (patch)
tree09f2702aca967b1dd2c43b35238f0aec55b6bc87 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
parent0cada82f0a30e5ae22dce66b58604ab9b47a3897 (diff)
downloadllvm-3f1372365ac6c860ff6ecc4cfd3ba131bdf81698.zip
llvm-3f1372365ac6c860ff6ecc4cfd3ba131bdf81698.tar.gz
llvm-3f1372365ac6c860ff6ecc4cfd3ba131bdf81698.tar.bz2
[lldb] Support gdbserver signals
GDB and LLDB use different signal models. GDB uses a predefined set of signal codes, and maps platform's signos to them. On the other hand, LLDB has historically simply passed native signos. In order to improve compatibility between LLDB and gdbserver, the GDB signal model should be used. However, GDB does not provide a mapping for all existing signals on Linux and unsupported signals are passed as 'unknown'. Limiting LLDB to this behavior could be considered a regression. To get the best of both worlds, use the LLDB signal model when talking to lldb-server, and the GDB signal model otherwise. For this purpose, new versions of lldb-server indicate "native-signals+" via qSupported. At the same time, we also detect older versions of lldb-server via QThreadSuffixSupported for backwards compatibility. If neither test succeeds, we assume gdbserver or another implementation using GDB model. Differential Revision: https://reviews.llvm.org/D108078
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
index 15a1f0e..c61ce2a 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -1346,5 +1346,6 @@ std::vector<std::string> GDBRemoteCommunicationServerCommon::HandleFeatures(
llvm::formatv("PacketSize={0}", max_packet_size),
"QStartNoAckMode+",
"qEcho+",
+ "native-signals+",
};
}