[all-commits] [llvm/llvm-project] 3f1372: [lldb] Support gdbserver signals

Michał Górny via All-commits all-commits at lists.llvm.org
Wed Nov 10 00:39:09 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3f1372365ac6c860ff6ecc4cfd3ba131bdf81698
      https://github.com/llvm/llvm-project/commit/3f1372365ac6c860ff6ecc4cfd3ba131bdf81698
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2021-11-10 (Wed, 10 Nov 2021)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
    M lldb/source/Plugins/Process/Utility/GDBRemoteSignals.cpp
    M lldb/source/Plugins/Process/Utility/GDBRemoteSignals.h
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
    M lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    M lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py
    M lldb/tools/debugserver/source/RNBRemote.cpp

  Log Message:
  -----------
  [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


  Commit: 82ce9127436b316eca6763b926b2cde2e3d4bb8a
      https://github.com/llvm/llvm-project/commit/82ce9127436b316eca6763b926b2cde2e3d4bb8a
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2021-11-10 (Wed, 10 Nov 2021)

  Changed paths:
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp

  Log Message:
  -----------
  [lldb] [gdb-server] Fix fill_clamp to handle signed src types

Fix the fill_clamp() function to handle signed source types.  Make sure
that the source value is always non-negative, and cast it to unsigned
when verifying the upper bound.  This fixes compiler warnings about
comparing unsigned and signed types.

Differential Revision: https://reviews.llvm.org/D113519


Compare: https://github.com/llvm/llvm-project/compare/0cada82f0a30...82ce9127436b


More information about the All-commits mailing list