Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Jan Vrany <jan.vrany@fit.cvut.cz>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] mi: add -a option to the "-data-disassemble" command
Date: Mon, 30 Jul 2018 15:05:00 -0000	[thread overview]
Message-ID: <87d0v469yy.fsf@tromey.com> (raw)
In-Reply-To: <20180727075447.16243-1-jan.vrany@fit.cvut.cz> (Jan Vrany's	message of "Fri, 27 Jul 2018 08:54:47 +0100")

>>>>> "Jan" == Jan Vrany <jan.vrany@fit.cvut.cz> writes:

Jan> A CLI command "disassemble" allows use to specify a single
Jan> address - in that case function surrounding that address is
Jan> disassembled.

Jan>  	  high = parse_and_eval_address (oarg);
Jan>  	  end_seen = 1;
Jan>  	  break;
Jan> +        case ADDR_OPT:
Jan> +          addr = parse_and_eval_address (oarg);
Jan> +          addr_seen = 1;
Jan> +          break;

The indentation looked slightly off here.
It could just be how the patch looked here, but could you double-check
just in case?

Jan> +  if (!((line_seen && file_seen && num_seen && !start_seen && !end_seen && !addr_seen)
Jan> +	|| (line_seen && file_seen && !num_seen && !start_seen && !end_seen && !addr_seen)
Jan> +	|| (!line_seen && !file_seen && !num_seen && start_seen && end_seen && !addr_seen)
Jan> +	|| (!line_seen && !file_seen && !num_seen && !start_seen && !end_seen && addr_seen)))

I suppose this ought to check for the case where either -s or -e is
given along with -a.  That seems like an error.

This "if" made me laugh.

Jan> +    mi_gdb_test "112-data-disassemble -a \$pc -- 0" \
Jan> +	    "112\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\},\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\]" \
Jan> +             "data-disassemble function around pc assembly only"
Jan> +
Jan> +    mi_gdb_test "112-data-disassemble -a callee4 -- 0" \
Jan> +	    "112\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"callee4\",offset=\"$decimal\",inst=\".*\"\},\{address=\"$hex\",func-name=\"callee4\",offset=\"$decimal\",inst=\".*\"\}.*\]" \
Jan> +             "data-disassemble function callee4 assembly only"

Probably the second "112" should be "113".  I don't know if you can
reuse tokens or not, but it seems simple and safe not to.

Thanks for doing this.  It seems like a good addition to me.

Tom


  reply	other threads:[~2018-07-30 15:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-06  9:39 Jan Vrany
2018-07-06 12:37 ` Eli Zaretskii
2018-07-14 17:39   ` Jan Vrany
2018-07-14 18:27     ` Eli Zaretskii
2018-07-26 14:56       ` Jan Vrany
2018-07-26 17:47         ` Eli Zaretskii
2018-07-27  7:57           ` Jan Vrany
2018-07-30 15:05             ` Tom Tromey [this message]
2018-07-31 10:23               ` Jan Vrany
2018-07-31 15:48                 ` Tom Tromey
2018-07-31 20:35                   ` Jan Vrany
2018-08-09 20:47                     ` Tom Tromey
2018-08-10  8:29                       ` Jan Vrany
2018-08-10 13:22                         ` Tom Tromey
2018-08-10  8:30                       ` Jan Vrany
2018-08-10  9:47                         ` Pedro Alves
2018-08-10 10:28                           ` Jan Vrany
2018-08-10 10:41                             ` Pedro Alves
2018-08-14  9:16                               ` Jan Vrany
2018-08-14 13:57                                 ` Pedro Alves
2018-08-14 14:40                                 ` Eli Zaretskii

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=87d0v469yy.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.vrany@fit.cvut.cz \
    /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