Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nils-Christian Kempke via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Cc: JiniSusan.George@amd.com, aburgess@redhat.com
Subject: [PATCH 12/18] testsuite/lib: add check_optional_entry for GDBInfoSymbols
Date: Tue, 10 May 2022 16:24:31 +0200	[thread overview]
Message-ID: <20220510142437.1397399-13-nils-christian.kempke@intel.com> (raw)
In-Reply-To: <20220510142437.1397399-1-nils-christian.kempke@intel.com>

There was already a similar functionality for the GDBInfoModuleSymbols.
This just extends the GDBInfoSymbols.  We will use this feature in a
later commit to make a testcase less GNU specific and more flexible for
other compilers.

Namely, in gdb.fortran/info-types.exp currenlty
GDBInfoSymbols::check_entry is used to verify and test the output of the
info symbols command.  The test, however was written with gfortran as a
basis and some of the tests are not fair with e.g. ifx and ifort as
they test for symbols that are not actually required to be emitted.  The
lines
   GDBInfoSymbols::check_entry "${srcfile}" "" "${character1}"
and
   GDBInfoSymbols::check_entry "${srcfile}" "37" "Type s1;"

check for types that are either not used in the source file (character1)
or should not be emitted by the compiler at global scope (s1) thus no
appearing in the info symbols command.  In order to fix this we will
later use the newly introduced check_optional_entry over check_entry.
---
 gdb/testsuite/lib/sym-info-cmds.exp | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/lib/sym-info-cmds.exp b/gdb/testsuite/lib/sym-info-cmds.exp
index f0272a0334..ce878f0d50 100644
--- a/gdb/testsuite/lib/sym-info-cmds.exp
+++ b/gdb/testsuite/lib/sym-info-cmds.exp
@@ -163,6 +163,16 @@ namespace eval GDBInfoSymbols {
 	gdb_assert {[regexp -- $pattern $_header]} $testname
     }
 
+    # Call check_entry_1 with OPTIONAL == 0.
+    proc check_entry { filename lineno text { testname "" } } {
+	check_entry_1 $filename $lineno $text 0 $testname
+    }
+
+    # Call check_entry_1 with OPTIONAL == 1.
+    proc check_optional_entry { filename lineno text { testname "" } } {
+	check_entry_1 $filename $lineno $text 1 $testname
+    }
+
     # Check that we have an entry in _entries matching FILENAME,
     # LINENO, and TEXT.  If LINENO is the empty string it is replaced
     # with the string NONE in order to match a similarly missing line
