Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Cc: Pedro Alves <palves@redhat.com>
Subject: Re: FYI: copy/paste error in sol-thread.c ?
Date: Tue, 07 May 2013 12:25:00 -0000	[thread overview]
Message-ID: <1367929532-4849-1-git-send-email-brobecker@adacore.com> (raw)
In-Reply-To: <518284AF.5090802@redhat.com>

> I agree it looks like a copy/paste.

Ok, the first patch of this series fixes the code.

> Very very very minor, but the prints look a little odd to me:
> 
> >             printf_filtered ("   startfunc: %s\n",
> >             printf_filtered (" - Sleep func: %s\n"
> 
> The first is lowercase, and doesn't start with '-', while the
> other  line is uppercase, and has a '-'...  Looks odd.
> It reads to me as if the original intention was to put this all
> in the same line, but then the startfunc print includes \n,
> breaking it...

You are right. This is a copy of the current output:

| (gdb) maintenance info sol-threads
| user   thread #1, lwp 1, (active)
| system thread #2, lwp 2, (active)
| system thread #3, lwp 0, (asleep)  - Sleep func: 0xff32d9e0
| user   thread #4, lwp 4, (asleep)    startfunc: system.tasking.stages.task_wrapper
|  - Sleep func: 0xff3290f0
|  system thread #5, lwp 7, (active)    startfunc: _co_timerset

Besides the lowercase/uppercase thing, two things are odd:
  - the '-' for thread #3
  - the fact that "sleep func" gets printed on the next line
    for thread #4, with an indentation that makes it hard to read
    the info.

It seems to me also that the initial intention was probably to have
everything on the same line, and that seems fine to me, as this is
only a maintenance command. So patch #2 makes a number of adjustments
to the formatting of the output.  In particular, for simplicity,
I just got rid of the '-' altogether, and to compensate for the
slight reduction in visual separation, I grouped the label and
the value a little more tightly.

And to boot, I wasn't very fond of the fact that the code printing
the info was duplicated, so I factorized it a bit. This is also
potentially a matter of taste - so I did not commit any of the patches
yet.

Tested on sparc-solaris by running the "maintenance info sol-threads"
command by hand. That's probably as much time as I am willing to
spend on this, and I think that's going to be sufficient anyway.



  parent reply	other threads:[~2013-05-07 12:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-30 17:09 Joel Brobecker
2013-05-02 15:22 ` Pedro Alves
2013-05-07 12:25   ` [RFA/commit 1/3] ti.ti_pc vs ti.ti_startfunc copy-pasto in sol-thread.c:info_cb Joel Brobecker
2013-05-07 14:31     ` Pedro Alves
2013-05-08  6:28     ` Checked in: " Joel Brobecker
2013-05-07 12:25   ` [RFA 3/3] Avoid duplicating text " Joel Brobecker
2013-05-07 14:27     ` Tom Tromey
2013-05-08  6:28     ` Checked in: " Joel Brobecker
2013-05-07 12:25   ` Joel Brobecker [this message]
2013-05-07 12:25   ` [RFA 2/3] Improve output of "maintenance info sol-threads" command Joel Brobecker
2013-05-07 14:26     ` Tom Tromey
2013-05-07 14:35     ` Pedro Alves
2013-05-08  6:27       ` Joel Brobecker
2013-05-08  6:28     ` Checked in: " Joel Brobecker

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=1367929532-4849-1-git-send-email-brobecker@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /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