From: Peter Bergner <bergner@vnet.ibm.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org, Yao Qi <qiyaoltc@gmail.com>,
Alan Modra <amodra@gmail.com>,
Ulrich Weigand <uweigand@de.ibm.com>,
binutils <binutils@sourceware.org>
Subject: Re: [PATCH, v17] Add support for setting disassembler-options in GDB for POWER, ARM and S390
Date: Fri, 24 Feb 2017 17:13:00 -0000 [thread overview]
Message-ID: <b501b4af-dcfd-666d-3572-e4392a24def3@vnet.ibm.com> (raw)
In-Reply-To: <46d6c25a-3d33-8e2a-043a-b46ae004d8b3@redhat.com>
On 2/24/17 9:06 AM, Pedro Alves wrote:
> On 02/24/2017 04:58 AM, Peter Bergner wrote:
>> The only architecture that uses this is the ppc arch and this mimics
>> what print_ppc_disassembler_options() does. We have ~60 options that
>> we're emitting, so I think wrapping does make things more readable.
>
> I see. Well that uses 66 instead of 80, which is equally arbitrary....
Well that uses 66 without the length of the option we're printing,
while this code includes the length of the option we're printing,
so it can be more accurate. But...
> What you may want to do is call wrap_here between printing each option,
> so that gdb automatically knows to break the line between options
> if necessary, instead of in the middle of some option.
I didn't realize that fprintf_filtered could wrap the output itself.
It does simplify things, so how about using the following loop to
print out the options (for arches without descriptions) instead?
I can confirm the output wraps nicely.
Peter
if (valid_options->description != NULL)
{
...
}
else
{
size_t i;
fprintf_filtered (file, " ");
for (i = 0; valid_options->name[i] != NULL; i++)
{
fprintf_filtered (file, "%s", valid_options->name[i]);
if (valid_options->name[i+1] != NULL)
fprintf_filtered (file, ", ");
wrap_here (" ");
}
fprintf_filtered (file, "\n");
}
next prev parent reply other threads:[~2017-02-24 17:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-22 21:23 Peter Bergner
2017-02-23 12:26 ` Pedro Alves
2017-02-24 4:58 ` Peter Bergner
2017-02-24 15:06 ` Pedro Alves
2017-02-24 17:13 ` Peter Bergner [this message]
2017-02-24 17:25 ` Pedro Alves
2017-02-24 17:28 ` Peter Bergner
2017-02-28 11:24 ` Yao Qi
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=b501b4af-dcfd-666d-3572-e4392a24def3@vnet.ibm.com \
--to=bergner@vnet.ibm.com \
--cc=amodra@gmail.com \
--cc=binutils@sourceware.org \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=qiyaoltc@gmail.com \
--cc=uweigand@de.ibm.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