Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] Add code to support evaluating Fortran exponentiation expression
@ 2005-06-17  7:36 Wu Zhou
  2005-06-17 10:17 ` Eli Zaretskii
  2005-06-17 13:41 ` Daniel Jacobowitz
  0 siblings, 2 replies; 13+ messages in thread
From: Wu Zhou @ 2005-06-17  7:36 UTC (permalink / raw)
  To: gdb-patches

Hello all,

There is no support for evaluating Fortran exponentiation expression in
current GDB.  I added some code (the patch is attached below) to do this.
And had tested it with g77-3.2.3 and g77-3.3.3.  Following is the related
gdb session.  Please review and comment.  Thanks.

[woodzltc@localhost build]$ ./gdb/gdb -q
(gdb) set language fortran
(gdb) p 2 ** 3
$1 = 8
(gdb) p 2 ** 2 ** 3
$2 = 256
(gdb) p (2 ** 2) ** 3
$3 = 64
(gdb) p 2 ** 0.5
$4 = 1.4142135623730951
(gdb)

Here goes the patch:

2005-06-17  Wu Zhou  <woodzltc@cn.ibm.com>

	* f-exp.y (yyparse): Add code to support exponentiation expression.
	(yylex): Add code to scan exponentiation operator.
	* eval.c (evaluate_subexp_standard): Add support for BINOP_EXP.
	* valarith.c (value_binop): Reset errno to 0 before calling pow
	to do exponentiation operation.

Index: f-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/f-exp.y,v
retrieving revision 1.16
diff -c -p -r1.16 f-exp.y
*** f-exp.y	12 Dec 2004 21:48:55 -0000	1.16
--- f-exp.y	17 Jun 2005 06:30:52 -0000
*************** static int parse_number (char *, int, in
*** 217,222 ****
--- 217,223 ----
  %left '@'
  %left '+' '-'
  %left '*' '/' '%'
+ %right STARSTAR
  %right UNARY 
  %right '('
  
*************** exp	:	exp '@' exp
*** 315,320 ****
--- 316,325 ----
  			{ write_exp_elt_opcode (BINOP_REPEAT); }
  	;
  
+ exp	:	exp STARSTAR exp
+ 			{ write_exp_elt_opcode (BINOP_EXP); }
+ 	;
+ 
  exp	:	exp '*' exp
  			{ write_exp_elt_opcode (BINOP_MUL); }
  	;
*************** yylex ()
*** 941,947 ****
  	}
      }
    
!   /* See if it is a special .foo. operator */
    
    for (i = 0; dot_ops[i].operator != NULL; i++)
      if (strncmp (tokstart, dot_ops[i].operator, strlen (dot_ops[i].operator)) == 0)
--- 946,952 ----
  	}
      }
    
!   /* See if it is a special .foo. operator.  */
    
    for (i = 0; dot_ops[i].operator != NULL; i++)
      if (strncmp (tokstart, dot_ops[i].operator, strlen (dot_ops[i].operator)) == 0)
*************** yylex ()
*** 951,956 ****
--- 956,970 ----
  	return dot_ops[i].token;
        }
    
