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 08/11] gdb/fortran: Add builtin 8-byte integer type with (kind=8) support
Date: Tue, 12 Feb 2019 16:11:00 -0000 [thread overview]
Message-ID: <f812096d60b67eb9a488129bd3cd5528f1bb2256.1549986233.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1549986233.git.andrew.burgess@embecosm.com>
In-Reply-To: <cover.1549986233.git.andrew.burgess@embecosm.com>
Add a new builtin type, an 8-byte integer, and allow GDB to parse
'integer (kind=8)', returning the new 8-byte integer.
gdb/ChangeLog:
* f-exp.y (convert_to_kind_type): Handle integer (kind=8).
* f-lang.c (build_fortran_types): Setup builtin_integer_s8.
* f-lang.h (struct builtin_f_type): Add builtin_integer_s8 field.
gdb/testsuite/ChangeLog:
* gdb.fortran/type-kinds.exp: Test new integer type kind.
---
gdb/ChangeLog | 6 ++++++
gdb/f-exp.y | 2 ++
gdb/f-lang.c | 4 ++++
gdb/f-lang.h | 1 +
gdb/testsuite/ChangeLog | 4 ++++
gdb/testsuite/gdb.fortran/type-kinds.exp | 1 +
6 files changed, 18 insertions(+)
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index 980ee4b4adb..d256ff14c1e 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -865,6 +865,8 @@ convert_to_kind_type (struct type *basetype, int kind)
return parse_f_type (pstate)->builtin_integer_s2;
else if (kind == 4)
return parse_f_type (pstate)->builtin_integer;
+ else if (kind == 8)
+ return parse_f_type (pstate)->builtin_integer_s8;
}
error (_("unsupported kind %d for type %s"),
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 72dafe6d66f..7bed3189283 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -374,6 +374,10 @@ build_fortran_types (struct gdbarch *gdbarch)
= arch_integer_type (gdbarch, gdbarch_short_bit (gdbarch), 0,
"integer*2");
+ builtin_f_type->builtin_integer_s8
+ = arch_integer_type (gdbarch, gdbarch_long_long_bit (gdbarch), 0,
+ "integer*8");
+
builtin_f_type->builtin_logical_s2
= arch_boolean_type (gdbarch, gdbarch_short_bit (gdbarch), 1,
"logical*2");
diff --git a/gdb/f-lang.h b/gdb/f-lang.h
index a4ae6a726d9..7164585f9ea 100644
--- a/gdb/f-lang.h
+++ b/gdb/f-lang.h
@@ -66,6 +66,7 @@ struct builtin_f_type
struct type *builtin_character;
struct type *builtin_integer;
struct type *builtin_integer_s2;
+ struct type *builtin_integer_s8;
struct type *builtin_logical;
struct type *builtin_logical_s1;
struct type *builtin_logical_s2;
diff --git a/gdb/testsuite/gdb.fortran/type-kinds.exp b/gdb/testsuite/gdb.fortran/type-kinds.exp
index b2e64d77081..129997e4f66 100644
--- a/gdb/testsuite/gdb.fortran/type-kinds.exp
+++ b/gdb/testsuite/gdb.fortran/type-kinds.exp
@@ -39,6 +39,7 @@ proc test_basic_parsing_of_type_kinds {} {
gdb_test "p ((integer (kind=2)) 1)" " = 1"
gdb_test "p ((integer (kind=4)) 1)" " = 1"
+ gdb_test "p ((integer (kind=8)) 1)" " = 1"
}
proc test_parsing_invalid_type_kinds {} {
--
2.14.5
next prev parent reply other threads:[~2019-02-12 16:11 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-12 16:11 [PATCH 00/11] Fortran Parser Cleanup, KIND Support, and Intrinsic Functions Andrew Burgess
2019-02-12 16:11 ` [PATCH 11/11] gdb/fortran: Handle older TYPE*SIZE typenames Andrew Burgess
2019-02-12 16:11 ` [PATCH 05/11] gdb/fortran: Enable debugging of the Fortran parser Andrew Burgess
2019-02-12 16:11 ` [PATCH 01/11] gdb/fortran: Remove some duplicate tests Andrew Burgess
2019-02-12 16:11 ` [PATCH 10/11] gdb/fortran: Add support for the ABS intrinsic function Andrew Burgess
2019-02-12 16:11 ` [PATCH 07/11] gdb/fortran: Expand the set of types that support (kind=N) Andrew Burgess
2019-02-12 16:11 ` [PATCH 04/11] gdb/fortran: Add new function to evaluate Fortran expressions Andrew Burgess
2019-02-12 16:11 ` Andrew Burgess [this message]
2019-02-12 16:11 ` [PATCH 02/11] gdb/fortran: Cleanup code for parsing logical constants Andrew Burgess
2019-02-12 16:11 ` [PATCH 03/11] gdb/fortran: Simplify handling of Fortran dot operations and keywords Andrew Burgess
2019-02-12 16:11 ` [PATCH 06/11] gdb/fortran: Add Fortran 'kind' intrinsic and keyword Andrew Burgess
2019-02-12 16:11 ` [PATCH 09/11] gdb/fortran: Use TYPE_CODE_CHAR for character types Andrew Burgess
2019-03-06 18:15 ` [PUSHED 04/11] gdb/fortran: Add new function to evaluate Fortran expressions Andrew Burgess
2019-03-06 18:15 ` [PUSHED 01/11] gdb/fortran: Remove some duplicate tests Andrew Burgess
2019-03-06 18:15 ` [PUSHED 02/11] gdb/fortran: Cleanup code for parsing logical constants Andrew Burgess
2019-03-06 18:15 ` [PUSHED 00/11] Fortran Parser Cleanup, KIND Support, and Intrinsic Functions Andrew Burgess
2019-03-06 18:16 ` [PUSHED 09/11] gdb/fortran: Use TYPE_CODE_CHAR for character types Andrew Burgess
2019-03-06 18:16 ` [PUSHED 05/11] gdb/fortran: Enable debugging of the Fortran parser Andrew Burgess
2019-03-06 18:16 ` [PUSHED 03/11] gdb/fortran: Simplify handling of Fortran dot operations and keywords Andrew Burgess
2019-03-06 18:16 ` [PUSHED 06/11] gdb/fortran: Add Fortran 'kind' intrinsic and keyword Andrew Burgess
2019-03-06 18:16 ` [PUSHED 07/11] gdb/fortran: Expand the set of types that support (kind=N) Andrew Burgess
2019-03-06 18:16 ` [PUSHED 11/11] gdb/fortran: Handle older TYPE*SIZE typenames Andrew Burgess
2019-03-06 18:16 ` [PUSHED 10/11] gdb/fortran: Add support for the ABS intrinsic function Andrew Burgess
2019-03-06 19:11 ` Tom Tromey
2019-03-07 15:23 ` [PATCH] gdb: Move value_from_host_double into value.c and make more use of it Andrew Burgess
2019-03-07 15:49 ` Tom Tromey
2019-03-06 18:16 ` [PUSHED 08/11] gdb/fortran: Add builtin 8-byte integer type with (kind=8) support 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=f812096d60b67eb9a488129bd3cd5528f1bb2256.1549986233.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