Change mi/data-disassemble command output to a list ([]) instead of
authorAndrew Cagney <cagney@redhat.com>
Sat, 23 Jun 2001 20:43:56 +0000 (20:43 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sat, 23 Jun 2001 20:43:56 +0000 (20:43 +0000)
({}).

gdb/mi/ChangeLog
gdb/mi/gdbmi.texinfo
gdb/mi/mi-cmd-disas.c
gdb/testsuite/gdb.mi/ChangeLog-mi
gdb/testsuite/gdb.mi/mi-disassemble.exp

index 203ced4236d74af2d451882e6110b7899e86b0e4..87c8725a4fdb80d9744c22c6d15d498e42eaf90e 100644 (file)
@@ -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
index e07b08929a58127d3c1b3ebc08dfa648c79f26c3..74b774bd857ec5acabdbebd3e72c8c899dae9227 100644 (file)
@@ -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
 
index 021ee5e6d9468d5407b6499d26d17e9ef7457417..0b513244c6b005ef55372e5e33c8f5c57def901a 100644 (file)
@@ -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);
 
index 0c1e353ce0189073607ccf589f0dd2694cdc6206..6295bbf3a526e3c4d5716d4be1006ae32846e4d6 100644 (file)
@@ -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,
index a1325d6f33491321ee4633fd3794d69f9aae40ea..e5fb12493b409ef3d5023c31de64ba70bc280e50 100644 (file)
@@ -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"
 }