From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15846 invoked by alias); 18 Mar 2002 18:34:00 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15664 invoked from network); 18 Mar 2002 18:33:43 -0000 Received: from unknown (HELO monkey.daikokuya.demon.co.uk) (158.152.184.26) by sources.redhat.com with SMTP; 18 Mar 2002 18:33:43 -0000 Received: from neil by monkey.daikokuya.demon.co.uk with local (Exim 3.35 #1 (Debian)) id 16n1wy-0005O4-00; Mon, 18 Mar 2002 18:33:40 +0000 Date: Mon, 18 Mar 2002 10:34:00 -0000 To: Jim Blandy Cc: gdb-patches@sources.redhat.com, gcc@gcc.gnu.org Subject: Re: RFC: C/C++ preprocessor macro support for GDB Message-ID: <20020318183339.GB19897@daikokuya.demon.co.uk> References: <20020317062306.CC96D5E9DE@zwingli.cygnus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020317062306.CC96D5E9DE@zwingli.cygnus.com> User-Agent: Mutt/1.3.27i From: Neil Booth X-SW-Source: 2002-03/txt/msg00314.txt.bz2 Jim Blandy wrote:- > > The following patch adds support for C/C++ preprocessor macros to GDB. > It's tentative: > > - There are no ChangeLog entries. > - It's not broken up into relatively independent changes. > - There's no documentation. > - There are no tests. > - There are some unimplemented features. > Jim, I've looked over your patch a little more, and I don't think your macro expander works, because it doesn't mark individual tokens. A "disabled macro" stack is *not* enough by itself to implement ISO C macro expansion semantics. You need to attach information to individual tokens as well. I've not tried it, but I'd bet that #define A(x) x A(A)(1) expands to "1" with your code, whereas the correct expansion is "A(1)". Implementing this properly is a PITA, more so with a text-based expander like yours. It would be very hard to get the same (correct) semantics as cpplib in corner cases with a text-based expander (2.95 has outstanding bugs in this area). In addition, as you note #, ## and the various variadic macro semantics and GCC extensions have not been implemented, I think a lot of work lies ahead in this implementation. IMO using cpplib will be a lot less effort, even after what you've already accomplished. Neil.