From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11994 invoked by alias); 2 Sep 2008 21:52:58 -0000 Received: (qmail 11984 invoked by uid 22791); 2 Sep 2008 21:52:58 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 02 Sep 2008 21:52:09 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id A638D98417; Tue, 2 Sep 2008 21:52:07 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 8FE80981E8; Tue, 2 Sep 2008 21:52:07 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KadnC-0006hz-V3; Tue, 02 Sep 2008 17:52:06 -0400 Date: Tue, 02 Sep 2008 21:52:00 -0000 From: Daniel Jacobowitz To: Ulrich Weigand Cc: gdb-patches@sourceware.org Subject: Re: [rfc][08/37] Eliminate builtin_type_ macros: Make pointer arithmetic explicit Message-ID: <20080902215206.GA25623@caradoc.them.org> Mail-Followup-To: Ulrich Weigand , gdb-patches@sourceware.org References: <20080902123738.GB21700@caradoc.them.org> <200809022147.m82Ll8Td011960@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200809022147.m82Ll8Td011960@d12av02.megacenter.de.ibm.com> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes 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/msg00028.txt.bz2 On Tue, Sep 02, 2008 at 11:47:08PM +0200, Ulrich Weigand wrote: > Lets put the question differently: Why should the generic "add" routine > of a debugger supporting many languages have hard-coded semantics that > are specific to C (and in fact, the C ABI on a specific platform)? > > I was trying to make the "value_*" routines be as much as possible > language- and architecture-independent, and push language- and > architecture-specific semantics up to higher layers. (In this case, > the expression evaluator. In fact, I might like it even better if > expressions themselves were also language-agnostic, and all the > language-specific semantics were encoded explicitly into different > operand codes by the parsers ...) Yes, that would be nice - but I think we'd need a different parsing system then; for instance, to do C++ overloading at the right time. > As to your question: when replacing uses of value_add, every caller > *knew* whether the arguments were pointers or scalars (exept for the > generic expression evaluator, of course). GDB-internal uses do not > really assume the C-specific overloading of the "+" operator ... OK, that's good enough for me. I agree it would be nice to define what the value operators do. We'll be exposing them to Python, and I want to be able to document sanely in the manual what happens if you add an integer and a pointer :-) -- Daniel Jacobowitz CodeSourcery