[GR-56599] Create type units for types during debuginfo generation for referencing across multiple debug info files. #9802
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.