From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25874 invoked by alias); 27 Jan 2006 18:41:18 -0000 Received: (qmail 25864 invoked by uid 22791); 27 Jan 2006 18:41:17 -0000 X-Spam-Check-By: sourceware.org Received: from nile.gnat.com (HELO nile.gnat.com) (205.232.38.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 27 Jan 2006 18:41:16 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-nile.gnat.com (Postfix) with ESMTP id 2A06F48CDA4; Fri, 27 Jan 2006 13:41:14 -0500 (EST) Received: from nile.gnat.com ([127.0.0.1]) by localhost (nile.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 08723-01-2; Fri, 27 Jan 2006 13:41:14 -0500 (EST) Received: from takamaka.act-europe.fr (joel.gnat.com [205.232.38.116]) by nile.gnat.com (Postfix) with ESMTP id BE86848CC15; Fri, 27 Jan 2006 13:41:13 -0500 (EST) Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 2570447E7E; Fri, 27 Jan 2006 13:41:09 -0500 (EST) Date: Fri, 27 Jan 2006 18:41:00 -0000 From: Joel Brobecker To: Eli Zaretskii Cc: gdb-patches@sourceware.org, Andrew STUBBS , Jim Blandy Subject: Re: [RFC] Alternate approach to keeping convenience variables Message-ID: <20060127184109.GA1457@adacore.com> References: <4381DC75.80800@st.com> <8f2776cb0511212138g2adef40cr1632365c00e3bebc@mail.gmail.com> <43835114.5060401@st.com> <20051209205923.GA21331@nevyn.them.org> <20060122213118.GH27224@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i 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/msg00450.txt.bz2 > > GDB developers seem to have developed an allergy to C macros that > > I just don't understand. They're not _inherently_ obfuscating > > or evil! They can be both useful and elegant. > > FWIW, I never understood the ``macros are bad, m'kay?'' policy, > either. Well, it is clear to me that a unilateral decision against macros might be a bit too extreme. I think that some of the macro usage in GDB could be advantageously replaced with something better, though. I don't have the luxury to always debug on platforms where dwarf2 is available. So I can't print the value of a macro in the debugger. When I debug some code and see a function call in the form of the macro, I can't inspect a function pointer variable, I have to step into the code to follow it. Same for contant macros. You can't take the address of a macro either. Even with dwarf2, I don't know how much people use this new feature that allows us to access macros from the debugger. There are cases where macros a the best solution too. I found the new try/catch mechanism a huge improvement over the catch_error abstraction. A nice additional layer to make programing easier. Same for the ALL_OBJFILE-like macros. They make the code simpler to write without propagating too much the details about the structure. So I welcome the usage of macros. But not without discrimination. -- Joel