From: Andrew Burgess <aburgess@redhat.com>
To: "Lluís Batlle i Rossell" <viric@viric.name>
Cc: gdb-patches@sourceware.org
Subject: Re: Re: [PATCH] Fix 'edit' command to go to right line
Date: Thu, 07 Nov 2024 13:22:08 +0000 [thread overview]
Message-ID: <87jzdfqiv3.fsf@redhat.com> (raw)
In-Reply-To: <aegskdhcmurxfssapeeh7cm5ckp4tix5paewag6pxvpznkle4o@fvphdawb3dcj>
Lluís Batlle i Rossell <viric@viric.name> writes:
> On Thu, Nov 07, 2024 at 11:13:12AM +0000, Andrew Burgess wrote:
>> Lluís Batlle i Rossell <viric@viric.name> writes:
>>
>> > I attach this patch I used more than 20 years ago.
>> >
>> > I thought I had sent it in these years but apparently not.
>> > From fc0f3f1200f18c86a6d90185f02b1f5ce0c0235b Mon Sep 17 00:00:00 2001
>> > From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= <viric@viric.name>
>> > Date: Tue, 5 Nov 2024 23:18:30 +0100
>> > Subject: [PATCH] Fix 'edit' command to go to right line
>> >
>> > The cursor was placed at a line off by a bunch of lines.
>>
>> Thanks for reporting this issue. I took a look at this patch and
>> started writing some tests for the 'edit' command. It would seem that
>> this was mostly untested until now!
>>
>> Anyway, though your patch does fix some cases, I found a bunch more
>> problems, so I'd like to propose the patch below as an alternative.
>>
>> I hope this should fix the case that I think you care about, though I'm
>> guessing really as you didn't describe exactly which case you believe
>> this fixes. If you are willing to give this alternative patch a try,
>> and report if this fixes your use case or not that would be really
>> helpful.
>>
>> Thanks,
>> Andrew
>
> (Now replying Cc to the list)
>
> Sure! Use your patch.
>
> I have EDITOR=vim. And when I'm debugging in some frame, I run 'edit' to
> get me to that position in vim.
>
> I don't really understand what is the get_first_line_listed ()
> situation... I think it means that if 'list' has been run, then the editor
> on 'edit' will point to the line in the middle of the last 'list'.
> I like this as well, if I interpret correctly.
That's correct. It means I can do:
(gdb) list SOME_LINE_NUMBER
(gdb) edit
and GDB will start editing SOME_LINE_NUMBER. I think we were already
trying to do this, but we were off by 'get_lines_to_list()' in this
case.
I've posted a v2 which fixes some problems with the new test. I'll
leave this for a while to see if anyone else wants to comment before
merging.
Thanks,
Andrew
next prev parent reply other threads:[~2024-11-07 13:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-05 22:23 Lluís Batlle i Rossell
2024-11-07 11:13 ` Andrew Burgess
2024-11-07 12:01 ` Lluís Batlle i Rossell
2024-11-07 13:22 ` Andrew Burgess [this message]
2024-11-07 13:17 ` [PATCHv2] gdb: fixes and tests for the 'edit' command Andrew Burgess
2024-11-07 15:03 ` Tom Tromey
2024-11-08 10:51 ` Andrew Burgess
2024-11-08 13:28 ` Lluís Batlle i Rossell
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=87jzdfqiv3.fsf@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=viric@viric.name \
/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