From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4793 invoked by alias); 24 Jan 2006 00:58:36 -0000 Received: (qmail 4784 invoked by uid 22791); 24 Jan 2006 00:58:35 -0000 X-Spam-Check-By: sourceware.org Received: from zproxy.gmail.com (HELO zproxy.gmail.com) (64.233.162.203) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 24 Jan 2006 00:58:32 +0000 Received: by zproxy.gmail.com with SMTP id x3so1035248nzd for ; Mon, 23 Jan 2006 16:58:31 -0800 (PST) Received: by 10.36.251.60 with SMTP id y60mr1361675nzh; Mon, 23 Jan 2006 16:58:31 -0800 (PST) Received: by 10.37.2.42 with HTTP; Mon, 23 Jan 2006 16:58:31 -0800 (PST) Message-ID: <8f2776cb0601231658k6cf2530di5d00b2f5e6bbdcf@mail.gmail.com> Date: Tue, 24 Jan 2006 00:58:00 -0000 From: Jim Blandy To: GDB Patches Subject: RFA: handle references to typedefs in binop_user_defined_p MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00347.txt.bz2 No regressions on x86_64 native. gdb/ChangeLog: 2006-01-23 Jim Blandy * valarith.c (binop_user_defined_p): Handle refs to typedefs. Index: gdb/valarith.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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; } =0C ! /* 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 `=3D' operator. */ --- 285,293 ---- return v; } =0C ! /* 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 `=3D' operator. */ *************** binop_user_defined_p (enum exp_opcode op *** 297,310 **** struct type *type1, *type2; if (op =3D=3D BINOP_ASSIGN || op =3D=3D BINOP_CONCAT) return 0; type1 =3D check_typedef (value_type (arg1)); type2 =3D check_typedef (value_type (arg2)); return (TYPE_CODE (type1) =3D=3D TYPE_CODE_STRUCT ! || TYPE_CODE (type2) =3D=3D TYPE_CODE_STRUCT ! || (TYPE_CODE (type1) =3D=3D TYPE_CODE_REF ! && TYPE_CODE (TYPE_TARGET_TYPE (type1)) =3D=3D TYPE_CODE_STRUCT) ! || (TYPE_CODE (type2) =3D=3D TYPE_CODE_REF ! && TYPE_CODE (TYPE_TARGET_TYPE (type2)) =3D=3D TYPE_CODE_STRUCT)); } /* Check to see if argument is a structure. This is called so --- 297,313 ---- struct type *type1, *type2; if (op =3D=3D BINOP_ASSIGN || op =3D=3D BINOP_CONCAT) return 0; + type1 =3D check_typedef (value_type (arg1)); + if (TYPE_CODE (type1) =3D=3D TYPE_CODE_REF) + type1 =3D check_typedef (TYPE_TARGET_TYPE (type1)); + type2 =3D check_typedef (value_type (arg2)); + if (TYPE_CODE (type2) =3D=3D TYPE_CODE_REF) + type2 =3D check_typedef (TYPE_TARGET_TYPE (type2)); + return (TYPE_CODE (type1) =3D=3D TYPE_CODE_STRUCT ! || TYPE_CODE (type2) =3D=3D TYPE_CODE_STRUCT); } /* Check to see if argument is a structure. This is called so