diff options
-rw-r--r-- | gdb/mi/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/mi/gdbmi.texinfo | 23 | ||||
-rw-r--r-- | gdb/mi/mi-cmd-disas.c | 16 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/ChangeLog-mi | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.mi/mi-disassemble.exp | 20 |
5 files changed, 46 insertions, 30 deletions
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index 203ced4..87c8725 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,14 @@ +2001-06-23 Andrew Cagney <ac131313@redhat.com> + + * gdbmi.texinfo (data-disassemble): Update documentation of + output. Produces a list of instructions and a list of source + lines. + +2001-06-22 Andrew Cagney <ac131313@redhat.com> + + * mi-cmd-disas.c (mi_cmd_disassemble): For "-data-disassemble", + output a list instead of a tupple. + 2001-06-21 Andrew Cagney <ac131313@redhat.com> * mi-out.c (struct ui_out_data): Replace field first_header with diff --git a/gdb/mi/gdbmi.texinfo b/gdb/mi/gdbmi.texinfo index e07b089..74b774b 100644 --- a/gdb/mi/gdbmi.texinfo +++ b/gdb/mi/gdbmi.texinfo @@ -1093,7 +1093,7 @@ Disassemble from the current value of @code{$pc} to @code{$pc + 20}: (@value{GDBP}) -data-disassemble -s $pc -e "$pc + 20" -- 0 ^done, -asm_insns=@{ +asm_insns=[ @{address="0x000107c0",func-name="main",offset="4", inst="mov 2, %o0"@}, @{address="0x000107c4",func-name="main",offset="8", @@ -1103,7 +1103,7 @@ inst="or %o2, 0x140, %o1\t! 0x11940 <_lib_version+8>"@}, @{address="0x000107cc",func-name="main",offset="16", inst="sethi %hi(0x11800), %o2"@}, @{address="0x000107d0",func-name="main",offset="20", -inst="or %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"@}@} +inst="or %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"@}] (@value{GDBP}) @end smallexample @@ -1112,7 +1112,7 @@ Disassemble the whole @code{main} function. Line 32 is part of @smallexample -data-disassemble -f basics.c -l 32 -- 0 -^done,asm_insns=@{ +^done,asm_insns=[ @{address="0x000107bc",func-name="main",offset="0", inst="save %sp, -112, %sp"@}, @{address="0x000107c0",func-name="main",offset="4", @@ -1121,7 +1121,7 @@ inst="mov 2, %o0"@}, inst="sethi %hi(0x11800), %o2"@}, [@dots{}] @{address="0x0001081c",func-name="main",offset="96",inst="ret "@}, -@{address="0x00010820",func-name="main",offset="100",inst="restore "@}@} +@{address="0x00010820",func-name="main",offset="100",inst="restore "@}] (@value{GDBP}) @end smallexample @@ -1130,13 +1130,13 @@ Disassemble 3 instructions from the start of @code{main}: @smallexample (@value{GDBP}) -data-disassemble -f basics.c -l 32 -n 3 -- 0 -^done,asm_insns=@{ +^done,asm_insns=[ @{address="0x000107bc",func-name="main",offset="0", inst="save %sp, -112, %sp"@}, @{address="0x000107c0",func-name="main",offset="4", inst="mov 2, %o0"@}, @{address="0x000107c4",func-name="main",offset="8", -inst="sethi %hi(0x11800), %o2"@}@} +inst="sethi %hi(0x11800), %o2"@}] (@value{GDBP}) @end smallexample @@ -1145,20 +1145,19 @@ Disassemble 3 instructions from the start of @code{main} in mixed mode: @smallexample (@value{GDBP}) -data-disassemble -f basics.c -l 32 -n 3 -- 1 -^done,asm_insns=@{ +^done,asm_insns=[ src_and_asm_line=@{line="31", file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \ - testsuite/gdb.mi/basics.c",line_asm_insn=@{ + testsuite/gdb.mi/basics.c",line_asm_insn=[ @{address="0x000107bc",func-name="main",offset="0", -inst="save %sp, -112, %sp"@}@}@}, - +inst="save %sp, -112, %sp"@}]@}, src_and_asm_line=@{line="32", file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \ - testsuite/gdb.mi/basics.c",line_asm_insn=@{ + testsuite/gdb.mi/basics.c",line_asm_insn=[ @{address="0x000107c0",func-name="main",offset="4", inst="mov 2, %o0"@}, @{address="0x000107c4",func-name="main",offset="8", -inst="sethi %hi(0x11800), %o2"@}@}@}@} +inst="sethi %hi(0x11800), %o2"@}]@}] (@value{GDBP}) @end smallexample diff --git a/gdb/mi/mi-cmd-disas.c b/gdb/mi/mi-cmd-disas.c index 021ee5e..0b51324 100644 --- a/gdb/mi/mi-cmd-disas.c +++ b/gdb/mi/mi-cmd-disas.c @@ -364,7 +364,7 @@ mi_cmd_disassemble (char *command, char **argv, int argc) for that line. */ next_line = 0; /* Force out first line */ - ui_out_tuple_begin (uiout, "asm_insns"); + ui_out_list_begin (uiout, "asm_insns"); num_displayed = 0; for (i = 0; i < newlines; i++) { @@ -387,8 +387,8 @@ mi_cmd_disassemble (char *command, char **argv, int argc) { ui_out_tuple_begin (uiout, "src_and_asm_line"); print_source_lines (symtab, next_line, mle[i].line + 1, 0); - ui_out_tuple_begin (uiout, "line_asm_insn"); - ui_out_tuple_end (uiout); + ui_out_list_begin (uiout, "line_asm_insn"); + ui_out_list_end (uiout); ui_out_tuple_end (uiout); } /* Print the last line and leave list open for @@ -404,7 +404,7 @@ mi_cmd_disassemble (char *command, char **argv, int argc) } next_line = mle[i].line + 1; - ui_out_tuple_begin (uiout, "line_asm_insn"); + ui_out_list_begin (uiout, "line_asm_insn"); if (i + 1 < newlines && mle[i + 1].line <= mle[i].line) close_list = 0; } @@ -441,7 +441,7 @@ mi_cmd_disassemble (char *command, char **argv, int argc) } if (close_list) { - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); ui_out_tuple_end (uiout); close_list = 0; } @@ -449,12 +449,12 @@ mi_cmd_disassemble (char *command, char **argv, int argc) if (num_displayed >= how_many) break; } - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); } else { assembly_only: - ui_out_tuple_begin (uiout, "asm_insns"); + ui_out_list_begin (uiout, "asm_insns"); num_displayed = 0; for (pc = low; pc < high;) { @@ -487,7 +487,7 @@ mi_cmd_disassemble (char *command, char **argv, int argc) ui_file_rewind (stb->stream); ui_out_tuple_end (uiout); } - ui_out_tuple_end (uiout); + ui_out_list_end (uiout); } gdb_flush (gdb_stdout); diff --git a/gdb/testsuite/gdb.mi/ChangeLog-mi b/gdb/testsuite/gdb.mi/ChangeLog-mi index 0c1e353..6295bbf 100644 --- a/gdb/testsuite/gdb.mi/ChangeLog-mi +++ b/gdb/testsuite/gdb.mi/ChangeLog-mi @@ -1,3 +1,9 @@ +2001-06-23 Andrew Cagney <ac131313@redhat.com> + + * mi-disassemble.exp: Update patterns matching data-disassemble + output. Now produces a list of instructions and a list of + source/assembly lines. + 2001-06-18 Andrew Cagney <ac131313@redhat.com> * mi-basics.exp, mi-break.exp, mi-console.exp, mi-disassemble.exp, diff --git a/gdb/testsuite/gdb.mi/mi-disassemble.exp b/gdb/testsuite/gdb.mi/mi-disassemble.exp index a1325d6f..e5fb124 100644 --- a/gdb/testsuite/gdb.mi/mi-disassemble.exp +++ b/gdb/testsuite/gdb.mi/mi-disassemble.exp @@ -100,11 +100,11 @@ proc test_disassembly_only {} { mi_gdb_test "print/x \$pc" "" "" mi_gdb_test "111-data-disassemble -s \$pc -e \"\$pc + 12\" -- 0" \ - "111\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\},\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\}" \ + "111\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\},\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\]" \ "data-disassemble from pc to pc+12 assembly only" mi_gdb_test "222-data-disassemble -f basics.c -l 32 -- 0" \ - "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}" \ + "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \ "data-disassemble file & line, assembly only" } @@ -121,15 +121,15 @@ proc test_disassembly_lines_limit {} { mi_gdb_test "print/x \$pc" "" "" mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 20 -- 0" \ - "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}" \ + "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \ "data-disassemble file, line, number assembly only" mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 0 -- 0" \ - "222\\^done,asm_insns=\{\}" \ + "222\\^done,asm_insns=\\\[\\\]" \ "data-disassemble file, line, number (zero lines) assembly only" mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 50 -- 0" \ - "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}" \ + "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \ "data-disassemble file, line, number (more than main lines) assembly only" } @@ -145,7 +145,7 @@ proc test_disassembly_mixed {} { # -data-disassembly -s $pc -e "$pc+8" -- 1 mi_gdb_test "002-data-disassemble -f basics.c -l 21 -- 1" \ - "002\\^done,asm_insns=\{src_and_asm_line=\{line=\"21\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"callee2\",offset=\"0\",inst=\".*\"\}.*\}\},.*,src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{.*\{address=\"$hex\",func-name=\"callee2\",offset=\"$decimal\",inst=\".*\"\}\}\}\}" \ + "002\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"21\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"callee2\",offset=\"0\",inst=\".*\"\}.*\\\]\}.*,src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[.*\{address=\"$hex\",func-name=\"callee2\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\\\]" \ "data-disassemble file, line assembly mixed" # @@ -154,7 +154,7 @@ proc test_disassembly_mixed {} { # which we are now, even if we have specified that the range is only 2 insns. # mi_gdb_test "003-data-disassemble -s \$pc -e \"\$pc+4\" -- 1" \ - "003\\^done,asm_insns=\{src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}\}\}" \ + "003\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\\\]" \ "data-disassemble range assembly mixed" } @@ -171,15 +171,15 @@ proc test_disassembly_mixed_lines_limit {} { mi_gdb_test "print/x \$pc" "" "" mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 20 -- 1" \ - "222\\^done,asm_insns=\{src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\}" \ + "222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\]" \ "data-disassemble file, line, number assembly mixed" mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 0 -- 1" \ - "222\\^done,asm_insns=\{src_and_asm_line=\{line=\"31\",file=\".*basics.c\",line_asm_insn=\{\}\}\}" \ + "222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"31\",file=\".*basics.c\",line_asm_insn=\\\[\\\]\}\\\]" \ "data-disassemble file, line, number (zero lines) assembly mixed" mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 50 -- 1" \ - "222\\^done,asm_insns=\{src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\}" \ + "222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\}.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\]" \ "data-disassemble file, line, number (more than main lines) assembly mixed" } |