public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Nav Mohammed <nav@oscillate.io>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] [PATCH] Improve range stepping efficiency (ensure GDB steps over entire line, at once)
Date: Thu, 21 Sep 2023 14:01:01 -0600	[thread overview]
Message-ID: <87wmwj5m9u.fsf@tromey.com> (raw)
In-Reply-To: <CAFYgX4Y35pLeM+oNE7V4MOJ9z66nsOmWTVj77pnBFOuTTGns9g@mail.gmail.com> (Nav Mohammed's message of "Wed, 20 Sep 2023 22:38:26 +0100")

>>>>> "Nav" == Nav Mohammed <nav@oscillate.io> writes:

Nav> First time contributor to GDB, please go easy on me.

Hi, and welcome to gdb.

Thank you for the patch.

Nav> I've attached a patch to address this issue, but in all honesty, it's a bit
Nav> of a hacky workaround where I've tried to keep the number of changed lines
Nav> to an absolute minimum. This is because I'm totally new to the GDB codebase
Nav> and I don't want to introduce more bugs by making too many changes. And
Nav> given that find_pc_sect_line() is called in quite a few places, I'm
Nav> concerned that some of those may *expect* the old behaviour from that
Nav> function (return a PC range for a single statement).

I have this same fear.  I don't really understand this function too
well, and I tend to think that somebody else ought to review it.

One thought that occurred to me, though, is that it would be good to
have a test case.  A unit test seems maybe simplest/best, but that seems
like a real pain, though, since the function reaches into the minimal
symbols, blockvector, etc.

Maybe the body of the central loop could be pulled into a separate
function and then that could be unit-tested?  It would only rely on line
tables, and making test line tables seems pretty easy.

I wonder if you have any thoughts on how to test it.

Tom

      reply	other threads:[~2023-09-21 20:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20 21:38 Nav Mohammed
2023-09-21 20:01 ` Tom Tromey [this message]

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=87wmwj5m9u.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nav@oscillate.io \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).