From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30064 invoked by alias); 22 Oct 2012 07:16:33 -0000 Received: (qmail 29953 invoked by uid 22791); 22 Oct 2012 07:16:32 -0000 X-SWARE-Spam-Status: No, hits=-5.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-qa0-f41.google.com (HELO mail-qa0-f41.google.com) (209.85.216.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Oct 2012 07:15:58 +0000 Received: by mail-qa0-f41.google.com with SMTP id c4so1275334qae.0 for ; Mon, 22 Oct 2012 00:15:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-system-of-record:x-gm-message-state; bh=UnmcluzXqoXbzEQi+i02HgkO5oqdHGDH79ILv5sSn7o=; b=B/3AjUJYnKgnfm9qa+cKT4PgrXL7Ty+6jt0BmKKYTTYVKh+uop2wxePrsM41FV7rTh fjkho2igYkaOCPlOs5v+aOqAjWctimN0+WZ/76QNbOhNyPa/q9WOwpUQ93bvtaNTQN2J gc3fJZ3naq+fFrCAWWIAzazCy9NhnYIiAFwaWD9KR6/6Md9QsV1ctgtDnCM/TeylX64F JhEvrXdg6aiqHiDG8xYwHpgDeuxhMqc9d5dxlsjO+o3Wt3tRk4okYq2dErGi3QlByubi E91qIVG9HNGEbJvd5haF/Nbu0AHLlaNS3i8nMVjyRy8297IrmEXMPxoxyRX5EYt+Dam7 xB2w== MIME-Version: 1.0 Received: by 10.49.28.231 with SMTP id e7mr4522935qeh.49.1350890157944; Mon, 22 Oct 2012 00:15:57 -0700 (PDT) Received: by 10.224.54.129 with HTTP; Mon, 22 Oct 2012 00:15:57 -0700 (PDT) In-Reply-To: References: Date: Mon, 22 Oct 2012 07:16:00 -0000 Message-ID: Subject: Re: [RFC] Fix for gdb.parameter('architecture') returning empty string From: Siva Chandra To: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-Gm-Message-State: ALoCoQle9oaWKgpV380R+3pGvbJvwE8oph3z+I7cjzTnlHNQbkQqnRbBYIaoC6ZZZCPoN0ITftQciXFhTA9ImEMPPj4zAX7foh8aMVLsK8gmsWSrbpUuUQrKLK3xXtxEF0tR2vHyrpVisAmm/zxu713WOLrtA0/5NUnZrucSzS79wURS74EwLJ9fO7HAiAmKPAKlvQr3HhnBmNoO1uw8/8dyhIcNhc51iQ== X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-10/txt/msg00381.txt.bz2 PING On Sun, Oct 14, 2012 at 1:36 AM, Siva Chandra wrote: > Based on Andreas Schwab's feedback, I am now printing 'big' and > 'little' explicitly. > > 2012-10-14 Siva Chandra Reddy > > * 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 > > 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 wrote: >> Siva Chandra 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."