public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 14/17] Remove some .debug_names tests
Date: Sun, 10 Dec 2023 09:45:03 -0700	[thread overview]
Message-ID: <20231210-debug-names-fix-v1-14-a8f6d2525018@tromey.com> (raw)
In-Reply-To: <20231210-debug-names-fix-v1-0-a8f6d2525018@tromey.com>

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 <http://www.gnu.org/licenses/>.  */
-
-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 <http://www.gnu.org/licenses/>.  */
-
-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 <http://www.gnu.org/licenses/>.
-
-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 <http://www.gnu.org/licenses/>.  */
-
-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 <http://www.gnu.org/licenses/>.
-
-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 <http://www.gnu.org/licenses/>.
-
-# 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"]
-    }
-}

-- 
2.43.0


  parent reply	other threads:[~2023-12-10 16:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-10 16:44 [PATCH 00/17] Rewrite .debug_names reader and writer Tom Tromey
2023-12-10 16:44 ` [PATCH 01/17] Refactor 'maint set dwarf synchronous' handling Tom Tromey
2023-12-10 16:44 ` [PATCH 02/17] Refactor quick-function installation in DWARF reader Tom Tromey
2023-12-10 16:44 ` [PATCH 03/17] Remove IS_ENUM_CLASS from cooked_index_flag Tom Tromey
2023-12-10 16:44 ` [PATCH 04/17] Add some new DW_IDX_* values Tom Tromey
2024-01-09 15:08   ` Tom Tromey
2024-01-09 19:02     ` Tom Tromey
2023-12-10 16:44 ` [PATCH 05/17] Document GDB extensions to DWARF .debug_names Tom Tromey
2023-12-10 17:37   ` Eli Zaretskii
2024-01-17 16:24     ` Tom Tromey
2023-12-10 16:44 ` [PATCH 06/17] Add language to cooked_index_entry Tom Tromey
2023-12-10 16:44 ` [PATCH 07/17] Move cooked_index_functions to cooked-index.h Tom Tromey
2023-12-10 16:44 ` [PATCH 08/17] Do not write the index cache from an index Tom Tromey
2023-12-10 16:44 ` [PATCH 09/17] Change cooked_index_worker to abstract base class Tom Tromey
2023-12-10 16:44 ` [PATCH 10/17] Remove cooked_index_worker::start_reading Tom Tromey
2023-12-10 16:45 ` [PATCH 11/17] Empty hash table fix in .debug_names reader Tom Tromey
2023-12-10 16:45 ` [PATCH 12/17] Fix dw2-zero-range.exp when an index is in use Tom Tromey
2023-12-10 16:45 ` [PATCH 13/17] Explicitly expand CUs in dw2-inline-with-lexical-scope.exp Tom Tromey
2023-12-10 16:45 ` Tom Tromey [this message]
2023-12-10 16:45 ` [PATCH 15/17] Rewrite .debug_names reader Tom Tromey
2023-12-10 16:45 ` [PATCH 16/17] Export dwarf5_augmentation Tom Tromey
2023-12-10 16:45 ` [PATCH 17/17] Rewrite .debug_names writer Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231210-debug-names-fix-v1-14-a8f6d2525018@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).