From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14887 invoked by alias); 19 Mar 2007 23:31:27 -0000 Received: (qmail 14878 invoked by uid 22791); 19 Mar 2007 23:31:26 -0000 X-Spam-Check-By: sourceware.org Received: from elrond.portugalmail.pt (HELO elrond.portugalmail.pt) (195.245.179.181) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 19 Mar 2007 23:31:25 +0000 Received: from localhost (localhost [127.0.0.1]) by elrond.portugalmail.pt (Postfix) with ESMTP id B877F3DC6B for ; Mon, 19 Mar 2007 23:25:45 +0000 (WET) Received: from elrond.portugalmail.pt ([127.0.0.1]) by localhost (elrond.portugalmail.pt [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WfELVQgQDCNe for ; Mon, 19 Mar 2007 23:25:45 +0000 (WET) Received: from [127.0.0.1] (88.210.72.155.rev.optimus.pt [88.210.72.155]) (Authenticated sender: pedro_alves@portugalmail.pt) by elrond.portugalmail.pt (Postfix) with ESMTP id C54E03D54F for ; Mon, 19 Mar 2007 22:52:35 +0000 (WET) Message-ID: <45FF1571.2080401@portugalmail.pt> Date: Mon, 19 Mar 2007 23:31:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.4.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: TUI + gdbserver broken? References: <45FDECB3.5000002@portugalmail.pt> <20070319021145.GA25872@caradoc.them.org> <45FEF7B0.9070209@portugalmail.pt> <20070319221430.GA24326@caradoc.them.org> In-Reply-To: <20070319221430.GA24326@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 000725-0, 19-03-2007), Outbound message X-Antivirus-Status: Clean 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: 2007-03/txt/msg00174.txt.bz2 Daniel Jacobowitz wrote: > >> static void >> tui_selected_frame_level_changed_hook (int level) >> { >> struct frame_info *fi; >> > > >> fi = deprecated_safe_get_selected_frame (); >> /* Ensure that symbols for this frame are read in. Also, determine the >> source language of this frame, and switch to it if desired. */ >> if (fi) >> { >> struct symtab *s; >> > > How about this: > > if (level >= 0) > { > struct frame_info *fi = get_selected_frame (NULL); > > > That has exactly the same effect as it was before the your select frame changes. That is, only try to get the selected frame when there is one. Maybe there should still be a function like this in frame.c ? struct frame_info * deprecated_get_selected_frame () { return selected_frame; } (or perhaps call it get_selected_frame_if_any) I don't think that the callbacks should ever change the selected_frame state, that is, they should be pure observers - that is how it worked before, and your suggestion would make it so too. (I'll go try both versions) Cheers, Pedro Alves