From patchwork Sun Dec 10 16:45:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 81818 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9EAB5385332C for ; Sun, 10 Dec 2023 16:46:05 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id 02B2C3858291 for ; Sun, 10 Dec 2023 16:45:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 02B2C3858291 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 02B2C3858291 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702226712; cv=none; b=gJeqa5ypUl0Y1MmVtaWLwu1EFKAsHgf0oU9HSQma2eCtLiN+0YGmySP2qT6c094MjphhSRWHBXxGJ5MevQVVmQ1sUtLOYCYrAa90gRrkUQyoqDaQTQtNCX9ELLnWkevQj2FxgcwtjSryMjGPYO+jN2G2QQ6Qv1oKMATt/iKGb1Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702226712; c=relaxed/simple; bh=eQapzvBGhAj1J6l5eRkSD0HSb4CkU81a9K74cS64yaU=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=UBqdCAS1HTMdTJkKYRFU6fbPNDu3dB2nWlFDI2O3hf4Dq1GBBMNn2qF+njzHLWwlEm85gbNvad2BkRaYgx14mlrd0pVnqWllGEMYAkVqzzxMCJG8AIhiugXBDvziCohbBtHx4xi/H6ZuYBPtAykd4DET7EzPNRfhS1FSqmBYKXY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5007a.ext.cloudfilter.net ([10.0.29.141]) by cmsmtp with ESMTPS id CCrDrAUKSL9AgCMvSrXN6n; Sun, 10 Dec 2023 16:45:06 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id CMvQrggETqkaTCMvRrWB8Y; Sun, 10 Dec 2023 16:45:05 +0000 X-Authority-Analysis: v=2.4 cv=bY547cDB c=1 sm=1 tr=0 ts=6575eb11 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=e2cXIFwxEfEA:10 a=Qbun_eYptAEA:10 a=mDV3o1hIAAAA:8 a=o9MxjqpwUOqBvTneeHYA:9 a=QEXdDO2ut3YA:10 a=gDReK6rTb-M7_I2FheKW:22 a=_FVE-zBwftR9WsbkzFJk:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7Tw35z794S41FwHpi3/K4SaURZl84Jpd+5cg5ERm43A=; b=cqzWZlc0jYPYYne4yPSB9KLkPJ 01yJGlEpWgxI6kjMYgNioHH2D9whok3ZSOxrLOhLp8XduhKB8AkT3tk0IHYBmTyKl2W/C0LiXpNZZ U8z/d8p9HIE5VsGcn887HLSip; Received: from [198.59.47.65] (port=52394 helo=[192.168.131.83]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rCMvQ-001rpu-2F for gdb-patches@sourceware.org; Sun, 10 Dec 2023 09:45:04 -0700 From: Tom Tromey Date: Sun, 10 Dec 2023 09:45:03 -0700 Subject: [PATCH 14/17] Remove some .debug_names tests MIME-Version: 1.0 Message-Id: <20231210-debug-names-fix-v1-14-a8f6d2525018@tromey.com> References: <20231210-debug-names-fix-v1-0-a8f6d2525018@tromey.com> In-Reply-To: <20231210-debug-names-fix-v1-0-a8f6d2525018@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.4 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 198.59.47.65 X-Source-L: No X-Exim-ID: 1rCMvQ-001rpu-2F X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.131.83]) [198.59.47.65]:52394 X-Source-Auth: tom+tromey.com X-Email-Count: 15 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfHELWVMOAEf8bkIaMDOxOpSHwYNV5Zf6suUpMGT3UgIPLcNvbKz465rW4X/0N681Tp8Zx1DJUp1idP0CBaOL79BHxe7uRq1s0jhYCitujQn4of4b/l6Z x8ug5wuSld+zuWVv3pDzjYv2saiDFznkeCZqa/O/j/zU7RJAXN+ufpmeSRWhycfJ7MOTbWTaoRy6CvPJyINzGj1x2YBJZs+tIFQ= X-Spam-Status: No, score=-3024.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_SHORT, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org These .debug_names tests were hand-written to mimic clang. However, they are difficult to update, and in any case the new reader won't accept clang-generated indices. Therefore this patch removes these tests. --- gdb/testsuite/gdb.dwarf2/clang-debug-names-2-foo.c | 22 ---- gdb/testsuite/gdb.dwarf2/clang-debug-names-2.c | 27 ----- gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp | 42 ------- gdb/testsuite/gdb.dwarf2/clang-debug-names.c | 25 ----- gdb/testsuite/gdb.dwarf2/clang-debug-names.exp | 42 ------- gdb/testsuite/gdb.dwarf2/clang-debug-names.exp.tcl | 121 --------------------- 6 files changed, 279 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names-2-foo.c b/gdb/testsuite/gdb.dwarf2/clang-debug-names-2-foo.c deleted file mode 100644 index aff6d60d861..00000000000 --- a/gdb/testsuite/gdb.dwarf2/clang-debug-names-2-foo.c +++ /dev/null @@ -1,22 +0,0 @@ -/* This testcase is part of GDB, the GNU debugger. - - Copyright 2020-2023 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -int -foo (void) -{ - return 3; -} diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.c b/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.c deleted file mode 100644 index 4887f95ed60..00000000000 --- a/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.c +++ /dev/null @@ -1,27 +0,0 @@ -/* This testcase is part of GDB, the GNU debugger. - - Copyright 2020-2023 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -extern int foo (void); - -int -main (void) -{ - asm ("main_label: .globl main_label"); - int sum, a, b; - sum = a + b + foo (); - return sum; -} diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp b/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp deleted file mode 100644 index 7bc46ce6531..00000000000 --- a/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2020-2023 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -load_lib dwarf.exp - -# This test can only be run on targets which support DWARF-2 and use gas. -require dwarf2_support - -standard_testfile .c -debug.S -foo.c - -lassign \ - [function_range main \ - "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile3}"] \ - main_start main_length - -set asm_file [standard_output_file $srcfile2] -source $srcdir/$subdir/clang-debug-names.exp.tcl - -if { [build_executable_from_specs "failed to prepare" ${testfile} "" \ - $srcfile "nodebug" $asm_file "nodebug" $srcfile3 "debug"] } { - return -1 -} -clean_restart $binfile - -set cmd "ptype main" -set pass_re \ - [multi_line \ - $cmd \ - "type = int \\(\\)"] -gdb_test $cmd $pass_re diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names.c b/gdb/testsuite/gdb.dwarf2/clang-debug-names.c deleted file mode 100644 index 12f184b0f85..00000000000 --- a/gdb/testsuite/gdb.dwarf2/clang-debug-names.c +++ /dev/null @@ -1,25 +0,0 @@ -/* This testcase is part of GDB, the GNU debugger. - - Copyright 2020-2023 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -int -main (void) -{ - asm ("main_label: .globl main_label"); - int sum, a, b; - sum = a + b; - return sum; -} diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp deleted file mode 100644 index 138bd86daee..00000000000 --- a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2020-2023 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -load_lib dwarf.exp - -# This test can only be run on targets which support DWARF-2 and use gas. -require dwarf2_support - -standard_testfile .c -debug.S - -lassign [function_range main ${srcdir}/${subdir}/${srcfile}] \ - main_start main_length - -set asm_file [standard_output_file $srcfile2] -source $srcdir/$subdir/clang-debug-names.exp.tcl - -if { [prepare_for_testing "failed to prepare" ${testfile} \ - [list $srcfile $asm_file] {nodebug}] } { - return -1 -} - -set test "no file command warnings" -gdb_assert { [regexp "warning: " $gdb_file_cmd_msg] == 0 } $test - -set cmd "ptype main" -set pass_re \ - [multi_line \ - $cmd \ - "type = int \\(\\)"] -gdb_test $cmd $pass_re diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp.tcl b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp.tcl deleted file mode 100644 index dca17fb86b7..00000000000 --- a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp.tcl +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright 2020-2023 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Set up the DWARF for the test. - -set main_str_label [Dwarf::_compute_label info_string3] -set int_str_label [Dwarf::_compute_label info_string4] -set main_die_label [Dwarf::_compute_label main_die_label] -set int_die_label [Dwarf::_compute_label int_die_label] - -set debug_str \ - [list \ - "$main_str_label:" \ - " .asciz \"main\"" \ - "$int_str_label:" \ - " .asciz \"int\""] - -set debug_names \ - [list \ - " .4byte .Ldebug_names_end - .Ldebug_names_start" \ - ".Ldebug_names_start:" \ - " .short 5 /* Header: version */" \ - " .short 0 /* Header: padding */" \ - " .long 1 /* Header: compilation unit count */" \ - " .long 0 /* Header: local type unit count */" \ - " .long 0 /* Header: foreign type unit count */" \ - " .long 2 /* Header: bucket count */" \ - " .long 2 /* Header: name count */" \ - " .long .Lnames_abbrev_end0-.Lnames_abbrev_start0 " \ - " /* Header: abbreviation table size */" \ - " .long 8 /* Header: augmentation string size */" \ - " .ascii \"LLVM0700\" /* Header: augmentation string */" \ - " .long .Lcu1_begin /* Compilation unit 0 */" \ - " .long 1 /* Bucket 0 */" \ - " .long 0 /* Bucket 1 */" \ - " .long 193495088 /* Hash in Bucket 0 */" \ - " .long 2090499946 /* Hash in Bucket 0 */" \ - " .long $int_str_label /* String in Bucket 0: int */" \ - " .long $main_str_label /* String in Bucket 0: main */" \ - " .long .Lnames1-.Lnames_entries0/* Offset in Bucket 0 */" \ - " .long .Lnames0-.Lnames_entries0/* Offset in Bucket 0 */" \ - ".Lnames_abbrev_start0:" \ - " .byte 46 /* Abbrev code */" \ - " .byte 46 /* DW_TAG_subprogram */" \ - " .byte 3 /* DW_IDX_die_offset */" \ - " .byte 19 /* DW_FORM_ref4 */" \ - " .byte 0 /* End of abbrev */" \ - " .byte 0 /* End of abbrev */" \ - " .byte 36 /* Abbrev code */" \ - " .byte 36 /* DW_TAG_base_type */" \ - " .byte 3 /* DW_IDX_die_offset */" \ - " .byte 19 /* DW_FORM_ref4 */" \ - " .byte 0 /* End of abbrev */" \ - " .byte 0 /* End of abbrev */" \ - " .byte 0 /* End of abbrev list */" \ - ".Lnames_abbrev_end0:" \ - ".Lnames_entries0:" \ - ".Lnames1:" \ - " .byte 36 /* Abbreviation code */" \ - " .long $int_die_label - .Lcu1_begin/* DW_IDX_die_offset */" \ - " .long 0 /* End of list: int */" \ - ".Lnames0:" \ - " .byte 46 /* Abbreviation code */" \ - " .long $main_die_label - .Lcu1_begin/* DW_IDX_die_offset */" \ - " .long 0 /* End of list: main */" \ - " .p2align 2" \ - ".Ldebug_names_end:"] - -Dwarf::assemble $asm_file { - global srcdir subdir srcfile - global main_start main_length - - cu {} { - DW_TAG_compile_unit { - {DW_AT_language @DW_LANG_C} - {DW_AT_name clang-debug-names.c} - {DW_AT_comp_dir /tmp} - - } { - global int_die_label - global main_die_label - - define_label $int_die_label - base_type { - {name "int"} - {encoding @DW_ATE_signed} - {byte_size 4 DW_FORM_sdata} - } - - define_label $main_die_label - subprogram { - {name main} - {type :$int_die_label} - {low_pc $main_start addr} - {high_pc "$main_start + $main_length" addr} - } - } - } - - _defer_output .debug_str { - global debug_str - _emit [join $debug_str "\n"] - } - - _defer_output .debug_names { - global debug_names - _emit [join $debug_names "\n"] - } -}