This is an archive of the discontinued LLVM Phabricator instance.

[DWARF] Dump .gdb_index of version 8
Needs ReviewPublic

Authored by MaskRay on Jul 9 2019, 3:49 AM.

Details

Summary

gdb index version was bumped from 7 to 8 by commit 796a7ff8234cfaa8ad1ab884c1c8dafe29b18d42.
The format doesn't change.

Accept version 8 so that we can dump .gdb_index built by the 'save gdb-index' command of gdb (Jan 2013 or newer). Manually verified the result is plausible:

mkdir dir; gdb a -batch -q -ex 'save gdb-index dir'; objcopy --add-section .gdb_index=dir/a.gdb-index --set-section-flags .gdb_index=readonly a b
llvm-dwarfdump -gdb-index b

Diff Detail

Event Timeline

MaskRay created this revision.Jul 9 2019, 3:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2019, 3:49 AM
grimar added a comment.Jul 9 2019, 3:54 AM

Do you know why the version was changed but the format remained the same?

grimar added a comment.Jul 9 2019, 4:12 AM

Well, since this allows dumping the "newer" format, it looks like a step forward, so I have no objections.

test/DebugInfo/dwarfdump-dump-gdbindex.test
7

Side note: seems we might want to try to improve yaml2obj to support the .gdb_index.

ikudrin added inline comments.Jul 9 2019, 4:25 AM
test/DebugInfo/dwarfdump-dump-gdbindex.test
6

Personally, I'd prefer to have another binary file for version 8 than patching the existing one. What do you think?

MaskRay marked an inline comment as done.Jul 9 2019, 6:48 AM
MaskRay added inline comments.
test/DebugInfo/dwarfdump-dump-gdbindex.test
6

I think that is not very necessary at the moment. We can do that after the non-empty types CU list issue is fixed or when yaml2obj gets improved to handle .gdb_index