public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Farre <simon.farre.cx@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Simon Farre via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v1] [gdb/infcmd]: Add next-expression command
Date: Thu, 18 May 2023 13:12:23 +0200	[thread overview]
Message-ID: <CACx6OkwZ8DZfJagEH7zYta2SeH9LyTq4Hryo8oJ3y3RX-urU2w@mail.gmail.com> (raw)
In-Reply-To: <83v8gsz4mm.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2743 bytes --]

Hi Eli, thanks for your review,

I'll change the NEWS message in in next patch as well as correct
any documentation formatting errors as well as reword phrases that you've
requested
to be changed.

> Also, I don't think I understand this description.  What did you mean by
"source-level steps to columns"?

I was attempting to signal that this is a "pure" source-level command, i.e.
that it's not
like "step", "stepi", or "nexti". After some discussion on IRC with Andrew
Burgess,
he pointed out to me that these commands are not supposed to work like this
new proposed command
because they were not "source level commands" but "instruction level
commands" so I figured I'd run
with that distinction/definition.

> This begs the question what happens if we are already on the last
expression or statement.

If we're on the last expression or statement on a source line, we'll step
to the first
expression on the next line (i.e. fall back to normal `next` behavior).
This first patch
explicitly only allows stepping to expressions on the same line and if it
can't find a column=N+1
in the linetable it will fall back on the `next` command; and as such won't
introduce new edge cases;
it will just call existing code that's battle tested.

> It would be good to mention the version of DWARF2 that supports the
> necessary information, and perhaps also the compilers known to emit
> it.  At least for GCC, I'd certainly like to see this in the manual.

I actually wrote this but decided to remove it which was something along
the lines of
"Column metadata has been supported since DWARF 2.0 (1992) and as such seem
to be
emitted by a lot of compilers I've tested, like g++, clang, rustc etc."

Where would you want me to put the information about compilers and
compatibility with emitting
column data?

> Two spaces there.  More importantly, what does current column measure
> in this case?  Is that a character number from beginning of source
> line, a byte number since the beginning of line, or the visual column
> (which can be different from the character number if some characters
> are double-width)?  How many columns is a TAB?

> IOW, we must explain the manual what we mean by "column" here.  It
> isn't trivial.

I have tested two different versions of GCC, clang and 1 version of the
rust compiler
and they all emit "columns" on a byte-level. So a smilie face with 4 bytes,
will be 4 columns.
I expect this to be the case for all DWARF-compliant compilers. Where would
you like
me to put this information? I could not find any information about this in
the DWARF standard
but seeing as how the two major C/C++ compilers (as well as the Rust
compiler)
emit it as such, then I think it's safe to assume this is how it's intended
to be?

  reply	other threads:[~2023-05-18 11:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16  9:47 Simon Farre
2023-05-16 15:18 ` Eli Zaretskii
2023-05-18 11:12   ` Simon Farre [this message]
2023-05-18 11:48     ` Eli Zaretskii
2023-05-24  8:18       ` Simon Farre
2023-05-24 11:14         ` Eli Zaretskii
2023-05-24 16:01           ` Simon Farre

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=CACx6OkwZ8DZfJagEH7zYta2SeH9LyTq4Hryo8oJ3y3RX-urU2w@mail.gmail.com \
    --to=simon.farre.cx@gmail.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.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).