From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Cc: Richard Bunt <Richard.Bunt@arm.com>,
Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCH 5/8] gdb/fortran: Print 'void' type in lower case
Date: Mon, 18 Mar 2019 12:52:00 -0000 [thread overview]
Message-ID: <6d0a648e363b5959d26c2065aea3fbe9da41c81a.1552913184.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1552913183.git.andrew.burgess@embecosm.com>
In-Reply-To: <cover.1552913183.git.andrew.burgess@embecosm.com>
For a program compiled with gfortran the base type names are written
as lower cases in the DWARF, and so GDB will display them as lower
case. Additionally, in most places where GDB supplies its own type
names (for example all of the types defined in f-lang.c in
`build_fortran_types`), the type names are all lower case.
An exception to this is where GDB prints the void type for Fortran.
In this case GDB uses upper case.
I'm not aware of any reason why this type should merit special
attention, and it looks our of place when printing types, so this
commit changes from 'VOID' to 'void' to match all the other types.
gdb/ChangeLog:
* f-lang.c (build_fortran_types): Change name of void type to
lower case.
* f-typeprint.c (f_type_print_base): Print the name of the void
type, rather than a fixed string.
* f-valprint.c (f_decorations): Use lower case void string.
gdb/testsuite/ChangeLog:
* gdb.fortran/exprs.exp (test_convenience_variables): Expect lower
case void string.
---
gdb/ChangeLog | 8 ++++++++
gdb/f-lang.c | 2 +-
gdb/f-typeprint.c | 6 +++++-
gdb/f-valprint.c | 2 +-
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.fortran/exprs.exp | 2 +-
6 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 51bbc6ad333..d8f752f6808 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2019-03-18 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * f-lang.c (build_fortran_types): Change name of void type to
+ lower case.
+ * f-typeprint.c (f_type_print_base): Print the name of the void
+ type, rather than a fixed string.
+ * f-valprint.c (f_decorations): Use lower case void string.
+
2019-03-18 Andrew Burgess <andrew.burgess@embecosm.com>
Chris January <chris.january@arm.com>
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index dd31b42ccd0..09a2df90e49 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -497,7 +497,7 @@ build_fortran_types (struct gdbarch *gdbarch)
= GDBARCH_OBSTACK_ZALLOC (gdbarch, struct builtin_f_type);
builtin_f_type->builtin_void
- = arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT, "VOID");
+ = arch_type (gdbarch, TYPE_CODE_VOID, TARGET_CHAR_BIT, "void");
builtin_f_type->builtin_character
= arch_type (gdbarch, TYPE_CODE_CHAR, TARGET_CHAR_BIT, "character");
diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
index 30e0c4dcda1..7e36ca16c69 100644
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
@@ -329,7 +329,11 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
break;
case TYPE_CODE_VOID:
- fprintfi_filtered (level, stream, "VOID");
+ {
+ gdbarch *gdbarch = get_type_arch (type);
+ struct type *void_type = builtin_f_type (gdbarch)->builtin_void;
+ fprintfi_filtered (level, stream, "%s", TYPE_NAME (void_type));
+ }
break;
case TYPE_CODE_UNDEF:
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index eee0a62fe88..b335a2b3b50 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -199,7 +199,7 @@ static const struct generic_val_print_decorations f_decorations =
")",
".TRUE.",
".FALSE.",
- "VOID",
+ "void",
"{",
"}"
};
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 83883cefd1e..3cdc3cfa6fc 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-03-18 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * gdb.fortran/exprs.exp (test_convenience_variables): Expect lower
+ case void string.
+
2019-03-18 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.fortran/complex.exp: Expand.
diff --git a/gdb/testsuite/gdb.fortran/exprs.exp b/gdb/testsuite/gdb.fortran/exprs.exp
index 3b24f7c135f..8649d0b246d 100644
--- a/gdb/testsuite/gdb.fortran/exprs.exp
+++ b/gdb/testsuite/gdb.fortran/exprs.exp
@@ -141,7 +141,7 @@ proc test_convenience_variables {} {
gdb_test "print (\$foo = 32) + 4" " = 36" \
"Use convenience variable assignment in arithmetic expression"
- gdb_test "print \$bar" " = VOID" \
+ gdb_test "print \$bar" " = void" \
"Print contents of uninitialized convenience variable"
}
--
2.14.5
next prev parent reply other threads:[~2019-03-18 12:52 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-02 23:58 [PATCHv2 0/8] Series of Fortran type printing patches Andrew Burgess
2019-03-18 12:52 ` [PATCH " Andrew Burgess
2019-03-18 12:52 ` [PATCH 7/8] gdb/fortran: Update rules for printing whitespace in types Andrew Burgess
2019-03-18 12:52 ` [PATCH 4/8] gdb/fortran: better types for components of complex numbers Andrew Burgess
2019-03-19 20:18 ` Tom Tromey
2019-03-18 12:52 ` [PATCH 6/8] gdb/fortran: print function arguments when printing function type Andrew Burgess
2019-03-18 12:52 ` [PATCH 3/8] gdb/fortran: Additional builtin procedures Andrew Burgess
2019-03-19 20:06 ` Tom Tromey
2019-03-18 12:52 ` [PATCH 1/8] gdb: Add $_cimag and $_creal internal functions Andrew Burgess
2019-03-18 17:20 ` Eli Zaretskii
2019-03-29 22:41 ` Andrew Burgess
2019-03-30 7:15 ` Eli Zaretskii
2019-03-19 19:47 ` Tom Tromey
2019-04-12 20:24 ` New FAIL on gdb.base/complex-parts.exp - unix/-m32 (was: Re: [PATCH 1/8] gdb: Add $_cimag and $_creal internal functions) Sergio Durigan Junior
2019-04-13 0:02 ` Andrew Burgess
2019-04-16 18:30 ` New FAIL on gdb.base/complex-parts.exp - unix/-m32 Tom Tromey
2019-04-17 0:03 ` Andrew Burgess
2019-03-18 12:52 ` Andrew Burgess [this message]
2019-03-18 12:52 ` [PATCH 2/8] gdb/fortran: Handle internal function calls Andrew Burgess
2019-03-19 19:52 ` Tom Tromey
2019-03-18 12:52 ` [PATCH 8/8] gdb/fortran: Add allocatable type qualifier Andrew Burgess
2019-03-19 20:27 ` [PATCH 0/8] Series of Fortran type printing patches Tom Tromey
2019-04-02 23:58 ` [PATCHv2 1/8] gdb: Remove an unbalanced stray double quote from a comment Andrew Burgess
2019-04-02 23:58 ` [PATCHv2 3/8] gdb/fortran: Additional builtin procedures Andrew Burgess
2019-04-02 23:58 ` [PATCHv2 2/8] gdb/fortran: Introduce fortran-operator.def file Andrew Burgess
2019-04-02 23:59 ` [PATCHv2 7/8] gdb/fortran: Update rules for printing whitespace in types Andrew Burgess
2019-04-02 23:59 ` [PATCHv2 6/8] gdb/fortran: print function arguments when printing function type Andrew Burgess
2019-04-02 23:59 ` [PATCHv2 4/8] gdb/fortran: better types for components of complex numbers Andrew Burgess
2019-05-03 0:21 ` Regression on gdb.fortran/complex.exp on unix/-m32 (was: Re: [PATCHv2 4/8] gdb/fortran: better types for components of complex numbers) Sergio Durigan Junior
2019-04-02 23:59 ` [PATCHv2 5/8] gdb/fortran: Print 'void' type in lower case Andrew Burgess
2019-04-02 23:59 ` [PATCHv2 8/8] gdb/fortran: Add allocatable type qualifier Andrew Burgess
2019-04-23 22:16 ` [PATCHv2 0/8] Series of Fortran type printing patches Andrew Burgess
2019-04-24 19:19 ` Tom Tromey
2019-04-30 12:37 ` Andrew Burgess
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=6d0a648e363b5959d26c2065aea3fbe9da41c81a.1552913184.git.andrew.burgess@embecosm.com \
--to=andrew.burgess@embecosm.com \
--cc=Richard.Bunt@arm.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