From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17743 invoked by alias); 10 Sep 2008 16:25:47 -0000 Received: (qmail 17684 invoked by uid 22791); 10 Sep 2008 16:25:44 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 10 Sep 2008 16:25:09 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id B303F2A9656; Wed, 10 Sep 2008 12:25:07 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id K9W+Z6WJ7LVY; Wed, 10 Sep 2008 12:25:07 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 49E2B2A961B; Wed, 10 Sep 2008 12:25:07 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 26000E7ACD; Wed, 10 Sep 2008 18:25:05 +0200 (CEST) Date: Wed, 10 Sep 2008 16:25:00 -0000 From: Joel Brobecker To: Ulrich Weigand Cc: gdb-patches@sourceware.org Subject: Re: [rfc][00/37] Eliminate builtin_type_ macros Message-ID: <20080910162505.GM12222@adacore.com> References: <20080910061720.GL12222@adacore.com> <200809100941.m8A9fBR4005671@d12av02.megacenter.de.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="raC6veAxrt5nqIoY" Content-Disposition: inline In-Reply-To: <200809100941.m8A9fBR4005671@d12av02.megacenter.de.ibm.com> User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-09/txt/msg00212.txt.bz2 --raC6veAxrt5nqIoY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1245 > > Sure! I don't know what this didn't cross my mind earlier, I guess > > I was in a bit of a crunch... Will do that tomorrow (I'm also planning > > on submitting a bunch of patches tomorrow as well, if things go as > > planned - so that'll be a good time for that). > > OK, thanks! OK, I ended up checking in both patches (there was simply too much confusion on the second one, so it was simpler if I just change the use of builtin_type_int into builtin_type_int32). Hopefully, this should clear the way for you to commit your series of patches! 2008-09-10 Joel Brobecker * ada-lang.c (ada_evaluate_subexp) [BINOP_ADD, BINOP_SUB]: Add special handling for pointer types. 2008-09-10 Joel Brobecker * ada-lang.c (ada_evaluate_subexp) [OP_ATR_SIZE]: Use archecture-neutral builtin_type_int32 instead of builtin_type_int. As I said, using int32 is not completely ideal, but should be good enough in practice. If someone ever hits that limitation, I'll think about writing a function that returns a type that's big enough to hold a given LONGEST/ULONGEST... Actual patches attached. Tested on x86-linux by running the gdb.ada testcases. Cheers, -- Joel --raC6veAxrt5nqIoY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="01-ptrdiff.diff" Content-length: 1409 Index: ada-lang.c =================================================================== RCS file: /cvs/src/src/gdb/ada-lang.c,v retrieving revision 1.156 retrieving revision 1.157 diff -u -p -r1.156 -r1.157 --- ada-lang.c 10 Sep 2008 09:47:39 -0000 1.156 +++ ada-lang.c 10 Sep 2008 16:12:35 -0000 1.157 @@ -8497,6 +8497,10 @@ ada_evaluate_subexp (struct type *expect arg2 = evaluate_subexp_with_coercion (exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; + if (TYPE_CODE (value_type (arg1)) == TYPE_CODE_PTR) + return (value_from_longest + (value_type (arg1), + value_as_long (arg1) + value_as_long (arg2))); if ((ada_is_fixed_point_type (value_type (arg1)) || ada_is_fixed_point_type (value_type (arg2))) && value_type (arg1) != value_type (arg2)) @@ -8514,6 +8518,10 @@ ada_evaluate_subexp (struct type *expect arg2 = evaluate_subexp_with_coercion (exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; + if (TYPE_CODE (value_type (arg1)) == TYPE_CODE_PTR) + return (value_from_longest + (value_type (arg1), + value_as_long (arg1) - value_as_long (arg2))); if ((ada_is_fixed_point_type (value_type (arg1)) || ada_is_fixed_point_type (value_type (arg2))) && value_type (arg1) != value_type (arg2)) --raC6veAxrt5nqIoY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="02-size_atr.diff" Content-length: 807 Index: ada-lang.c =================================================================== RCS file: /cvs/src/src/gdb/ada-lang.c,v retrieving revision 1.157 diff -u -p -r1.157 ada-lang.c --- ada-lang.c 10 Sep 2008 16:12:35 -0000 1.157 +++ ada-lang.c 10 Sep 2008 16:19:19 -0000 @@ -9074,9 +9074,9 @@ ada_evaluate_subexp (struct type *expect if (noside == EVAL_SKIP) goto nosideret; else if (noside == EVAL_AVOID_SIDE_EFFECTS) - return value_zero (builtin_type_int, not_lval); + return value_zero (builtin_type_int32, not_lval); else - return value_from_longest (builtin_type_int, + return value_from_longest (builtin_type_int32, TARGET_CHAR_BIT * TYPE_LENGTH (value_type (arg1))); --raC6veAxrt5nqIoY--