[RFC] Building LLVM-Debuginfod

Debuginfod is a simple protocol
<https://sourceware.org/elfutils/Debuginfod.html&gt; allowing a client to
fetch debug information about a stripped binary from a server by supplying
its build-id. We would like to add debuginfod support to LLVM to make it
easier for users to debug stripped binaries.

In summary, we would like to:


   Build an LLVM debuginfod client library in LLVM.

   Integrate the client library into llvm-symbolizer and other tools.

   Build a simple LLVM debuginfod server library for local development use.

The client and server tasks are separate and we have already begun work on
the client side. The server is nothing more than a simple web server that
serves static content associated with the build_id in the URL. We are eager
to get feedback and advice from the community.
HTTP Client

The debuginfod client library will require an HTTP client, which should be
fully featured to maximize compatibility across various network
configurations and debuginfo server implementations. We were leaning
towards libcurl <https://curl.se/libcurl/&gt; which is widely available.
HTTP Server

The debuginfod server is essentially a static file server using HTTP over
TCP/IP. We propose to use the TCPSocket library from lldb-server
<https://lldb.llvm.org/use/remote.html&gt; and build a very small HTTP file
server on top using LLVM regular expressions
<https://llvm.org/doxygen/classllvm_1_1Regex.html&gt;\. We built a
proof-of-concept, more details can be found below under HTTP Server
Benchmarks. This would require a refactor of the LLDB IOObject hierarchy
into LLVM as described in our previous RFC

As a short-term solution, since the refactor may take some time, we propose
to use the lightweight cpp-httplib library to get a server up and running.

Debuginfod needs to run key-value lookup queries to serve requests.
Specifically, it must implement these logical mappings: