[all-commits] [llvm/llvm-project] 16f116: [lldb] Reply to malformed requests and use JSON-RP...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Wed Jul 29 11:12:52 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 16f116f476c248c345fd8ffe4b3e863f2700161f
      https://github.com/llvm/llvm-project/commit/16f116f476c248c345fd8ffe4b3e863f2700161f
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2026-07-29 (Wed, 29 Jul 2026)

  Changed paths:
    M lldb/include/lldb/Host/JSONTransport.h
    M lldb/include/lldb/Protocol/MCP/Transport.h
    M lldb/source/Host/common/JSONTransport.cpp
    M lldb/source/Protocol/MCP/Transport.cpp
    M lldb/unittests/Host/JSONTransportTest.cpp

  Log Message:
  -----------
  [lldb] Reply to malformed requests and use JSON-RPC error codes (#212678)

The transport dropped a message that failed to parse: it logged the
error and returned, so a peer waiting on that request hung forever and
every message already buffered behind it was discarded. Keep going after
a failed parse, and add ReplyWithParseError so a message that is valid
JSON but not a valid request is answered against its own id. Unparseable
JSON still gets no reply, since it carries no id and JSON-RPC forbids
inventing one.

Method-not-found was raised with createStringError, which converts
through inconvertibleErrorCode() to -32603, so clients could not tell a
misspelled method from a server fault. Use the MethodNotFound error,
which already carries -32601, and give InvalidParams the -32602 code it
was missing.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list