From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91140 invoked by alias); 30 Jun 2015 15:12:58 -0000 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 Received: (qmail 91114 invoked by uid 89); 30 Jun 2015 15:12:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-oi0-f45.google.com Received: from mail-oi0-f45.google.com (HELO mail-oi0-f45.google.com) (209.85.218.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 30 Jun 2015 15:12:56 +0000 Received: by oiax193 with SMTP id x193so9671170oia.2 for ; Tue, 30 Jun 2015 08:12:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=NpC5gRPjvioWobcA+0B5+ADRQAL0X3f9FCRmqC7sx8A=; b=e06jGwAPzJhHeyysGEKUxIeSmiTQCynmoYj0JKVWgXyp78WyxLPuEOANWixIKPgowO ImaYRosxaxxapIgFXSgB5bIA5FIvBkKplKix1faMJ02hieUxzFJPQocHLrWub5Y4px5U Ni0upD00dORBl9ByKVkN1xgY+6WL+YPFvSOLBYE0lqxB/EKywxERKrMCBt5ZZuByYpKn fna8+9rEdu5LKYEqUAFlBo3nqs7if/nFfOb6gPbZ5YiIWGRdoJNRLb1Dkxz9blvVdsgW ERXq2ULZ0CwECqfIxmzlShle14qpyzbMZ6Yk50K187fpSr1Awqe0D6hZ6aKrpmK66cz8 K+pQ== X-Gm-Message-State: ALoCoQnKM+1VTgrZd0fHzdDWdaE48Yz9kEU9OAiW/jV2bt+r2C3MwurYBCQnhYgEp/9TW48PzpqF X-Received: by 10.182.102.129 with SMTP id fo1mr20134687obb.24.1435677174586; Tue, 30 Jun 2015 08:12:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.96.167 with HTTP; Tue, 30 Jun 2015 08:12:34 -0700 (PDT) In-Reply-To: References: <1435667837-16337-1-git-send-email-patrick@parcs.ath.cx> <5592A2EE.40900@redhat.com> From: Patrick Palka Date: Tue, 30 Jun 2015 15:12:00 -0000 Message-ID: Subject: Re: [PATCH 3/3] Replace TUI's select_frame hook (PR tui/13378) To: Pedro Alves Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-06/txt/msg00646.txt.bz2 On Tue, Jun 30, 2015 at 10:54 AM, Patrick Palka wrote: > On Tue, Jun 30, 2015 at 10:08 AM, Pedro Alves wrote: >> On 06/30/2015 01:37 PM, Patrick Palka wrote: >>> This version adds a tui_normal_stop observer in place of augmenting the >>> tui_on_sync_execution_done observer. And tui_refresh_frame_and_register_information >>> can now be made a static function. >>> >>> The observer takes a print_frame parameter that is supposed to inform us >>> whether the frame should be printed. This boolean seems to only be true for >> >> s/only be true/only be false/ >> >>> when the inferior has exited. Since tui_refresh_frame_and_register_information >>> already handles this case by checking has_stack_frames() this patch elects to >>> ignore this parameter in the observer. >> >> This is OK. I'll take a look at patch 2 soon. >> >> Did you find that we still need deprecated_print_frame_info_listing_hook? > > It still seems to be "necessary" -- at least, I can't outright remove it. > > The only caller of deprecated_print_frame_info_listing_hook is in > print_frame_info and its use looks like this: > > if (deprecated_print_frame_info_listing_hook) > (*deprecated_print_frame_info_listing_hook) (...); > else > { ... other code ... } > > If I remove the hook by replacing the above code with > > { ... other code ... } > > Then a regression occurs: the TUI decides to make sure that the > currently executing line always sits at the top of the window instead > of only scrolling the screen when the currently executing line is not > invisible. > > But if I disable the hook by replacing the body of code in print_frame_info with > > if (deprecated_print_frame_info_listing_hook) > ; > else > { ... other code ... } > > Then everything seems to be OK. So the code in the else branch is > interfering with TUI somehow. I will investigate further. The call to "print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);" in the else branch eventually calls "tui_show_source (sal.line);" which adjusts the source window so that sal.line is the very first line visible. I'm not sure how easy this would be to fix properly. We want to avoid calling print_source_lines in print_frame_info when the TUI is active. Of course, I can just guard the code with "if (tui_active)" but that's not a good fix. Instead of removing the hook yet, what about making it (tui_print_frame_info_listing_hook) a no-op in the interim? BTW, in the CLI, this call to print_source_lines is responsible for printing the stopped-at source line to stdout, e.g. (gdb) start .... Temporary breakpoint 2, main () at 13378.c:9 9 int i = 0; // THIS LINE (gdb)