From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14159 invoked by alias); 10 Sep 2008 06:18:00 -0000 Received: (qmail 14150 invoked by uid 22791); 10 Sep 2008 06:18:00 -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 06:17:25 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 2B2122A9664; Wed, 10 Sep 2008 02:17:23 -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 WAyEl6ExX-sn; Wed, 10 Sep 2008 02:17:23 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id BA2012A965E; Wed, 10 Sep 2008 02:17:22 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 9ABA9E7ACD; Wed, 10 Sep 2008 08:17:20 +0200 (CEST) Date: Wed, 10 Sep 2008 06:18:00 -0000 From: Joel Brobecker To: Ulrich Weigand Cc: gdb-patches@sourceware.org Subject: Re: [rfc][00/37] Eliminate builtin_type_ macros Message-ID: <20080910061720.GL12222@adacore.com> References: <20080909211801.GH12222@adacore.com> <200809092211.m89MBers023545@d12av02.megacenter.de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200809092211.m89MBers023545@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/msg00206.txt.bz2 > > 1. Pointer arithmetics, in particular "PTR + PTR" or "PTR - PTR" > > expressions. For instance: > > > > (gdb) print b'address - a'address > > Argument to arithmetic operation not a number or boolean. [...] > I see. In that case, your patch would be a bugfix completely > independently of my patch set. Do you want to commit it right away? 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). > > 2. The second problem is just an oversight. You needed a variable > > to store the int builtin type, and unfortunately you reused > > a variable that was still in use. > > See ada-lang.c (evaluate_subexp) [OP_ATR_SIZE]. > > > > For now, I just used builtin_type_int32. Not ideal, but should > > be large enough for the vast majority of objects we actually > > have to deal with in real life. > > Huh? I'm not sure what base this patch is against: It was on top of your patch - If I am not mistaken, it should apply cleanly after you apply yours. I did, however, generate the patch against AdaCore's gdb-head (which is a merge between our changes and nearly-top-of-fsf-tree) to which I applied your patch. So there might indeed be some differences that would cause a conflict; I just don't see any, right now. Perhaps there are some withspace differences? I hate those tabs with a passion, and always having them right is really difficult and fustrating for me. > > --- a/ada-lang.c Tue Sep 09 12:31:38 2008 -0700 > > +++ b/ada-lang.c Tue Sep 09 12:57:26 2008 -0700 > > @@ -10541,11 +10541,10 @@ ada_evaluate_subexp (struct type *expect > > > > if (noside == EVAL_SKIP) > > goto nosideret; > > - type = builtin_type (exp->gdbarch)->builtin_int; > > if (noside == EVAL_AVOID_SIDE_EFFECTS) > > - return value_zero (type, not_lval); > > - else > > - return value_from_longest (type, > > + return value_zero (builtin_type_int32, not_lval); > > + else > > + return value_from_longest (builtin_type_int32, > > TARGET_CHAR_BIT * TYPE_LENGTH (type)); > > > > case OP_ATR_VAL: > > The OP_ATR_SIZE in ada_evaluate_subexp in current head looks like this: > > case OP_ATR_SIZE: > arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); > if (noside == EVAL_SKIP) > goto nosideret; > else if (noside == EVAL_AVOID_SIDE_EFFECTS) > return value_zero (builtin_type_int, not_lval); > else > return value_from_longest (builtin_type_int, > TARGET_CHAR_BIT > * TYPE_LENGTH (value_type (arg1))); > > and after my patch set we have: > > case OP_ATR_SIZE: > arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); > if (noside == EVAL_SKIP) > goto nosideret; > type = builtin_type (exp->gdbarch)->builtin_int; > if (noside == EVAL_AVOID_SIDE_EFFECTS) > return value_zero (type, not_lval); > else > return value_from_longest (type, > TARGET_CHAR_BIT > * TYPE_LENGTH (value_type (arg1))); > -- Joel