From: Tom Tromey <tom@tromey.com>
To: Simon Farre <simon.farre.cx@gmail.com>
Cc: gdb-patches@sourceware.org, tom@tromey.org
Subject: Re: [PATCH v3 1/5] [dap & linetable]: Add column to linetable entry
Date: Wed, 07 Feb 2024 12:28:06 -0700 [thread overview]
Message-ID: <87fry4axbt.fsf@tromey.com> (raw)
In-Reply-To: <20240122133115.201205-1-simon.farre.cx@gmail.com> (Simon Farre's message of "Mon, 22 Jan 2024 14:31:11 +0100")
>>>>> "Simon" == Simon Farre <simon.farre.cx@gmail.com> writes:
Thanks for the patch.
Simon> void
Simon> -record_line (struct subfile *subfile, int line, unrelocated_addr pc)
Simon> +record_line (struct subfile *subfile, int line, uint col, unrelocated_addr pc)
"uint" isn't really a type used in gdb. I think "unsigned" would be
fine.
Simon> + void set_column (unsigned int column) noexcept {
Simon> + m_col = column;
Simon> + }
gdb style puts the opening brace on the next line.
Simon> + else if(line == last_line && col != last_col)
Simon> + return 1;
Space before paren.
Simon> diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
Simon> index 73df0ed8165..b5cbe4548a7 100644
Simon> --- a/gdb/mdebugread.c
Simon> +++ b/gdb/mdebugread.c
Simon> @@ -4008,7 +4008,7 @@ mdebug_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
Simon> {
Simon> /* Handle encoded stab line number. */
Simon> record_line
Simon> - (get_current_subfile (), sh.index,
Simon> + (get_current_subfile (), sh.index, 0,
Unfortunately there's also mdebugread.c:add_line.
I suspect this code is already a bit wrong because new_linetable doesn't
zero out the memory.
I think there are other such spots needing an update as well, for
instance jit.c.
Simon> - /* Two entries are equal if they have the same line and PC. The
Simon> + /* Two entries are equal if they have the same line, PC and col. The
Simon> other members are ignored. */
Simon> bool operator== (const linetable_entry &other) const
Simon> - { return line == other.line && m_pc == other.m_pc; }
Simon> + { return line == other.line && m_pc == other.m_pc && col == other.col; }
Does operator< also need a change?
Tom
prev parent reply other threads:[~2024-02-07 19:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-22 13:31 Simon Farre
2024-01-22 13:31 ` [PATCH v3 2/5] [dap & linetable]: Add column to maint info linetable output Simon Farre
2024-02-07 19:52 ` Tom Tromey
2024-01-22 13:31 ` [PATCH v3 3/5] [dap & linetable]: Change gdb.LineTableEntry & Add gdb.lookup_linetable Simon Farre
2024-02-07 20:05 ` Tom Tromey
2024-01-22 13:31 ` [PATCH v3 4/5] [dap & linetable]: Add breakpointLocations request Simon Farre
2024-02-07 19:44 ` Tom Tromey
2024-01-22 13:31 ` [PATCH v3 5/5] [dap & linetable]: Added docs Simon Farre
2024-02-07 19:28 ` 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=87fry4axbt.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.farre.cx@gmail.com \
--cc=tom@tromey.org \
/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).