+   /* See if it is an exponentiation operator.  */
+ 
+   if (strncmp (tokstart, "**", 2) == 0)
+     {
+       lexptr += 2;
+       yylval.opcode = BINOP_EXP;
+       return STARSTAR;
+     }
+ 
    switch (c = *tokstart)
      {
      case 0:
Index: eval.c
===================================================================
RCS file: /cvs/src/src/gdb/eval.c,v
retrieving revision 1.56
diff -c -p -r1.56 eval.c
*** eval.c	13 Jun 2005 07:23:15 -0000	1.56
--- eval.c	17 Jun 2005 06:30:52 -0000
*************** evaluate_subexp_standard (struct type *e
*** 1510,1515 ****
--- 1510,1516 ----
        else
  	return value_sub (arg1, arg2);
  
+     case BINOP_EXP:
      case BINOP_MUL:
      case BINOP_DIV:
      case BINOP_REM:
Index: valarith.c
===================================================================
RCS file: /cvs/src/src/gdb/valarith.c,v
retrieving revision 1.40
diff -c -p -r1.40 valarith.c
*** valarith.c	9 May 2005 21:20:35 -0000	1.40
--- valarith.c	17 Jun 2005 06:30:53 -0000
*************** value_binop (struct value *arg1, struct 
*** 791,801 ****
  	  v = v1 / v2;
  	  break;
  
!         case BINOP_EXP:
!           v = pow (v1, v2);
!           if (errno)
!             error (_("Cannot perform exponentiation: %s"), safe_strerror (errno));
!           break;
  
  	default:
  	  error (_("Integer-only operation on floating point number."));
--- 791,802 ----
  	  v = v1 / v2;
  	  break;
  
! 	case BINOP_EXP:
! 	  errno = 0;
! 	  v = pow (v1, v2);
! 	  if (errno)
! 	    error (_("Cannot perform exponentiation: %s"), safe_strerror (errno));
! 	  break;
  
  	default:
  	  error (_("Integer-only operation on floating point number."));
*************** value_binop (struct value *arg1, struct 
*** 929,939 ****
  	      v = v1 / v2;
  	      break;
  
!             case BINOP_EXP:
!               v = pow (v1, v2);
!               if (errno)
!                 error (_("Cannot perform exponentiation: %s"), safe_strerror (errno));
!               break;
  
  	    case BINOP_REM:
  	      v = v1 % v2;
--- 930,941 ----
  	      v = v1 / v2;
  	      break;
  
! 	    case BINOP_EXP:
! 	      errno = 0;
! 	      v = pow (v1, v2);
! 	      if (errno)
! 		error (_("Cannot perform exponentiation: %s"), safe_strerror (errno));
! 	      break;
  
  	    case BINOP_REM:
  	      v = v1 % v2;
*************** value_binop (struct value *arg1, struct 
*** 1050,1059 ****
  		error (_("Division by zero"));
                break;
  
!             case BINOP_EXP:
!               v = pow (v1, v2);
!               if (errno)
!                 error (_("Cannot perform exponentiation: %s"), safe_strerror (errno));
  	      break;
  
  	    case BINOP_REM:
--- 1052,1062 ----
  		error (_("Division by zero"));
                break;
  
! 	    case BINOP_EXP:
! 	      errno = 0;
! 	      v = pow (v1, v2);
! 	      if (errno)
! 		error (_("Cannot perform exponentiation: %s"), safe_strerror (errno));
  	      break;
  
  	    case BINOP_REM:


Cheers
- Wu Zhou



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC] Add code to support evaluating Fortran exponentiation expression
  2005-06-17  7:36 [RFC] Add code to support evaluating Fortran exponentiation expression Wu Zhou
@ 2005-06-17 10:17 ` Eli Zaretskii
  2005-06-20  3:47   ` Wu Zhou
  2005-06-17 13:41 ` Daniel Jacobowitz
  1 sibling, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2005-06-17 10:17 UTC (permalink / raw)
  To: Wu Zhou; +Cc: gdb-patches

> Date: Fri, 17 Jun 2005 13:22:26 +0800 (CST)
> From: Wu Zhou <woodzltc@cn.ibm.com>
> 
> There is no support for evaluating Fortran exponentiation expression in
> current GDB.  I added some code (the patch is attached below) to do this.
> And had tested it with g77-3.2.3 and g77-3.3.3.  Following is the related
> gdb session.  Please review and comment.  Thanks.

Thank you for working on this.

If this patch is accepted, please submit a suitable change for the
user's manual which describes this operator.  (There's a section about
Fortran-specific support where this info belongs.)

TIA


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC] Add code to support evaluating Fortran exponentiation expression
  2005-06-17  7:36 [RFC] Add code to support evaluating Fortran exponentiation expression Wu Zhou
  2005-06-17 10:17 ` Eli Zaretskii
@ 2005-06-17 13:41 ` Daniel Jacobowitz
  2005-06-20  4:00   ` Wu Zhou
  2005-06-20  4:14   ` Wu Zhou
  1 sibling, 2 replies; 13+ messages in thread
From: Daniel Jacobowitz @ 2005-06-17 13:41 UTC (permalink / raw)
  To: Wu Zhou; +Cc: gdb-patches

On Fri, Jun 17, 2005 at 01:22:26PM +0800, Wu Zhou wrote:
> 2005-06-17  Wu Zhou  <woodzltc@cn.ibm.com>
> 
> 	* f-exp.y (yyparse): Add code to support exponentiation expression.
> 	(yylex): Add code to scan exponentiation operator.
> 	* eval.c (evaluate_subexp_standard): Add support for BINOP_EXP.
> 	* valarith.c (value_binop): Reset errno to 0 before calling pow
> 	to do exponentiation operation.

This will need a testcase, in addition to documentation.  Doing those
separately is fine.  The only other problem is that f-exp.y needs a
copyright year update: the last listed year is 2001, but I see it has
been modified in 2002, 2003, and 2004.  So please add all of those
years (plus 2005).

Otherwise OK.


-- 
Daniel Jacobowitz
CodeSourcery, LLC


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC] Add code to support evaluating Fortran exponentiation expression
  2005-06-17 10:17 ` Eli Zaretskii
@ 2005-06-20  3:47   ` Wu Zhou
  2005-06-20 19:08     ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Wu Zhou @ 2005-06-20  3:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

On Fri, 17 Jun 2005, Eli Zaretskii wrote:

> If this patch is accepted, please submit a suitable change for the
> user's manual which describes this operator.  (There's a section about
> Fortran-specific support where this info belongs.)

OK.  I will submit some document once this is approved.  

BTW.  Do you means to add some words into section 12.4.3 to describe this 
change?  It seems the text there is very short.  Do you think that it is 
desirable to add some other words to describe a little more Fortran 
specific information, such as the limitation on evaluating Fortran 
expression, the different symbol name (MAIN__ other than main, 
sub_ other than sub)?  Maybe some others.

Cheers
- Wu Zhou


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC] Add code to support evaluating Fortran exponentiation expression
  2005-06-17 13:41 ` Daniel Jacobowitz
@ 2005-06-20  4:00   ` Wu Zhou
  2005-07-03 17:07     ` Daniel Jacobowitz
  2005-06-20  4:14   ` Wu Zhou
  1 sibling, 1 reply; 13+ messages in thread
From: Wu Zhou @ 2005-06-20  4:00 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

On Fri, 17 Jun 2005, Daniel Jacobowitz wrote:

> On Fri, Jun 17, 2005 at 01:22:26PM +0800, Wu Zhou wrote:
> > 2005-06-17  Wu Zhou  <woodzltc@cn.ibm.com>
> > 
> > 	* f-exp.y (yyparse): Add code to support exponentiation expression.
> > 	(yylex): Add code to scan exponentiation operator.
> > 	* eval.c (evaluate_subexp_standard): Add support for BINOP_EXP.
> > 	* valarith.c (value_binop): Reset errno to 0 before calling pow
> > 	to do exponentiation operation.
> 
> This will need a testcase, in addition to documentation.  Doing those
> separately is fine.  The only other problem is that f-exp.y needs a
> copyright year update: the last listed year is 2001, but I see it has
> been modified in 2002, 2003, and 2004.  So please add all of those
> years (plus 2005).

OK.  I add five tests in gdb.fortran/exprs.exp (patch is included below).  
Without the above patch, all the five tests fail; with it, all pass.  OK 
to commit?  Thanks.

2005-06-20  Wu Zhou  <woodzltc@cn.ibm.com>

	* gdb.fortran/exprs.exp (test_arithmetic_expressions): Add five 
	tests to evaluate exponentiation expression.

Index: gdb.fortran/exprs.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.fortran/exprs.exp,v
retrieving revision 1.3
diff -c -p -r1.3 exprs.exp
*** gdb.fortran/exprs.exp	16 Dec 2002 19:33:53 -0000	1.3
--- gdb.fortran/exprs.exp	20 Jun 2005 03:25:02 -0000
*************** proc test_arithmetic_expressions {} {
*** 250,255 ****
--- 250,263 ----
  
      # Test modulo with various operands
  
+     # Test exponentiation with various operands
+     
+     gdb_test "p 2 ** 3" " = 8" "int powered by int"
+     gdb_test "p 2 ** 2 ** 3" " = 256" "combined exponentiation expression"
+     gdb_test "p (2 ** 2) ** 3" " = 64" "combined exponentiation expression in specified order"
+     gdb_test "p 4 ** 0.5" " = 2" "int powered by real"
+     gdb_test "p 4.0 ** 0.5" " = 2" "real powered by real"
+ 
  }
  
  # Start with a fresh gdb.

Cheers
- Wu Zhou


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC] Add code to support evaluating Fortran exponentiation expression
  2005-06-17 13:41 ` Daniel Jacobowitz
  2005-06-20  4:00   ` Wu Zhou
@ 2005-06-20  4:14   ` Wu Zhou
  2005-07-03 17:05     ` Daniel Jacobowitz
  1 sibling, 1 reply; 13+ messages in thread
From: Wu Zhou @ 2005-06-20  4:14 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

On Fri, 17 Jun 2005, Daniel Jacobowitz wrote:

> This will need a testcase, in addition to documentation.  Doing those
> separately is fine.  The only other problem is that f-exp.y needs a
> copyright year update: the last listed year is 2001, but I see it has
> been modified in 2002, 2003, and 2004.  So please add all of those
> years (plus 2005).

Daniel,

The re-worked patch (copyright year updated) is included as follows.  OK 
to commit?  Thanks.

2005-06-20  Wu Zhou  <woodzltc@cn.ibm.com>

	* f-exp.y (yyparse): Add code to support exponentiation expression.
	(yylex): Add code to scan exponentiation operator.
	* eval.c (evaluate_subexp_standard): Add support for BINOP_EXP.
	* valarith.c (value_binop): Reset errno to 0 before calling pow
	to do exponentiation operation.

Index: f-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/f-exp.y,v
retrieving revision 1.16
diff -c -p -r1.16 f-exp.y
*** f-exp.y	12 Dec 2004 21:48:55 -0000	1.16
--- f-exp.y	20 Jun 2005 03:20:30 -0000
***************
*** 1,6 ****
  /* YACC parser for Fortran expressions, for GDB.
!    Copyright 1986, 1989, 1990, 1991, 1993, 1994, 1995, 1996, 2000, 2001
!    Free Software Foundation, Inc.
  
     Contributed by Motorola.  Adapted from the C parser by Farooq Butt
     (fmbutt@engage.sps.mot.com).
--- 1,6 ----
  /* YACC parser for Fortran expressions, for GDB.
!    Copyright 1986, 1989, 1990, 1991, 1993, 1994, 1995, 1996, 2000, 2001,
!    2002, 2003, 2004, 2005 Free Software Foundation, Inc.
  
     Contributed by Motorola.  Adapted from the C parser by Farooq Butt
     (fmbutt@engage.sps.mot.com).
*************** static int parse_number (char *, int, in
*** 217,222 ****
--- 217,223 ----
  %left '@'
  %left '+' '-'
  %left '*' '/' '%'
+ %right STARSTAR
  %right UNARY 
  %right '('
  
*************** exp	:	exp '@' exp
*** 315,320 ****
--- 316,325 ----
  			{ write_exp_elt_opcode (BINOP_REPEAT); }
  	;
  
+ exp	:	exp STARSTAR exp
+ 			{ write_exp_elt_opcode (BINOP_EXP); }
+ 	;
+ 
  exp	:	exp '*' exp
  			{ write_exp_elt_opcode (BINOP_MUL); }
  	;
*************** yylex ()
*** 941,947 ****
  	}
      }
    
!   /* See if it is a special .foo. operator */
    
    for (i = 0; dot_ops[i].operator != NULL; i++)
      if (strncmp (tokstart, dot_ops[i].operator, strlen (dot_ops[i].operator)) == 0)
--- 946,952 ----
  	}
      }
    
!   /* See if it is a special .foo. operator.  */
    
    for (i = 0; dot_ops[i].operator != NULL; i++)
      if (strncmp (tokstart, dot_ops[i].operator, strlen (dot_ops[i].operator)) == 0)
*************** yylex ()
*** 951,956 ****
--- 956,970 ----
  	return dot_ops[i].token;
        }
    
+   /* See if it is an exponentiation operator.  */
+ 
+   if (strncmp (tokstart, "**", 2) == 0)
+     {
+       lexptr += 2;
+       yylval.opcode = BINOP_EXP;
+       return STARSTAR;
+     }
+ 
    switch (c = *tokstart)
      {
      case 0:
Index: eval.c
===================================================================
RCS file: /cvs/src/src/gdb/eval.c,v
retrieving revision 1.56
diff -c -p -r1.56 eval.c
*** eval.c	13 Jun 2005 07:23:15 -0000	1.56
--- eval.c	20 Jun 2005 03:20:33 -0000
*************** evaluate_subexp_standard (struct type *e
*** 1510,1515 ****
--- 1510,1516 ----
        else
  	return value_sub (arg1, arg2);
  
+     case BINOP_EXP:
      case BINOP_MUL:
      case BINOP_DIV:
      case BINOP_REM:
Index: valarith.c
===================================================================
RCS file: /cvs/src/src/gdb/valarith.c,v
retrieving revision 1.40
diff -c -p -r1.40 valarith.c
*** valarith.c	9 May 2005 21:20:35 -0000	1.40
--- valarith.c	20 Jun 2005 03:20:33 -0000
*************** value_binop (struct value *arg1, struct 
*** 791,801 ****
  	  v = v1 / v2;
  	  break;
  
!         case BINOP_EXP:
!           v = pow (v1, v2);
!           if (errno)
!             error (_("Cannot perform exponentiation: %s"), safe_strerror (errno));
!           break;
  
  	default:
  	  error (_("Integer-only operation on floating point number."));
--- 791,802 ----
  	  v = v1 / v2;
  	  break;
  
! 	case BINOP_EXP:
! 	  errno = 0;
! 	  v = pow (v1, v2);
! 	  if (errno)
! 	    error (_("Cannot perform exponentiation: %s"), safe_strerror (errno));
! 	  break;
  
  	default:
  	  error (_("Integer-only operation on floating point number."));
*************** value_binop (struct value *arg1, struct 
*** 929,939 ****
  	      v = v1 / v2;
  	      break;
  
!             case BINOP_EXP:
!               v = pow (v1, v2);
!               if (errno)
!                 error (_("Cannot perform exponentiation: %s"), safe_strerror (errno));
!               break;
  
  	    case BINOP_REM:
  	      v = v1 % v2;
--- 930,941 ----
  	      v = v1 / v2;
  	      break;
  
! 	    case BINOP_EXP:
! 	      errno = 0;
! 	      v = pow (v1, v2);
! 	      if (errno)
! 		error (_("Cannot perform exponentiation: %s"), safe_strerror (errno));
! 	      break;
  
  	    case BINOP_REM:
  	      v = v1 % v2;
*************** value_binop (struct value *arg1, struct 
*** 1050,1059 ****
  		error (_("Division by zero"));
                break;
  
!             case BINOP_EXP:
!               v = pow (v1, v2);
!               if (errno)
!                 error (_("Cannot perform exponentiation: %s"), safe_strerror (errno));
  	      break;
  
  	    case BINOP_REM:
--- 1052,1062 ----
  		error (_("Division by zero"));
                break;
  
! 	    case BINOP_EXP:
! 	      errno = 0;
! 	      v = pow (v1, v2);
! 	      if (errno)
! 		error (_("Cannot perform exponentiation: %s"), safe_strerror (errno));
  	      break;
  
  	    case BINOP_REM:

Cheers
- Wu Zhou


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC] Add code to support evaluating Fortran exponentiation expression
  2005-06-20  3:47   ` Wu Zhou
@ 2005-06-20 19:08     ` Eli Zaretskii
  2005-06-21 14:32       ` Wu Zhou
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2005-06-20 19:08 UTC (permalink / raw)
  To: Wu Zhou; +Cc: gdb-patches

> Date: Mon, 20 Jun 2005 11:16:54 +0800 (CST)
> From: Wu Zhou <woodzltc@cn.ibm.com>
> cc: gdb-patches@sources.redhat.com
> 
> On Fri, 17 Jun 2005, Eli Zaretskii wrote:
> 
> > If this patch is accepted, please submit a suitable change for the
> > user's manual which describes this operator.  (There's a section about
> > Fortran-specific support where this info belongs.)
> 
> OK.  I will submit some document once this is approved.  

Thanks.

> BTW.  Do you means to add some words into section 12.4.3 to describe this 
> change?

Yes.

> It seems the text there is very short.

It says everything I know about Fortran-specific features and issues.

> Do you think that it is 
> desirable to add some other words to describe a little more Fortran 
> specific information, such as the limitation on evaluating Fortran 
> expression, the different symbol name (MAIN__ other than main, 
> sub_ other than sub)?  Maybe some others.

By all means, please add anything you think might be of use to GDB
users who debug Fortran programs.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC] Add code to support evaluating Fortran exponentiation expression
  2005-06-20 19:08     ` Eli Zaretskii
@ 2005-06-21 14:32       ` Wu Zhou
  2005-06-21 19:41         ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Wu Zhou @ 2005-06-21 14:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

On Mon, 20 Jun 2005, Eli Zaretskii wrote:

> By all means, please add anything you think might be of use to GDB
> users who debug Fortran programs.

Eli,

It might be desirable to add the following text:

GDB support Fortran language, but mainly support output from the GNU Fortran
compiler(maybe more specifically GNU F77 compiler here?). It also has the
following limitation:

1. You need to use "break MAIN__" to make the Fortran program to stop at the
begining of the execution. To set breakpoint at a subroutine or function 
named "sub", you need to add a trailing underscore, to say "break sub_".

2. GDB can't handle the evaluation of exponentiation expression yet.

3. Current GDB can't handle the evaluation of substring expression. 
(There are some code intended to handle this, but it doesn't work with 
g77-3.2.3, g77-3.3.3 and g77-3.4.3.  I will code a testcase to show this
later.  Not sure how to fix this yet.)

4. GDB can't handle the evaluation of Fortran intrinsic functions, such as 
"mod", "abs" and so on.

5. GDB can't handle some Fortran-90 or Fortran-95 extension, such as the 
self-defined data type, such as the array addition operation, array 
substraction operation...

Maybe there are still others.  There isn't much compilable Fortran 
testcases in current testsuite.  So it is hard to say what works and what 
not.  

BTW, I am thinking of doing something to enhance GDB's support of Fortran 
language (not only f77, but also f95 or some other fortran compiler). Do 
you have any suggestion on this?  Thanks!

Cheers
- Wu Zhou


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC] Add code to support evaluating Fortran exponentiation expression
  2005-06-21 14:32       ` Wu Zhou
@ 2005-06-21 19:41         ` Eli Zaretskii
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2005-06-21 19:41 UTC (permalink / raw)
  To: Wu Zhou; +Cc: gdb-patches

> Date: Tue, 21 Jun 2005 04:34:04 +0800 (CST)
> From: Wu Zhou <woodzltc@cn.ibm.com>
> cc: gdb-patches@sources.redhat.com
> 
> It might be desirable to add the following text:

Thanks!  I will add this to the manual when I have some free time.

> BTW, I am thinking of doing something to enhance GDB's support of Fortran 
> language (not only f77, but also f95 or some other fortran compiler).

Enhancing Fortran support is indeed better than describing the current
limitations.  If you have motivation and resources, please do.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC] Add code to support evaluating Fortran exponentiation expression
  2005-06-20  4:14   ` Wu Zhou
@ 2005-07-03 17:05     ` Daniel Jacobowitz
  2005-07-06  8:36       ` Wu Zhou
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Jacobowitz @ 2005-07-03 17:05 UTC (permalink / raw)
  To: Wu Zhou; +Cc: gdb-patches

On Mon, Jun 20, 2005 at 11:30:05AM +0800, Wu Zhou wrote:
> On Fri, 17 Jun 2005, Daniel Jacobowitz wrote:
> 
> > This will need a testcase, in addition to documentation.  Doing those
> > separately is fine.  The only other problem is that f-exp.y needs a
> > copyright year update: the last listed year is 2001, but I see it has
> > been modified in 2002, 2003, and 2004.  So please add all of those
> > years (plus 2005).
> 
> Daniel,
> 
> The re-worked patch (copyright year updated) is included as follows.  OK 
> to commit?  Thanks.
> 
> 2005-06-20  Wu Zhou  <woodzltc@cn.ibm.com>
> 
> 	* f-exp.y (yyparse): Add code to support exponentiation expression.
> 	(yylex): Add code to scan exponentiation operator.
> 	* eval.c (evaluate_subexp_standard): Add support for BINOP_EXP.
> 	* valarith.c (value_binop): Reset errno to 0 before calling pow
> 	to do exponentiation operation.

Yes, this version is OK.  Thank you.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC] Add code to support evaluating Fortran exponentiation expression
  2005-06-20  4:00   ` Wu Zhou
