From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12541 invoked by alias); 28 Aug 2002 15:37:02 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 12524 invoked from network); 28 Aug 2002 15:37:00 -0000 Received: from unknown (HELO valrhona.uglyboxes.com) (64.1.192.220) by sources.redhat.com with SMTP; 28 Aug 2002 15:37:00 -0000 Received: from localhost.localdomain (IDENT:BFehEZWfWfYTUv2aHbherb8N7W3yEB4F@localhost.localdomain [127.0.0.1]) by valrhona.uglyboxes.com (8.11.6/8.11.6) with ESMTP id g7SFdfA01771 for ; Wed, 28 Aug 2002 08:39:41 -0700 Date: Wed, 28 Aug 2002 08:41:00 -0000 From: Keith Seitz X-X-Sender: keiths@valrhona.uglyboxes.com To: gdb-patches@sources.redhat.com Subject: Re: [RFA] add selected-frame-level-changed events In-Reply-To: <3D6BF9E1.4010005@ges.redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-08/txt/msg00939.txt.bz2 On Tue, 27 Aug 2002, Andrew Cagney wrote: > Ok. Can you just add comments explaining the above, especially in > select_frame(), so that people know why the call isn't yet there. I've appended a revised patch for your review. > As for the unnecessary select frame calls, I guess ``we'' are working on > it. I suspect that varobj could do with an audit --- use FRAME_ID() and > frame parameterized versions of various functions. Hmmm... Patch coming. Keith Revised patch: Index: stack.c =================================================================== RCS file: /cvs/src/src/gdb/stack.c,v retrieving revision 1.40 diff -p -r1.40 stack.c *** stack.c 11 Jul 2002 19:29:08 -0000 1.40 --- stack.c 28 Aug 2002 15:36:14 -0000 *************** select_frame (struct frame_info *fi) *** 1516,1521 **** --- 1516,1527 ---- frame is being invalidated. */ if (selected_frame_level_changed_hook) selected_frame_level_changed_hook (frame_relative_level (fi)); + /* NOTE: kseitz/2002-08-28: It would be nice to call + selected_frame_level_changed_event right here, but we would end up + flooding the UI with events because select_frame is used extensively + internally. Instead, event notifications are scattered through + the "UI" code, select_frame_command, up_silently_base, and + down_silently_base. */ /* Ensure that symbols for this frame are read in. Also, determine the source language of this frame, and switch to it if desired. */ *************** select_frame_command_wrapper (char *leve *** 1620,1627 **** static void select_frame_command (char *level_exp, int from_tty) { ! register struct frame_info *frame, *frame1; ! unsigned int level = 0; if (!target_has_stack) error ("No stack."); --- 1626,1633 ---- static void select_frame_command (char *level_exp, int from_tty) { ! struct frame_info *frame; ! int level = frame_relative_level (selected_frame); if (!target_has_stack) error ("No stack."); *************** select_frame_command (char *level_exp, i *** 1629,1634 **** --- 1635,1642 ---- frame = parse_frame_specification (level_exp); select_frame (frame); + if (level != frame_relative_level (selected_frame)) + selected_frame_level_changed_event (frame_relative_level (selected_frame)); } /* The "frame" command. With no arg, print selected frame briefly. *************** up_silently_base (char *count_exp) *** 1674,1679 **** --- 1682,1688 ---- if (count1 != 0 && count_exp == 0) error ("Initial frame selected; you cannot go up."); select_frame (fi); + selected_frame_level_changed_event (frame_relative_level (selected_frame)); } static void *************** down_silently_base (char *count_exp) *** 1719,1724 **** --- 1728,1734 ---- } select_frame (frame); + selected_frame_level_changed_event (frame_relative_level (selected_frame)); } /* ARGSUSED */