[RFC] Fix for gdb.parameter('architecture') returning empty string

Siva Chandra sivachandra@google.com
Mon Oct 22 07:16:00 GMT 2012


PING

On Sun, Oct 14, 2012 at 1:36 AM, Siva Chandra <sivachandra@google.com> wrote:
> Based on Andreas Schwab's feedback, I am now printing 'big' and
> 'little' explicitly.
>
> 2012-10-14  Siva Chandra Reddy  <sivachandra@google.com>
>
>         * arch-utils.c: Rename variables 'set_endian_string' and
>         'set_architecture_string' to 'endian_string' and
>         'architecture_string' respectively.
>         (show_endian): Use 'endian_string' instead of evaluating the
>         endianness from the current architecture.
>         (show_architecture): Use 'architecture_string' instead of
>         evaluating the architecture name from the current architecture.
>         (set_endian, _initialize_gdbarch_utils): Use the new
>         'endian_string' variable.
>         (selected_architecture_name, set_architecture): Use the new
>         'architecture_string' variable.
>         (set_endian_string): New convenience function to set
>         'endian_string'.
>         (on_architecture_change): Callback for the architecture change
>         event.
>         (initialize_current_architecture): Initialize
>         'architecture_string' and 'endian_string'. Attach the callback
>         on_architecture_change to the architecture change observer.
>
> testsuite/
>
> 2012-10-14  Siva Chandra Reddy  <sivachandra@google.com>
>
>         gdb.python/py-parameter.exp: Add a new test to test
>         gdb.parameter ('endian').
>
> Thanks,
> Siva Chandra
>
> On Sun, Oct 14, 2012 at 12:53 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
>> Siva Chandra <sivachandra@google.com> writes:
>>
>>> @@ -274,19 +275,13 @@ show_endian (struct ui_file *file, int f
>>>            const char *value)
>>>  {
>>>    if (target_byte_order_user == BFD_ENDIAN_UNKNOWN)
>>> -    if (gdbarch_byte_order (get_current_arch ()) == BFD_ENDIAN_BIG)
>>>        fprintf_unfiltered (file, _("The target endianness is set automatically "
>>> -                               "(currently big endian)\n"));
>>> -    else
>>> -      fprintf_unfiltered (file, _("The target endianness is set automatically "
>>> -                               "(currently little endian)\n"));
>>> +                               "(currently %s endian)\n"),
>>> +                          endian_string);
>>>    else
>>> -    if (target_byte_order_user == BFD_ENDIAN_BIG)
>>> -      fprintf_unfiltered (file,
>>> -                       _("The target is assumed to be big endian\n"));
>>> -    else
>>>        fprintf_unfiltered (file,
>>> -                       _("The target is assumed to be little endian\n"));
>>> +                       _("The target is assumed to be %s endian\n"),
>>> +                          endian_string);
>>
>> This is bad for i18n, since big/little can no longer be translated.
>>
>> Andreas.
>>
>> --
>> Andreas Schwab, schwab@linux-m68k.org
>> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
>> "And now for something completely different."



More information about the Gdb-patches mailing list