-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[GR-56599] Create type units for types during debuginfo generation for referencing across multiple debug info files. #9802
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
6e1b849
to
12ee8a5
Compare
…ts, Bugfixes and cleanup for debug info generation
12ee8a5
to
bedc2cb
Compare
the PR is in good shape already. I only have a few questions before we can merge this:
|
...atevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/StructureTypeEntry.java
Show resolved
Hide resolved
...atevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/StructureTypeEntry.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/TypeEntry.java
Outdated
Show resolved
Hide resolved
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.
Looks good overall.
Please process the comments and we should be able to merge this soon.
substratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/TypeEntry.java
Outdated
Show resolved
Hide resolved
...tratevm/src/com.oracle.objectfile/src/com/oracle/objectfile/debugentry/ForeignTypeEntry.java
Show resolved
Hide resolved
...src/com.oracle.objectfile/src/com/oracle/objectfile/elf/dwarf/constants/DwarfUnitHeader.java
Outdated
Show resolved
Hide resolved
The time for debug info generation stays about the same, I checked that with debug info files with sizes of up to a few hundred MB.
Yes, the classloader is looked up for all types except primitives (and the single instance of the header type which represents the object header).
Overall, this achieves a reduction of around 30% in debug info size, mostly due to the dwarf5 format changes of the .debug_loc and .debug_range sections. |
Remove separate type unit for the layout of compressed types
d9d8f09
to
c64fc03
Compare
Each type is currently generated within a compilation unit, with no way to reference it from outside the
.debug_info
section. During debuginfo generation at image runtime, we have to create a separate debuginfo file that references types generated during image build. This would require to reproduce debuginfo for types that was already created at image build.One way to reference types in different objectfiles is to put them into so-called type units and create type signatures that can be used as references. Each type is placed in its own type unit and type references will be changed to refer to the type units. During the runtime debuginfo generation, we can then reference existing types by the type signature.
Type units were introduced in DWARF 4 in their own debugging section (.debug_types) and moved to the .debug_info section in DWARF 5 to reduce overhead. As a change to DWARF 5 requires little changes and makes creating type units more convenient, we will also update the DWARF version of the .debug_info section to DWARF 5.