From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102155 invoked by alias); 21 Jan 2020 15:50:45 -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 102147 invoked by uid 89); 21 Jan 2020 15:50:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 spammy=begins, H*RU:sk:smtprel, Hx-ms-oob-tlc-oobclassifiers:8882, H*f:sk:cover.1 X-HELO: smtprelay-out1.synopsys.com Received: from smtprelay-out1.synopsys.com (HELO smtprelay-out1.synopsys.com) (149.117.73.133) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Jan 2020 15:50:34 +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 6FF3D4065C; Tue, 21 Jan 2020 15:50:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1579621833; bh=H5eYy9L+JUhRbXbBSW3vHQ5FESlHnH3+DHw30DCMECQ=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=LkZSGCEaOuQuuFYn6g4ByO/9IlAWAH1YK5NVRKcg041dyMz5p+U02iAwoPUlbyAqo QHBNvd9M1R3flsb8UYpNuL+CntfnHsNprlCJz77khZ12JqtAaUYhy08k6vP5+jYy+G PmzS/A/h3yKVVr9z+oO9T1a02S5/RJ4DdilsZPSqjJFtg2+FtvJ13rtPIQceuEoH2A On0z8H44aSAOGjRn0nLtEZ+mYIvcWCSTv/ipjP4GJ55khN+pxm/dI9R5FI+TXswZqu c2uf0mKYTDkjweQUIXNbNffKNG7Tp+3PRXnPbE85EnseSp/UKnPLjbWL81WDN9Ya3k KQW5PIjGSdUiA== 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 A63DFA0079; Tue, 21 Jan 2020 15:50:32 +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, 21 Jan 2020 07:50:32 -0800 Received: from NAM02-BL2-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, 21 Jan 2020 07:50:32 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AAnyX7G/Ug7CeN+gpEgyO54kyaFNDWCIl5a2vpFIWLVmaBc1jWPY+MKtYwYYpTg/Ibgq3Silypb5gVn+CD7ZW8m5arG5Yp3R+e4WbqF/UgQkyuodWeerjXPTrqyeKa63Nv0SZ/z9s1tJ1FYYA8Q4VjImO8IwWEOSxvq0T+N/oAIvf8JH9o9jeUF8LXFtEEKLScvnfQnhWHVIAb5NCBjfIrlR9kFtBXk3au/DKpdJr+Sx4IWhS5fSHgifznzECB/sATGTqNmVVRF/67pokOOxrT4ndc3YdrdpQ6hOmiYDngSkd1qEg2HZcdf0faulzrpv+M8J9SndR7wtWMjYiZa/4A== 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=RExRTOUSSABrCFTKxOYZnQc0I9ezdw/QarDVKssI2b4=; b=ngXIPa+owBzhFLcBJH3kOcWhqvusOeodhSafJ3ouIqgJYOTHBHCVMza9J43D7Gt0ajgTb6AudWGLoiolExdTAClKw5tZPmd3Q72oz2SemCmEYgVyx4+u380w6clqH8AmOV3tSzR313OGjH7ReBFXkZScgER/Lly99uQxerRvtzhORgvBscKCMpi7kCip47/81YFFl2J9DnczmqzHsYSa5AyIg4mhysoKb8uXQjTqjiUvvZtzBInIVHt6QCN2kAmBy91YCwLXqopNvYpSYiaZp1IC+Nu0RcV7fJPJRBXRVfFIi2fq0Dcf1C3+nd1I2XGzA0SPyO3r7FeSZ/vIly/5ww== 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=RExRTOUSSABrCFTKxOYZnQc0I9ezdw/QarDVKssI2b4=; b=CX/bYvkVEWUMuTw2x1xFUQ/XOhz3jajY0QJDK3L4OxlnxZukZTs0hQrwXKfMmmldQVkT/DGFXIq9RZJ/cAmmXpuXb2vWiGnmNAYfIatkTKgPVQeoQEEP/eRMOKTpYKDemCd3yBLyxezg1TbqipwVqvGu5P/ZbNXA5/4CkawXMwQ= Received: from CH2PR12MB3847.namprd12.prod.outlook.com (52.132.247.27) by CH2PR12MB3717.namprd12.prod.outlook.com (52.132.244.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Tue, 21 Jan 2020 15:50:28 +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.2644.024; Tue, 21 Jan 2020 15:50:28 +0000 From: Shahab Vahedi To: Andrew Burgess , "gdb-patches@sourceware.org" CC: Pedro Alves , Tom Tromey Subject: Re: [PATCHv2 2/2] gdb/tui: asm window handles invalid memory and scrolls better Date: Tue, 21 Jan 2020 16:27:00 -0000 Message-ID: References: , In-Reply-To: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahab@synopsys.com; x-ms-oob-tlc-oobclassifiers: OLM:8882; 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: NK7363Xb7LjecU4LiLpObXAoTOuEeQALeJdx3m37PZTYVw5IbaVlAavNXrbakq+M9qJLU9wjOG/kpAHdF85XaQ== X-SW-Source: 2020-01/txt/msg00639.txt.bz2 Great job Andrew! Functionality testing: I have tested this patch and it is impossible to break it. Code review: The comments that have been added are very self explanatory. The logic that is used seems sound and thorough. I have one small remark though. For most part of the tui_find_disassembly_address() function, there are usages of new_low, prev_low, and possible_new_low variables. What these variables are actually used for is finding a new _high_. I suggest replacing every instance of "low/LOW" with "high/HIGH". The region of code I am talking about is listed below: region of code begins else { ... gdb::optional possible_new_low; ... CORE_ADDR prev_low; do { ... } while (...) ... if (asm_lines.size () < max_lines) { if (!possible_new_low.has_value ()) return pc; new_low =3D *possible_new_low; next_addr =3D tui_disassemble (gdbarch, asm_lines, new_low, max_lines); ... } region of code ends Nevertheless, the code looks (very) fine to me as it is. Cheers, Shahab >From gdb-patches-return-163326-listarch-gdb-patches=sources.redhat.com@sourceware.org Tue Jan 21 16:27:30 2020 Return-Path: Delivered-To: listarch-gdb-patches@sources.redhat.com Received: (qmail 54158 invoked by alias); 21 Jan 2020 16:27:29 -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 Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 53625 invoked by uid 89); 21 Jan 2020 16:27:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy=sometime, reader, smoke X-HELO: esa1.hgst.iphmx.com Received: from esa1.hgst.iphmx.com (HELO esa1.hgst.iphmx.com) (68.232.141.245) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Jan 2020 16:27:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1579624038; x=1611160038; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=Xn3j90Cj5upky+IQLmTyeKGLmWkcrVwjNqKUy99EAi8=; b=e+JO5SFwFwpLuBiZJ1iN37Wcm8CVNheEZNfBI3Xp9g5GJblQ/4gzqEO6 gIpGM/eMhRRG3YirZpLJt2ET7VNHREbD517kdhG4uHVY5VtsTB85ATMNh ZNP6b7aGTvqUnqP2u7QAvmFfBlvmA4+Z6GSyHu7xy2jhIdRldAoq62w6L zsgMufo794Kv+yzxxSyTPnURLsnjMfD4iU5KRqau9gDW5LxkYpBZPuwaI Qwl9Tj4fB50A2wbIP9+89m+YoGfuFWubFwJI39bxT8Gbv2ER6KppoC8T1 hfTZeJJHay/kCnyC1dsS4tKeEgiULOcNsX21t8LOksQT0wFy+hLWLcBus A==; IronPort-SDR: lhbgwV5TMlogd2j1izX2JenXpCh+G4xIPLRQpabDMZi2c5WDyHcmI9JNUe9DS0kEBiu++IJGKE WqYXpRAZ72/JdiKuh/8YMqLEpIagfglf8wwq+oWiSCY7O9b/26Qt3gPGkQCtTUWle6KSIAqxUD KMQcRVpzsnAoWr7dmNwJXVP+31Yex6J3ZGfcWwpjEb/PYZZh8/1O9aIFEcFAscXiYQO4ixhPkE 9TFFl8tOU50cy/qwzVCdkWFgj0nFPVZeC3poSKNy31bKJV36uuH/MitvURzvAcMdIWRi2Th2b0 UtU= Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 22 Jan 2020 00:27:16 +0800 IronPort-SDR: 9FbTDrH9+YYqFejxBm4VW3y1EOkuqVYdlUXAwCSVps3IYS41Pr2PnM628x3MVPqfAp/cGsz4V2 8pJorWJN18dpRkZbYYdTkd/vxjNrrrdv+G7HOxzZ4CoxfkScSlmMKOd+wWSCmyVB7Ix635XRbI gA3cxLcsZsRtEBd7FQwT+0OLQJ445aHDd+D7OnC1+XKsw3IgCKksejFi6UUjZ60/NZSlhd6Bcd XVTjwIhzjzsK8w/Y6BiUEX6iI4ElMEebH0YwOBdpz330cNRP0RMCyMeyJkQJ/JT/4qULM4Dbjf I9nZXT6yq3qJRZBf0QqqnKi+ Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2020 08:20:42 -0800 IronPort-SDR: Fh8P2YoXRYYAEd8Px6p1dEmC7PtxHWAWOzYxV6zOwuty8CBs4CqJbdT2NLfv90LLRIqAXFYecP 0zTK/Gmv3fRDyCtHb5O38H1wqCeriUAp9BmP8ii+n1BHnO4zCejEl2Lgm9AtL501zEH5clqscu MKKzExPfH5niPEiaaO6gpHDtXWw1MvEqGniss2lhNWsyvpXe7ZGbvJ9+sMsPJla64XvsQwz6Lf acYXEHLv+UbE3nQsq3721BbPehrF7qfEpfQByl5mhA7UGpQeKZ9Z4NgESKGI6s9dF2fT60zLSI hd4= WDCIronportException: Internal Received: from unknown (HELO redsun52) ([10.149.66.28]) by uls-op-cesaip02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2020 08:27:15 -0800 Date: Tue, 21 Jan 2020 17:11:00 -0000 From: "Maciej W. Rozycki" To: Andrew Burgess cc: Simon Marchi , Jim Wilson , jiangshuai_li@c-sky.com, guoren@kernel.org, gdb-patches@sourceware.org, =?UTF-8?B?5aSP56uL5pa5?= , yunhai_shang Subject: Re: [PATCH] riscv: add gdbserver support In-Reply-To: <20200121125657.GH3865@embecosm.com> Message-ID: References: <00e401d5cb52$63a4d000$2aee7000$@c-sky.com> <3a15e9f5-099f-3be0-e3f1-0e17c2959158@simark.ca> <20200121125657.GH3865@embecosm.com> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2020-01/txt/msg00640.txt.bz2 Content-length: 1598 On Tue, 21 Jan 2020, Andrew Burgess wrote: > I had planned to go back and review this code next w/e, but I might > hold off now to see if the xml issue is addressed. I have given it some thought and I'll actually post the whole series of my changes; there are 4 patches total, 3 of which addressing some bugs before the actual `gdbserver' implementation is put on top of them (I could ignore some of these bugs, but I couldn't persuade myself to put in bug-compatible nonsense only to be fixed later on). Since this whole series does not address the XML arch acceptance bug (which I'm fairly sure will require poking at BFD too) I do not think this can go in as it stands anyway and I will not rerun full verification. I do need to do some smoke testing however, including for the bug fixes, as Tom has been working on some build infrastructure rework and I had to take it into account while updating the patches from their last October's state. I expect to be ready with this sometime tomorrow. There's a minor ptrace(2) Linux kernel API abuse bug in RISC-V arch code that I find worth addressing while this work is being done. I have a patch for that too, which needs final verification. By chance it doesn't trigger in GDB's use, and it may not at all, but the way the RISC-V kernel backend has been implemented mismatches the core Linux kernel API as documented and is at the very least confusing to the reader. NB I have been verifying this work with the HiFive Unleashed real hardware running Linux (including native support as a reference). FWIW, Maciej