Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Andrew Burgess <aburgess@broadcom.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] MI disassemble opcode support
Date: Tue, 28 Dec 2010 06:35:00 -0000	[thread overview]
Message-ID: <20101228054733.GC2596@adacore.com> (raw)
In-Reply-To: <4D08C355.9010809@broadcom.com>

> 2010-12-10  Andrew Burgess  <aburgess@broadcom.com>
> 
>           * disasm.c (dump_insns): Build the opcodes into a stream so 
>             that we can dump them as a field for MI.
> 
> gdb/doc/
> 
> 2010-12-10  Andrew Burgess  <aburgess@broadcom.com>
> 
>           * gdb.texinfo: Update to reflect changes in mi/mi-cmd-disas.c
> 
> gdb/mi/
> 
> 2010-12-10  Andrew Burgess  <aburgess@broadcom.com>
> 
>           * mi-cmd-disas.c (mi_cmd_disassemble): Allow mode to control
>             dumping of instruction opcodes.
> 
> gdb/testsuite/
> 
> 2010-12-10  Andrew Burgess  <aburgess@broadcom.com>
> 
>           * gdb.mi/mi-disassemble.exp, gdb.mi/mi2-disassemble.exp: Update
>             expected output to reflect changes in gdb/mi/mi-cmd-disas.c and
>             add new tests to check opcode dumping works.

Pre-approved with the following changes made:

I think a NEWS entry might be worthwhile (this can be treated as a
separate patch - maybe ask Eli if he thinks it's significant enough
to be mentioned there).

The alignment of your ChangeLog entries is incorrect. Everything should
be aligned on a tabulation. Therefore:

           * gdb.mi/mi-disassemble.exp, gdb.mi/mi2-disassemble.exp: Update
           expected output to reflect changes in gdb/mi/mi-cmd-disas.c and
           add new tests to check opcode dumping works.

A general comment: The ChangeLog should explain the WHAT. If you feel
that you need to explain the WHY, that comment should be in the code.
For instance:

> +          const char *spacer = "";
> +
> +          /* Temporary stream for building up the opcodes */

You can put the reason why you are building the opcode in a stream here
instead of inside the ChangeLog.

> +              fprintf_filtered(opcode_stream->stream, "%s%02x", 
> +                               spacer, (unsigned)data);
> +              spacer = " ";

Formatting: space before the first '(', and also space after the
unsigned cast.  I know the second one is not your doing, but might
as well fix it.

>      error
>        ("mi_cmd_disassemble: Usage: [-f filename -l linenum [-n howmany]] [-s startaddr -e endaddr] [--] mixed_mode.");

This error message need to be updated (replace "mixed_mode" by "mode").

> +  /* Convert the mode into a set of disassembly flags */

Period and 2 spaces at the end of the sentence.

-- 
Joel


  parent reply	other threads:[~2010-12-28  5:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15 13:32 Andrew Burgess
2010-12-15 18:17 ` Eli Zaretskii
2010-12-16 10:46   ` Andrew Burgess
2010-12-28  6:35 ` Joel Brobecker [this message]
2010-12-28 19:12   ` Eli Zaretskii
2011-01-04 11:35   ` Andrew Burgess

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=20101228054733.GC2596@adacore.com \
    --to=brobecker@adacore.com \
    --cc=aburgess@broadcom.com \
    --cc=gdb-patches@sourceware.org \
    /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