From: Will Hawkins Date: Thu, 18 Apr 2024 11:28:52 +0000 (+0200) Subject: Add DW_TAG_compile_unit DIE to Dummy CUs X-Git-Tag: gdb-15-branchpoint~355 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41d5ff24c6723b87ada11c1287f50cb87f7d89e2;p=thirdparty%2Fbinutils-gdb.git 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 Approved-By: Tom de Vries Tested-By: Tom de Vries --- diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index c694375b534..1a97f83f8e6 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -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.