From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9168 invoked by alias); 27 Aug 2009 20:50:34 -0000 Received: (qmail 9160 invoked by uid 22791); 27 Aug 2009 20:50:34 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1-old.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 Aug 2009 20:50:28 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com ([10.11.47.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7RKoPij001288 for ; Thu, 27 Aug 2009 16:50:25 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7RKoNQl001041; Thu, 27 Aug 2009 16:50:24 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7RKoMij030239; Thu, 27 Aug 2009 16:50:22 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 2383E3782A9; Thu, 27 Aug 2009 14:50:22 -0600 (MDT) From: Tom Tromey To: Dmitry Dzhus Cc: gdb-patches@sources.redhat.com Subject: Re: =frame-selected MI notification References: <87iqg99xb5.fsf@sphinx.net.ru> Reply-To: tromey@redhat.com Date: Thu, 27 Aug 2009 20:54:00 -0000 In-Reply-To: <87iqg99xb5.fsf@sphinx.net.ru> (Dmitry Dzhus's message of "Thu, 27 Aug 2009 17:54:38 +0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2009-08/txt/msg00495.txt.bz2 >>>>> "Dmitry" == Dmitry Dzhus writes: Dmitry> Nick Roberts once posted a patch which implements both =thread-selected Dmitry> and =frame-selected via observers: Dmitry> http://sourceware.org/ml/gdb-patches/2008-04/msg00377.html. I didn't see any discussion of this patch in the archives. Was it just forgotten? In general I think that it makes sense to have MI notifications for state changes caused by CLI commands. Dmitry> Current implementation of =thread-selected in mi-main.c uses a Dmitry> different approach, comparing current thread ID before and after Dmitry> executing a command in `mi_execute_command` function. My patch Dmitry> does the same for frame level. I don't know how is it Dmitry> technically better. I think it would be nice if somebody Dmitry> reviewed Nick's patch once again or at least accepted the one Dmitry> proposed by me. I tend to prefer Nick's approach. I like the use of observers. I would want to hear Vladimir's opinion as MI maintainer before approving anything though. Dmitry> -struct frame_info Dmitry> -{ Dmitry> - /* Level of this frame. The inner-most (youngest) frame is at level Moving struct frame_info from frame.c to frame.h is definitely not ok. The point of the current approach is that frame_info is opaque and cannot be directly manipulated by other modules. I think this is a good quality worth preserving. But ... Dmitry> + if (fi->level != previous_frame->level) You should probably just get the frame_id for the previous frame, before the command, and then compare it to the frame_id after the command (using frame_id_eq). Tom