6 Commits

Author SHA1 Message Date
Fangrui Song
816141ce0e [llvm-debuginfod] Include llvm/Support/StringExtras.h after D155178
To fix undefined errors like to_float. This tool is often not built as
LLVM_ENABLE_HTTPLIB defaults to off (and the external dependency
cpp-httplib is difficult to set up due to a dependency on brotli) and
LLVM_TOOL_LLVM_DEBUGINFOD_BUILD disabling logic in D147185.
2023-07-13 14:46:59 -07:00
Andrés Villegas
8148fc576a [llvm-debuginfod][NFC] Switch to OptTable
Reviewed By: mysterymath

Differential Revision: https://reviews.llvm.org/D151273
2023-05-30 16:04:41 -07:00
Alex Brachet
728a7de88a Revert "[llvm-debuginfod][NFC] Switch to OptTable"
This reverts commit 1610627d2b42c0daf8cc20649c50ddad222f001b.
2023-05-29 16:31:04 +00:00
Andrés Villegas
1610627d2b [llvm-debuginfod][NFC] Switch to OptTable
Reviewed By: mysterymath

Differential Revision: https://reviews.llvm.org/D151273
2023-05-26 14:42:43 -07:00
Kazu Hirata
7094ab4ee7 [llvm] Modernize bool literals (NFC)
Identified with modernize-use-bool-literals.
2022-07-17 18:08:51 -07:00
Noah Shutty
36f01909a0 [llvm] [Debuginfod] LLVM debuginfod server.
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.

Reviewed By: mysterymath

Differential Revision: https://reviews.llvm.org/D114846
2022-07-07 18:33:27 +00:00