From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3717 invoked by alias); 20 Mar 2002 23:19:04 -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 3577 invoked from network); 20 Mar 2002 23:18:59 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 20 Mar 2002 23:18:59 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 16npM8-0004YU-00; Wed, 20 Mar 2002 18:18:56 -0500 Date: Wed, 20 Mar 2002 15:19:00 -0000 From: Daniel Jacobowitz To: Jim Ingham Cc: gdb-patches@sources.redhat.com Subject: Re: add set cp-abi command Message-ID: <20020320181856.A17115@nevyn.them.org> Mail-Followup-To: Jim Ingham , gdb-patches@sources.redhat.com References: <20020315224121.B3612@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.23i X-SW-Source: 2002-03/txt/msg00398.txt.bz2 On Mon, Mar 18, 2002 at 12:01:04PM -0800, Jim Ingham wrote: > In fact, since the ABI's are all added in _initialize functions, it would be > even simpler just to fix the size of the array. When somebody adds the > "last straw" ABI to gdb, we can just spit out a message saying increase this > number, and that developer can do so and recompile. This is safe since I > don't think we really have the intention that we are adding these things > dynamically at runtime... Definitely not as GDB stands, and I don't see a point. This bit is fine. > > > >> const char *name = SYMBOL_NAME (&objfile->msymbols[i]); > >> if (name[0] == '_' && name[1] == 'Z') > >> { > >> + if (cp_abi_is_auto_p ()) > >> switch_to_cp_abi ("gnu-v3"); > >> break; > >> } > > > > This bit, of course, is great :) > > Way too much work to get there, however. Another point that is unclear to > me, should this instead be: > > if (cp_abi_is_auto_p ()) > set_cp_abi_as_auto_default ("gnu_v3"); > break; > > I would have to change set_... to take the name rather than a structure, and > look it up (and add a lookup_cp_abi to be nice). But it fits with the set > lang more. OTOH, I have already spent more time on this that it deserves by > a long shot, so... I suppose that this would be best; if we set cp-abi to auto it should remain v3. > I am including a new patch, with just the cp-abi.c bits to keep it smaller, > and I didn't edit this one to change the indentation goofs that the mailer > added (I did with the last patch, oh fun...). Mangled patches are a pain to read. If you can't get a mailer that won't mangle it inline, can you at least get them attached in some vaguely sane MIME-ish way? Other than set_cp_abi_as_auto_default, my only remaining nits are grammatical again: ! error ("Too many CP ABI's, please increase CP_ABI_MAX in cp-abi.c"); internal_error(), and "C++ ABIs". + if (!switch_to_cp_abi (args)) + error ("Could not find ABI: \"%s\" in ABI list\n", args); "Could not find \"%s\" in ABI list" (and no \n) + ui_out_text (uiout, "The currently selected C++ abi is: "); "ABI", not "abi". And show_cp_abis should probably mention "auto". With the above changes it should be OK, although I would like to see it. Thanks for following this through. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer