This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix alignment of disassemble /r
- From: Daniel Gutson <daniel dot gutson at tallertechnologies dot com>
- To: Doug Evans <dje at google dot com>
- Cc: Yao Qi <yao at codesourcery dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Thu, 17 Apr 2014 14:27:39 -0300
- Subject: Re: [PATCH] Fix alignment of disassemble /r
- Authentication-results: sourceware.org; auth=none
- References: <CAF5HaEUBbK4d2reSxUpUQwp7Zt_KjcpNC_nbUrMHRb0yNo9wtw at mail dot gmail dot com> <534F294D dot 4050907 at codesourcery dot com> <CAF5HaEUqppN8vLXnv5spG4WbWA0eNCQ1OybBNsM3ceTJDivrxw at mail dot gmail dot com> <CADPb22Qii2QiTZxv6-cz0zWTVOcft_nf1+Lb0rgg2c3Qyq07Og at mail dot gmail dot com>
On Thu, Apr 17, 2014 at 1:27 PM, Doug Evans <dje@google.com> wrote:
> On Thu, Apr 17, 2014 at 7:37 AM, Daniel Gutson
> <daniel.gutson@tallertechnologies.com> wrote:
>> So what if I add a new configuration variable, such as
>> set disassemble-raw-alignment
>> with "off" as default, and if set to on, pad to gdbarch_max_insn_length ?
>
> Presumably some frontends will do their own alignment.
>
> If we went with disassemble-raw-alignment, a boolean value won't help
> x86 much, it's either no alignment or (in general) too much
> whitespace.
> An improvement would be a value from min-insn-length to
> max-insn-length, but that would be problematic in a multi-arch
> debugging scenario.
>
> If we could agree on some minimum alignment for each variable-length
> ISA (5 would be fine for me for x86) then maybe a boolean value could
> be useful ("off" = no alignment, "on" = employ arch-specific minimum).
>
> OTOH, what if we made two passes over the instructions, with the first
> pass computing the maximum instruction length that is present?
I already considered this, but thought that it would be going to be
rejected due to be too much non-performant. Wouldn't each pass
translate in a lot of MI messaging in a case of a remote server? And,
what about screen paginig? I shouldn't iterate over all the range, but
the screen height range only.
I can go for any of the proposed solutions. 5 insn-length was fine for
me. On a side note, I did this since I was debugging some
self-modifying-code where the mis-alignment was driving me crazy.
The two-passes solution is the one I dislike more IMVHO.
Yet another option is to set the disassembly raw alignment width, something like
set disassemble-raw-width 5
(5 is the amount of insn; 0 means no padding equal to the current
behavior and that would be the default value).
Daniel.
> [And maybe only doing this for CLI.]
--
Daniel F. Gutson
Chief Engineering Officer, SPD
San Lorenzo 47, 3rd Floor, Office 5
CÃrdoba, Argentina
Phone: +54 351 4217888 / +54 351 4218211
Skype: dgutson