]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add DW_TAG_compile_unit DIE to Dummy CUs
authorWill Hawkins <hawkinsw@obs.cr>
Thu, 18 Apr 2024 11:28:52 +0000 (13:28 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 18 Apr 2024 11:28:52 +0000 (13:28 +0200)
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>
gdb/testsuite/lib/dwarf.exp

index c694375b5343e5e0198fb20973d92811d4cfb91e..1a97f83f8e60b8573fe6953ec8f55e91b9ebe0c8 100644 (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.