From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29927 invoked by alias); 2 Nov 2012 19:52:32 -0000 Received: (qmail 29914 invoked by uid 22791); 2 Nov 2012 19:52:31 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Nov 2012 19:52:23 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qA2JqLBS026073 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 2 Nov 2012 15:52:21 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qA2JqJCM031223 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 2 Nov 2012 15:52:20 -0400 From: Tom Tromey To: Siva Chandra Cc: gdb-patches@sourceware.org Subject: Re: [RFC] Fix for gdb.parameter('architecture') returning empty string References: <87y5ilqdoz.fsf@fleche.redhat.com> <87r4ocosah.fsf@fleche.redhat.com> Date: Fri, 02 Nov 2012 19:52:00 -0000 In-Reply-To: (Siva Chandra's message of "Fri, 2 Nov 2012 11:45:49 -0700") Message-ID: <87hap7ok98.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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-11/txt/msg00070.txt.bz2 >>>>> "Siva" == Siva Chandra writes: Tom> I think this just means that "show architecture" will now show incorrect Tom> results, though. Siva> This is for my understanding: Can you give an example where this can Siva> give incorrect results. Is it only for the case when the arch can Siva> change from frame to frame? I have tested for all cases that I could Siva> think of and it seems fine. Yeah, if two frames have different architectures and the user does "show arch" in each one. I could be wrong. I don't have a setup like this to actually test it. I just didn't see what notifies the architecture-changed observer in this scenario. Similarly, I think if the inferior starts or exits, and it has a different architecture from the target_gdbarch, then observer will not be notified, yielding wrong results. Siva> For now, I have been using gdb.execute("show architecture", Siva> to_string=True) and getting the value from the resulting string. I am Siva> trying to tidy that up by using gdb.parameter(...). And, for my work, Siva> exposing arch from frames will work as I need the arch during an Siva> active frame only. I see two items here then: Siva> 1. Fix gdb.parameter by the way of using methods on CLI objects. Siva> 2. Expose current frame arch through the gdb.Frame class. Siva> Do they seem reasonable? I think so. Tom