@@ -174,7 +184,7 @@ namespace eval GDBInfoSymbols {
     # If a matching entry is found then it is removed from the
     # _entries list, this allows us to check for duplicates using the
     # check_no_entry call.
-    proc check_entry { filename lineno text { testname "" } } {
+    proc check_entry_1 { filename lineno text optional testname } {
 	variable _entries
 	variable _last_command
 
@@ -209,7 +219,11 @@ namespace eval GDBInfoSymbols {
 	}
 
 	set _entries $new_entries
-	gdb_assert { $found_match } $testname
+	if { $optional && ! $found_match } {
+	    unsupported $testname
+	} else {
+	    gdb_assert { $found_match } $testname
+	}
     }
 
     # Check that there is no entry in the _entries list matching
-- 
2.25.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


  parent reply	other threads:[~2022-05-10 14:30 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 14:24 [PATCH 00/18] Fortran compiler identification and ifx testsuite support Nils-Christian Kempke via Gdb-patches
2022-05-10 14:24 ` [PATCH 01/18] gdb/testsuite: remove F77_FOR_TARGET support Nils-Christian Kempke via Gdb-patches
2022-05-10 14:24 ` [PATCH 02/18] gdb/testsuite: Use -module option for Intel Fortran compilers Nils-Christian Kempke via Gdb-patches
2022-05-10 14:24 ` [PATCH 03/18] gdb/testsuite: Fix fortran types for Intel compilers Nils-Christian Kempke via Gdb-patches
2022-05-11  9:49   ` Andrew Burgess via Gdb-patches
2022-05-11  9:57     ` Kempke, Nils-Christian via Gdb-patches
2022-05-10 14:24 ` [PATCH 04/18] gdb/testsuite: add local variable for passing 'getting_compiler_info' to gdb_compile Nils-Christian Kempke via Gdb-patches
2022-05-11 10:10   ` Andrew Burgess via Gdb-patches
2022-05-11 14:24     ` Kempke, Nils-Christian via Gdb-patches
2022-05-10 14:24 ` [PATCH 05/18] gdb/testsuite: add Fortran compiler identification to GDB Nils-Christian Kempke via Gdb-patches
2022-05-10 14:24 ` [PATCH 06/18] gdb/testsuite: rename intel next gen c/cpp compilers Nils-Christian Kempke via Gdb-patches
2022-05-11 11:23   ` Andrew Burgess via Gdb-patches
2022-05-11 14:28     ` Kempke, Nils-Christian via Gdb-patches
2022-05-10 14:24 ` [PATCH 07/18] gdb/testsuite: disable charset.exp for intel compilers Nils-Christian Kempke via Gdb-patches
2022-05-10 14:24 ` [PATCH 08/18] testsuite, fortran: make print-formatted.exp more robust Nils-Christian Kempke via Gdb-patches
2022-05-11 11:32   ` Andrew Burgess via Gdb-patches
2022-05-11 14:32     ` Kempke, Nils-Christian via Gdb-patches
2022-05-10 14:24 ` [PATCH 09/18] testsuite, fortran: add required external keyword Nils-Christian Kempke via Gdb-patches
2022-05-10 14:24 ` [PATCH 10/18] testsuite, fortran: add compiler dependent types to dynamic-ptype-whatis Nils-Christian Kempke via Gdb-patches
2022-05-10 14:24 ` [PATCH 11/18] testsuite, fortran: Add '-debug-parameters all' when compiling with ifx Nils-Christian Kempke via Gdb-patches
2022-05-11 11:56   ` Andrew Burgess via Gdb-patches
2022-05-11 14:36     ` Kempke, Nils-Christian via Gdb-patches
2022-05-10 14:24 ` Nils-Christian Kempke via Gdb-patches [this message]
2022-05-10 14:24 ` [PATCH 13/18] testsuite, fortran: fix info-types for intel compilers Nils-Christian Kempke via Gdb-patches
2022-05-11 12:06   ` Andrew Burgess via Gdb-patches
2022-05-11 15:20     ` Kempke, Nils-Christian via Gdb-patches
2022-05-11 16:43       ` Kempke, Nils-Christian via Gdb-patches
2022-05-30 10:33         ` Andrew Burgess via Gdb-patches
2022-05-30 10:32       ` Andrew Burgess via Gdb-patches
2022-05-10 14:24 ` [PATCH 14/18] testsuite, fortran: Add type info of formal parameter for Intel compilers Nils-Christian Kempke via Gdb-patches
2022-05-10 14:24 ` [PATCH 15/18] testsuite, fortran: allow additional completions in module.exp Nils-Christian Kempke via Gdb-patches
2022-05-10 14:24 ` [PATCH 16/18] gdb, testsuite, fortran: fix double free in mixed-lang-stack.exp Nils-Christian Kempke via Gdb-patches
2022-05-10 14:24 ` [PATCH 17/18] gdb, testsuite, fortran: fixup mixed-lang-stack for Intel/LLVM compilers Nils-Christian Kempke via Gdb-patches
2022-05-10 14:24 ` [PATCH 18/18] gdb/testsuite: fixup common-block.exp for intel compilers Nils-Christian Kempke via Gdb-patches
2022-05-11 13:29   ` Andrew Burgess via Gdb-patches
2022-05-11 15:31     ` Kempke, Nils-Christian via Gdb-patches
2022-05-16  6:36       ` George, Jini Susan via Gdb-patches
2022-05-16  7:59         ` Kempke, Nils-Christian via Gdb-patches
2022-05-11 13:32 ` [PATCH 00/18] Fortran compiler identification and ifx testsuite support Andrew Burgess via Gdb-patches

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=20220510142437.1397399-13-nils-christian.kempke@intel.com \
    --to=gdb-patches@sourceware.org \
    --cc=JiniSusan.George@amd.com \
    --cc=aburgess@redhat.com \
    --cc=nils-christian.kempke@intel.com \
    /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