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>,
	"Shahab Vahedi" <shahab.vahedi@gmail.com>
Subject: Re: [PATCH 0/2] gdb/tui: Assembler window scrolling fixes
Date: Tue, 14 Jan 2020 14:19:00 -0000	[thread overview]
Message-ID: <CH2PR12MB3847FB39E41D9FD2F5B5DF67A6340@CH2PR12MB3847.namprd12.prod.outlook.com> (raw)
In-Reply-To: <cover.1578948166.git.andrew.burgess@embecosm.com>

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=12200
"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;
 
-  for (int offset = 1; offset <= 1024; offset *= 2)
+  for (int offset = 1; offset <= 1024; ++offset)
     {
       CORE_ADDR tmp = addr - offset;
       msym = 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=12201
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 = tui_disassemble (gdbarch, asm_lines, ...
          last_addr = asm_lines.back ().addr;
-         if (last_addr > pc && msymbol.minsym != nullptr
+         if (last_addr >= pc && msymbol.minsym != nullptr
              && asm_lines.size () >= max_lines)
            {
              /* This will do if we can't find anything... */
              possible_new_low.found = true;
              possible_new_low.new_low = new_low;
            }
-       } while (last_addr > pc && msymbol.minsym != nullptr);
+       } while (last_addr >= pc && msymbol.minsym != nullptr);

3. With the changes from above, "arrow up" stops working near
beginning of the file:
https://sourceware.org/bugzilla/attachment.cgi?id=12202

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 >= 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=12199
From gdb-patches-return-163060-listarch-gdb-patches=sources.redhat.com@sourceware.org Tue Jan 14 14:19:09 2020
Return-Path: <gdb-patches-return-163060-listarch-gdb-patches=sources.redhat.com@sourceware.org>
Delivered-To: listarch-gdb-patches@sources.redhat.com
Received: (qmail 61439 invoked by alias); 14 Jan 2020 14:19:09 -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 61158 invoked by uid 89); 14 Jan 2020 14:19:08 -0000
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-14.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammyX-HELO: mail-qt1-f176.google.com
Received: from mail-qt1-f176.google.com (HELO mail-qt1-f176.google.com) (209.85.160.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Jan 2020 14:18:58 +0000
Received: by mail-qt1-f176.google.com with SMTP id w30so12507346qtd.12        for <gdb-patches@sourceware.org>; Tue, 14 Jan 2020 06:18:58 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=linaro.org; s=google;        h=subject:to:references:from:message-id:date:user-agent:mime-version         :in-reply-to:content-language:content-transfer-encoding;        bh0J67NEgBygQJZpX4yfKahwEK1/yD50zgZjthjYlcY=;        b=rtxIv+GUvXN0evobHrrrShVjFryCge3vTA3teUue+qr1ru+romJ0DnuJGOdqj3kFLI         /+uP+/E+Q77hFOByUhRGXeJCaRakrI/4NGs5mNP4EoCvEyK5k5Hu0fYbvp0p1B7HJFhD         iDKF1Y+iV3kw4ClnycmScUUX4BJz3P52D9k0Gl/KoIacY0Eo4T8XTm1BASa4UnJRg8yR         TM0QuwYuLL8p9DdTJhBg4uQegnjFK3kQjHpEOZtv8ePEN5NYDq2LUuIjciBnat/WcLPI         dhyceCGn8pfpPXG8RmmTslMgo9Wu1CufpwVYSm/xsgyFK9SWyVaPjDdVJFHuszYcHBEg         G8Dg=Return-Path: <luis.machado@linaro.org>
Received: from [192.168.0.185] ([179.177.239.131])        by smtp.gmail.com with ESMTPSA id m10sm6634948qki.74.2020.01.14.06.18.54        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits\x128/128);        Tue, 14 Jan 2020 06:18:55 -0800 (PST)
Subject: Re: [PATCH, v2] Fix/Update misc comments
To: Pedro Alves <palves@redhat.com>, gdb-patches@sourceware.org
References: <20200106143620.2881-1-luis.machado@linaro.org> <20200109232626.13846-1-luis.machado@linaro.org> <b6a15032-3b8f-fc72-42f1-ba9b69315c06@redhat.com>
From: Luis Machado <luis.machado@linaro.org>
Message-ID: <833ff275-e299-4fe2-06d6-5f80a6554a67@linaro.org>
Date: Tue, 14 Jan 2020 15:22:00 -0000
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2
MIME-Version: 1.0
In-Reply-To: <b6a15032-3b8f-fc72-42f1-ba9b69315c06@redhat.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
X-SW-Source: 2020-01/txt/msg00374.txt.bz2
Content-length: 322

On 1/13/20 4:44 PM, Pedro Alves wrote:
> On 1/9/20 11:26 PM, Luis Machado wrote:
>> v2: Updated comments based on review.
>
> Thanks.
>
>> How does it look?
>>
>
> OK.
>
>> 	* inf-ptrace.c (inf_ptrace_target::resume): Update comments
>
> Missing period.
>

Fixed and pushed now. Thanks!

> Thanks,
> Pedro Alves
>


  parent reply	other threads:[~2020-01-14 13:59 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         ` Shahab Vahedi [this message]
2020-01-16  0:48         ` [PATCHv2 0/2] gdb/tui: Assembler window scrolling fixes Andrew Burgess
2020-01-24 11:22           ` Shahab Vahedi
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:22             ` [PATCH 0/2] Further Assembler Scrolling Fixes Andrew Burgess
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
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=CH2PR12MB3847FB39E41D9FD2F5B5DF67A6340@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=shahab.vahedi@gmail.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