gimli
gimli copied to clipboard
Support GNU-style DWZ multi-file extension
Fedora's packaged debuginfo are using these extensively. http://www.dwarfstd.org/ShowIssue.php?issue=120604.1 is the standardized version. I can't find real documentation for the GNU flavour that Fedora is using, but here is some information: https://gcc.gnu.org/ml/gcc-patches/2012-06/msg00513.html
The addition of DW_FORM_GNU_ref_alt
and DW_FORM_GNU_strp_alt
mean that gimli can't parse these debug binaries at all.
It looks like this hasn't actually been standardized in DWARF5 yet. I thought perhaps DWARF5 DWO would cover these use-cases but as far as I can tell it doesn't.
I think this is 7.3.6 DWARF Supplementary Object Files.
Aha, so it is.
I guess the main thing we need to do for gimli is to extend AttributeValue
to support alt-references for DebugStrRef
and DebugInfoRef
. We could add new AttributeValue
cases, e.g. DebugStrRefAlt
/DebugInfoRefAlt
, or we could add a field to DebugStrRef
and DebugInfoRef
to indicate which file is referenced. Any preference?
Aside, do you have any thoughts about how to handle split DWARF? I guess gimli is just going to provide parsing for skeleton compilation units and other split-DWARF-related syntax and leave it up to the consumer to actually reassemble the debuginfo.
I filed #288 to add DebugStrRefSup
and DebugInfoRefSup
to AttributeValue
.
For split DWARF, initially it'll be up to the consumer to reassemble the debuginfo. Adding higher level handling would be nice, but it might be hard to make that independent of the object file parser.
For split DWARF, initially it'll be up to the consumer to reassemble the debuginfo. Adding higher level handling would be nice, but it might be hard to make that independent of the object file parser.
It feels like there's probably room for a slightly higher-level interface atop gimli that could handle things like this nicely. I've found myself cribbing code from addr2line
a few times because it's got quite a few things like that. Honestly that might not be a bad place to start, just refactoring the higher-level APIs out of addr2line
into a separate crate. Things like read_ranges
and name_attr
might feel too high-level to fit into gimli itself, but they're pretty necessary for anyone writing tools to handle DWARF.