From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id A0FB63857C7B for ; Thu, 26 Aug 2021 11:57:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A0FB63857C7B Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D019120192 for ; Thu, 26 Aug 2021 11:57:50 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id BA47813318 for ; Thu, 26 Aug 2021 11:57:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id AChbLL6BJ2EDPgAAGKfGzw (envelope-from ) for ; Thu, 26 Aug 2021 11:57:50 +0000 Date: Thu, 26 Aug 2021 13:57:49 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH][gdb/testsuite] Add .debug_aranges in more test-cases Message-ID: <20210826115747.GA22794@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2021 11:58:02 -0000 Hi, A couple of test-cases fail when run with target board cc-with-debug-names due to missing .debug_aranges entries for the CUs added by the dwarf assembler. Add a .debug_aranges entry for those CUs. Tested on x86_64-linux. Any comments? Thanks, - Tom [gdb/testsuite] Add .debug_aranges in more test-cases --- gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp | 10 ++++++++-- gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp | 8 ++++++-- .../gdb.dwarf2/template-specification-full-name.exp | 13 ++++++++++++- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp index 4a9634e5418..a17d6259ffb 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp @@ -37,7 +37,7 @@ standard_testfile .c -dw.S set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { global srcdir subdir srcfile srcfile2 - declare_labels ranges_label + declare_labels ranges_label cu_label declare_labels L # Find start address and length for our functions. @@ -52,7 +52,7 @@ Dwarf::assemble $asm_file { # this information being correct (w.r.t. funtion / argument types) # just so long as the compilation using makes use of the # .debug_ranges data then the test achieves its objective. - cu {} { + cu { label cu_label } { compile_unit { {language @DW_LANG_C} {name dw-ranges-base.c} @@ -123,6 +123,12 @@ Dwarf::assemble $asm_file { range 0 [lindex $frame3_func 1] } } + + aranges {} cu_label { + arange [lindex $main_func 0] [lindex $main_func 1] + arange [lindex $frame2_func 0] [lindex $frame2_func 1] + arange [lindex $frame3_func 0] [lindex $frame3_func 1] + } } if { [prepare_for_testing "failed to prepare" ${testfile} \ diff --git a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp index 76b90f23976..5dc08090fef 100644 --- a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp +++ b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp @@ -38,12 +38,12 @@ Dwarf::assemble $dwarf_asm { global srcfile declare_labels foo_subprogram bar_subprogram - declare_labels stmt_list + declare_labels stmt_list cu_label # See the comment in the .S file for the equivalent C program this is meant # to represent. - cu { addr_size 4 } { + cu { label cu_label addr_size 4 } { DW_TAG_compile_unit { {DW_AT_name $srcfile} {DW_AT_stmt_list $stmt_list DW_FORM_sec_offset} @@ -93,6 +93,10 @@ Dwarf::assemble $dwarf_asm { include_dir "/some/directory" file_name "/some/directory/file.c" 0 } + + aranges {} cu_label { + arange __cu_low_pc __cu_high_pc + } } if { [build_executable ${testfile}.exp ${testfile} "$srcfile $dwarf_asm" \ diff --git a/gdb/testsuite/gdb.dwarf2/template-specification-full-name.exp b/gdb/testsuite/gdb.dwarf2/template-specification-full-name.exp index cf61e330ec4..0cba935845f 100644 --- a/gdb/testsuite/gdb.dwarf2/template-specification-full-name.exp +++ b/gdb/testsuite/gdb.dwarf2/template-specification-full-name.exp @@ -28,9 +28,16 @@ if {![dwarf2_support]} { standard_testfile main.c .S +lassign [function_range main ${srcdir}/${subdir}/${srcfile}] \ + main_start main_length + set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { - cu {} { + global main_start main_length + + declare_labels cu_start + + cu { label cu_start } { DW_TAG_compile_unit { {DW_AT_language @DW_LANG_C_plus_plus} } { @@ -62,6 +69,10 @@ Dwarf::assemble $asm_file { } } } + + aranges {} cu_start { + arange "$main_start" "$main_length" + } } if { [prepare_for_testing "failed to prepare" ${testfile} \