gimli-rs / gimli

A library for reading and writing the DWARF debugging format
https://docs.rs/gimli/
Apache License 2.0
853 stars 108 forks source link

Introduce new enum for `.dwo` section IDs #716

Closed jameysharp closed 6 months ago

jameysharp commented 6 months ago

Keeping this type distinct from the SectionId enum ensures that the compiler will report an error if someone adds incomplete support for new separate-debug sections.

As discussed in: https://github.com/gimli-rs/gimli/pull/714#discussion_r1611164319

The existing SectionId::dwo_name method did not match the list of sections actually supported elsewhere in gimli. I've added the one section ID that was missing (.debug_macinfo.dwo), but I have not removed the section IDs which are only present there: .debug_str.dwo, .debug_cu_index, and .debug_tu_index.

jameysharp commented 6 months ago

No problem; done. Almost everything I know about DWARF today is stuff I learned this week, so you could easily convince me either way. I'm always happy to take advice.

philipc commented 6 months ago

Do you have plans for more gimli work? If not I'll do a release soon (along with object and addr2line).

jameysharp commented 6 months ago

I don't have anything more planned right now. I kind of wanted to improve the string formatting of the Error type, both to include the data associated with the various Unknown and Unsupported variants, and also ideally to attach a ReaderOffsetId to every error, not just UnexpectedEof. But I don't think I actually have the energy for either of those projects at the moment.

I intend to dig into the support for DWARF that's in Wasmtime and Cranelift, so it's possible I'll find more things I'd like from gimli along the way. But for now, I think a new release would be great. Thanks for your help getting these changes merged so promptly!