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: [RFC] mi: add -a option to the "-data-disassemble" command


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


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