Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add cross-session caching to the Internal DWARF Indexer #214

Open
JamesMcNellis opened this issue Aug 6, 2024 · 3 comments
Open

Comments

@JamesMcNellis
Copy link

I love all of the new ELF/DWARF debugging tools in WinDbg!

This is a feature request. Whenever I open a dump from a Linux process, WinDbg goes "BUSY" for several minutes. In the log, the following entry is printed:

Information : DbgX.Services.dll : ELFBin : Building an index for DWARF symbols using Internal DWARF Indexer

It would be great if this index were persisted to disk into the symbol cache, so that subsequent debugging sessions could utilize it. That would make opening dumps much, much faster!

@lzybkr
Copy link
Collaborator

lzybkr commented Aug 9, 2024

DWARF supports an index which can be generated by the compiler or a script installed with gdb. windbg will use that index and that is probably a better solution than us generating our own index.

@wmessmer-msft
Copy link

@JamesMcNellis : JFYI: The script that @lzybkr refers to here is "gdb-add-index". If you are compiling with DWARFv4 symbols, you can use it (post-build) to add a GDB defined index (which we support):

gdb-add-index

If you are compiling with DWARFv5 symbols (e.g.: -gdwarf-5 on gcc), you can also use that script to add the standard v5 index sections:

gdb-add-index -dwarf-5

There are also compiler switches on gcc/clang/etc... to generate the appropriate index sections.

Long story short: windbg doesn't "trust" the default indexes in DWARFv4-.
.debug_pubnames isn't largely useful... and we've seen too many cases where other sections (aranges / CU DIE described ranges) are missing large swaths of data. If we open a symbol file like that, we'll take an internal pass over the DIE tree and build our own index. On the other hand, if there is a .gdb.index or DWARFv5 with .debug.names, etc..., we will trust those indicies and not build one of our own.

We've advised folks who want faster symbol open times to make sure to build / add one of those index formats to their DWARF symbols.

@JamesMcNellis
Copy link
Author

Thanks for the information. I can confirm that if I run gdb-add-index on the binary, WinDbg loads symbols for it much faster (several seconds instead of several minutes).

Unfortunately, I can't afford to include the indexing as part of the build because it bloats my binary by over 500MB. But, I can look into seeing if I can script WinDbg to run gdb-add-index somehow, perhaps from a local WSL installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants