public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Dominik Czarnota <dominik.b.czarnota@gmail.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: John Baldwin <jhb@freebsd.org>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] gdb/linux-tdep: move "Perms" column right
Date: Thu, 24 Feb 2022 13:22:32 +0100	[thread overview]
Message-ID: <CABEVAa0=BAhaCc39V2hJO-quNVU6zKBibFaWj7qpfbsLYjbXqw@mail.gmail.com> (raw)
In-Reply-To: <f9433590-e606-5aa0-49b5-c60b798e44aa@polymtl.ca>

Hey,

On Thu, 24 Feb 2022 at 13:18, Simon Marchi <simon.marchi@polymtl.ca> wrote:

> On 2022-02-23 16:41, John Baldwin wrote:
> > On 2/23/22 1:26 PM, Simon Marchi via Gdb-patches wrote:
> >> Commit 29ef4c0699e1 ("gdb/linux-tdep.c: Add Perms to the 'info proc
> >> mappings' output") has broken test gdb.base/info-proc.exp on Linux,
> >> because it changes the output of "info proc mappings" in a way that the
> >> test does not expect (my bad for not testing before pushing).
> >>
> >> I looked at how FreeBSD handles this, since I remembered it did show
> >> permission flags.  It looks like this:
> >>
> >>            Start Addr           End Addr       Size     Offset   Flags
>  File
> >>              0x200000           0x243000    0x43000        0x0  r--
> CN-- /usr/local/bin/tmux
> >>
> >> (I think that `Flags` and the flags not being aligned is not
> >> intentional)
> >>
> >> The test passes on FreeBSD, because the test looks for four hex numbers
> >> in a row and ignores the rest:
> >>
> >>      ".*Mapped address
> spaces:.*${hex}${ws}${hex}${ws}${hex}${ws}${hex}.*"
> >>
> >> I suggest fixing it on Linux by moving the flags column to the same
> >> place as in the FreeBSD output.  It makes things a bit more consistent
> >> between OSes, and we don't have to touch the test.
> >
> > FWIW, the format I chose to use on FreeBSD was to match an existing tool
> > in FreeBSD (procstat(1)).  I wasn't necessarily trying to come up with a
> > cross-platform format.
>
> That's fine, and I don't think we can really have a cross-platform
> format, each OS has different concepts.
>
> > The weird alignment of "Flags" is on purpose as it
> > spans both the permissions field and a separate "flags" field (the 'C'
> > stands for a Copy-On-Write mapping for example).
>
> Ah ok, so it's centered on the column.
>
> > (https://www.freebsd.org/cgi/man.cgi?procstat describes possible flags)
> >
> > I think your change is fine though.
>
> Thanks.  Adding Dominik in CC, I realize he is probably not subscribed
> to gdb-patches.  Does that look good to you?  Here's the link to the
> patch if needed:
>
>   https://sourceware.org/pipermail/gdb-patches/2022-February/186083.html

Yeah, it looks good to me. Thanks a lot for taking care of this.


>
>
> Simon
>

Best regards,
Dominik

  reply	other threads:[~2022-02-24 12:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23 21:26 [PATCH 1/2] gdb/linux-tdep: make read_mapping return a structure Simon Marchi
2022-02-23 21:26 ` [PATCH 2/2] gdb/linux-tdep: move "Perms" column right Simon Marchi
2022-02-23 21:41   ` John Baldwin
2022-02-24 12:17     ` Simon Marchi
2022-02-24 12:22       ` Dominik Czarnota [this message]
2022-02-24 12:29         ` Simon Marchi
2022-05-04 22:04           ` Dominik Czarnota
2022-05-05 13:01             ` Simon Marchi
2022-02-25 18:25   ` Tom Tromey

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='CABEVAa0=BAhaCc39V2hJO-quNVU6zKBibFaWj7qpfbsLYjbXqw@mail.gmail.com' \
    --to=dominik.b.czarnota@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@freebsd.org \
    --cc=simon.marchi@polymtl.ca \
    /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).