<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/129543>129543</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [LLDB] Reduce the size of lldb-server binary (isolate plug-ins)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lldb
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          slydiman
      </td>
    </tr>
</table>

<pre>
    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 Denwer related code.
Many "lldb plug-ins" are not plug-ins, but libraries used by other plug-ins.
See https://github.com/llvm/llvm-project/commit/ac1ea0d3da1ef620a392d2e22a38c03bd844383b

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.

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVd2O4jgTfRpzU2oUnPB3wUVoxAiJ_j60jFZ7t3LsSuKVYyP_QGeeflUJ9PSyo9HsVRKnXD516pyyCEE3FnHD5ls2301Eiq3zm2B6pTthJ5VT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