This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Handle BINOP_INTDIV in eval.c


 My first patch handling BINOP_INTDIV was incomplete,
I forgot the eval.c part that is required:

I send here a minimal patch to
allow to get a 'print 13 div 3' to return '4'

  Is this OK?
  
ChangeLog entry:

2008-01-25  Pierre Muller  <muller@ics.u-strasbg.fr>

	* eval.c (evaluate_subexp_standard): Support
	BINOP_INTDIV opcode.


Index: gdb/eval.c
===================================================================
RCS file: /cvs/src/src/gdb/eval.c,v
retrieving revision 1.77
diff -u -p -r1.77 eval.c
--- gdb/eval.c  18 Jan 2008 17:07:39 -0000      1.77
+++ gdb/eval.c  21 Jan 2008 14:55:45 -0000
@@ -1496,6 +1496,7 @@ evaluate_subexp_standard (struct type *e
     case BINOP_EXP:
     case BINOP_MUL:
     case BINOP_DIV:
+    case BINOP_INTDIV:
     case BINOP_REM:
     case BINOP_MOD:
     case BINOP_LSH:
@@ -1510,7 +1511,8 @@ evaluate_subexp_standard (struct type *e
       if (binop_user_defined_p (op, arg1, arg2))
        return value_x_binop (arg1, arg2, op, OP_NULL, noside);
       else if (noside == EVAL_AVOID_SIDE_EFFECTS
-              && (op == BINOP_DIV || op == BINOP_REM || op == BINOP_MOD))
+              && (op == BINOP_DIV || op == BINOP_REM || op == BINOP_MOD
+                  || op == BINOP_INTDIV))
        return value_zero (value_type (arg1), not_lval);
       else
        return value_binop (arg1, arg2, op);





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]