[all-commits] [llvm/llvm-project] 68c8c8: Reland "[lldb][RPC] Upstream lldb-rpc-gen tool" (...

Chelsea Cassanova via All-commits all-commits at lists.llvm.org
Wed Jul 23 18:10:38 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 68c8c8ceeba6da96189335236e3ec80a082e4d7b
      https://github.com/llvm/llvm-project/commit/68c8c8ceeba6da96189335236e3ec80a082e4d7b
  Author: Chelsea Cassanova <chelsea_cassanova at apple.com>
  Date:   2025-07-23 (Wed, 23 Jul 2025)

  Changed paths:
    M lldb/cmake/modules/LLDBConfig.cmake
    M lldb/test/CMakeLists.txt
    A lldb/test/Shell/RPC/Generator/Inputs/SBDummy.h
    A lldb/test/Shell/RPC/Generator/Tests/CheckRPCGenToolByproducts.test
    A lldb/test/Shell/RPC/Generator/lit.local.cfg
    M lldb/test/Shell/helper/toolchain.py
    M lldb/test/Shell/lit.site.cfg.py.in
    M lldb/tools/CMakeLists.txt
    A lldb/tools/lldb-rpc-gen/CMakeLists.txt
    A lldb/tools/lldb-rpc-gen/RPCCommon.cpp
    A lldb/tools/lldb-rpc-gen/RPCCommon.h
    A lldb/tools/lldb-rpc-gen/lldb-rpc-gen.cpp
    A lldb/tools/lldb-rpc-gen/server/RPCServerHeaderEmitter.cpp
    A lldb/tools/lldb-rpc-gen/server/RPCServerHeaderEmitter.h
    A lldb/tools/lldb-rpc-gen/server/RPCServerSourceEmitter.cpp
    A lldb/tools/lldb-rpc-gen/server/RPCServerSourceEmitter.h
    A lldb/tools/lldb-rpc/CMakeLists.txt
    A lldb/tools/lldb-rpc/LLDBRPCGeneration.cmake
    A lldb/tools/lldb-rpc/LLDBRPCHeaders.cmake
    R lldb/tools/lldb-rpc/lldb-rpc-gen/lldb-rpc-gen.cpp
    R lldb/tools/lldb-rpc/lldb-rpc-gen/server/RPCServerHeaderEmitter.cpp
    R lldb/tools/lldb-rpc/lldb-rpc-gen/server/RPCServerHeaderEmitter.h
    R lldb/tools/lldb-rpc/lldb-rpc-gen/server/RPCServerSourceEmitter.cpp
    R lldb/tools/lldb-rpc/lldb-rpc-gen/server/RPCServerSourceEmitter.h

  Log Message:
  -----------
   Reland "[lldb][RPC] Upstream lldb-rpc-gen tool" (#146969)" Attempt 2 (#148996)

Second attempt at relanding the lldb-rpc-gen tool. This should fix 2
issues:

- An assert that was hitting when building on Linux. The assert would
hit in the server source emitter, specifically when attemping to
determine the storage size for a return type is that is a pointer, but
isn't a const char *, const char ** or void pointer.

The assert would hit when attempting to generate
SBAttachInfo::GetProcessPluginName, which returns a const char *
(meaning it shouldn't have been in the code block for the assert at
all). The reason that it was hitting the assert when generating this
function is that lldb_rpc_gen::TypeIsConstCharPtr was returning false
for this function even though it did return a const char *. This was
happening because when checking the return type for a const char *,
TypeIsConstCharPtr would only check that the underlying type was a
signed char. This failed on Linux (but was fine on Darwin), as the
underlying type also needs to be checked for being an unsigned char.

- Cross compiling support

The build for lldb-rpc-gen had no support for cross compiling and as
such, the sources generated for lldb-rpc-gen would get compiled too
early in phase 2 when cross compiling, before the Clang toolchain was
built and this led to an error when trying to include stdlib files. This
reland splits this build into 2 by building the tool first and then
compiling the sources in the second stage of the cross-compiled build.

Original PR Description:
This commit upstreams the lldb-rpc-gen tool, a ClangTool that generates
the LLDB RPC client and server interfaces. This tool, as well as LLDB
RPC itself is built by default. If it needs to be disabled, put
-DLLDB_BUILD_LLDBRPC=OFF in your CMake invocation.

https://discourse.llvm.org/t/rfc-upstreaming-lldb-rpc/85804

Original PR Link:
github.com/llvm/llvm-project/pull/138031



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