From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36818 invoked by alias); 15 Jan 2020 00:56:20 -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 36810 invoked by uid 89); 15 Jan 2020 00:56:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=resizing, scrolls X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.54.2) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Jan 2020 00:56:18 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway20.websitewelcome.com (Postfix) with ESMTP id B64F8400C47C2 for ; Tue, 14 Jan 2020 17:44:08 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id rWynizgH532AdrWyniAgqU; Tue, 14 Jan 2020 18:56:17 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=G7yBOMMlVu3puuvUMeqzvjptYZ669XSm0Cb2G11vPjQ=; b=VjvpnOmgEqKw/dmyYAYEn5BVM4 PiU9dmAsblXhOPWf1OCLVztqsKBCBxXAS9QmE5YN35xoQBof7ITkzUCINgluf8E3L6bKwbZApqyxi pkqF2z+40xL2dJJ04XMETo2gs; Received: from 50-194-130-62-static.hfc.comcastbusiness.net ([50.194.130.62]:50420 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1irWym-004KQ9-U7; Tue, 14 Jan 2020 17:56:17 -0700 From: Tom Tromey To: Andrew Burgess Cc: gdb-patches@sourceware.org, Shahab Vahedi , Pedro Alves , Tom Tromey Subject: Re: [PATCH 2/2] gdb/tui: asm window handles invalid memory and scrolls better References: Date: Wed, 15 Jan 2020 00:57:00 -0000 In-Reply-To: (Andrew Burgess's message of "Mon, 13 Jan 2020 20:46:27 +0000") Message-ID: <87lfq9zget.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2020-01/txt/msg00399.txt.bz2 >>>>> "Andrew" == Andrew Burgess writes: Andrew> Adding tests for this scrolling was a little bit of a problem. First Andrew> I would have liked to add tests for PageUp / PageDown, but the tuiterm Andrew> library we use doesn't support these commands. I wonder if setting TERM to xterm or vt100 would let this work without too much effort. Andrew> Next, I would have liked to test scrolling to the start or end of the Andrew> assembler listing and then trying to scroll even more [...] Andrew> The problem is that there is no curses output, so how long do we wait Andrew> at step 3? Resizing had the same problem (how to tell when the resize is finished), so I added a special mode to the TUI for this. So, if you really wanted, in this case you could have the TUI debug mode print something or ring the bell when scrolling isn't possible. Andrew> + asm_lines.push_back (tal); This should probably use push_back (std::move (tal)), to avoid copying the string. Andrew> + /* As we search backward if we find an address that looks promising Andrew> + then we record it in this structure. If the next address we try Andrew> + is not suitable then we fall back to the previous good address. Andrew> + Otherwise, if the next address is also good it gets recorded here Andrew> + instead, and then we try the next address. */ Andrew> + struct Andrew> + { Andrew> + bool found = false; Andrew> + CORE_ADDR new_low; Andrew> + } possible_new_low; This can be gdb::optional, which would seem clearer in this case to me. Aside from these nits, this seems fine to me. I didn't try it, but if you can reproduce the problems Shahab saw, I think it would be good to incorporate his suggested change and also file a TUI bug for the remaining problem (unless you feel like fixing it as well...) Thanks for doing this. This is a tricky area. Tom