Add DW_TAG_compile_unit DIE to Dummy CUs

Dummy CUs help detect errors and are very helpful. However, the DWARF
spec seems to indicate the CUs need a DW_TAG_compile_unit in addition to
the header. This patch adds that.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31650

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
Approved-By: Tom de Vries <tdevries@suse.de>
Tested-By: Tom de Vries <tdevries@suse.de>
This commit is contained in:
Will Hawkins 2024-04-18 13:28:52 +02:00 committed by Tom de Vries
parent ebf1867135
commit 41d5ff24c6

View File

@ -2999,6 +2999,7 @@ namespace eval Dwarf {
proc dummy_cu {} {
# Generate a CU with default options and empty body.
cu {label dummy_cu} {
compile_unit {}
}
# Generate an .debug_aranges entry for the dummy CU.