-
Notifications
You must be signed in to change notification settings - Fork 119
Add support for reading items from .debug_macinfo #759
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
Conversation
Thanks for working on this. I haven't reviewed your changes, but I wanted to do a quick comparision with the llvm output so I tried running dwarfdump on a file here and I get output like:
For reference, llvm-dwarfdump simply gives the offset and lists the macinfo contents elsewhere:
Note that in addition to missing a line break, the gimli output only gives one line of the macinfo data, whereas there are many more lines that would be useful to see. So I think the way llvm-dwarfdump does it is better. It's also better to simply list the constants and arguments (such as |
I just updated my branch: As a result, i changed |
New update - as far as I can tell I've addressed all of your comments. The module is renamed to |
The style used in this crate is to always expose a |
Oh, I see. In that case, what is the benefit of the fallible-iterator crate? |
The |
In case you missed it - my last push yesterday changed the iterator implementation, so fallible-iterator is no longer required. |
Done! |
Oof. That's the result of trying to automatically rename through rust-language-server, and I didn't check the diff afterwards. It's fixed now. |
The section .debug_macinfo was specified in DWARF standards v2, v3 and v4. It was replaced by .debug_macro in DWARF v5. The content of .debug_macinfo is represented through the enum DebugMacInfoItem. It has variants for each specified type: - macro defined - macro undefined - file includd - end of include - vendor extension - end of unit A DW_AT_macro_info attribute points to a list of macros that were defined in the unit. To handle this, get_macinfo(offset) returns an iterator over the items found starting at the offset. This change does not implement writing of .debug_macinfo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
The section .debug_macinfo was specified in DWARF standards v2, v3 and v4. It was replaced by .debug_macro in DWARF v5. The content of .debug_macinfo is represented through the enum DebugMacInfoItem. It has variants for each specified type:
This change does not implement writing of .debug_macinfo.