This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCHv2 2/2] gdb/tui: asm window handles invalid memory and scrolls better
- From: Shahab Vahedi <Shahab dot Vahedi at synopsys dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Cc: Pedro Alves <palves at redhat dot com>, Tom Tromey <tom at tromey dot com>
- Date: Tue, 21 Jan 2020 15:50:28 +0000
- Subject: Re: [PATCHv2 2/2] gdb/tui: asm window handles invalid memory and scrolls better
- 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
- 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-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==
- References: <cover.1578948166.git.andrew.burgess@embecosm.com> <cover.1579135219.git.andrew.burgess@embecosm.com>,<c48251d89180b0a09c0911958ea0dd4b2e389c1a.1579135219.git.andrew.burgess@embecosm.com>
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<CORE_ADDR> 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 = *possible_new_low;
next_addr = 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