Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Shahab Vahedi <Shahab.Vahedi@synopsys.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>,
	"gdb-patches@sourceware.org"	<gdb-patches@sourceware.org>
Cc: Pedro Alves <palves@redhat.com>, Tom Tromey <tom@tromey.com>
Subject: Re: [PATCHv2 2/2] gdb/tui: asm window handles invalid memory and scrolls better
Date: Tue, 21 Jan 2020 16:27:00 -0000	[thread overview]
Message-ID: <CH2PR12MB384753BA9090F57FA58083DBA60D0@CH2PR12MB3847.namprd12.prod.outlook.com> (raw)
In-Reply-To: <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
From gdb-patches-return-163326-listarch-gdb-patches=sources.redhat.com@sourceware.org Tue Jan 21 16:27:30 2020
Return-Path: <gdb-patches-return-163326-listarch-gdb-patches=sources.redhat.com@sourceware.org>
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: <gdb-patches.sourceware.org>
List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org>
List-Archive: <http://sourceware.org/ml/gdb-patches/>
List-Post: <mailto:gdb-patches@sourceware.org>
List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs>
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\x1579624038; x\x1611160038;  hÚte: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 UtUReceived: 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 hd4WDCIronportException: 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" <macro@wdc.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>
cc: Simon Marchi <simark@simark.ca>, Jim Wilson <jimw@sifive.com>,     jiangshuai_li@c-sky.com, guoren@kernel.org, gdb-patches@sourceware.org,     =?UTF-8?B?5aSP56uL5pa5?= <lifang_xia@c-sky.com>,     yunhai_shang <yunhai_shang@c-sky.com>
Subject: Re: [PATCH] riscv: add gdbserver support
In-Reply-To: <20200121125657.GH3865@embecosm.com>
Message-ID: <alpine.LFD.2.21.2001211610190.15714@redsun52.ssa.fujisawa.hgst.com>
References: <00e401d5cb52$63a4d000$2aee7000$@c-sky.com> <CAFyWVaa7ADP_SmBVoan9AOkWK9parEz5EENZZL5vY+_GcD9SrA@mail.gmail.com> <alpine.LFD.2.21.2001202307240.15714@redsun52.ssa.fujisawa.hgst.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


  reply	other threads:[~2020-01-21 15:50 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200110115728.13940-1-shahab.vahedi@gmail.com>
2020-01-10 12:53 ` [PATCH v2][PR tui/9765] Fix segfault in asm TUI when reaching end of file Pedro Alves
2020-01-10 13:37   ` [PATCH] Don't let TUI exceptions escape to readline (PR tui/9765) Pedro Alves
2020-01-10 14:31     ` Shahab Vahedi
2020-01-13 20:46       ` [PATCH 2/2] gdb/tui: asm window handles invalid memory and scrolls better Andrew Burgess
2020-01-15  0:57         ` Tom Tromey
2020-01-13 22:04       ` [PATCH 1/2] gdb/tui: Prevent exceptions from trying to cross readline Andrew Burgess
2020-01-15  0:56         ` Tom Tromey
     [not found]       ` <cover.1578948166.git.andrew.burgess@embecosm.com>
2020-01-14 14:19         ` [PATCH 0/2] gdb/tui: Assembler window scrolling fixes Shahab Vahedi
2020-01-16  0:48         ` [PATCHv2 " Andrew Burgess
2020-01-24 11:22           ` Shahab Vahedi
2020-01-24 21:22             ` [PATCH 0/2] Further Assembler Scrolling Fixes Andrew Burgess
2020-01-24 21:22             ` [PATCH 1/2] gdb/tui: Update help text for scroll commands Andrew Burgess
2020-01-26 16:07               ` Tom Tromey
2020-01-24 21:29             ` [PATCH 2/2] gdb/tui: Disassembler scrolling of very small programs Andrew Burgess
2020-01-26 16:10               ` Tom Tromey
2020-01-31 10:10               ` Shahab Vahedi
2020-01-16  0:48         ` [PATCHv2 2/2] gdb/tui: asm window handles invalid memory and scrolls better Andrew Burgess
2020-01-21 16:27           ` Shahab Vahedi [this message]
2020-01-22 13:30             ` Shahab Vahedi
2020-01-22 16:32               ` Andrew Burgess
2020-01-22 19:26           ` Pedro Alves
2020-01-16  2:55         ` [PATCHv2 1/2] gdb/tui: Prevent exceptions from trying to cross readline Andrew Burgess
2020-01-10 14:42     ` [PATCH] Don't let TUI exceptions escape to readline (PR tui/9765) Tom Tromey
2020-01-10 13:47   ` [PATCH v2][PR tui/9765] Fix segfault in asm TUI when reaching end of file Shahab Vahedi
2020-01-11  2:00 ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CH2PR12MB384753BA9090F57FA58083DBA60D0@CH2PR12MB3847.namprd12.prod.outlook.com \
    --to=shahab.vahedi@synopsys.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox