From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19866 invoked by alias); 5 Sep 2013 14:27:42 -0000 Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org Received: (qmail 19854 invoked by uid 89); 5 Sep 2013 14:27:42 -0000 Received: from mms2.broadcom.com (HELO mms2.broadcom.com) (216.31.210.18) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Sep 2013 14:27:42 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_40,KHOP_THREADED,RDNS_NONE autolearn=no version=3.3.2 X-HELO: mms2.broadcom.com Received: from [10.9.208.57] by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Thu, 05 Sep 2013 07:21:12 -0700 X-Server-Uuid: 4500596E-606A-40F9-852D-14843D8201B2 Received: from IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.1.438.0; Thu, 5 Sep 2013 07:27:31 -0700 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) with Microsoft SMTP Server id 14.1.438.0; Thu, 5 Sep 2013 07:27:30 -0700 Received: from [10.177.73.74] (unknown [10.177.73.74]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id CD5841A48 for ; Thu, 5 Sep 2013 07:27:29 -0700 (PDT) Message-ID: <522894D1.3030209@broadcom.com> Date: Thu, 05 Sep 2013 14:27:00 -0000 From: "Andrew Burgess" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: insight@sourceware.org Subject: [PATCH 2/2] Notice architecture changes even when the register window is not open. References: <5228941F.8080601@broadcom.com> In-Reply-To: <5228941F.8080601@broadcom.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-q3/txt/msg00036.txt.bz2 The register cache can be accessed through the TCL proc "gdb_reginfo", which can be called from anywhere, there's currently only one other caller in "actiondlg.tcl", but more callers could easily be added. I believe that currently any caller to gdb_reginfo needs to (a) know if they are accessing the reg-cache, and (b) if they are listen for arch changed events and update the reg-cache. I think this a bad situation to be in as, the reg-cache would ideally be hidden from the user of "gdb_reginfo", and secondly, we only really need to update the reg-cache once per architecture change, not many times, which could happen if many users are all trying to keep the reg-cache upto date. Phew! So, the patch below moves the call to "gdb_reg_arch_changed" into the top-level tcl event handler, we need to ensure that it gets called before any of the event-handling windows see the architecture change event as they might access the reg-cache. I could in-theory have moved the call to "gdb_reg_arch_changed" into the top-level window event handler, I didn't do this for two reasons, (1) I didn't know if the top level window always exists, though I suspect it does, but really (2) I didn't know if there was any control on the order the windows receive the events... Anyway, let me know what you think, all feedback welcome. Thanks, Andrew gdb/gdbtk/ChangeLog 2013-09-05 Andrew Burgess * library/interface.tcl (gdbtk_tcl_architecture_changed): Add call to gdb_reg_arch_changed. * library/regwin.itb (arch_changed): Remove call to gdb_reg_arch_changed. Index: ./gdb/gdbtk/library/interface.tcl =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/library/interface.tcl,v retrieving revision 1.60 diff -u -p -r1.60 interface.tcl --- ./gdb/gdbtk/library/interface.tcl 9 Oct 2009 01:23:55 -0000 1.60 +++ ./gdb/gdbtk/library/interface.tcl 5 Sep 2013 14:19:53 -0000 @@ -1815,6 +1815,9 @@ proc initialize_gdbtk {} { # The architecture changed. Inform the UI. proc gdbtk_tcl_architecture_changed {} { set e [ArchChangedEvent \#auto] + # First perform global actions as a result of the architecture change. + gdb_reg_arch_changed $e + # Now dispatch to all the other even handlers. GDBEventHandler::dispatch $e delete object $e } Index: ./gdb/gdbtk/library/regwin.itb =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/library/regwin.itb,v retrieving revision 1.30 diff -u -p -r1.30 regwin.itb --- ./gdb/gdbtk/library/regwin.itb 25 May 2012 10:34:32 -0000 1.30 +++ ./gdb/gdbtk/library/regwin.itb 5 Sep 2013 14:19:53 -0000 @@ -932,9 +932,6 @@ itcl::body RegWin::_select_group {} { # ------------------------------------------------------------------ itcl::body RegWin::arch_changed {event} { - # Update internal register caches - gdb_reg_arch_changed - # Relayout the table _layout_table