Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Accept new complex print style in mixed-lang-stack.exp
Date: Thu, 2 Apr 2020 08:42:03 +0200	[thread overview]
Message-ID: <98be8190-d392-804f-863a-c24fd7193b85@suse.de> (raw)
In-Reply-To: <20200320215340.16749-4-tom@tromey.com>

[-- Attachment #1: Type: text/plain, Size: 2127 bytes --]

[ was: Re: [PATCH v2 3/7] Change how complex types are printed in C ]

On 20-03-2020 22:53, Tom Tromey wrote:
> GCC accepts the "i" suffix for complex numbers.  I think this is nicer
> to read than the current output, so this patch changes the C code to
> print complex numbers this way.
> 
> gdb/ChangeLog
> 2020-03-20  Tom Tromey  <tom@tromey.com>
> 
> 	* c-valprint.c (c_decorations): Change complex suffix to "i".
> 
> gdb/testsuite/ChangeLog
> 2020-03-20  Tom Tromey  <tom@tromey.com>
> 
> 	* gdb.compile/compile.exp: Update.
> 	* gdb.compile/compile-cplus.exp: Update.
> 	* gdb.base/varargs.exp: Update.
> 	* gdb.base/floatn.exp: Update.
> 	* gdb.base/endianity.exp: Update.
> 	* gdb.base/callfuncs.exp (do_function_calls): Update.
> 	* gdb.base/funcargs.exp (complex_args, complex_integral_args)
> 	(complex_float_integral_args): Update.
> 	* gdb.base/complex.exp: Update.
> 	* gdb.base/complex-parts.exp: Update.
> ---
>  gdb/ChangeLog                               |  4 ++++
>  gdb/c-valprint.c                            |  2 +-
>  gdb/testsuite/ChangeLog                     | 13 +++++++++++++
>  gdb/testsuite/gdb.base/callfuncs.exp        |  6 +++---
>  gdb/testsuite/gdb.base/complex-parts.exp    |  6 +++---
>  gdb/testsuite/gdb.base/complex.exp          |  4 ++--
>  gdb/testsuite/gdb.base/endianity.exp        |  4 ++--
>  gdb/testsuite/gdb.base/floatn.exp           | 13 +++++--------
>  gdb/testsuite/gdb.base/funcargs.exp         | 20 ++++++++++----------
>  gdb/testsuite/gdb.base/varargs.exp          |  6 +++---
>  gdb/testsuite/gdb.compile/compile-cplus.exp |  2 +-
>  gdb/testsuite/gdb.compile/compile.exp       |  2 +-
>  12 files changed, 48 insertions(+), 34 deletions(-)
> 
> diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
> index 76a86faea6a..bde9c6cc883 100644
> --- a/gdb/c-valprint.c
> +++ b/gdb/c-valprint.c
> @@ -121,7 +121,7 @@ static const struct generic_val_print_decorations c_decorations =
>  {
>    "",
>    " + ",
> -  " * I",
> +  "i",
>    "true",
>    "false",
>    "void",

This broke gdb.fortran/mixed-lang-stack.exp, fixed in patch below.

Committed as obvious.

Thanks,
- Tom

[-- Attachment #2: 0001-gdb-testsuite-Accept-new-complex-print-style-in-mixed-lang-stack.exp.patch --]
[-- Type: text/x-patch, Size: 1785 bytes --]

[gdb/testsuite] Accept new complex print style in mixed-lang-stack.exp

Since commit 981c08ce72 "Change how complex types are printed in C", we see
these FAILs:
...
FAIL: gdb.fortran/mixed-lang-stack.exp: lang=auto: info args in frame #6
FAIL: gdb.fortran/mixed-lang-stack.exp: lang=c: info args in frame #6
FAIL: gdb.fortran/mixed-lang-stack.exp: lang=c: info args in frame #7
FAIL: gdb.fortran/mixed-lang-stack.exp: lang=c++: info args in frame #6
FAIL: gdb.fortran/mixed-lang-stack.exp: lang=c++: info args in frame #7
...

The problem is that printing of complex types has changed from:
...
d = 4 + 5 * I
...
to:
...
d = 4 + 5i
...
but the test-case still checks for the old printing style.

Fix this by updating the test-case to check for the new style.

gdb/testsuite/ChangeLog:

2020-04-02  Tom de Vries  <tdevries@suse.de>

	* gdb.fortran/mixed-lang-stack.exp: Accept new complex printing style.

---
 gdb/testsuite/gdb.fortran/mixed-lang-stack.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp b/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp
index c0531c3fd9..793318626d 100644
--- a/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp
+++ b/gdb/testsuite/gdb.fortran/mixed-lang-stack.exp
@@ -106,7 +106,7 @@ proc run_tests { lang } {
 	    set d_pattern "\\(4,5\\)"
 	    set f_pattern "$hex 'abcdef\\\\000'"
 	} else {
-	    set d_pattern "4 \\+ 5 \\* I"
+	    set d_pattern "4 \\+ 5i"
 	    set f_pattern "$hex \"abcdef\""
 	}
 
@@ -134,7 +134,7 @@ proc run_tests { lang } {
 	    "info frame in frame #7"
 
 	if { $lang == "c" || $lang == "c++" } {
-	    set d_pattern "4 \\+ 5 \\* I"
+	    set d_pattern "4 \\+ 5i"
 	    set e_pattern "\"abcdef\""
 	    set g_pattern "\{a = 1.5, b = 2.5\}"
 	} else {

  reply	other threads:[~2020-04-02  6:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-20 21:53 [PATCH v2 0/7] Update complex number support Tom Tromey
2020-03-20 21:53 ` [PATCH v2 1/7] Change how complex types are created Tom Tromey
2020-04-02 14:59   ` Aktemur, Tankut Baris
2020-04-02 19:17     ` Tom Tromey
2020-03-20 21:53 ` [PATCH v2 2/7] Add accessors for members of complex numbers Tom Tromey
2020-03-20 21:53 ` [PATCH v2 3/7] Change how complex types are printed in C Tom Tromey
2020-04-02  6:42   ` Tom de Vries [this message]
2020-04-02 13:30     ` [committed][gdb/testsuite] Accept new complex print style in mixed-lang-stack.exp Tom Tromey
2020-03-20 21:53 ` [PATCH v2 4/7] Change the C parser to allow complex constants Tom Tromey
2020-03-20 21:53 ` [PATCH v2 5/7] Implement complex arithmetic Tom Tromey
2020-03-20 21:53 ` [PATCH v2 6/7] Add _Complex type support to C parser Tom Tromey
2020-03-20 21:53 ` [PATCH v2 7/7] Fix value_literal_complex comment Tom Tromey
2020-04-01 20:10 ` [PATCH v2 0/7] Update complex number support 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=98be8190-d392-804f-863a-c24fd7193b85@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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