@ 2005-07-03 17:07     ` Daniel Jacobowitz
  2005-07-06  8:55       ` Wu Zhou
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Jacobowitz @ 2005-07-03 17:07 UTC (permalink / raw)
  To: Wu Zhou; +Cc: gdb-patches

On Mon, Jun 20, 2005 at 11:22:53AM +0800, Wu Zhou wrote:
> OK.  I add five tests in gdb.fortran/exprs.exp (patch is included below).  
> Without the above patch, all the five tests fail; with it, all pass.  OK 
> to commit?  Thanks.
> 
> 2005-06-20  Wu Zhou  <woodzltc@cn.ibm.com>
> 
> 	* gdb.fortran/exprs.exp (test_arithmetic_expressions): Add five 
> 	tests to evaluate exponentiation expression.

You need to update the copyright year in this file.  Otherwise OK.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC] Add code to support evaluating Fortran exponentiation expression
  2005-07-03 17:05     ` Daniel Jacobowitz
@ 2005-07-06  8:36       ` Wu Zhou
  0 siblings, 0 replies; 13+ messages in thread
From: Wu Zhou @ 2005-07-06  8:36 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

On Sun, 3 Jul 2005, Daniel Jacobowitz wrote:

> > 2005-06-20  Wu Zhou  <woodzltc@cn.ibm.com>
> > 
> > 	* f-exp.y (yyparse): Add code to support exponentiation expression.
> > 	(yylex): Add code to scan exponentiation operator.
> > 	* eval.c (evaluate_subexp_standard): Add support for BINOP_EXP.
> > 	* valarith.c (value_binop): Reset errno to 0 before calling pow
> > 	to do exponentiation operation.
> 
> Yes, this version is OK.  Thank you.

