[llvm] [llvm][dwarf][rfc][donotcommit] Enable print of ranges addresses from .debug_info.dwo (PR #65516)

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 15:13:09 PDT 2023


ayermolo wrote:

> > This is 100% split dwarf specific. Main usage model is to be able to dump out .debug_info.dwo either full or specific dies (with usual optional parent/children flags), and see addresses and ranges. So to bring the functionality of monolithic dwarf to split-dwarf space.
> 
> I'm trying to ask about the higher level goal - what's the problem you were trying to address by dumping this information? Presumably you were looking to see if some piece of the DWARF encoded some data correctly, etc? And what I'm asking is, if the binary hadn't been built with Split DWARF, what would be the right tools to help dump just the data you're interested in? (eg: if you were looking at a specific function and wanted to see how the address ranges of the function were emitted - the ability to search the DWARF by function name, using the index, or scoping it to a specific file could be useful - and that could be suitable with or without Split DWARF)
> 
> And if we had /that/ tool, and made it work with Split DWARF too, then we'd have a more unified mechanism for answering that sort of question.

Without the split dwarf the correct tool still would have been llvm-dwarfdump. The goal is to be able to look at "random" DIEs, or all DIEs, and see full debug information about that DIE. One concrete example is verify that debug information BOLT outputs is correct. This came up during internal verification of llvm-gsymutil. It was reporting error that address range was not in it's parent. At high level right now when you look at output of llvm-dwarfdump for monolithic case you can query CU for all the dies, or random DIE and see full information that includes address and ranges. This functionality is missing when we enable split dwarf and try to output context of .debug_info.dwo section. This requires manual effort of figuring out what correct offset is in .debug_ranges/.debug_addr from CU, adding correct index, etc.

What I would like is to have a functionality in existing tool, llvm-dwarfdump, to display the same information for monolithic case and for split-dwarf. Preferably as fast as possible. 

https://github.com/llvm/llvm-project/pull/65516


More information about the llvm-commits mailing list