This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 2/4] disasm: add struct disasm_insn to describe to-be-disassembled instruction
- From: Doug Evans <xdje42 at gmail dot com>
- To: "Metzger\, Markus T" <markus dot t dot metzger at intel dot com>
- Cc: "gdb-patches\ at sourceware dot org" <gdb-patches at sourceware dot org>, "palves\ at redhat dot com" <palves at redhat dot com>
- Date: Mon, 26 Oct 2015 09:24:15 -0700
- Subject: Re: [PATCH v2 2/4] disasm: add struct disasm_insn to describe to-be-disassembled instruction
- Authentication-results: sourceware.org; auth=none
- References: <1445246610-11645-1-git-send-email-markus dot t dot metzger at intel dot com> <1445246610-11645-3-git-send-email-markus dot t dot metzger at intel dot com> <8637wyege1 dot fsf at sspiff dot org> <A78C989F6D9628469189715575E55B2333207D29 at IRSMSX104 dot ger dot corp dot intel dot com>
"Metzger, Markus T" <markus.t.metzger@intel.com> writes:
>> -----Original Message-----
>> From: Doug Evans [mailto:xdje42@gmail.com]
>> Sent: Sunday, October 25, 2015 11:24 PM
>> To: Metzger, Markus T
>> Cc: gdb-patches@sourceware.org; palves@redhat.com
>> Subject: Re: [PATCH v2 2/4] disasm: add struct disasm_insn to describe to-
>> be-disassembled instruction
>
> Hi Doug,
>
> Thanks for your review.
>
>
>> > +/* Prints the instruction INSN into UIOUT and returns the length of the
>> > + printed instruction in bytes. */
>> > +
>> > +extern int gdb_print_insn_tuple (struct gdbarch *gdbarch, struct ui_out
>> *uiout,
>>
>> Still would rather not have "tuple" in the name here.
>> I know gdb_print_insn is taken.
>> If one reads their function comments the reader is left thinking
>> they print essentially the same thing (which is obviously not true).
>> We need to pick names that distinguish them.
>> I'm as bad at picking names as anyone, but how about
>> using gdb_pretty_print_insn here (leaving gdb_print_insn as is) ?
>
> The "tuple" in the name refers to ui_out/MI. The function prints the ui_out
> tuple for one instruction.
Yeah, but it's also used for the non-MI case,
and when I read "insn_tuple" MI isn't what I think about.
> I'm also fine to call it gdb_pretty_print_insn or just dump_insn.
The convention in disasm.c is to prefix exported routines with gdb_,
which is fine by me, so let's go with gdb_pretty_print_insn.
[Maybe that's just happenstance, but I like it so let's stick with it.]