Committed.  Thanks for reviewing this.

- Wu Zhou


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC] Add code to support evaluating Fortran exponentiation expression
  2005-07-03 17:07     ` Daniel Jacobowitz
@ 2005-07-06  8:55       ` Wu Zhou
  0 siblings, 0 replies; 13+ messages in thread
From: Wu Zhou @ 2005-07-06  8:55 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

On Sun, 3 Jul 2005, Daniel Jacobowitz wrote:

> On Mon, Jun 20, 2005 at 11:22:53AM +0800, Wu Zhou wrote:
> > OK.  I add five tests in gdb.fortran/exprs.exp (patch is included below).  
> > Without the above patch, all the five tests fail; with it, all pass.  OK 
> > to commit?  Thanks.
> > 
> > 2005-06-20  Wu Zhou  <woodzltc@cn.ibm.com>
> > 
> > 	* gdb.fortran/exprs.exp (test_arithmetic_expressions): Add five 
> > 	tests to evaluate exponentiation expression.
> 
> You need to update the copyright year in this file.  Otherwise OK.

Copyright year is updated and patch committed.  Thanks for reviewing this.

- Wu Zhou


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2005-07-06  8:55 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-17  7:36 [RFC] Add code to support evaluating Fortran exponentiation expression Wu Zhou
2005-06-17 10:17 ` Eli Zaretskii
2005-06-20  3:47   ` Wu Zhou
2005-06-20 19:08     ` Eli Zaretskii
2005-06-21 14:32       ` Wu Zhou
2005-06-21 19:41         ` Eli Zaretskii
2005-06-17 13:41 ` Daniel Jacobowitz
2005-06-20  4:00   ` Wu Zhou
2005-07-03 17:07     ` Daniel Jacobowitz
2005-07-06  8:55       ` Wu Zhou
2005-06-20  4:14   ` Wu Zhou
2005-07-03 17:05     ` Daniel Jacobowitz
2005-07-06  8:36       ` Wu Zhou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox