From 6a6429e19b0aa87f95cd20cb9df2715e6d3df6f1 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 27 Aug 2021 16:52:44 +0200 Subject: [PATCH] [gdb/testsuite] Generate .debug_aranges entry for dummy CU A best practise for DWARF [1] is to generate .debug_aranges entries for CUs even if they have no address range. Generate .debug_arange entries for the dummy CUs added by the DWARF assembler. Tested on x86_64-linux. [1] http://wiki.dwarfstd.org/index.php?title=Best_Practices --- gdb/testsuite/lib/dwarf.exp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index a058a78df2e..120fa418201 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -2419,7 +2419,11 @@ namespace eval Dwarf { # Emit a dummy CU. proc dummy_cu {} { # Generate a CU with default options and empty body. - cu {} { + cu {label dummy_cu} { + } + + # Generate an .debug_aranges entry for the dummy CU. + aranges {} dummy_cu { } } -- 2.30.2