aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-01-17 16:31:56 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-03-06 18:11:31 +0000
commit067630bdb553bb889104e3b064e4551531ddcedc (patch)
tree3327cbb47953a59b2d8628a20641bab91faac310 /gdb
parent3be47f7aa99dc90190e642a4e191c9f049e0a934 (diff)
downloadgdb-067630bdb553bb889104e3b064e4551531ddcedc.zip
gdb-067630bdb553bb889104e3b064e4551531ddcedc.tar.gz
gdb-067630bdb553bb889104e3b064e4551531ddcedc.tar.bz2
gdb/fortran: Add builtin 8-byte integer type with (kind=8) support
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/f-exp.y2
-rw-r--r--gdb/f-lang.c4
-rw-r--r--gdb/f-lang.h1
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.fortran/type-kinds.exp1
6 files changed, 18 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index be7b96b..b0d0edb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
+ * 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.
+
+2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
+
* f-exp.y (convert_to_kind_type): Handle more type kinds.
2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index 980ee4b4..d256ff1 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 34ebfd9..f27eb0d 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -375,6 +375,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 5afafb1..746c11f 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/ChangeLog b/gdb/testsuite/ChangeLog
index a441165..b5599e4 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
+ * gdb.fortran/type-kinds.exp: Test new integer type kind.
+
+2019-03-06 Andrew Burgess <andrew.burgess@embecosm.com>
+
* gdb.fortran/type-kinds.exp (test_cast_1_to_type_kind): New
function.
(test_basic_parsing_of_type_kinds): Expand types tested.
diff --git a/gdb/testsuite/gdb.fortran/type-kinds.exp b/gdb/testsuite/gdb.fortran/type-kinds.exp
index c679bc5..198ac58 100644
--- a/gdb/testsuite/gdb.fortran/type-kinds.exp
+++ b/gdb/testsuite/gdb.fortran/type-kinds.exp
@@ -54,6 +54,7 @@ proc test_basic_parsing_of_type_kinds {} {
test_cast_1_to_type_kind "integer" "2" "1" "2"
test_cast_1_to_type_kind "integer" "4" "1" "4"
+ test_cast_1_to_type_kind "integer" "8" "1" "8"
}
proc test_parsing_invalid_type_kinds {} {