Re: add set cp-abi command

Jim Ingham
2002-03-16T01:11:57Z

Oops, I muffed one line in the patch I sent. The line:

static struct cp_abi_ops current_cp_abi;

should be:

static struct cp_abi_ops current_cp_abi = {"auto", NULL};

We do intend for auto to be the initial "current" abi, but we can't be
sure when this will be done (and currently the initializers for
gnu-v2-abi.c & gnu-v3-abi.c run BEFORE the cp-abi.c initializer). I
could fix this, but it is better to make the order not matter.

Jim

On Thursday, March 14, 2002, at 01:26 PM, Daniel Jacobowitz wrote:

> On Thu, Mar 14, 2002 at 01:14:09PM -0800, Jim Ingham wrote:
>> Thanks... I am not sure it is really worth the effort. It is not
>> really something we want to encourage folks to do, after all, and in
>> time the issue will fade away...
>
> Very true. And by definition, there should really only be one ABI...
> if it comes up as a bug again somewhere else, we can look into this.
>
>>>> ***************
>>>> *** 103,109 ****
>>>> --- 106,164 ----
>>>> int i;
>>>> for (i = 0; i < num_cp_abis; i++)
>>>> if (strcmp (cp_abis[i].shortname, short_name) == 0)
>>>> + {
>>>> current_cp_abi = cp_abis[i];
>>>> return 1;
>>>> + }
>>>> +
>>>> + return 0;
>>>> + }
>>>
>>> Indentation, of course.
>>
>> This is actually mailer mangling, it was right in the sources. $%#$#$$#
>> GUI mailers...
>
> Well, unless your mailer ate a "+" at the beginning of "return 1;", it
> wasn't right in the mail. That line is moving over. I'm sure you'll
> have it right when you commit it :)
>
>>> "currently selected C++ ABI", please.
>>
>> As you wish...
>
> Thanks. We may not have consistent grammar or spelling in our messages
> right now, but I'm still all over trying.
>
>>>> + ui_out_field_string (uiout, "cp-abi", current_cp_abi.shortname);
>>>> + ui_out_text (uiout, ".\n");
>>>> + }
>>>> +
>>>> + void
>>>> + show_cp_abis_cmd (char *args, int from_tty)
>>>> + {
>>>> + int i;
>>>> + ui_out_text (uiout, "The valid cplus abi's are:\n");
>>>
>>> "C++ ABIs" (or ABI's? ABIs, I think, if there isn't a precedent)
>>
>> We actually checked Strunk & White, and as of the mid 30's, this should
>> be ABIs...
>
> "ABIs" looks like what I remember, too, so let's use that.
>
>>> I believe 'show cp-abi' should show the available ABIs. That's more
>>> in
>>> keeping with existing code.
>>
>> How would you find out the current ABI, then? Probably better is to
>> chuck the show abis, and let "set cp-abi" (with no arguments) perform
>> this function. This is the way "set language" works, so it has
>> precedent. I was sure that there was another command that used the
>> singular lists current, plural lists all, but I can't find it so
>> maybe I
>> was just out of my mind...
>
> Shall we agree to mimic "set language", then?
>
> [For anyone following along:
>
> (gdb) set language
> The currently understood settings are:
>
> local or auto Automatic setting based on source file
> c Use the C language
> c++ Use the C++ language
> asm Use the Asm language
> chill Use the Chill language
> fortran Use the Fortran language
> java Use the Java language
> modula-2 Use the Modula-2 language
> pascal Use the Pascal language
> scheme Use the Scheme language
> (gdb) show language
> The current source language is "auto; currently c".
>
> ]
>
> --
> Daniel Jacobowitz Carnegie Mellon University
> MontaVista Software Debian GNU/Linux Developer
>
--
Jim Ingham jingham@apple.com
Developer Tools - gdb
Apple Computer