+
Skip to content

Add a llvm-dwarfdump inspired --debug-info [OFFSET] argument to dwarfdump. #776

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

Merged
merged 2 commits into from
Jun 30, 2025

Conversation

khuey
Copy link
Contributor

@khuey khuey commented Jun 28, 2025

This dumps only .debug_info and if the optional offset is provided only the subtree of DIEs starting at that offset.

This relies on the way parallel_output() outputs each unit to its own individual buffer that can be discarded partway through. Implementing it for .debug_types isn't possible at the moment because dump_types() outputs directly to stdout.

…dump.

This dumps only .debug_info and if the optional offset is provided only
the subtree of DIEs starting at that offset.

This relies on the way parallel_output() outputs each unit to its own individual buffer
that can be discarded partway through. Implementing it for .debug_types isn't possible
at the moment because dump_types() outputs directly to stdout.
@khuey
Copy link
Contributor Author

khuey commented Jun 28, 2025

Example output:

khuey@zhadum:~/dev/gimli$ ./target/debug/dwarfdump --debug-info=0x0000015b -G target/debug/dwarfdump

.debug_info

UNIT<.debug_info+0x00000000>: length = 0x36e, format = Dwarf32, version = 4, address_size = 8, abbrev_offset = 0x0
< 3><0x0000015b GOFF=0x0000015b>  DW_TAG_structure_type
                                    DW_AT_name                  PhantomData<core::hash::sip::Sip13Rounds>
                                    DW_AT_byte_size             0x00000000
                                    DW_AT_accessibility         DW_ACCESS_public
                                    DW_AT_alignment             0x00000001
< 4><0x00000163 GOFF=0x00000163>    DW_TAG_template_type_parameter
                                      DW_AT_type                  0x00000113<.debug_info+0x00000113>
                                      DW_AT_name                  T
< 4><0x0000016c GOFF=0x0000016c>    DW_TAG_null
< 3><0x0000016d GOFF=0x0000016d>  DW_TAG_null

@khuey khuey requested a review from philipc June 29, 2025 13:33
@philipc philipc merged commit 1ab93f1 into gimli-rs:master Jun 30, 2025
20 checks passed
@khuey
Copy link
Contributor Author

khuey commented Jul 1, 2025

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载