Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* RFA: handle references to typedefs in binop_user_defined_p
@ 2006-01-24  0:58 Jim Blandy
  2006-01-24 19:24 ` Mark Kettenis
  0 siblings, 1 reply; 3+ messages in thread
From: Jim Blandy @ 2006-01-24  0:58 UTC (permalink / raw)
  To: GDB Patches

No regressions on x86_64 native.

gdb/ChangeLog:
2006-01-23  Jim Blandy  <jimb@redhat.com>

	* valarith.c (binop_user_defined_p): Handle refs to typedefs.

Index: gdb/valarith.c
===================================================================
RCS file: /cvs/src/src/gdb/valarith.c,v
retrieving revision 1.44
diff -c -p -r1.44 valarith.c
*** gdb/valarith.c	17 Dec 2005 22:34:03 -0000	1.44
--- gdb/valarith.c	24 Jan 2006 00:42:36 -0000
*************** value_subscripted_rvalue (struct value *
*** 285,293 ****
    return v;
  }
  \f
! /* Check to see if either argument is a structure.  This is called so
!    we know whether to go ahead with the normal binop or look for a
!    user defined function instead.

     For now, we do not overload the `=' operator.  */

--- 285,293 ----
    return v;
  }
  \f
! /* Check to see if either argument is a structure, or a reference to
!    one.  This is called so we know whether to go ahead with the normal
!    binop or look for a user defined function instead.

     For now, we do not overload the `=' operator.  */

*************** binop_user_defined_p (enum exp_opcode op
*** 297,310 ****
    struct type *type1, *type2;
    if (op == BINOP_ASSIGN || op == BINOP_CONCAT)
      return 0;
    type1 = check_typedef (value_type (arg1));
    type2 = check_typedef (value_type (arg2));
    return (TYPE_CODE (type1) == TYPE_CODE_STRUCT
! 	  || TYPE_CODE (type2) == TYPE_CODE_STRUCT
! 	  || (TYPE_CODE (type1) == TYPE_CODE_REF
! 	      && TYPE_CODE (TYPE_TARGET_TYPE (type1)) == TYPE_CODE_STRUCT)
! 	  || (TYPE_CODE (type2) == TYPE_CODE_REF
! 	      && TYPE_CODE (TYPE_TARGET_TYPE (type2)) == TYPE_CODE_STRUCT));
  }

  /* Check to see if argument is a structure.  This is called so
--- 297,313 ----
    struct type *type1, *type2;
    if (op == BINOP_ASSIGN || op == BINOP_CONCAT)
      return 0;
+
    type1 = check_typedef (value_type (arg1));
+   if (TYPE_CODE (type1) == TYPE_CODE_REF)
+     type1 = check_typedef (TYPE_TARGET_TYPE (type1));
+
    type2 = check_typedef (value_type (arg2));
+   if (TYPE_CODE (type2) == TYPE_CODE_REF)
+     type2 = check_typedef (TYPE_TARGET_TYPE (type2));
+
    return (TYPE_CODE (type1) == TYPE_CODE_STRUCT
! 	  || TYPE_CODE (type2) == TYPE_CODE_STRUCT);
  }

  /* Check to see if argument is a structure.  This is called so


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

* Re: RFA: handle references to typedefs in binop_user_defined_p
  2006-01-24  0:58 RFA: handle references to typedefs in binop_user_defined_p Jim Blandy
@ 2006-01-24 19:24 ` Mark Kettenis
  2006-01-24 21:21   ` Jim Blandy
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2006-01-24 19:24 UTC (permalink / raw)
  To: jimb; +Cc: gdb-patches

> Date: Mon, 23 Jan 2006 16:58:31 -0800
> From: Jim Blandy <jimb@red-bean.com>
> 
> No regressions on x86_64 native.
> 
> gdb/ChangeLog:
> 2006-01-23  Jim Blandy  <jimb@redhat.com>
> 
> 	* valarith.c (binop_user_defined_p): Handle refs to typedefs.

Looks ok to me.


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

* Re: RFA: handle references to typedefs in binop_user_defined_p
  2006-01-24 19:24 ` Mark Kettenis
@ 2006-01-24 21:21   ` Jim Blandy
  0 siblings, 0 replies; 3+ messages in thread
From: Jim Blandy @ 2006-01-24 21:21 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

On 1/24/06, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> > 2006-01-23  Jim Blandy  <jimb@redhat.com>
> >
> >       * valarith.c (binop_user_defined_p): Handle refs to typedefs.
>
> Looks ok to me.

Committed --- thanks.


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

end of thread, other threads:[~2006-01-24 21:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-24  0:58 RFA: handle references to typedefs in binop_user_defined_p Jim Blandy
2006-01-24 19:24 ` Mark Kettenis
2006-01-24 21:21   ` Jim Blandy

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