This implements a debuginfod server in llvm using the DebuginfodCollection and DebuginfodServer classes. This is tested with lit tests against the debuginfod-find client.
The server scans 0 or more local directories for artifacts. It serves the debuginfod protocol over HTTP. Only the executable and debuginfo endpoints are supported (no /source endpoint).
The server also uses the debuginfod client as a fallback, so it can hit the local debuginfod cache or federate to other known debuginfod servers.
The client behavior is controllable through the standard environment variables (DEBUGINFOD_URLS, DEBUGINFOD_CACHE_PATH, DEBUGINFOD_TIMEOUT)
The server implements on-demand collection updates as follows:
If the build-id is not found by a local lookup, rescan immediately and look up the build-id again before returning 404. To protect against DoS attacks, do not rescan more frequently than once per N seconds (specified by -m).
Lit tests are provided which test the llvm-debuginfod-find client against the llvm-debuginfod server.
Looks like this comment should be updated to describe llvm-debuginfod instead of llvm-debuginfod-find.