From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19131 invoked by alias); 14 Jan 2020 13:59:54 -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 19121 invoked by uid 89); 14 Jan 2020 13:59:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=BAYES_00,KAM_ASCII_DIVIDERS,SPF_PASS autolearn=no version=3.3.1 spammy= X-HELO: smtprelay-out1.synopsys.com Received: from smtprelay-out1.synopsys.com (HELO smtprelay-out1.synopsys.com) (149.117.87.133) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Jan 2020 13:59:43 +0000 Received: from mailhost.synopsys.com (badc-mailhost1.synopsys.com [10.192.0.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 818C8C061E; Tue, 14 Jan 2020 13:59:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1579010381; bh=0Whs7fES5PN3QeKpUgCgEOqvQtIKzcJsoCj23mtkWGU=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=ijPks+fNHpYKGOCeLKRNhDzvdfW3JCm2IHME+tqV0Ms+XYl7Xai7N2OplbZ4IegSf oT0mc5Owdkkh+GEDu/GGSR/rK7arDiD8Chb9tp+O/0bBUyFi0IMA3+af4kJYkb+TEA jfmLoWgRt8kJiYmkjDo6JMXx40RHtFlf1/trYH0neo39QqaZL7Zxod4LBuku6ketp7 /dhvqlqkr4A7Ybol9upAELAXQtG3lVureT3M7Oj09dCjIyacEs2e3CDP2yQYAS1Ccp ZsxCsXxzvCn45atfu2xQ+AuJrQgHObKR0u0MkHdAMqZvTYxU9ReS/lXO56hs4UPKac i0nWN7vJfaoxA== Received: from US01WEHTC3.internal.synopsys.com (us01wehtc3.internal.synopsys.com [10.15.84.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPS id AE39FA0085; Tue, 14 Jan 2020 13:59:40 +0000 (UTC) Received: from us01hybrid1.internal.synopsys.com (10.200.27.51) by US01WEHTC3.internal.synopsys.com (10.15.84.232) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 14 Jan 2020 05:59:26 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (10.202.3.67) by mrs.synopsys.com (10.200.27.51) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 14 Jan 2020 05:59:26 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E0iwahOWomK5Mv9kmxX81jFoixNqm0DKgZmSkCuOLQdGRT/FLkRUpAW+A6YPU5Rd1OziM8X3+dthU238BOdKGOXT9gGCjvfpNByxAvq0cKa1MU84myW6gsBlxroMRZxu0fVL5t71E4bChwTk72KN8rJaKgCsvICR90IGXvOWbT5gT+VyCDn5d4W/e/vbT9cWFsoMLDmc5ClAXNnlTLC9khWtZbUPf5sS7Vtw/TH7rRtSEaA792Y7fZzT/64s6Um/1SChTjwvopaZgzGCaAfurYXfukKpBJlslDM1JSvB5PTpe8FFpiJkYFlOTQjDNFrpH8GPzOHBt5iOo/UL+GxqFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NiazOUKTrh/h/Rp2p1BASvbFd9btJnJWUOixuTm0EUA=; b=cFmvpaf6lvMjWGCiOYsZhyAsous9ddtSmAbEdOTv1PsqIxGkfvIgrbFdOCobOLByZAQlC2pGhEpDTioEjjx3WrTpZ20cK7DVaz+HMwa8jFbdZR0MOcBTgochXAe/ADIKrw1uAZ0EE72JLWlDfZIbkosMq/AgpLBmAHprXAv1JlHvM2mVKyMWgtBcSVN/LpHmx+hhnGXq6Pox4aOf2ld01BFwzPH3bwJY34f9i6M+76K7/Ulm9RlgGMa26iSZ8NWMDE/huhNzzaP6WTmcULwxsVNwCc3beWrU1aRTjZADmn0d4d8eYxSlu0QRdmJSlYdYAKMtzxpeeqJWztAKnf1Cog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synopsys.com; dmarc=pass action=none header.from=synopsys.com; dkim=pass header.d=synopsys.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.onmicrosoft.com; s=selector2-synopsys-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NiazOUKTrh/h/Rp2p1BASvbFd9btJnJWUOixuTm0EUA=; b=nqm4fLxtMbJXPq61x7KoPUsRi3Y8K5/mgCtsPQ9B9B7/TrAeNEW3dRVHStyXTfgZ1J25mGDe5QgY5+OEv2FHCRkTpcs1mLMiQ7mGcniev8GD+T0N8qAD36PeaR9NDTl33oTreqwNvyUYhm3Do9rCaPPW/lJvm/ch0ut6bxGxhGI= Received: from CH2PR12MB3847.namprd12.prod.outlook.com (52.132.247.27) by CH2PR12MB4215.namprd12.prod.outlook.com (20.180.7.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.9; Tue, 14 Jan 2020 13:59:25 +0000 Received: from CH2PR12MB3847.namprd12.prod.outlook.com ([fe80::c820:fae4:7b47:1ecb]) by CH2PR12MB3847.namprd12.prod.outlook.com ([fe80::c820:fae4:7b47:1ecb%5]) with mapi id 15.20.2623.015; Tue, 14 Jan 2020 13:59:25 +0000 From: Shahab Vahedi To: Andrew Burgess , "gdb-patches@sourceware.org" CC: Pedro Alves , Tom Tromey , "Shahab Vahedi" Subject: Re: [PATCH 0/2] gdb/tui: Assembler window scrolling fixes Date: Tue, 14 Jan 2020 14:19:00 -0000 Message-ID: References: <20200110143056.GD3815@gmail.com>, In-Reply-To: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahab@synopsys.com; x-ms-oob-tlc-oobclassifiers: OLM:10000; received-spf: None (protection.outlook.com: synopsys.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: DxlBfdN6qWu67j3vJF5f7nYBJAQdt2ZIoSsoaih0+68+CEKU97jrHb0j4pTBgZIgw+SKkGAaCC/etJACPHfkvA== X-SW-Source: 2020-01/txt/msg00373.txt.bz2 Hello Andrew, I have tested the patch series against the "hello world" program that I have [1]. Here comes my observations: 1. As you can see in this gif file: https://sourceware.org/bugzilla/attachment.cgi?id=3D12200 "Going up" sometimes does not work. In this case, it is between "main" and "_start" (garbage?). Nevertheless, I manged to have it working for me by: @@ -161,7 +161,7 @@ tui_find_symbol_backward (CORE_ADDR addr) { struct bound_minimal_symbol msym; =20 - for (int offset =3D 1; offset <=3D 1024; offset *=3D 2) + for (int offset =3D 1; offset <=3D 1024; ++offset) { CORE_ADDR tmp =3D addr - offset; msym =3D lookup_minimal_symbol_by_pc_section (tmp, 0); 2. I run into a problem that "page-up" does not work when we reach the end of file: https://sourceware.org/bugzilla/attachment.cgi?id=3D12201 The following fixes that, but breaks elsewhere (see 3): @@ -232,14 +232,14 @@ tui_find_disassembly_address ... /* Disassemble forward a few lines and see ... next_addr =3D tui_disassemble (gdbarch, asm_lines, ... last_addr =3D asm_lines.back ().addr; - if (last_addr > pc && msymbol.minsym !=3D nullptr + if (last_addr >=3D pc && msymbol.minsym !=3D nullptr && asm_lines.size () >=3D max_lines) { /* This will do if we can't find anything... */ possible_new_low.found =3D true; possible_new_low.new_low =3D new_low; } - } while (last_addr > pc && msymbol.minsym !=3D nullptr); + } while (last_addr >=3D pc && msymbol.minsym !=3D nullptr); 3. With the changes from above, "arrow up" stops working near beginning of the file: https://sourceware.org/bugzilla/attachment.cgi?id=3D12202 I can summarise what I have learned in the following table: ,-------------.----------.----------------------------------. | usecase | action | condition that works | |-------------+----------+----------------------------------| | very bottom | page-up | as long as last_addr >=3D pc ..., | | | | go higher (try reducing new_low) | |-------------+----------+----------------------------------| | second line | arrow up | as long as last_addr > pc ..., | | | | go higher (try reducing new_low) | `-------------^----------^----------------------------------' This table portrays contradictory conditions for corner case scenarios. I believe the real solution in the end should be much simpler and ideally as such that it covers the corner cases naturally. I will try to cook something up in my free time. I suggest that this patch series should be in along with the changes proposed at point 1. So we only end-up with none-working page-up at the end of assembly output. Cheers, Shahab [1] that x86_64 elf program is archived here: https://sourceware.org/bugzilla/attachment.cgi?id=3D12199