aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2001-06-27 17:27:08 +0000
committerAndrew Cagney <cagney@redhat.com>2001-06-27 17:27:08 +0000
commitcff22675c610105a7d0a2cf13b348497d4e2fa9f (patch)
tree26f61569a97c8d2066b5e02cd087c929da3acdf2 /gdb/mi
parent38b87a1b807c1caeee3e66f67fa94d89962bbfb4 (diff)
downloadgdb-cff22675c610105a7d0a2cf13b348497d4e2fa9f.zip
gdb-cff22675c610105a7d0a2cf13b348497d4e2fa9f.tar.gz
gdb-cff22675c610105a7d0a2cf13b348497d4e2fa9f.tar.bz2
For MI>0, output full breakpoint table header information. Output the
breakpoint table body as a list.
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/ChangeLog14
-rw-r--r--gdb/mi/gdbmi.texinfo128
-rw-r--r--gdb/mi/mi-out.c53
3 files changed, 152 insertions, 43 deletions
diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog
index 3bafadf..2611b45 100644
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,3 +1,17 @@
+2001-06-27 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-out.c (mi_table_begin): Include nr_cols and nr_rows in mi1
+ table output.
+ * mi-out.c (mi_table_begin): Only suppress output when mi0. Change
+ the header to a list.
+ (mi_table_body): For mi1, close the header list and open a table
+ body list.
+ (mi_table_end): For mi1, close the body list.
+ (mi_table_header): For mi1, output a tuple containing all the
+ header information.
+ (mi_open, mi_close): Reverse logic of mi_version test.
+ * gdbmi.texinfo (GDB/MI Breakpoint Table Commands): Update.
+
2001-06-26 Andrew Cagney <ac131313@redhat.com>
* gdbmi.texinfo (GDB/MI Output Syntax): Delete reference to query
diff --git a/gdb/mi/gdbmi.texinfo b/gdb/mi/gdbmi.texinfo
index 2f9dc8d..ae69649 100644
--- a/gdb/mi/gdbmi.texinfo
+++ b/gdb/mi/gdbmi.texinfo
@@ -588,10 +588,16 @@ The corresponding @value{GDBN} command is @samp{ignore}.
^done
(@value{GDBP})
-break-list
-^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
-bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
+^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",line="5",times="0",
-ignore="3"@}@}
+ignore="3"@}]@}
(@value{GDBP})
@end smallexample
@@ -630,10 +636,16 @@ The corresponding @value{GDBN} command is @samp{condition}.
^done
(@value{GDBP})
-break-list
-^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
-bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
+^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",line="5",cond="1",
-times="0",ignore="3"@}@}
+times="0",ignore="3"@}]@}
(@value{GDBP})
@end smallexample
@@ -661,7 +673,14 @@ The corresponding @value{GDBN} command is @samp{delete}.
^done
(@value{GDBP})
-break-list
-^done,BreakpointTable=@{@}
+^done,BreakpointTable=@{nr_rows="0",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[]@}
(@value{GDBP})
@end example
@@ -689,9 +708,15 @@ The corresponding @value{GDBN} command is @samp{disable}.
^done
(@value{GDBP})
-break-list
-^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
-bkpt=@{number="2",type="breakpoint",disp="keep",enabled="n",
-addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}@}
+^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="2",type="breakpoint",disp="keep",enabled="n",
+addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}]@}
(@value{GDBP})
@end smallexample
@@ -718,9 +743,15 @@ The corresponding @value{GDBN} command is @samp{enable}.
^done
(@value{GDBP})
-break-list
-^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
-bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
-addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}@}
+^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
+addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}]@}
(@value{GDBP})
@end smallexample
@@ -818,11 +849,17 @@ The corresponding @value{GDBN} commands are @samp{break}, @samp{tbreak},
^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",line="11"@}
(@value{GDBP})
-break-list
-^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
-bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
+^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x0001072c", func="main",file="recursive2.c",line="4",times="0"@},
bkpt=@{number="2",type="breakpoint",disp="del",enabled="y",
-addr="0x00010774",func="foo",file="recursive2.c",line="11",times="0"@}@}
+addr="0x00010774",func="foo",file="recursive2.c",line="11",times="0"@}]@}
(@value{GDBP})
-break-insert -r foo.*
~int foo(int, int);
@@ -861,7 +898,7 @@ number of times the breakpoint has been hit
@end table
If there are no breakpoints or watchpoints, the @code{BreakpointTable}
-field is an empty list.
+@code{body} field is an empty list.
@subsubheading @value{GDBN} Command
@@ -872,11 +909,17 @@ The corresponding @value{GDBN} command is @samp{info break}.
@smallexample
(@value{GDBP})
-break-list
-^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
-bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
+^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@},
bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
-addr="0x00010114",func="foo",file="hello.c",line="13",times="0"@}@}
+addr="0x00010114",func="foo",file="hello.c",line="13",times="0"@}]@}
(@value{GDBP})
@end smallexample
@@ -885,7 +928,14 @@ Here's an example of the result when there are no breakpoints:
@smallexample
(@value{GDBP})
-break-list
-^done,BreakpointTable=@{@}
+^done,BreakpointTable=@{nr_rows="0",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[]@}
(@value{GDBP})
@end smallexample
@@ -967,12 +1017,18 @@ deleted.
^done,wpt=@{number="2",exp="C"@}
(@value{GDBP})
-break-list
-^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
-bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
+^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x00010734",func="callee4",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@},
bkpt=@{number="2",type="watchpoint",disp="keep",
-enabled="y",addr="",what="C",times="0"@}@}
+enabled="y",addr="",what="C",times="0"@}]@}
(@value{GDBP})
-exec-continue
^running
@@ -982,12 +1038,18 @@ frame=@{func="callee4",args=[],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(@value{GDBP})
-break-list
-^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
-bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
+^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x00010734",func="callee4",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@},
bkpt=@{number="2",type="watchpoint",disp="keep",
-enabled="y",addr="",what="C",times="-5"@}@}
+enabled="y",addr="",what="C",times="-5"@}]@}
(@value{GDBP})
-exec-continue
^running
@@ -997,10 +1059,16 @@ value="0x11940 \"A string argument.\""@}],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(@value{GDBP})
-break-list
-^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
-bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
+^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
+hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
+@{width="14",alignment="-1",col_name="type",colhdr="Type"@},
+@{width="4",alignment="-1",col_name="disp",colhdr="Disp"@},
+@{width="3",alignment="-1",col_name="enabled",colhdr="Enb"@},
+@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
+@{width="40",alignment="2",col_name="what",colhdr="What"@}],
+body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x00010734",func="callee4",
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@}@}
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@}]@}
(@value{GDBP})
@end smallexample
diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c
index 6787b52..040e2e4 100644
--- a/gdb/mi/mi-out.c
+++ b/gdb/mi/mi-out.c
@@ -105,18 +105,26 @@ static void out_field_fmt (struct ui_out *uiout, int fldno, char *fldname,
/* Mark beginning of a table */
void
-mi_table_begin (struct ui_out *uiout, int nbrofcols,
+mi_table_begin (struct ui_out *uiout,
+ int nr_cols,
int nr_rows,
const char *tblid)
{
struct ui_out_data *data = ui_out_data (uiout);
mi_open (uiout, tblid, ui_out_type_tuple);
- if (nr_rows == 0)
+ if (data->mi_version == 0)
{
- data->suppress_output = 1;
+ if (nr_rows == 0)
+ data->suppress_output = 1;
+ else
+ mi_open (uiout, "hdr", ui_out_type_list);
return;
}
- mi_open (uiout, "hdr", ui_out_type_tuple);
+ mi_field_int (uiout, -1/*fldno*/, -1/*width*/, -1/*alin*/,
+ "nr_rows", nr_rows);
+ mi_field_int (uiout, -1/*fldno*/, -1/*width*/, -1/*alin*/,
+ "nr_cols", nr_cols);
+ mi_open (uiout, "hdr", ui_out_type_list);
}
/* Mark beginning of a table body */
@@ -125,10 +133,13 @@ void
mi_table_body (struct ui_out *uiout)
{
struct ui_out_data *data = ui_out_data (uiout);
- /* close the table header line if there were any headers */
if (data->suppress_output)
return;
- mi_close (uiout, ui_out_type_tuple);
+ /* close the table header line if there were any headers */
+ mi_close (uiout, ui_out_type_list);
+ if (data->mi_version == 0)
+ return;
+ mi_open (uiout, "body", ui_out_type_list);
}
/* Mark end of a table */
@@ -138,6 +149,12 @@ mi_table_end (struct ui_out *uiout)
{
struct ui_out_data *data = ui_out_data (uiout);
data->suppress_output = 0;
+ if (data->mi_version == 0)
+ {
+ mi_close (uiout, ui_out_type_tuple);
+ return;
+ }
+ mi_close (uiout, ui_out_type_list); /* body */
mi_close (uiout, ui_out_type_tuple);
}
@@ -151,7 +168,17 @@ mi_table_header (struct ui_out *uiout, int width, int alignment,
struct ui_out_data *data = ui_out_data (uiout);
if (data->suppress_output)
return;
- mi_field_string (uiout, 0, width, alignment, 0, colhdr);
+ if (data->mi_version == 0)
+ {
+ mi_field_string (uiout, 0, width, alignment, 0, colhdr);
+ return;
+ }
+ mi_open (uiout, NULL, ui_out_type_tuple);
+ mi_field_int (uiout, 0, 0, 0, "width", width);
+ mi_field_int (uiout, 0, 0, 0, "alignment", alignment);
+ mi_field_string (uiout, 0, 0, 0, "col_name", col_name);
+ mi_field_string (uiout, 0, width, alignment, "colhdr", colhdr);
+ mi_close (uiout, ui_out_type_tuple);
}
/* Mark beginning of a list */
@@ -337,10 +364,10 @@ mi_open (struct ui_out *uiout,
fputc_unfiltered ('{', data->buffer);
break;
case ui_out_type_list:
- if (data->mi_version > 0)
- fputc_unfiltered ('[', data->buffer);
- else
+ if (data->mi_version == 0)
fputc_unfiltered ('{', data->buffer);
+ else
+ fputc_unfiltered ('[', data->buffer);
break;
default:
internal_error (__FILE__, __LINE__, "bad switch");
@@ -358,10 +385,10 @@ mi_close (struct ui_out *uiout,
fputc_unfiltered ('}', data->buffer);
break;
case ui_out_type_list:
- if (data->mi_version > 0)
- fputc_unfiltered (']', data->buffer);
- else
+ if (data->mi_version == 0)
fputc_unfiltered ('}', data->buffer);
+ else
+ fputc_unfiltered (']', data->buffer);
break;
default:
internal_error (__FILE__, __LINE__, "bad switch");