Skip to content

[LLDB] Fix lldb plug-ins isolation to reduce lldb-server size #129543

@slydiman

Description

@slydiman

I'm trying to reduce the size of lldb-server binary.
The size of lldb-server binary for Aarch64 (release) is about 42MB.
I have analyzed the code and found a lot of x86, PDB, MIPS and Darwin related code.
Many "lldb plug-ins" are not plug-ins, but libraries used by other plug-ins.
See ac1ea0d

  1. It is necessary to review and isolate plug-ins more accurately.
    llvm-project/lldb/tools/lldb-server/SystemInitializerLLGS.cpp includes only necessary plug-ins, but it is not enough.
    For example, llvm-project/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp uses PDB code in
    PDBASTParser *TypeSystemClang::GetPDBParser() and npdb::PdbAstBuilder *TypeSystemClang::GetNativePDBParser().
    That's why Aarch64 lldb-server binary contains unwanted x86 and PDB code.
    I'm trying to figure out how to disable some plug-ins (with loss of some functionality) to reduce the size of lldb-server binary. But they have a lot of cross-dependencies.
    PlatformPOSIX::DoLoadImage() uses TypeSystemClang directly, etc.

  2. A lot of unwanted code is used directly in the base LLVM code and cannot be disabled in lldb.
    For example ms_demangler is used in llvm-project/llvm/lib/Demangle/Demangle.cpp
    Currently I have no solution how to remove such unwanted code except by using local patches.

Any thoughts are welcome.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions