[Lldb-commits] [PATCH] D75750: [lldb] integrate debuginfod

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 30 03:13:01 PDT 2020

labath added a comment.

In D75750#1948273 <https://reviews.llvm.org/D75750#1948273>, @clayborg wrote:

> Currently we have a solution for macOS to locate symbol files in the "lldb/source/Symbol/LocateSymbolFile.cpp" file in the Symbols::LocateExecutableSymbolFile(...) function:
>   static FileSpec Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec, const FileSpecList &default_search_paths);
> This will locate any files that are already on the system and return the symbol file. When you don't have a symbol file, we can call:
>   static bool Symbols::DownloadObjectAndSymbolFile(ModuleSpec &module_spec, bool force_lookup = true);
> This might ping a build server and download the symbols.
> As for source file remappings, as Jim stated, on mac, each dSYM has path remappings already inside of it that are applied on the Module (not a target wide setting) itself and no modifications need to be done to the SourceManager.
> So my question is: can be use debuginfod to find the symbol file for a given build ID via Symbols::LocateExecutableSymbolFile(...), and when/if a symbol file is fetched from debuginfod, apply all path remappings to the module itself that we hand out? Then no changes would be needed in the SourceManager, we would just ask for a symbol file and get one back with all the remappings that are needed.

I've been thinking about that a lot too. The thing that's not clear to me is, does `DownloadObjectAndSymbolFile` download source files too? If so, how?

I am expecting that this feature will hook in very near to `DownloadObjectAndSymbolFile` for downloading the debug info, but it's not clear to me how would the source files fit in. Currently, debuginfod only provides an api to retrieve a single source file, so this code would have to parse all of the debug info, pry out the source files, and download them one by one -- a complicated and slow process.

Now if debuginfod provided an api to download all source files in a single request (*), that might be workable. However, in principle, I see nothing wrong with being able to download the files on demand, if we have the option to do that. (debuginfod's long term goal seems to be to provide an api to download the debug info in chunks too -- that would be very interesting, though I also expect it to be very complicated.)

(*) Though it seems very wasteful to download all files when we are going to need only a handful of them, it may not really be that way -- we're going to be downloading all of debug info anyway, and this is going to be much larger that all of source code put together.

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list