[PATCH, v1] Add code for processing version 5 DWP files (for use with DWARF v5)
Caroline Tice
cmtice@google.com
Tue Jul 21 04:06:49 GMT 2020
The DWARF v5 Spec describes a (slightly) new format for V5 .dwp files.
This patch updates GDB to allow it to read/process .dwp files in the
new DWARF v5 format, while continuing to be able to read/process .dwp
files in the older V1 & V2 formats.
The one thing I felt a little odd about in this patch: I couldn't
re-use the enum dwarf_sect
definitions, because in version 5 several of the sections have the
same name as in the previous versions, but have a different ordering,
with different numbers attached. So I had to create a new enum,
dwarf_sect_v5 for this purpose.
Is this patch ok to commit?
-- Caroline
cmtice@google.com
gdb/ChangeLog
2020-07-20 Caroline Tice <cmtice@google.com>
* dwarf2/read.c (struct dwo_file): Update comment on 'sections' field.
(struct dwp_sections): Update field comments. Add loclists and
rnglists fields.
(struct virtual_v2_dwo_sections): Rename struct to
'virtual_v2_or_v5_dwo_sections'; update comments at top of struct; add
size & offset fields for loclists and rnglists.
(struct dwp_hash_table): Add a 'v5' struct field to the union section.
(create_dwp_hash_table): Update the large comment above the function to
discuss Version 5 DWP files as well. Update all the version checks in
the function to check for version 5 as well. Add new section at the
end to create dwp hash table for version 5.
(create_dwp_v2_section): Rename function to
'create_dwp_v2_or_v5_section'. Update function comment appropriately.
Add V5 to error message text.
(create_dwo_unit_in_dwp_v2): Change calls to create_cwp_v2_section
into calls to create_dwp_v2_or_v5_section.
(create_dwo_unit_in_dwp_v5): New function.
(lookup_dwo_unit_in_dwp): Update conditional statement to explicitly
check for version2; add else clause to handle version 5.
(dwarf2_locate_v2_dwp_sections): Update function comment to mention
version 5.
(dwarf2_locate_v5_dwp_sections): New function.
(open_and_init_dwp_file): Add else-if clause for version 5 to call
bfd_map_over_sections with dwarf2_locate_v5_dwp_sections.
include/ChangeLog
2020-07-20 Caroline Tice <cmtice@google.com>
* dwarf2.h (enum dwarf_sect_v5): A new enum section for the
sections in a DWARF 5 DWP file (DWP version 5).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v1-0002-Add-code-for-processing-version-5-DWP-files-for-u.patch
Type: application/octet-stream
Size: 28980 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20200720/60e4e8ec/attachment-0001.obj>
More information about the Gdb-patches
mailing list