From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v4 1/2] Add back gdb_pretty_print_insn
Date: Thu, 02 Feb 2017 01:20:00 -0000 [thread overview]
Message-ID: <91f689224629236a3be67f06d3b01557@polymtl.ca> (raw)
In-Reply-To: <0c624f14-cd12-289d-a0a5-6cd56b79a376@redhat.com>
On 2017-02-01 18:50, Pedro Alves wrote:
> On 02/01/2017 08:31 PM, Pedro Alves wrote:
>
>> reuse both. Which suggests creating a new struct to hold
>> whatever should survive across calls. And then we can
>> go the step further, and make that a class, with
>> pretty_print_insn a method of _that_ class instead of
>> of gdb_disassembler. Like:
>>
>> I can try that, but I think I'd rather do it after
>> string_file is in already.
>
> Here's what it looks like, on top of the v4 series.
I think it looks good, it doesn't really add any complexity.
> diff --git a/gdb/disasm.h b/gdb/disasm.h
> index dffe9cd..a03eba6 100644
> --- a/gdb/disasm.h
> +++ b/gdb/disasm.h
> @@ -97,11 +97,34 @@ extern void gdb_disassembly (struct gdbarch
> *gdbarch, struct ui_out *uiout,
> extern int gdb_print_insn (struct gdbarch *gdbarch, CORE_ADDR memaddr,
> struct ui_file *stream, int *branch_delay_insns);
>
> -/* Prints the instruction INSN into UIOUT and returns the length of
> - the printed instruction in bytes. */
> +/* Class used to pretty-print an instruction. */
I'd say "...to pretty-print instructions.", since the goal is to reuse
it for multiple instructions.
next prev parent reply other threads:[~2017-02-02 1:20 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-01 0:30 [PATCH v4 0/2] Eliminate cleanups & make ui_file a C++ class hierarchy Pedro Alves
2017-02-01 0:30 ` [PATCH v4 1/2] Add back gdb_pretty_print_insn Pedro Alves
2017-02-01 17:01 ` Luis Machado
2017-02-01 18:10 ` Simon Marchi
2017-02-01 18:26 ` Simon Marchi
2017-02-02 0:00 ` Pedro Alves
2017-02-01 20:02 ` Pedro Alves
2017-02-01 20:31 ` Pedro Alves
2017-02-01 23:50 ` Pedro Alves
2017-02-02 1:20 ` Simon Marchi [this message]
2017-02-02 11:37 ` [pushed] Reuse buffers across gdb_pretty_print_insn calls (Re: [PATCH v4 1/2] Add back gdb_pretty_print_insn) Pedro Alves
2017-02-01 0:31 ` [PATCH v4 2/2] Eliminate make_cleanup_ui_file_delete / make ui_file a class hierarchy Pedro Alves
2017-02-01 17:37 ` Luis Machado
2017-02-01 22:49 ` Pedro Alves
2017-02-01 23:24 ` Luis Machado
2017-02-02 0:02 ` Pedro Alves
2017-02-27 19:43 ` Edjunior Barbosa Machado
2017-03-07 14:02 ` Pedro Alves
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=91f689224629236a3be67f06d3b01557@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--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