* [PATCH]: New `logical*8' type for Fortran
@ 2010-04-15 23:01 Sergio Durigan Junior
2010-04-16 6:09 ` Jan Kratochvil
0 siblings, 1 reply; 9+ messages in thread
From: Sergio Durigan Junior @ 2010-04-15 23:01 UTC (permalink / raw)
To: gdb-patches; +Cc: Jan Kratochvil
Hello,
This patch has been in our tree for a while and we would like to see it
upstream. Jan asked me to take care of this, so I would like to post it for
your appreciation. Comments are welcome as usual.
Tested on the compile farm without regressions.
Ok?
Thank you,
--
Sergio
gdb/ChangeLog:
2010-04-15 Jan Kratochvil <jan.kratochvil@redhat.com>
* f-exp.y: Add new production to recognize the `logical*8' type.
(LOGICAL_S8_KEYWORD): New token.
* f-lang.c (enum f_primitive_types)
<f_primitive_type_logical_s8>: New field.
(f_language_arch_info): Handling `logical*8' type.
(build_fortran_types): Building `logical*8' type.
* f-lang.h (builtin_logical_s8): New struct.
gdb/testsuite/ChangeLog:
2010-04-15 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.fortran/logical.exp: New testcase.
* gdb.fortran/logical.f90: New file.
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index e320f2c..abc590e 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -196,6 +196,7 @@ static int parse_number (char *, int, int, YYSTYPE *);
/* Special type cases, put in to allow the parser to distinguish different
legal basetypes. */
%token INT_KEYWORD INT_S2_KEYWORD LOGICAL_S1_KEYWORD LOGICAL_S2_KEYWORD
+%token LOGICAL_S8_KEYWORD
%token LOGICAL_KEYWORD REAL_KEYWORD REAL_S8_KEYWORD REAL_S16_KEYWORD
%token COMPLEX_S8_KEYWORD COMPLEX_S16_KEYWORD COMPLEX_S32_KEYWORD
%token BOOL_AND BOOL_OR BOOL_NOT
@@ -606,6 +607,8 @@ typebase /* Implements (approximately): (type-qualifier)*
type-specifier */
{ $$ = parse_f_type->builtin_integer_s2; }
| CHARACTER
{ $$ = parse_f_type->builtin_character; }
+ | LOGICAL_S8_KEYWORD
+ { $$ = parse_f_type->builtin_logical_s8; }
| LOGICAL_KEYWORD
{ $$ = parse_f_type->builtin_logical; }
| LOGICAL_S2_KEYWORD
@@ -858,6 +861,7 @@ static const struct token f77_keywords[] =
{ "integer_2", INT_S2_KEYWORD, BINOP_END },
{ "logical_1", LOGICAL_S1_KEYWORD, BINOP_END },
{ "logical_2", LOGICAL_S2_KEYWORD, BINOP_END },
+ { "logical_8", LOGICAL_S8_KEYWORD, BINOP_END },
{ "complex_8", COMPLEX_S8_KEYWORD, BINOP_END },
{ "integer", INT_KEYWORD, BINOP_END },
{ "logical", LOGICAL_KEYWORD, BINOP_END },
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index b914b49..0bee8f5 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -259,6 +259,7 @@ enum f_primitive_types {
f_primitive_type_logical,
f_primitive_type_logical_s1,
f_primitive_type_logical_s2,
+ f_primitive_type_logical_s8,
f_primitive_type_integer,
f_primitive_type_integer_s2,
f_primitive_type_real,
@@ -289,6 +290,8 @@ f_language_arch_info (struct gdbarch *gdbarch,
= builtin->builtin_logical_s1;
lai->primitive_type_vector [f_primitive_type_logical_s2]
= builtin->builtin_logical_s2;
+ lai->primitive_type_vector [f_primitive_type_logical_s8]
+ = builtin->builtin_logical_s8;
lai->primitive_type_vector [f_primitive_type_real]
= builtin->builtin_real;
lai->primitive_type_vector [f_primitive_type_real_s8]
@@ -372,6 +375,10 @@ build_fortran_types (struct gdbarch *gdbarch)
= arch_boolean_type (gdbarch, gdbarch_short_bit (gdbarch), 1,
"logical*2");
+ builtin_f_type->builtin_logical_s8
+ = arch_boolean_type (gdbarch, gdbarch_long_long_bit (gdbarch), 1,
+ "logical*8");
+
builtin_f_type->builtin_integer
= arch_integer_type (gdbarch, gdbarch_int_bit (gdbarch), 0,
"integer");
diff --git a/gdb/f-lang.h b/gdb/f-lang.h
index b98c556..094d6fa 100644
--- a/gdb/f-lang.h
+++ b/gdb/f-lang.h
@@ -113,6 +113,7 @@ struct builtin_f_type
struct type *builtin_logical;
struct type *builtin_logical_s1;
struct type *builtin_logical_s2;
+ struct type *builtin_logical_s8;
struct type *builtin_real;
struct type *builtin_real_s8;
struct type *builtin_real_s16;
diff --git a/gdb/testsuite/gdb.fortran/logical.exp
b/gdb/testsuite/gdb.fortran/logical.exp
new file mode 100644
index 0000000..a4caecd
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/logical.exp
@@ -0,0 +1,38 @@
+# Copyright 2007 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
+set test "logical"
+set srcfile ${test}.f90
+
+if { [prepare_for_testing "${test}.exp" "${test}" "${srcfile}" {debug f77
quiet}] } {
+ untested "Could not compile ${srcfile}."
+ return -1
+}
+
+if { ![runto MAIN__] } {
+ perror "Could not run to breakpoint `MAIN__'."
+ continue
+}
+
+gdb_breakpoint [gdb_get_line_number "stop-here"]
+gdb_continue_to_breakpoint "stop-here" ".*stop-here.*"
+gdb_test "p l" " = \\.TRUE\\."
+gdb_test "p l1" " = \\.TRUE\\."
+gdb_test "p l2" " = \\.TRUE\\."
+gdb_test "p l4" " = \\.TRUE\\."
+gdb_test "p l8" " = \\.TRUE\\."
diff --git a/gdb/testsuite/gdb.fortran/logical.f90
b/gdb/testsuite/gdb.fortran/logical.f90
new file mode 100644
index 0000000..4229304
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/logical.f90
@@ -0,0 +1,33 @@
+! Copyright 2008 Free Software Foundation, Inc.
+!
+! This program is free software; you can redistribute it and/or modify
+! it under the terms of the GNU General Public License as published by
+! the Free Software Foundation; either version 2 of the License, or
+! (at your option) any later version.
+!
+! This program is distributed in the hope that it will be useful,
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+! GNU General Public License for more details.
+!
+! You should have received a copy of the GNU General Public License
+! along with this program; if not, write to the Free Software
+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+!
+! Ihis file is the Fortran source file for dynamic.exp.
+! Original file written by Jakub Jelinek <jakub@redhat.com>.
+! Modified for the GDB testcase by Jan Kratochvil
<jan.kratochvil@redhat.com>.
+
+program test
+ logical :: l
+ logical (kind=1) :: l1
+ logical (kind=2) :: l2
+ logical (kind=4) :: l4
+ logical (kind=8) :: l8
+ l = .TRUE.
+ l1 = .TRUE.
+ l2 = .TRUE.
+ l4 = .TRUE.
+ l8 = .TRUE.
+ l = .FALSE. ! stop-here
+end
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH]: New `logical*8' type for Fortran
2010-04-15 23:01 [PATCH]: New `logical*8' type for Fortran Sergio Durigan Junior
@ 2010-04-16 6:09 ` Jan Kratochvil
2010-04-16 15:48 ` Sergio Durigan Junior
2010-04-18 21:48 ` Sergio Durigan Junior
0 siblings, 2 replies; 9+ messages in thread
From: Jan Kratochvil @ 2010-04-16 6:09 UTC (permalink / raw)
To: Sergio Durigan Junior; +Cc: gdb-patches
Hi Sergio,
On Fri, 16 Apr 2010 01:01:21 +0200, Sergio Durigan Junior wrote:
> This patch has been in our tree for a while and we would like to see it
> upstream. Jan asked me to take care of this, so I would like to post it for
> your appreciation. Comments are welcome as usual.
sorry for follow-up from me:
> 2010-04-15 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> * f-exp.y: Add new production to recognize the `logical*8' type.
> (LOGICAL_S8_KEYWORD): New token.
>
> * f-lang.c (enum f_primitive_types)
> <f_primitive_type_logical_s8>: New field.
> (f_language_arch_info): Handling `logical*8' type.
> (build_fortran_types): Building `logical*8' type.
>
> * f-lang.h (builtin_logical_s8): New struct.
It is a new field of struct builtin_f_type, not a new struct.
Also these changes depend each on the other so there should not be empty lines
between the changes. (6.8.2 Style of Change Logs)
> gdb/testsuite/ChangeLog:
>
> 2010-04-15 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> * gdb.fortran/logical.exp: New testcase.
> * gdb.fortran/logical.f90: New file.
As you did some *.exp modifications you should list yourself here (in the case
you explicitly do not want to be listed there I do not know what the rules are).
> +++ b/gdb/testsuite/gdb.fortran/logical.exp
> +# Copyright 2007 Free Software Foundation, Inc.
> +++ b/gdb/testsuite/gdb.fortran/logical.f90
> +! Copyright 2008 Free Software Foundation, Inc.
The your should be changed as the patch was neither in FSF GDB nor in Archer.
> +! Ihis file is the Fortran source file for dynamic.exp.
This is not true.
> +! Original file written by Jakub Jelinek <jakub@redhat.com>.
This is not true (it was for dynamic.exp where the code size was not trivial).
> +! Modified for the GDB testcase by Jan Kratochvil
> <jan.kratochvil@redhat.com>.
Patch lines are corrupted (wrapped) by your MUA (mail user agent).
Thanks,
Jan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH]: New `logical*8' type for Fortran
2010-04-16 6:09 ` Jan Kratochvil
@ 2010-04-16 15:48 ` Sergio Durigan Junior
2010-04-16 16:03 ` Jan Kratochvil
2010-04-18 21:48 ` Sergio Durigan Junior
1 sibling, 1 reply; 9+ messages in thread
From: Sergio Durigan Junior @ 2010-04-16 15:48 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
On Friday 16 April 2010 03:09:16, Jan Kratochvil wrote:
> Hi Sergio,
Hello Jan,
> On Fri, 16 Apr 2010 01:01:21 +0200, Sergio Durigan Junior wrote:
> > This patch has been in our tree for a while and we would like to see it
> > upstream. Jan asked me to take care of this, so I would like to post it
> > for your appreciation. Comments are welcome as usual.
>
> sorry for follow-up from me:
No problem.
> > 2010-04-15 Jan Kratochvil <jan.kratochvil@redhat.com>
> >
> > * f-exp.y: Add new production to recognize the `logical*8' type.
> > (LOGICAL_S8_KEYWORD): New token.
> >
> > * f-lang.c (enum f_primitive_types)
> > <f_primitive_type_logical_s8>: New field.
> > (f_language_arch_info): Handling `logical*8' type.
> > (build_fortran_types): Building `logical*8' type.
> >
> > * f-lang.h (builtin_logical_s8): New struct.
>
> It is a new field of struct builtin_f_type, not a new struct.
Sorry for that.
>
> Also these changes depend each on the other so there should not be empty
> lines between the changes. (6.8.2 Style of Change Logs)
I'll fix that.
> > gdb/testsuite/ChangeLog:
> >
> > 2010-04-15 Jan Kratochvil <jan.kratochvil@redhat.com>
> >
> > * gdb.fortran/logical.exp: New testcase.
> > * gdb.fortran/logical.f90: New file.
>
> As you did some *.exp modifications you should list yourself here (in the
> case you explicitly do not want to be listed there I do not know what the
> rules are).
I did really minor adjustments so I thought it wasn't worth listing my name,
but I will fix it then.
> > +++ b/gdb/testsuite/gdb.fortran/logical.exp
> > +# Copyright 2007 Free Software Foundation, Inc.
> > +++ b/gdb/testsuite/gdb.fortran/logical.f90
> > +! Copyright 2008 Free Software Foundation, Inc.
>
> The your should be changed as the patch was neither in FSF GDB nor in
> Archer.
Sorry, will fix that.
> > +! Ihis file is the Fortran source file for dynamic.exp.
>
> This is not true.
> > +! Original file written by Jakub Jelinek <jakub@redhat.com>.
>
> This is not true (it was for dynamic.exp where the code size was not
> trivial).
Should I remove these lines then?
> > +! Modified for the GDB testcase by Jan Kratochvil
> > <jan.kratochvil@redhat.com>.
>
> Patch lines are corrupted (wrapped) by your MUA (mail user agent).
Really? Darn... I will send it attached then, sorry for that.
Thanks,
--
Sergio
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH]: New `logical*8' type for Fortran
2010-04-16 15:48 ` Sergio Durigan Junior
@ 2010-04-16 16:03 ` Jan Kratochvil
0 siblings, 0 replies; 9+ messages in thread
From: Jan Kratochvil @ 2010-04-16 16:03 UTC (permalink / raw)
To: Sergio Durigan Junior; +Cc: gdb-patches
On Fri, 16 Apr 2010 17:47:59 +0200, Sergio Durigan Junior wrote:
> > > +! Ihis file is the Fortran source file for dynamic.exp.
> >
> > This is not true.
> > > +! Original file written by Jakub Jelinek <jakub@redhat.com>.
> >
> > This is not true (it was for dynamic.exp where the code size was not
> > trivial).
>
> Should I remove these lines then?
Yes.
> > > +! Modified for the GDB testcase by Jan Kratochvil
> > > <jan.kratochvil@redhat.com>.
> >
> > Patch lines are corrupted (wrapped) by your MUA (mail user agent).
>
> Really? Darn... I will send it attached then, sorry for that.
You can Google many mails here by Mark Kettenis he cannot read attachments,
But I cannot comment it more whether he can for example read some non-flowed
text/plain 7-bit MIME attachments or not. Posting it just FYI as I can
perfectly read any type of MIME-compliant attachment myself.
Regards,
Jan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH]: New `logical*8' type for Fortran
2010-04-16 6:09 ` Jan Kratochvil
2010-04-16 15:48 ` Sergio Durigan Junior
@ 2010-04-18 21:48 ` Sergio Durigan Junior
2010-04-19 2:53 ` Jan Kratochvil
1 sibling, 1 reply; 9+ messages in thread
From: Sergio Durigan Junior @ 2010-04-18 21:48 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
On Friday 16 April 2010 03:09:16, Jan Kratochvil wrote:
> Hi Sergio,
>
> On Fri, 16 Apr 2010 01:01:21 +0200, Sergio Durigan Junior wrote:
> > This patch has been in our tree for a while and we would like to see it
> > upstream. Jan asked me to take care of this, so I would like to post it
> > for your appreciation. Comments are welcome as usual.
>
> sorry for follow-up from me:
Hi Jan,
Please take a look at this version of the patch. Also, I tried to configure
my MUA in order to correctly insert files, but please take a look and tell me
if it continues to wrap words. If so, I will send the patch attached.
Thanks,
--
Sergio
gdb/ChangeLog:
2010-04-18 Jan Kratochvil <jan.kratochvil@redhat.com>
* f-exp.y: Add new production to recognize the `logical*8' type.
(LOGICAL_S8_KEYWORD): New token.
* f-lang.c (enum f_primitive_types)
<f_primitive_type_logical_s8>: New field.
(f_language_arch_info): Handling `logical*8' type.
(build_fortran_types): Building `logical*8' type.
* f-lang.h (struct builtin_f_type) <builtin_logical_s8>: New field.
gdb/testsuite/ChangeLog:
2010-04-18 Jan Kratochvil <jan.kratochvil@redhat.com>
Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.fortran/logical.exp: New testcase.
* gdb.fortran/logical.f90: New file.
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index e320f2c..abc590e 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -196,6 +196,7 @@ static int parse_number (char *, int, int, YYSTYPE *);
/* Special type cases, put in to allow the parser to distinguish different
legal basetypes. */
%token INT_KEYWORD INT_S2_KEYWORD LOGICAL_S1_KEYWORD LOGICAL_S2_KEYWORD
+%token LOGICAL_S8_KEYWORD
%token LOGICAL_KEYWORD REAL_KEYWORD REAL_S8_KEYWORD REAL_S16_KEYWORD
%token COMPLEX_S8_KEYWORD COMPLEX_S16_KEYWORD COMPLEX_S32_KEYWORD
%token BOOL_AND BOOL_OR BOOL_NOT
@@ -606,6 +607,8 @@ typebase /* Implements (approximately): (type-qualifier)*
type-specifier */
{ $$ = parse_f_type->builtin_integer_s2; }
| CHARACTER
{ $$ = parse_f_type->builtin_character; }
+ | LOGICAL_S8_KEYWORD
+ { $$ = parse_f_type->builtin_logical_s8; }
| LOGICAL_KEYWORD
{ $$ = parse_f_type->builtin_logical; }
| LOGICAL_S2_KEYWORD
@@ -858,6 +861,7 @@ static const struct token f77_keywords[] =
{ "integer_2", INT_S2_KEYWORD, BINOP_END },
{ "logical_1", LOGICAL_S1_KEYWORD, BINOP_END },
{ "logical_2", LOGICAL_S2_KEYWORD, BINOP_END },
+ { "logical_8", LOGICAL_S8_KEYWORD, BINOP_END },
{ "complex_8", COMPLEX_S8_KEYWORD, BINOP_END },
{ "integer", INT_KEYWORD, BINOP_END },
{ "logical", LOGICAL_KEYWORD, BINOP_END },
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index b914b49..0bee8f5 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -259,6 +259,7 @@ enum f_primitive_types {
f_primitive_type_logical,
f_primitive_type_logical_s1,
f_primitive_type_logical_s2,
+ f_primitive_type_logical_s8,
f_primitive_type_integer,
f_primitive_type_integer_s2,
f_primitive_type_real,
@@ -289,6 +290,8 @@ f_language_arch_info (struct gdbarch *gdbarch,
= builtin->builtin_logical_s1;
lai->primitive_type_vector [f_primitive_type_logical_s2]
= builtin->builtin_logical_s2;
+ lai->primitive_type_vector [f_primitive_type_logical_s8]
+ = builtin->builtin_logical_s8;
lai->primitive_type_vector [f_primitive_type_real]
= builtin->builtin_real;
lai->primitive_type_vector [f_primitive_type_real_s8]
@@ -372,6 +375,10 @@ build_fortran_types (struct gdbarch *gdbarch)
= arch_boolean_type (gdbarch, gdbarch_short_bit (gdbarch), 1,
"logical*2");
+ builtin_f_type->builtin_logical_s8
+ = arch_boolean_type (gdbarch, gdbarch_long_long_bit (gdbarch), 1,
+ "logical*8");
+
builtin_f_type->builtin_integer
= arch_integer_type (gdbarch, gdbarch_int_bit (gdbarch), 0,
"integer");
diff --git a/gdb/f-lang.h b/gdb/f-lang.h
index b98c556..094d6fa 100644
--- a/gdb/f-lang.h
+++ b/gdb/f-lang.h
@@ -113,6 +113,7 @@ struct builtin_f_type
struct type *builtin_logical;
struct type *builtin_logical_s1;
struct type *builtin_logical_s2;
+ struct type *builtin_logical_s8;
struct type *builtin_real;
struct type *builtin_real_s8;
struct type *builtin_real_s16;
diff --git a/gdb/testsuite/gdb.fortran/logical.exp
b/gdb/testsuite/gdb.fortran/logical.exp
new file mode 100644
index 0000000..e9034f7
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/logical.exp
@@ -0,0 +1,38 @@
+# Copyright 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
+set test "logical"
+set srcfile ${test}.f90
+
+if { [prepare_for_testing "${test}.exp" "${test}" "${srcfile}" {debug f77
quiet}] } {
+ untested "Could not compile ${srcfile}."
+ return -1
+}
+
+if { ![runto MAIN__] } {
+ perror "Could not run to breakpoint `MAIN__'."
+ continue
+}
+
+gdb_breakpoint [gdb_get_line_number "stop-here"]
+gdb_continue_to_breakpoint "stop-here" ".*stop-here.*"
+gdb_test "p l" " = \\.TRUE\\."
+gdb_test "p l1" " = \\.TRUE\\."
+gdb_test "p l2" " = \\.TRUE\\."
+gdb_test "p l4" " = \\.TRUE\\."
+gdb_test "p l8" " = \\.TRUE\\."
diff --git a/gdb/testsuite/gdb.fortran/logical.f90
b/gdb/testsuite/gdb.fortran/logical.f90
new file mode 100644
index 0000000..2fa93f9
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/logical.f90
@@ -0,0 +1,31 @@
+! Copyright 2010 Free Software Foundation, Inc.
+!
+! This program is free software; you can redistribute it and/or modify
+! it under the terms of the GNU General Public License as published by
+! the Free Software Foundation; either version 2 of the License, or
+! (at your option) any later version.
+!
+! This program is distributed in the hope that it will be useful,
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+! GNU General Public License for more details.
+!
+! You should have received a copy of the GNU General Public License
+! along with this program; if not, write to the Free Software
+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+!
+! This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
+program test
+ logical :: l
+ logical (kind=1) :: l1
+ logical (kind=2) :: l2
+ logical (kind=4) :: l4
+ logical (kind=8) :: l8
+ l = .TRUE.
+ l1 = .TRUE.
+ l2 = .TRUE.
+ l4 = .TRUE.
+ l8 = .TRUE.
+ l = .FALSE. ! stop-here
+end
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH]: New `logical*8' type for Fortran
2010-04-18 21:48 ` Sergio Durigan Junior
@ 2010-04-19 2:53 ` Jan Kratochvil
2010-04-19 20:17 ` Sergio Durigan Junior
0 siblings, 1 reply; 9+ messages in thread
From: Jan Kratochvil @ 2010-04-19 2:53 UTC (permalink / raw)
To: Sergio Durigan Junior; +Cc: gdb-patches
On Sun, 18 Apr 2010 23:48:34 +0200, Sergio Durigan Junior wrote:
> Please take a look at this version of the patch.
I agree with it now, thanks.
> Also, I tried to configure
> my MUA in order to correctly insert files, but please take a look and tell me
> if it continues to wrap words. If so, I will send the patch attached.
...
> Content-Type: Text/Plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: 7bit
> @@ -606,6 +607,8 @@ typebase /* Implements (approximately): (type-qualifier)*
> type-specifier */
patch: **** malformed patch at line 57: type-specifier */
I do not defend this policy, though.
Regards,
Jan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH]: New `logical*8' type for Fortran
2010-04-19 2:53 ` Jan Kratochvil
@ 2010-04-19 20:17 ` Sergio Durigan Junior
2010-04-20 15:55 ` Tom Tromey
0 siblings, 1 reply; 9+ messages in thread
From: Sergio Durigan Junior @ 2010-04-19 20:17 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
[-- Attachment #1: Type: Text/Plain, Size: 265 bytes --]
On Sunday 18 April 2010 23:53:23, Jan Kratochvil wrote:
> patch: **** malformed patch at line 57: type-specifier */
>
> I do not defend this policy, though.
Ok, I give up (for now). Here is the attached version of the patch.
Ok to commit?
Regards,
--
Sergio
[-- Attachment #2: ChangeLog --]
[-- Type: text/x-changelog, Size: 639 bytes --]
gdb/ChangeLog:
2010-04-18 Jan Kratochvil <jan.kratochvil@redhat.com>
* f-exp.y: Add new production to recognize the `logical*8' type.
(LOGICAL_S8_KEYWORD): New token.
* f-lang.c (enum f_primitive_types)
<f_primitive_type_logical_s8>: New field.
(f_language_arch_info): Handling `logical*8' type.
(build_fortran_types): Building `logical*8' type.
* f-lang.h (struct builtin_f_type) <builtin_logical_s8>: New field.
gdb/testsuite/ChangeLog:
2010-04-18 Jan Kratochvil <jan.kratochvil@redhat.com>
Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.fortran/logical.exp: New testcase.
* gdb.fortran/logical.f90: New file.
[-- Attachment #3: fortran-logical8.patch --]
[-- Type: text/x-patch, Size: 5831 bytes --]
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index e320f2c..abc590e 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -196,6 +196,7 @@ static int parse_number (char *, int, int, YYSTYPE *);
/* Special type cases, put in to allow the parser to distinguish different
legal basetypes. */
%token INT_KEYWORD INT_S2_KEYWORD LOGICAL_S1_KEYWORD LOGICAL_S2_KEYWORD
+%token LOGICAL_S8_KEYWORD
%token LOGICAL_KEYWORD REAL_KEYWORD REAL_S8_KEYWORD REAL_S16_KEYWORD
%token COMPLEX_S8_KEYWORD COMPLEX_S16_KEYWORD COMPLEX_S32_KEYWORD
%token BOOL_AND BOOL_OR BOOL_NOT
@@ -606,6 +607,8 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */
{ $$ = parse_f_type->builtin_integer_s2; }
| CHARACTER
{ $$ = parse_f_type->builtin_character; }
+ | LOGICAL_S8_KEYWORD
+ { $$ = parse_f_type->builtin_logical_s8; }
| LOGICAL_KEYWORD
{ $$ = parse_f_type->builtin_logical; }
| LOGICAL_S2_KEYWORD
@@ -858,6 +861,7 @@ static const struct token f77_keywords[] =
{ "integer_2", INT_S2_KEYWORD, BINOP_END },
{ "logical_1", LOGICAL_S1_KEYWORD, BINOP_END },
{ "logical_2", LOGICAL_S2_KEYWORD, BINOP_END },
+ { "logical_8", LOGICAL_S8_KEYWORD, BINOP_END },
{ "complex_8", COMPLEX_S8_KEYWORD, BINOP_END },
{ "integer", INT_KEYWORD, BINOP_END },
{ "logical", LOGICAL_KEYWORD, BINOP_END },
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index b914b49..0bee8f5 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -259,6 +259,7 @@ enum f_primitive_types {
f_primitive_type_logical,
f_primitive_type_logical_s1,
f_primitive_type_logical_s2,
+ f_primitive_type_logical_s8,
f_primitive_type_integer,
f_primitive_type_integer_s2,
f_primitive_type_real,
@@ -289,6 +290,8 @@ f_language_arch_info (struct gdbarch *gdbarch,
= builtin->builtin_logical_s1;
lai->primitive_type_vector [f_primitive_type_logical_s2]
= builtin->builtin_logical_s2;
+ lai->primitive_type_vector [f_primitive_type_logical_s8]
+ = builtin->builtin_logical_s8;
lai->primitive_type_vector [f_primitive_type_real]
= builtin->builtin_real;
lai->primitive_type_vector [f_primitive_type_real_s8]
@@ -372,6 +375,10 @@ build_fortran_types (struct gdbarch *gdbarch)
= arch_boolean_type (gdbarch, gdbarch_short_bit (gdbarch), 1,
"logical*2");
+ builtin_f_type->builtin_logical_s8
+ = arch_boolean_type (gdbarch, gdbarch_long_long_bit (gdbarch), 1,
+ "logical*8");
+
builtin_f_type->builtin_integer
= arch_integer_type (gdbarch, gdbarch_int_bit (gdbarch), 0,
"integer");
diff --git a/gdb/f-lang.h b/gdb/f-lang.h
index b98c556..094d6fa 100644
--- a/gdb/f-lang.h
+++ b/gdb/f-lang.h
@@ -113,6 +113,7 @@ struct builtin_f_type
struct type *builtin_logical;
struct type *builtin_logical_s1;
struct type *builtin_logical_s2;
+ struct type *builtin_logical_s8;
struct type *builtin_real;
struct type *builtin_real_s8;
struct type *builtin_real_s16;
diff --git a/gdb/testsuite/gdb.fortran/logical.exp b/gdb/testsuite/gdb.fortran/logical.exp
new file mode 100644
index 0000000..e9034f7
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/logical.exp
@@ -0,0 +1,38 @@
+# Copyright 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
+set test "logical"
+set srcfile ${test}.f90
+
+if { [prepare_for_testing "${test}.exp" "${test}" "${srcfile}" {debug f77 quiet}] } {
+ untested "Could not compile ${srcfile}."
+ return -1
+}
+
+if { ![runto MAIN__] } {
+ perror "Could not run to breakpoint `MAIN__'."
+ continue
+}
+
+gdb_breakpoint [gdb_get_line_number "stop-here"]
+gdb_continue_to_breakpoint "stop-here" ".*stop-here.*"
+gdb_test "p l" " = \\.TRUE\\."
+gdb_test "p l1" " = \\.TRUE\\."
+gdb_test "p l2" " = \\.TRUE\\."
+gdb_test "p l4" " = \\.TRUE\\."
+gdb_test "p l8" " = \\.TRUE\\."
diff --git a/gdb/testsuite/gdb.fortran/logical.f90 b/gdb/testsuite/gdb.fortran/logical.f90
new file mode 100644
index 0000000..2fa93f9
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/logical.f90
@@ -0,0 +1,31 @@
+! Copyright 2010 Free Software Foundation, Inc.
+!
+! This program is free software; you can redistribute it and/or modify
+! it under the terms of the GNU General Public License as published by
+! the Free Software Foundation; either version 2 of the License, or
+! (at your option) any later version.
+!
+! This program is distributed in the hope that it will be useful,
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+! GNU General Public License for more details.
+!
+! You should have received a copy of the GNU General Public License
+! along with this program; if not, write to the Free Software
+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+!
+! This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
+program test
+ logical :: l
+ logical (kind=1) :: l1
+ logical (kind=2) :: l2
+ logical (kind=4) :: l4
+ logical (kind=8) :: l8
+ l = .TRUE.
+ l1 = .TRUE.
+ l2 = .TRUE.
+ l4 = .TRUE.
+ l8 = .TRUE.
+ l = .FALSE. ! stop-here
+end
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH]: New `logical*8' type for Fortran
2010-04-19 20:17 ` Sergio Durigan Junior
@ 2010-04-20 15:55 ` Tom Tromey
2010-04-20 17:23 ` Sergio Durigan Junior
0 siblings, 1 reply; 9+ messages in thread
From: Tom Tromey @ 2010-04-20 15:55 UTC (permalink / raw)
To: Sergio Durigan Junior; +Cc: Jan Kratochvil, gdb-patches
>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
Sergio> Ok, I give up (for now). Here is the attached version of the patch.
Sergio> Ok to commit?
Sergio> 2010-04-18 Jan Kratochvil <jan.kratochvil@redhat.com>
Sergio> * f-exp.y: Add new production to recognize the `logical*8' type.
Sergio> (LOGICAL_S8_KEYWORD): New token.
Sergio> * f-lang.c (enum f_primitive_types)
Sergio> <f_primitive_type_logical_s8>: New field.
Sergio> (f_language_arch_info): Handling `logical*8' type.
Sergio> (build_fortran_types): Building `logical*8' type.
Sergio> * f-lang.h (struct builtin_f_type) <builtin_logical_s8>: New field.
This is ok. Thanks.
Tom
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH]: New `logical*8' type for Fortran
2010-04-20 15:55 ` Tom Tromey
@ 2010-04-20 17:23 ` Sergio Durigan Junior
0 siblings, 0 replies; 9+ messages in thread
From: Sergio Durigan Junior @ 2010-04-20 17:23 UTC (permalink / raw)
To: tromey; +Cc: Jan Kratochvil, gdb-patches
On Tuesday 20 April 2010 12:54:53, Tom Tromey wrote:
> >>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
> Sergio> Ok, I give up (for now). Here is the attached version of the
> patch. Sergio> Ok to commit?
>
> Sergio> 2010-04-18 Jan Kratochvil <jan.kratochvil@redhat.com>
> Sergio> * f-exp.y: Add new production to recognize the `logical*8'
type.
> Sergio> (LOGICAL_S8_KEYWORD): New token.
> Sergio> * f-lang.c (enum f_primitive_types)
> Sergio> <f_primitive_type_logical_s8>: New field.
> Sergio> (f_language_arch_info): Handling `logical*8' type.
> Sergio> (build_fortran_types): Building `logical*8' type.
> Sergio> * f-lang.h (struct builtin_f_type) <builtin_logical_s8>: New
> field.
>
> This is ok. Thanks.
Thanks, commited.
--
Sergio
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-04-20 17:23 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-15 23:01 [PATCH]: New `logical*8' type for Fortran Sergio Durigan Junior
2010-04-16 6:09 ` Jan Kratochvil
2010-04-16 15:48 ` Sergio Durigan Junior
2010-04-16 16:03 ` Jan Kratochvil
2010-04-18 21:48 ` Sergio Durigan Junior
2010-04-19 2:53 ` Jan Kratochvil
2010-04-19 20:17 ` Sergio Durigan Junior
2010-04-20 15:55 ` Tom Tromey
2010-04-20 17:23 ` Sergio Durigan Junior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).