This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 2/4] disasm: add struct disasm_insn to describe to-be-disassembled instruction


"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.]


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]