Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [MI][patch] -break-list to specify "thread-group"
@ 2012-09-21 10:01 Marc Khouzam
  2012-09-21 10:45 ` Marc Khouzam
  2012-09-21 18:12 ` [MI][patch] " André Pönitz
  0 siblings, 2 replies; 23+ messages in thread
From: Marc Khouzam @ 2012-09-21 10:01 UTC (permalink / raw)
  To: gdb-patches

Hi,

In Eclipse I'm trying to filter breakpoints per thread and/or
per process.  Currently -break-list does not tell me the inferior
of a bp as 'info break' does.

Currently:

(gdb) inf b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   <MULTIPLE> 
1.1                         y     0x08048533 in main() at loopfirst.cc:8 inf 2
1.2                         y     0x08048533 in main() at loopfirst.cc:8 inf 1

Notice the "inf 1" tag at the end.

(gdb) interpreter-exec mi -break-list
^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",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="<MULTIPLE>",times="0",original-location="/home/lmckhou/testing/loopfirst.cc:8"},{number="1.1",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8"},{number="1.2",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8"}]}

but no such info from MI.

The below patch adds this new field.

The output would then look like:

(gdb) interpreter-exec mi -break-list
^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",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="<MULTIPLE>",times="0",original-location="/home/lmckhou/testing/loopfirst.cc:8"},{number="1.1",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8",thread-group=["2"]},{number="1.2",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8",thread-group=["1"]}]}

or (if the bp applies to multiple inferiors, which I didn't quite
out how to officially trigger, so I hacked the code to make sure
the output was done properly in that case)

(gdb) interpreter-exec mi -break-list
^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",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="<MULTIPLE>",times="0",original-location="loopfirst.cc:8"},{number="1.1",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8",thread-group=["2","1"]},{number="1.2",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8",thread-group=["2","1"]}]}


I was going to update the doc, but when I looked at it 
I realized it was completely out-of-date with respect to 
-break-list _and_ that the MI output itself does not to have 
the right content in the  'hdr' part.  I wasn't sure if I can 
change such MI output or not due to backwards
compatibility.

Can this patch go in as is?  Or can I get some guidance 
about how to handle this out-of-date MI output?

Thanks

Marc


2012-09-20  Marc Khouzam  <marc.khouzam@ericsson.com>

	* breakpoint.c (print_one_breakpoint_location): Add MI
	field 'thread-group' to output of -break-list.
	(output_thread_groups): New function.


### Eclipse Workspace Patch 1.0
#P src
Index: gdb/breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.704
diff -u -r1.704 breakpoint.c
--- gdb/breakpoint.c    17 Sep 2012 07:03:14 -0000      1.704
+++ gdb/breakpoint.c    21 Sep 2012 09:50:03 -0000
@@ -5779,6 +5779,36 @@
   return bptypes[(int) type].description;
 }
 
+/* Output a field named 'thread-group' with a list as the value.  The
+   elements of the list are obtained by splitting 'groups' on
+   comma.  */
+
+static void 
+output_thread_groups (struct ui_out *uiout, const char *field_name, const char *xgroups)
+{
+  struct cleanup *back_to = make_cleanup_ui_out_list_begin_end (uiout,
+                                                               field_name);
+  char *groups = xstrdup (xgroups);
+  char *p = groups;
+  int first = 1;
+
+  make_cleanup (xfree, groups);
+
+  for (p = strtok (p, ","); p;  p = strtok (NULL, ","))
+    {
+      if (first)
+       {
+         first = 0;
+         ui_out_text (uiout, " inf ");
+       }
+      else
+       ui_out_text (uiout, ", ");
+      ui_out_field_string (uiout, NULL, p);
+    }
+
+  do_cleanups (back_to);
+}
+
 /* Print B to gdb_stdout.  */
 
 static void
@@ -5944,21 +5974,27 @@
     {
       struct inferior *inf;
       int first = 1;
+      char thread_groups[100]; 
+      const char *inf_name;
+      int len;
 
+      thread_groups[0] = 0;
       for (inf = inferior_list; inf != NULL; inf = inf->next)
        {
          if (inf->pspace == loc->pspace)
            {
              if (first)
-               {
-                 first = 0;
-                 ui_out_text (uiout, " inf ");
-               }
+               first = 0;
              else
-               ui_out_text (uiout, ", ");
-             ui_out_text (uiout, plongest (inf->num));
+               strncat (thread_groups, ",", len);
+
+             inf_name = plongest (inf->num);
+             len = strlen (inf_name);
+             strncat (thread_groups, inf_name, len);
            }
        }
+       output_thread_groups (uiout, "thread-group", thread_groups);
+
     }
 
   if (!part_of_multiple)


^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [MI][patch] -break-list to specify "thread-group"
  2012-09-21 10:01 [MI][patch] -break-list to specify "thread-group" Marc Khouzam
@ 2012-09-21 10:45 ` Marc Khouzam
  2012-09-21 14:47   ` [MI][patch v2] " Marc Khouzam
  2012-09-21 18:12 ` [MI][patch] " André Pönitz
  1 sibling, 1 reply; 23+ messages in thread
From: Marc Khouzam @ 2012-09-21 10:45 UTC (permalink / raw)
  To: Marc Khouzam, gdb-patches

> Hi,
> 
> In Eclipse I'm trying to filter breakpoints per thread and/or
> per process.  Currently -break-list does not tell me the inferior
> of a bp as 'info break' does.
> 
> Currently:
> 
> (gdb) inf b
> Num     Type           Disp Enb Address    What
> 1       breakpoint     keep y   <MULTIPLE>
> 1.1                         y     0x08048533 in main() at loopfirst.cc:8 inf 2
> 1.2                         y     0x08048533 in main() at loopfirst.cc:8 inf 1
> 
> Notice the "inf 1" tag at the end.
> 
> (gdb) interpreter-exec mi -break-list
> ^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",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="<MULTIPLE>",times="0",original-location="/home/lmckhou/testing/loopfirst.cc:8"},{number="1.1",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8"},{number="1.2",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8"}]}
> 
> but no such info from MI.
> 
> The below patch adds this new field.

I just realized I should use "i<num>" for an MI thread-group id e.g., "i1", "i2"
I'll come back with a new version of the patch.

Sorry about that.

> The output would then look like:
> 
> (gdb) interpreter-exec mi -break-list
> ^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",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="<MULTIPLE>",times="0",original-location="/home/lmckhou/testing/loopfirst.cc:8"},{number="1.1",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8",thread-group=["2"]},{number="1.2",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8",thread-group=["1"]}]}
> 
> or (if the bp applies to multiple inferiors, which I didn't quite
> out how to officially trigger, so I hacked the code to make sure
> the output was done properly in that case)
> 
> (gdb) interpreter-exec mi -break-list
> ^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",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="<MULTIPLE>",times="0",original-location="loopfirst.cc:8"},{number="1.1",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8",thread-group=["2","1"]},{number="1.2",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8",thread-group=["2","1"]}]}
> 
> 
> I was going to update the doc, but when I looked at it
> I realized it was completely out-of-date with respect to
> -break-list _and_ that the MI output itself does not to have
> the right content in the  'hdr' part.  I wasn't sure if I can
> change such MI output or not due to backwards
> compatibility.
> 
> Can this patch go in as is?  Or can I get some guidance
> about how to handle this out-of-date MI output?
> 
> Thanks
> 
> Marc
> 
> 
> 2012-09-20  Marc Khouzam  <marc.khouzam@ericsson.com>
> 
>         * breakpoint.c (print_one_breakpoint_location): Add MI
>         field 'thread-group' to output of -break-list.
>         (output_thread_groups): New function.
> 
> 
> ### Eclipse Workspace Patch 1.0
> #P src
> Index: gdb/breakpoint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/breakpoint.c,v
> retrieving revision 1.704
> diff -u -r1.704 breakpoint.c
> --- gdb/breakpoint.c    17 Sep 2012 07:03:14 -0000      1.704
> +++ gdb/breakpoint.c    21 Sep 2012 09:50:03 -0000
> @@ -5779,6 +5779,36 @@
>    return bptypes[(int) type].description;
>  }
> 
> +/* Output a field named 'thread-group' with a list as the value.  The
> +   elements of the list are obtained by splitting 'groups' on
> +   comma.  */
> +
> +static void
> +output_thread_groups (struct ui_out *uiout, const char *field_name, const char *xgroups)
> +{
> +  struct cleanup *back_to = make_cleanup_ui_out_list_begin_end (uiout,
> +                                                               field_name);
> +  char *groups = xstrdup (xgroups);
> +  char *p = groups;
> +  int first = 1;
> +
> +  make_cleanup (xfree, groups);
> +
> +  for (p = strtok (p, ","); p;  p = strtok (NULL, ","))
> +    {
> +      if (first)
> +       {
> +         first = 0;
> +         ui_out_text (uiout, " inf ");
> +       }
> +      else
> +       ui_out_text (uiout, ", ");
> +      ui_out_field_string (uiout, NULL, p);
> +    }
> +
> +  do_cleanups (back_to);
> +}
> +
>  /* Print B to gdb_stdout.  */
> 
>  static void
> @@ -5944,21 +5974,27 @@
>      {
>        struct inferior *inf;
>        int first = 1;
> +      char thread_groups[100];
> +      const char *inf_name;
> +      int len;
> 
> +      thread_groups[0] = 0;
>        for (inf = inferior_list; inf != NULL; inf = inf->next)
>         {
>           if (inf->pspace == loc->pspace)
>             {
>               if (first)
> -               {
> -                 first = 0;
> -                 ui_out_text (uiout, " inf ");
> -               }
> +               first = 0;
>               else
> -               ui_out_text (uiout, ", ");
> -             ui_out_text (uiout, plongest (inf->num));
> +               strncat (thread_groups, ",", len);
> +
> +             inf_name = plongest (inf->num);
> +             len = strlen (inf_name);
> +             strncat (thread_groups, inf_name, len);
>             }
>         }
> +       output_thread_groups (uiout, "thread-group", thread_groups);
> +
>      }
> 
>    if (!part_of_multiple)


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [MI][patch v2] -break-list to specify "thread-group"
  2012-09-21 10:45 ` Marc Khouzam
@ 2012-09-21 14:47   ` Marc Khouzam
  2012-09-22 13:00     ` Yao Qi
                       ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Marc Khouzam @ 2012-09-21 14:47 UTC (permalink / raw)
  To: gdb-patches


Hi,

Here's a second stab at it using the "i" prefix for MI.

In Eclipse I'm trying to filter breakpoints per thread and/or
per process.  Currently -break-list does not tell me the inferior
of a bp as 'info break' does.

Currently:

(gdb) inf b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   <MULTIPLE>
1.1                         y     0x08048533 in main() at loopfirst.cc:8 inf 2
1.2                         y     0x08048533 in main() at loopfirst.cc:8 inf 1

Notice the "inf 1" tag at the end.

(gdb) interpreter-exec mi -break-list

^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",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="<MULTIPLE>",times="0",original-location="/home/lmckhou/testing/loopfirst.cc:8"},{number="1.1",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8"},{number="1.2",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8"}]}

but no such info from MI.

The below patch adds the new field "thread-group".

The output would then look like:

(gdb) interpreter-exec mi -break-list
^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",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="<MULTIPLE>",times="0",original-location="/home/lmckhou/testing/loopfirst.cc:8"},{number="1.1",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8",thread-group=["i2"]},{number="1.2",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8",thread-group=["i1"]}]}

or (if the bp applies to multiple inferiors, which I didn't quite
out how to officially trigger, so I hacked the code to make sure
the output was done properly in that case):

(gdb) interpreter-exec mi -break-list
^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",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="<MULTIPLE>",times="0",original-location="/home/lmckhou/testing/loopfirst.cc:8"},{number="1.1",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8",thread-group=["i2","i1"]},{number="1.2",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8",thread-group=["i2","i1"]}]}


I was going to update the doc, but when I looked at it
I realized it was completely out-of-date with respect to
-break-list _and_ that the MI output itself does not to have
the right content in the  'hdr' part.  I wasn't sure if I can
change such MI output or not due to backwards compatibility.

Can this patch go in as is?  Or can I get some guidance
about how to handle this out-of-date MI output?

Thanks

Marc


2012-09-21  Marc Khouzam  <marc.khouzam@ericsson.com>

        * breakpoint.c (print_one_breakpoint_location): Add MI
         field 'thread-group' to output of -break-list.
         (output_thread_groups): New function.

### Eclipse Workspace Patch 1.0
#P src
Index: gdb/breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.704
diff -u -r1.704 breakpoint.c
--- gdb/breakpoint.c    17 Sep 2012 07:03:14 -0000      1.704
+++ gdb/breakpoint.c    21 Sep 2012 14:40:23 -0000
@@ -69,6 +69,7 @@
 #include "gdb_regex.h"
 #include "ax-gdb.h"
 #include "dummy-frame.h"
+#include "interps.h"
 
 #include "format.h"
 
@@ -5779,6 +5780,46 @@
   return bptypes[(int) type].description;
 }
 
+/* Output a field named 'thread-group' with a list as the value.  The
+   elements of the list are obtained by splitting 'groups' on
+   comma.  */
+
+static void 
+output_thread_groups (struct ui_out *uiout, const char *field_name, const char *xgroups)
+{
+  struct cleanup *back_to = make_cleanup_ui_out_list_begin_end (uiout,
+                                                               field_name);
+  char *groups = xstrdup (xgroups);
+  char *p = groups;
+  int first = 1;
+  int is_mi = ui_out_is_mi_like_p (uiout);
+
+  make_cleanup (xfree, groups);
+
+  for (p = strtok (p, ","); p;  p = strtok (NULL, ","))
+    {
+      if (is_mi)
+       {
+         char mi_group[10] = "i";
+         ui_out_field_string (uiout, NULL, strcat (mi_group, p));
+       }
+      else
+       {
+         if (first)
+           {
+             first = 0;
+             ui_out_text (uiout, " inf ");
+           }
+         else
+           ui_out_text (uiout, ", ");
+
+         ui_out_text (uiout, p);
+       }
+    }
+
+  do_cleanups (back_to);
+}
+
 /* Print B to gdb_stdout.  */
 
 static void
@@ -5944,21 +5985,27 @@
     {
       struct inferior *inf;
       int first = 1;
+      char thread_groups[100]; 
+      const char *inf_name;
+      int len;
 
+      thread_groups[0] = 0;
       for (inf = inferior_list; inf != NULL; inf = inf->next)
        {
          if (inf->pspace == loc->pspace)
            {
              if (first)
-               {
-                 first = 0;
-                 ui_out_text (uiout, " inf ");
-               }
+               first = 0;
              else
-               ui_out_text (uiout, ", ");
-             ui_out_text (uiout, plongest (inf->num));
+               strncat (thread_groups, ",", len);
+
+             inf_name = plongest (inf->num);
+             len = strlen (inf_name);
+             strncat (thread_groups, inf_name, len);
            }
        }
+       output_thread_groups (uiout, "thread-group", thread_groups);
+
     }
 
   if (!part_of_multiple)


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [MI][patch] -break-list to specify "thread-group"
  2012-09-21 10:01 [MI][patch] -break-list to specify "thread-group" Marc Khouzam
  2012-09-21 10:45 ` Marc Khouzam
@ 2012-09-21 18:12 ` André Pönitz
  2012-09-21 18:54   ` Marc Khouzam
  1 sibling, 1 reply; 23+ messages in thread
From: André Pönitz @ 2012-09-21 18:12 UTC (permalink / raw)
  To: Marc Khouzam; +Cc: gdb-patches

On Fri, Sep 21, 2012 at 06:01:20AM -0400, Marc Khouzam wrote:
> ^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",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="<MULTIPLE>",times="0",original-location="loopfirst.cc:8"},{number="1.1",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8",thread-group=["2","1"]},{number="1.2",enabled="y",addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8",thread-group=["2","1"]}]}
> 
> 
> I was going to update the doc, but when I looked at it 
> I realized it was completely out-of-date with respect to 
> -break-list _and_ that the MI output itself does not to have 
> the right content in the  'hdr' part. 

Is there _any_ frontend known that uses the hdr part at all? 

Andre'


^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [MI][patch] -break-list to specify "thread-group"
  2012-09-21 18:12 ` [MI][patch] " André Pönitz
@ 2012-09-21 18:54   ` Marc Khouzam
  0 siblings, 0 replies; 23+ messages in thread
From: Marc Khouzam @ 2012-09-21 18:54 UTC (permalink / raw)
  To: 'André Pönitz'; +Cc: 'gdb-patches@sourceware.org'


> -----Original Message-----
> From: apoe@hrz.tu-chemnitz.de 
> [mailto:apoe@hrz.tu-chemnitz.de] On Behalf Of André Pönitz
> Sent: Friday, September 21, 2012 2:12 PM
> To: Marc Khouzam
> Cc: gdb-patches@sourceware.org
> Subject: Re: [MI][patch] -break-list to specify "thread-group"
> 
> On Fri, Sep 21, 2012 at 06:01:20AM -0400, Marc Khouzam wrote:
> > 
> ^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7"
> ,alignment="-1",col_name="number",colhdr="Num"},{width="14",al
> ignment="-1",col_name="type",colhdr="Type"},{width="4",alignme
> nt="-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",c
> ol_name="what",colhdr="What"}],body=[bkpt={number="1",type="br
> eakpoint",disp="keep",enabled="y",addr="<MULTIPLE>",times="0",
> original-location="loopfirst.cc:8"},{number="1.1",enabled="y",
addr="0x08048533",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="8",thread-> group=["2","1"]},{number="1.2",enabled="y",addr="0x08048533",f
> unc="main()",file="loopfirst.cc",fullname="/home/lmckhou/testi
> ng/loopfirst.cc",line="8",thread-group=["2","1"]}]}
> > 
> > 
> > I was going to update the doc, but when I looked at it 
> > I realized it was completely out-of-date with respect to 
> > -break-list _and_ that the MI output itself does not to have 
> > the right content in the  'hdr' part. 
> 
> Is there _any_ frontend known that uses the hdr part at all? 

Eclipse does not except for the -info-os command, where
we base the table headers on what GDB says in 'hdr'.

Marc


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [MI][patch v2] -break-list to specify "thread-group"
  2012-09-21 14:47   ` [MI][patch v2] " Marc Khouzam
@ 2012-09-22 13:00     ` Yao Qi
  2012-09-26 10:05       ` Marc Khouzam
                         ` (2 more replies)
  2012-09-28 19:10     ` Tom Tromey
  2012-09-28 19:18     ` Tom Tromey
  2 siblings, 3 replies; 23+ messages in thread
From: Yao Qi @ 2012-09-22 13:00 UTC (permalink / raw)
  To: Marc Khouzam; +Cc: gdb-patches

On 09/21/2012 10:46 PM, Marc Khouzam wrote:
> or (if the bp applies to multiple inferiors, which I didn't quite
> out how to officially trigger, so I hacked the code to make sure
> the output was done properly in that case):
>

I don't know ether.  I can't think of a case that multiple inferiors 
share a single pspace.


> Can this patch go in as is?  Or can I get some guidance
> about how to handle this out-of-date MI output?
>

Maybe, we still need a test case for '-break-list' command here.

> #P src
> Index: gdb/breakpoint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/breakpoint.c,v
> retrieving revision 1.704
> diff -u -r1.704 breakpoint.c
> --- gdb/breakpoint.c    17 Sep 2012 07:03:14 -0000      1.704
> +++ gdb/breakpoint.c    21 Sep 2012 14:40:23 -0000
> @@ -69,6 +69,7 @@
>   #include "gdb_regex.h"
>   #include "ax-gdb.h"
>   #include "dummy-frame.h"
> +#include "interps.h"
>

It is useless to include "interps.h" here.

>   #include "format.h"
>
> @@ -5779,6 +5780,46 @@
>     return bptypes[(int) type].description;
>   }
>
> +/* Output a field named 'thread-group' with a list as the value.  The
> +   elements of the list are obtained by splitting 'groups' on
> +   comma.  */
> +
> +static void
> +output_thread_groups (struct ui_out *uiout, const char *field_name, const char *xgroups)

This line is too long.

The id of inferiors is passed in XGROUPS, why don't we pass an array of 
integer?  In this way, it is easier, IMO, and we don't have to parse string.

-- 
Yao


^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [MI][patch v2] -break-list to specify "thread-group"
  2012-09-22 13:00     ` Yao Qi
@ 2012-09-26 10:05       ` Marc Khouzam
  2012-09-28 19:23         ` Tom Tromey
  2012-09-28 19:21       ` Tom Tromey
  2012-12-07 15:37       ` Pedro Alves
  2 siblings, 1 reply; 23+ messages in thread
From: Marc Khouzam @ 2012-09-26 10:05 UTC (permalink / raw)
  To: Yao Qi, gdb-patches

> From: Yao Qi [yao@codesourcery.com]
> Sent: September 22, 2012 8:58 AM
> To: Marc Khouzam
> Cc: gdb-patches@sourceware.org
> Subject: Re: [MI][patch v2] -break-list to specify "thread-group"
>
> On 09/21/2012 10:46 PM, Marc Khouzam wrote:
> > or (if the bp applies to multiple inferiors, which I didn't quite
> > out how to officially trigger, so I hacked the code to make sure
> > the output was done properly in that case):
> >
>
> I don't know ether.  I can't think of a case that multiple inferiors
> share a single pspace.

If this is impossible, then we could avoid using a list in this
new MI field.  It would also make it simpler for the frontend.
However, I'm not going to try to change that unless
someone confirms that it is safe.

> > Can this patch go in as is?  Or can I get some guidance
> > about how to handle this out-of-date MI output?
> >
>
> Maybe, we still need a test case for '-break-list' command here.

I had forgotten to update the tests to take into consideration the
new parameter.  Those tests use -break-list in multiple places.
The new patch below does update the testsuite.
Only one new regression happens:

FAIL: gdb.mi/mi-nsmoribund.exp: thread specific breakpoint at thread_function

This was a latent problem where the unexpected 'thread' field was being sucked
into a '.*' pattern, which hid the error.  Because the problem is in
lib/mi-support.exp it is not as simple to fix.  Since the problem is not caused
by my patch, I suggest not to fix it right away.
However, I'm hoping to fix it in another patch that I will post to deal with
the 'thread' field in general which is currently output twice for breakpoints.

> > +#include "interps.h"
>
> It is useless to include "interps.h" here.

Removed.

> > +static void
> > +output_thread_groups (struct ui_out *uiout, const char *field_name, const char *xgroups)
>
> This line is too long.

Fixed.

> The id of inferiors is passed in XGROUPS, why don't we pass an array of
> integer?  In this way, it is easier, IMO, and we don't have to parse string.

I had taken this solution from another part, but your suggestion simplifies
things greatly.  I also took the opportunity to create the list in reverse
order, to actually yield a list of increasing inferior id.

Also, as I was testing, I felt that this new field should always be present
for MI (in CLI it only shows where there are multiple inferiors), so I did that.

Finally, one should note that this extra 'thread-group' field will now
appear in multiple command outputs and notifications.  Things such as
'-break-list', '-break-insert', '-break-info', '=breakpoint-modified'.
I believe that this all makes sense since a breakpoint is associated with
an inferior and the frontend may want to know that.

Here is the new patch.

Thanks!

Marc


2012-09-26  Marc Khouzam  <marc.khouzam@ericsson.com>

        * breakpoint.c (print_one_breakpoint_location): Add MI
        field 'thread-group' to output of -break-list.
        (output_thread_groups): New function.

2012-09-24  Marc Khouzam  <marc.khouzam@ericsson.com>

        * gdb.mi/mi-break.exp: Expect new 'thread-group' field.
        * gdb.mi/mi-simplerun.exp: Expect new 'thread-group' field.
        * gdb.mi/mi-watch.exp: Expect new 'thread-group' field.
        * gdb.mi/mi2-break.exp: Expect new 'thread-group' field.
        * gdb.mi/mi2-simplerun.exp: Expect new 'thread-group' field.
        * gdb.mi/mi2-watch.exp: Expect new 'thread-group' field.
        * lib/mi-support.exp: Expect new 'thread-group' field.

### Eclipse Workspace Patch 1.0
#P src
Index: gdb/breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.705
diff -u -r1.705 breakpoint.c
--- gdb/breakpoint.c    25 Sep 2012 12:48:52 -0000      1.705
+++ gdb/breakpoint.c    26 Sep 2012 08:40:26 -0000
@@ -5778,6 +5778,54 @@
   return bptypes[(int) type].description;
 }

+/* For MI, output a field named 'thread-group' with a list as the value.
+   For CLI, prefix the list with the string 'inf'. */
+
+static void
+output_thread_groups (struct ui_out *uiout,
+                     const char *field_name,
+                     int *inf_num,
+                     int len,
+                     int mi_only)
+{
+  struct cleanup *back_to = make_cleanup_ui_out_list_begin_end (uiout,
+                                                               field_name);
+  int first = 1;
+  int is_mi = ui_out_is_mi_like_p (uiout);
+  int index;
+
+  /* For backward compatibility, don't display inferiors in CLI unless
+     there are several.  Always display them for MI. */
+  if (!is_mi && mi_only)
+    return;
+
+  /* Go through list in reverse order to print inferiors ids in
+     increasing order. */
+  for (index = len - 1; index >= 0; index--)
+    {
+      if (is_mi)
+       {
+         char mi_group[10];
+         sprintf (mi_group, "i%d", inf_num[index]);
+         ui_out_field_string (uiout, NULL, mi_group);
+       }
+      else
+       {
+         if (first)
+           {
+             first = 0;
+             ui_out_text (uiout, " inf ");
+           }
+         else
+           ui_out_text (uiout, ", ");
+
+         ui_out_text (uiout, plongest (inf_num[index]));
+       }
+    }
+
+  do_cleanups (back_to);
+}
+
 /* Print B to gdb_stdout.  */

 static void
@@ -5928,36 +5976,30 @@
        break;
       }

-
-  /* For backward compatibility, don't display inferiors unless there
-     are several.  */
-  if (loc != NULL
-      && !header_of_multiple
-      && (allflag
-         || (!gdbarch_has_global_breakpoints (target_gdbarch)
-             && (number_of_program_spaces () > 1
-                 || number_of_inferiors () > 1)
-             /* LOC is for existing B, it cannot be in
-                moribund_locations and thus having NULL OWNER.  */
-             && loc->owner->type != bp_catchpoint)))
+  if (loc != NULL && !header_of_multiple)
     {
       struct inferior *inf;
-      int first = 1;
+      int inf_num[number_of_inferiors ()];
+      int index = 0;
+      int mi_only = 1;

-      for (inf = inferior_list; inf != NULL; inf = inf->next)
+      ALL_INFERIORS (inf)
        {
          if (inf->pspace == loc->pspace)
-           {
-             if (first)
-               {
-                 first = 0;
-                 ui_out_text (uiout, " inf ");
-               }
-             else
-               ui_out_text (uiout, ", ");
-             ui_out_text (uiout, plongest (inf->num));
-           }
+           inf_num[index++] = inf->num;
        }
+
+    /* For backward compatibility, don't display inferiors in CLI unless
+       there are several.  Always display for MI. */
+      if (allflag
+         || (!gdbarch_has_global_breakpoints (target_gdbarch)
+             && (number_of_program_spaces () > 1
+                 || number_of_inferiors () > 1)
+             /* LOC is for existing B, it cannot be in
+                moribund_locations and thus having NULL OWNER.  */
+             && loc->owner->type != bp_catchpoint))
+       mi_only = 0;
+      output_thread_groups (uiout, "thread-group", inf_num, index, mi_only);
     }

   if (!part_of_multiple)
Index: gdb/testsuite/gdb.mi/mi-break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-break.exp,v
retrieving revision 1.36
diff -u -r1.36 mi-break.exp
--- gdb/testsuite/gdb.mi/mi-break.exp   10 Jul 2012 15:32:51 -0000      1.36
+++ gdb/testsuite/gdb.mi/mi-break.exp   26 Sep 2012 08:40:26 -0000
@@ -93,7 +93,7 @@
              "insert temp breakpoint at \"<fullfilename>\":\$line_callee4_head"

     mi_gdb_test "666-break-list" \
-           "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",times=\"0\",original-location=\".*\"\}.*\\\]\}" \
+           "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",thread-group=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}.*\\\]\}" \
                 "list of breakpoints"

     mi_gdb_test "777-break-delete" \
@@ -190,7 +190,7 @@
     global line_callee2_body

     mi_gdb_test "-break-insert -d basics.c:callee2" \
-        "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\",enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",fullname=\".*\",line=\"$line_callee2_body\",times=\"0\",original-location=\".*\"\}" \
+        "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\",enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",fullname=\".*\",line=\"$line_callee2_body\",thread-group=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \
         "test disabled creation"

     mi_gdb_test "-break-delete" \
@@ -211,7 +211,7 @@
         "breakpoint commands: set commands"

     mi_gdb_test "-break-info 7" \
-       "\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"$line_callee2_body\",times=\"0\",script=\{\"print 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \
+       "\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"$line_callee2_body\",thread-group=\\\[\"i1\"\\\],times=\"0\",script=\{\"print 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \
         "breakpoint commands: check that commands are set"

     mi_gdb_test "-break-commands 7" \
Index: gdb/testsuite/gdb.mi/mi-simplerun.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-simplerun.exp,v
retrieving revision 1.29
diff -u -r1.29 mi-simplerun.exp
--- gdb/testsuite/gdb.mi/mi-simplerun.exp       10 Jul 2012 15:32:51 -0000      1.29
+++ gdb/testsuite/gdb.mi/mi-simplerun.exp       26 Sep 2012 08:40:26 -0000
@@ -79,7 +79,7 @@
              "insert breakpoint at \"<fullfilename>\":\$line_callee4_head"

     mi_gdb_test "204-break-list" \
-           "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
+           "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-group=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
                 "list of breakpoints"

     mi_gdb_test "205-break-disable 2 3 4" \
Index: gdb/testsuite/gdb.mi/mi-watch.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-watch.exp,v
retrieving revision 1.32
diff -u -r1.32 mi-watch.exp
--- gdb/testsuite/gdb.mi/mi-watch.exp   10 Jul 2012 15:32:52 -0000      1.32
+++ gdb/testsuite/gdb.mi/mi-watch.exp   26 Sep 2012 08:40:26 -0000
@@ -58,7 +58,7 @@
              "break-watch operation"

     mi_gdb_test "222-break-list" \
-           "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",times=\"0\",original-location=\"C\"\}\\\]\}" \
+           "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",thread-group=\\\[\"i1\"\\\],times=\"0\",original-location=\"C\"\}\\\]\}" \
                 "list of watchpoints"

 }
@@ -82,7 +82,7 @@
              "break-watch -a operation"

     mi_gdb_test "444-break-list" \
-           "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
+           "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-group=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
                 "list of watchpoints awatch"

     mi_gdb_test "777-break-delete 3" \
@@ -109,7 +109,7 @@
              "break-insert -r operation"

     mi_gdb_test "300-break-list" \
-           "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\}\}" \
+           "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-group=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\}\}" \
                 "list of breakpoints"

     mi_gdb_test "177-break-delete 4" \
Index: gdb/testsuite/gdb.mi/mi2-break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-break.exp,v
retrieving revision 1.18
diff -u -r1.18 mi2-break.exp
--- gdb/testsuite/gdb.mi/mi2-break.exp  10 Jul 2012 15:32:52 -0000      1.18
+++ gdb/testsuite/gdb.mi/mi2-break.exp  26 Sep 2012 08:40:26 -0000
@@ -92,7 +92,7 @@
              "insert temp breakpoint at \"<fullfilename>\":\$line_callee4_head"

     mi_gdb_test "666-break-list" \
-           "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",times=\"0\",original-location=\".*\"\}.*\\\]\}" \
+           "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",thread-group=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}.*\\\]\}" \
                 "list of breakpoints"

     mi_gdb_test "777-break-delete" \
Index: gdb/testsuite/gdb.mi/mi2-simplerun.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-simplerun.exp,v
retrieving revision 1.20
diff -u -r1.20 mi2-simplerun.exp
--- gdb/testsuite/gdb.mi/mi2-simplerun.exp      10 Jul 2012 15:32:52 -0000      1.20
+++ gdb/testsuite/gdb.mi/mi2-simplerun.exp      26 Sep 2012 08:40:26 -0000
@@ -79,7 +79,7 @@
              "insert breakpoint at \"<fullfilename>\":\$line_callee4_head"

     mi_gdb_test "204-break-list" \
-           "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
+           "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-group=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
                 "list of breakpoints"

     mi_gdb_test "205-break-disable 2 3 4" \
Index: gdb/testsuite/gdb.mi/mi2-watch.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-watch.exp,v
retrieving revision 1.23
diff -u -r1.23 mi2-watch.exp
--- gdb/testsuite/gdb.mi/mi2-watch.exp  10 Jul 2012 15:32:52 -0000      1.23
+++ gdb/testsuite/gdb.mi/mi2-watch.exp  26 Sep 2012 08:40:27 -0000
@@ -57,7 +57,7 @@
              "break-watch operation"

     mi_gdb_test "222-break-list" \
-           "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",times=\"0\",original-location=\"C\"\}\\\]\}" \
+           "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",thread-group=\\\[\"i1\"\\\],times=\"0\",original-location=\"C\"\}\\\]\}" \
                 "list of watchpoints"

 }
@@ -81,7 +81,7 @@
              "break-watch -a operation"

     mi_gdb_test "444-break-list" \
-           "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
+           "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-group=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
                 "list of watchpoints awatch"

     mi_gdb_test "777-break-delete 3" \
@@ -108,7 +108,7 @@
              "break-insert -r operation"

     mi_gdb_test "300-break-list" \
-           "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\}\}" \
+           "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-group=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\}\}" \
                 "list of breakpoints"

     mi_gdb_test "177-break-delete 4" \
Index: gdb/testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.112
diff -u -r1.112 mi-support.exp
--- gdb/testsuite/lib/mi-support.exp    25 Jul 2012 20:19:56 -0000      1.112
+++ gdb/testsuite/lib/mi-support.exp    26 Sep 2012 08:40:27 -0000
@@ -923,7 +923,7 @@

   set test "mi runto $func"
   mi_gdb_test "200-break-insert -t $func" \
-    "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",times=\"0\",original-location=\".*\"\}" \
+    "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",thread-group=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \
     "breakpoint at $func"

   if {![regexp {number="[0-9]+"} $expect_out(buffer) str]
@@ -1205,9 +1205,9 @@

 # Creates a breakpoint and checks the reported fields are as expected
 proc mi_create_breakpoint { location number disp func file line address test } {
-    verbose -log "Expecting: 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-location=\".*\"\}"
+    verbose -log "Expecting: 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",thread-group=\\\[\".*\"\\\],times=\"0\",original-location=\".*\"\}"
     mi_gdb_test "222-break-insert $location" \
-        "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-location=\".*\"\}" \
+        "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",thread-group=\\\[\".*\"\\\],times=\"0\",original-location=\".*\"\}" \
         $test
 }

@@ -1228,7 +1228,7 @@
         set file [lindex $item 3]
         set line [lindex $item 4]
         set address [lindex $item 5]
-        set body "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\".*$file\",${fullname},line=\"$line\",times=\"0\",original-location=\".*\"\}"
+        set body "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\".*$file\",${fullname},line=\"$line\",thread-group=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}"
         set first 0
     }


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [MI][patch v2] -break-list to specify "thread-group"
  2012-09-21 14:47   ` [MI][patch v2] " Marc Khouzam
  2012-09-22 13:00     ` Yao Qi
@ 2012-09-28 19:10     ` Tom Tromey
  2012-09-28 19:18     ` Tom Tromey
  2 siblings, 0 replies; 23+ messages in thread
From: Tom Tromey @ 2012-09-28 19:10 UTC (permalink / raw)
  To: Marc Khouzam; +Cc: gdb-patches

>>>>> "Marc" == Marc Khouzam <marc.khouzam@ericsson.com> writes:

Marc> Here's a second stab at it using the "i" prefix for MI.

I think the general idea is great.

Marc> The below patch adds the new field "thread-group".

My recollection, reinforced by browsing the MI docs just now, is that
generally the field name "thread-group" is used to specify a single
group.  However, with this patch it is actually list-valued.  So, I
think a different name would be somewhat better, maybe "thread-groups".

Marc> or (if the bp applies to multiple inferiors, which I didn't quite
Marc> out how to officially trigger, so I hacked the code to make sure
Marc> the output was done properly in that case):

Hm.  I think a given location can only apply to a single inferior.
I am not totally sure.

So maybe making it "thread-group" and giving it a single value is the
right thing to do.

Tom


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [MI][patch v2] -break-list to specify "thread-group"
  2012-09-21 14:47   ` [MI][patch v2] " Marc Khouzam
  2012-09-22 13:00     ` Yao Qi
  2012-09-28 19:10     ` Tom Tromey
@ 2012-09-28 19:18     ` Tom Tromey
  2 siblings, 0 replies; 23+ messages in thread
From: Tom Tromey @ 2012-09-28 19:18 UTC (permalink / raw)
  To: Marc Khouzam; +Cc: gdb-patches

>>>>> "Marc" == Marc Khouzam <marc.khouzam@ericsson.com> writes:

Marc> I was going to update the doc, but when I looked at it
Marc> I realized it was completely out-of-date with respect to
Marc> -break-list _and_ that the MI output itself does not to have
Marc> the right content in the  'hdr' part.  I wasn't sure if I can
Marc> change such MI output or not due to backwards compatibility.

The very best thing would be to fix the -break-list documentation.

But, I understand if you don't want to do that.  But maybe you could
file a bug report in this case.

However, I think you should still update the docs for your change.

I think changing the 'hdr' part of the MI output is ok, if it is useful
to you somehow.  I think it has to be done with care to avoid messing up
the CLI output.

Tom


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [MI][patch v2] -break-list to specify "thread-group"
  2012-09-22 13:00     ` Yao Qi
  2012-09-26 10:05       ` Marc Khouzam
@ 2012-09-28 19:21       ` Tom Tromey
  2012-12-07 15:37       ` Pedro Alves
  2 siblings, 0 replies; 23+ messages in thread
From: Tom Tromey @ 2012-09-28 19:21 UTC (permalink / raw)
  To: Yao Qi; +Cc: Marc Khouzam, gdb-patches

>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:

Yao> I don't know ether.  I can't think of a case that multiple inferiors
Yao> share a single pspace.

Thinking about it more -- maybe an inferior which just vforked?

Tom


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [MI][patch v2] -break-list to specify "thread-group"
  2012-09-26 10:05       ` Marc Khouzam
@ 2012-09-28 19:23         ` Tom Tromey
  2012-10-01 16:10           ` Marc Khouzam
  0 siblings, 1 reply; 23+ messages in thread
From: Tom Tromey @ 2012-09-28 19:23 UTC (permalink / raw)
  To: Marc Khouzam; +Cc: Yao Qi, gdb-patches

>>>>> "Marc" == Marc Khouzam <marc.khouzam@ericsson.com> writes:

Marc> I had forgotten to update the tests to take into consideration the
Marc> new parameter.  Those tests use -break-list in multiple places.
Marc> The new patch below does update the testsuite.
Marc> Only one new regression happens:

Marc> FAIL: gdb.mi/mi-nsmoribund.exp: thread specific breakpoint at thread_function

Marc> This was a latent problem where the unexpected 'thread' field was
Marc> being sucked into a '.*' pattern, which hid the error.  Because
Marc> the problem is in lib/mi-support.exp it is not as simple to fix.
Marc> Since the problem is not caused by my patch, I suggest not to fix
Marc> it right away.

We try not to let any regressions in.
So I think it does need to be fixed before this patch can go in.

Marc> Finally, one should note that this extra 'thread-group' field will now
Marc> appear in multiple command outputs and notifications.  Things such as
Marc> '-break-list', '-break-insert', '-break-info', '=breakpoint-modified'.
Marc> I believe that this all makes sense since a breakpoint is associated with
Marc> an inferior and the frontend may want to know that.

Totally fine, IMO.

Marc> +  /* Go through list in reverse order to print inferiors ids in
Marc> +     increasing order. */
Marc> +  for (index = len - 1; index >= 0; index--)

It isn't clear to me that it is reliable to assume that the inferior
list is sorted.

However, this shouldn't really matter for clients, either.

Marc> +       {
Marc> +         char mi_group[10];
Marc> +         sprintf (mi_group, "i%d", inf_num[index]);

Blank line between declarations and code.

Marc> +      int inf_num[number_of_inferiors ()];

I think you'd have to use alloca here -- but it is better to use a VEC
anyway.

Tom


^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [MI][patch v2] -break-list to specify "thread-group"
  2012-09-28 19:23         ` Tom Tromey
@ 2012-10-01 16:10           ` Marc Khouzam
  2012-10-01 16:17             ` Eli Zaretskii
  2012-10-15 10:39             ` Marc Khouzam
  0 siblings, 2 replies; 23+ messages in thread
From: Marc Khouzam @ 2012-10-01 16:10 UTC (permalink / raw)
  To: 'Tom Tromey'
  Cc: 'Yao Qi', 'gdb-patches@sourceware.org'


> Marc> Here's a second stab at it using the "i" prefix for MI.
>
> I think the general idea is great.
>
> Marc> The below patch adds the new field "thread-group".
>
> My recollection, reinforced by browsing the MI docs just now, is that
> generally the field name "thread-group" is used to specify a single
> group.  However, with this patch it is actually list-valued.  So, I
> think a different name would be somewhat better, maybe
> "thread-groups".

I've made the field "thread-groups" for now, since the patch still
returns a list of inferiors.

> Marc> or (if the bp applies to multiple inferiors, which I didn't quite
> Marc> out how to officially trigger, so I hacked the code to make sure
> Marc> the output was done properly in that case):
>
> Hm.  I think a given location can only apply to a single inferior.
> I am not totally sure.
>
> So maybe making it "thread-group" and giving it a single value is the
> right thing to do.

I'd prefer this.  And it would make things simpler for the frontend code.

> Yao> I don't know ether.  I can't think of a case that
> Yao> multiple inferiors share a single pspace.
>
> Thinking about it more -- maybe an inferior which just vforked?

Since we're still not sure if a list is needed or not, I kept
the patch returning a list, to be safe.

> Marc> I was going to update the doc, but when I looked at it
> Marc> I realized it was completely out-of-date with respect to
> Marc> -break-list _and_ that the MI output itself does not to have
> Marc> the right content in the  'hdr' part.  I wasn't sure if I can
> Marc> change such MI output or not due to backwards compatibility.
>
> The very best thing would be to fix the -break-list documentation.
>
> But, I understand if you don't want to do that.  But maybe you could
> file a bug report in this case.

Thanks for understanding.  I've opened
Bug 14651 - [doc] -break-list command not documented properly
http://sourceware.org/bugzilla/show_bug.cgi?id=14651

> However, I think you should still update the docs for your change.

The below patch now does this.

> I think changing the 'hdr' part of the MI output is ok, if it
> is useful to you somehow.  I think it has to be done with care to
> avoid  messing up the CLI output.

I haven't ventured down that path :)

> Marc> I had forgotten to update the tests to take into
> consideration the
> Marc> new parameter.  Those tests use -break-list in multiple places.
> Marc> The new patch below does update the testsuite.
> Marc> Only one new regression happens:
>
> Marc> FAIL: gdb.mi/mi-nsmoribund.exp: thread specific
> breakpoint at thread_function
>
> Marc> This was a latent problem where the unexpected 'thread'
> field was
> Marc> being sucked into a '.*' pattern, which hid the error.  Because
> Marc> the problem is in lib/mi-support.exp it is not as simple to fix.
> Marc> Since the problem is not caused by my patch, I suggest
> not to fix
> Marc> it right away.
>
> We try not to let any regressions in.
> So I think it does need to be fixed before this patch can go in.

I've updated that test and fixed the regression.

> Marc> +  /* Go through list in reverse order to print inferiors ids in
> Marc> +     increasing order. */
> Marc> +  for (index = len - 1; index >= 0; index--)
>
> It isn't clear to me that it is reliable to assume that the inferior
> list is sorted.
>
> However, this shouldn't really matter for clients, either.

I didn't like seeing "inf 4, 3, 2 ,1", but I agree that the order
is not guaranteed anyway.  Besides, we still don't know how to actually
see a list of inferior for a single breakpoint :)  I therefore
iterate over the VEC in whatever order it is.

> Marc> +       {
> Marc> +         char mi_group[10];
> Marc> +         sprintf (mi_group, "i%d", inf_num[index]);
>
> Blank line between declarations and code.

Done.

> Marc> +      int inf_num[number_of_inferiors ()];
>
> I think you'd have to use alloca here -- but it is better to use a VEC
> anyway.

Nice.  It is the first time I use the VEC macros.  Done.

No regressions with this patch.

Thanks!

Marc


2012-10-01  Marc Khouzam  <marc.khouzam@ericsson.com>

        * breakpoint.c (print_one_breakpoint_location): Add MI
        field 'thread-groups' when printing a breakpoint.
        (output_thread_groups): New function.

2012-10-01  Marc Khouzam  <marc.khouzam@ericsson.com>

        * gdb.mi/mi-break.exp: Expect new 'thread-groups' field.
        * gdb.mi/mi-nsmoribund.exp: Expect new 'thread-groups' field.
        Also handle 'thread' field.
        * gdb.mi/mi-simplerun.exp: Expect new 'thread-groups' field.
        * gdb.mi/mi-watch.exp: Ditto.
        * gdb.mi/mi2-break.exp: Ditto.
        * gdb.mi/mi2-simplerun.exp: Ditto.
        * gdb.mi/mi2-watch.exp: Ditto.
        * lib/mi-support.exp: Ditto.

2012-10-01  Marc Khouzam  <marc.khouzam@ericsson.com>

        * gdb.texinfo (GDB/MI Breakpoint Commands): Document new
        `thread-group' field when printing a breakpoint in MI.

### Eclipse Workspace Patch 1.0
#P src
Index: gdb/breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.707
diff -u -r1.707 breakpoint.c
--- gdb/breakpoint.c    26 Sep 2012 16:35:59 -0000      1.707
+++ gdb/breakpoint.c    1 Oct 2012 16:04:16 -0000
@@ -5778,6 +5778,51 @@
   return bptypes[(int) type].description;
 }

+DEF_VEC_I(int);
+
+/* For MI, output a field named 'thread-groups' with a list as the value.
+   For CLI, prefix the list with the string 'inf'. */
+
+static void
+output_thread_groups (struct ui_out *uiout,
+                     const char *field_name,
+                     VEC(int) *inf_num,
+                     int mi_only)
+{
+  struct cleanup *back_to = make_cleanup_ui_out_list_begin_end (uiout,
+                                                               field_name);
+  int is_mi = ui_out_is_mi_like_p (uiout);
+  int inf;
+  int i;
+
+  /* For backward compatibility, don't display inferiors in CLI unless
+     there are several.  Always display them for MI. */
+  if (!is_mi && mi_only)
+    return;
+
+  for (i = 0; VEC_iterate (int, inf_num, i, inf); ++i)
+    {
+      if (is_mi)
+       {
+         char mi_group[10];
+
+         sprintf (mi_group, "i%d", inf);
+         ui_out_field_string (uiout, NULL, mi_group);
+       }
+      else
+       {
+         if (i == 0)
+           ui_out_text (uiout, " inf ");
+         else
+           ui_out_text (uiout, ", ");
+
+         ui_out_text (uiout, plongest (inf));
+       }
+    }
+
+  do_cleanups (back_to);
+}
+
 /* Print B to gdb_stdout.  */

 static void
@@ -5929,35 +5974,30 @@
       }


-  /* For backward compatibility, don't display inferiors unless there
-     are several.  */
-  if (loc != NULL
-      && !header_of_multiple
-      && (allflag
-         || (!gdbarch_has_global_breakpoints (target_gdbarch)
-             && (number_of_program_spaces () > 1
-                 || number_of_inferiors () > 1)
-             /* LOC is for existing B, it cannot be in
-                moribund_locations and thus having NULL OWNER.  */
-             && loc->owner->type != bp_catchpoint)))
+  if (loc != NULL && !header_of_multiple)
     {
       struct inferior *inf;
-      int first = 1;
+      VEC(int) *inf_num = NULL;
+      int mi_only = 1;

-      for (inf = inferior_list; inf != NULL; inf = inf->next)
+      ALL_INFERIORS (inf)
        {
          if (inf->pspace == loc->pspace)
-           {
-             if (first)
-               {
-                 first = 0;
-                 ui_out_text (uiout, " inf ");
-               }
-             else
-               ui_out_text (uiout, ", ");
-             ui_out_text (uiout, plongest (inf->num));
-           }
+           VEC_safe_push (int, inf_num, inf->num);
        }
+
+      /* For backward compatibility, don't display inferiors in CLI unless
+         there are several.  Always display for MI. */
+      if (allflag
+         || (!gdbarch_has_global_breakpoints (target_gdbarch)
+             && (number_of_program_spaces () > 1
+                 || number_of_inferiors () > 1)
+             /* LOC is for existing B, it cannot be in
+                moribund_locations and thus having NULL OWNER.  */
+             && loc->owner->type != bp_catchpoint))
+        mi_only = 0;
+      output_thread_groups (uiout, "thread-groups", inf_num, mi_only);
+      VEC_free (int, inf_num);
     }

   if (!part_of_multiple)
@@ -7902,8 +7942,6 @@
   catch_load_or_unload (arg, from_tty, 0, command);
 }

-DEF_VEC_I(int);
-
 /* An instance of this type is used to represent a syscall catchpoint.
    It includes a "struct breakpoint" as a kind of base class; users
    downcast to "struct breakpoint *" when needed.  A breakpoint is
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.1012
diff -u -r1.1012 gdb.texinfo
--- gdb/doc/gdb.texinfo 21 Sep 2012 01:46:42 -0000      1.1012
+++ gdb/doc/gdb.texinfo 1 Oct 2012 16:04:18 -0000
@@ -27763,7 +27763,8 @@
 -> -break-insert main
 <- ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
     enabled="y",addr="0x08048564",func="main",file="myprog.c",
-    fullname="/home/nickrob/myprog.c",line="68",times="0"@}
+    fullname="/home/nickrob/myprog.c",line="68",thread-groups=["i1"],
+    times="0"@}
 <- (gdb)
 @end smallexample

@@ -27887,7 +27888,8 @@
 -break-insert main
 ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
 enabled="y",addr="0x000100d0",func="main",file="hello.c",
-fullname="/home/foo/hello.c",line="5",times="0"@}
+fullname="/home/foo/hello.c",line="5",thread-groups=["i1"]
+,times="0"@}
 (gdb)
 -break-after 1 3
 ~
@@ -27903,7 +27905,7 @@
 @{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",fullname="/home/foo/hello.c",
-line="5",times="0",ignore="3"@}]@}
+line="5",thread-groups=["i1"],times="0",ignore="3"@}]@}
 (gdb)
 @end smallexample

@@ -27939,7 +27941,8 @@
 -break-insert main
 ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
 enabled="y",addr="0x000100d0",func="main",file="hello.c",
-fullname="/home/foo/hello.c",line="5",times="0"@}
+fullname="/home/foo/hello.c",line="5",thread-groups=["i1"],
+times="0"@}
 (gdb)
 -break-commands 1 "print v" "continue"
 ^done
@@ -27981,7 +27984,7 @@
 @{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",fullname="/home/foo/hello.c",
-line="5",cond="1",times="0",ignore="3"@}]@}
+line="5",cond="1",thread-groups=["i1"],times="0",ignore="3"@}]@}
 (gdb)
 @end smallexample

@@ -28053,7 +28056,7 @@
 @{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",fullname="/home/foo/hello.c",
-line="5",times="0"@}]@}
+line="5",thread-groups=["i1"],times="0"@}]@}
 (gdb)
 @end smallexample

@@ -28089,7 +28092,7 @@
 @{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",fullname="/home/foo/hello.c",
-line="5",times="0"@}]@}
+line="5",thread-groups=["i1"],times="0"@}]@}
 (gdb)
 @end smallexample

@@ -28170,14 +28173,15 @@
 ^done,bkpt=@{number="@var{number}",type="@var{type}",disp="del"|"keep",
 enabled="y"|"n",addr="@var{hex}",func="@var{funcname}",file="@var{filename}",
 fullname="@var{full_filename}",line="@var{lineno}",[thread="@var{threadno},]
-times="@var{times}"@}
+thread-groups=["@var{group1}","@var{group2}"],times="@var{times}"@}
 @end smallexample

 @noindent
 where @var{number} is the @value{GDBN} number for this breakpoint,
 @var{funcname} is the name of the function where the breakpoint was
 inserted, @var{filename} is the name of the source file which contains
-this function, @var{lineno} is the source line number within that file
+this function, @var{lineno} is the source line number within that file,
+@var{thread-groups} is the list of inferiors to which this breakpoint applies,
 and @var{times} the number of times that the breakpoint has been hit
 (always 0 for -break-insert but may be greater for -break-info or -break-list
 which use the same output).
@@ -28196,11 +28200,13 @@
 (gdb)
 -break-insert main
 ^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",
-fullname="/home/foo/recursive2.c,line="4",times="0"@}
+fullname="/home/foo/recursive2.c,line="4",thread-groups=["i1"],
+times="0"@}
 (gdb)
 -break-insert -t foo
 ^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",
-fullname="/home/foo/recursive2.c,line="11",times="0"@}
+fullname="/home/foo/recursive2.c,line="11",thread-groups=["i1"],
+times="0"@}
 (gdb)
 -break-list
 ^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
@@ -28212,15 +28218,18 @@
 @{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",
-fullname="/home/foo/recursive2.c,"line="4",times="0"@},
+fullname="/home/foo/recursive2.c,"line="4",thread-groups=["i1"],
+times="0"@},
 bkpt=@{number="2",type="breakpoint",disp="del",enabled="y",
 addr="0x00010774",func="foo",file="recursive2.c",
-fullname="/home/foo/recursive2.c",line="11",times="0"@}]@}
+fullname="/home/foo/recursive2.c",line="11",thread-groups=["i1"],
+times="0"@}]@}
 (gdb)
 @c -break-insert -r foo.*
 @c ~int foo(int, int);
 @c ^done,bkpt=@{number="3",addr="0x00010774",file="recursive2.c,
-@c "fullname="/home/foo/recursive2.c",line="11",times="0"@}
+@c "fullname="/home/foo/recursive2.c",line="11",thread-groups=["i1"],
+@c times="0"@}
 @c (gdb)
 @end smallexample

@@ -28250,6 +28259,8 @@
 @item What
 logical location of the breakpoint, expressed by function name, file
 name, line number
+@item Thread-groups
+list of inferiors to which this breakpoint applies
 @item Times
 number of times the breakpoint has been hit
 @end table
@@ -28277,7 +28288,7 @@
 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",fullname="/home/foo/hello.c",
-line="13",times="0"@}]@}
+line="13",thread-groups=["i1"],times="0"@}]@}
 (gdb)
 @end smallexample

Index: gdb/testsuite/gdb.mi/mi-break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-break.exp,v
retrieving revision 1.36
diff -u -r1.36 mi-break.exp
--- gdb/testsuite/gdb.mi/mi-break.exp   10 Jul 2012 15:32:51 -0000      1.36
+++ gdb/testsuite/gdb.mi/mi-break.exp   1 Oct 2012 16:04:18 -0000
@@ -93,7 +93,7 @@
              "insert temp breakpoint at \"<fullfilename>\":\$line_callee4_head"

     mi_gdb_test "666-break-list" \
-           "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",times=\"0\",original-location=\".*\"\}.*\\\]\}" \
+           "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}.*\\\]\}" \
                 "list of breakpoints"

     mi_gdb_test "777-break-delete" \
@@ -142,7 +142,7 @@

     setup_kfail "*-*-*" mi/14270
     mi_gdb_test "166-break-list" \
-           "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
+           "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
                 "list of breakpoints"

     mi_gdb_test "177-break-delete" \
@@ -190,7 +190,7 @@
     global line_callee2_body

     mi_gdb_test "-break-insert -d basics.c:callee2" \
-        "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\",enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",fullname=\".*\",line=\"$line_callee2_body\",times=\"0\",original-location=\".*\"\}" \
+        "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\",enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",fullname=\".*\",line=\"$line_callee2_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \
         "test disabled creation"

     mi_gdb_test "-break-delete" \
@@ -211,7 +211,7 @@
         "breakpoint commands: set commands"

     mi_gdb_test "-break-info 7" \
-       "\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"$line_callee2_body\",times=\"0\",script=\{\"print 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \
+       "\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"$line_callee2_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",script=\{\"print 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \
         "breakpoint commands: check that commands are set"

     mi_gdb_test "-break-commands 7" \
Index: gdb/testsuite/gdb.mi/mi-nsmoribund.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-nsmoribund.exp,v
retrieving revision 1.17
diff -u -r1.17 mi-nsmoribund.exp
--- gdb/testsuite/gdb.mi/mi-nsmoribund.exp      10 Jul 2012 15:32:51 -0000      1.17
+++ gdb/testsuite/gdb.mi/mi-nsmoribund.exp      1 Oct 2012 16:04:18 -0000
@@ -79,8 +79,11 @@
 mi_delete_breakpoints

 # Recreate the same breakpoint, but this time, specific to thread 5.
-mi_create_breakpoint "-p 5 $srcfile:$bkpt_line" 3 keep thread_function .* .* .* \
-    "thread specific breakpoint at thread_function"
+mi_gdb_test "234-break-insert -p 5 $srcfile:$bkpt_line" \
+    "234\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\".*\",\
+    func=\"thread_function\",file=\".*\",fullname=\".*\",line=\".*\",thread-groups=\\\[\".*\"\\\],\
+    thread=\"5\",thread=\"5\",times=\"0\",original-location=\".*\"\}" \
+    "thread specific breakpoint at thread_function"

 # Resume all threads.  Only thread 5 should report a stop.

Index: gdb/testsuite/gdb.mi/mi-simplerun.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-simplerun.exp,v
retrieving revision 1.29
diff -u -r1.29 mi-simplerun.exp
--- gdb/testsuite/gdb.mi/mi-simplerun.exp       10 Jul 2012 15:32:51 -0000      1.29
+++ gdb/testsuite/gdb.mi/mi-simplerun.exp       1 Oct 2012 16:04:18 -0000
@@ -79,7 +79,7 @@
              "insert breakpoint at \"<fullfilename>\":\$line_callee4_head"

     mi_gdb_test "204-break-list" \
-           "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
+           "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
                 "list of breakpoints"

     mi_gdb_test "205-break-disable 2 3 4" \
Index: gdb/testsuite/gdb.mi/mi-watch.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-watch.exp,v
retrieving revision 1.32
diff -u -r1.32 mi-watch.exp
--- gdb/testsuite/gdb.mi/mi-watch.exp   10 Jul 2012 15:32:52 -0000      1.32
+++ gdb/testsuite/gdb.mi/mi-watch.exp   1 Oct 2012 16:04:18 -0000
@@ -58,7 +58,7 @@
              "break-watch operation"

     mi_gdb_test "222-break-list" \
-           "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",times=\"0\",original-location=\"C\"\}\\\]\}" \
+           "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\"C\"\}\\\]\}" \
                 "list of watchpoints"

 }
@@ -82,7 +82,7 @@
              "break-watch -a operation"

     mi_gdb_test "444-break-list" \
-           "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
+           "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
                 "list of watchpoints awatch"

     mi_gdb_test "777-break-delete 3" \
@@ -109,7 +109,7 @@
              "break-insert -r operation"

     mi_gdb_test "300-break-list" \
-           "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\}\}" \
+           "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\}\}" \
                 "list of breakpoints"

     mi_gdb_test "177-break-delete 4" \
Index: gdb/testsuite/gdb.mi/mi2-break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-break.exp,v
retrieving revision 1.18
diff -u -r1.18 mi2-break.exp
--- gdb/testsuite/gdb.mi/mi2-break.exp  10 Jul 2012 15:32:52 -0000      1.18
+++ gdb/testsuite/gdb.mi/mi2-break.exp  1 Oct 2012 16:04:18 -0000
@@ -92,7 +92,7 @@
              "insert temp breakpoint at \"<fullfilename>\":\$line_callee4_head"

     mi_gdb_test "666-break-list" \
-           "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",times=\"0\",original-location=\".*\"\}.*\\\]\}" \
+           "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}.*\\\]\}" \
                 "list of breakpoints"

     mi_gdb_test "777-break-delete" \
@@ -142,7 +142,7 @@

     setup_xfail "*-*-*"
     mi_gdb_test "166-break-list" \
-           "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
+           "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
                 "list of breakpoints"

     mi_gdb_test "177-break-delete" \
Index: gdb/testsuite/gdb.mi/mi2-simplerun.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-simplerun.exp,v
retrieving revision 1.20
diff -u -r1.20 mi2-simplerun.exp
--- gdb/testsuite/gdb.mi/mi2-simplerun.exp      10 Jul 2012 15:32:52 -0000      1.20
+++ gdb/testsuite/gdb.mi/mi2-simplerun.exp      1 Oct 2012 16:04:18 -0000
@@ -79,7 +79,7 @@
              "insert breakpoint at \"<fullfilename>\":\$line_callee4_head"

     mi_gdb_test "204-break-list" \
-           "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
+           "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
                 "list of breakpoints"

     mi_gdb_test "205-break-disable 2 3 4" \
Index: gdb/testsuite/gdb.mi/mi2-watch.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-watch.exp,v
retrieving revision 1.23
diff -u -r1.23 mi2-watch.exp
--- gdb/testsuite/gdb.mi/mi2-watch.exp  10 Jul 2012 15:32:52 -0000      1.23
+++ gdb/testsuite/gdb.mi/mi2-watch.exp  1 Oct 2012 16:04:18 -0000
@@ -57,7 +57,7 @@
              "break-watch operation"

     mi_gdb_test "222-break-list" \
-           "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",times=\"0\",original-location=\"C\"\}\\\]\}" \
+           "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\"C\"\}\\\]\}" \
                 "list of watchpoints"

 }
@@ -81,7 +81,7 @@
              "break-watch -a operation"

     mi_gdb_test "444-break-list" \
-           "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
+           "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
                 "list of watchpoints awatch"

     mi_gdb_test "777-break-delete 3" \
@@ -108,7 +108,7 @@
              "break-insert -r operation"

     mi_gdb_test "300-break-list" \
-           "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\}\}" \
+           "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\}\}" \
                 "list of breakpoints"

     mi_gdb_test "177-break-delete 4" \
Index: gdb/testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.112
diff -u -r1.112 mi-support.exp
--- gdb/testsuite/lib/mi-support.exp    25 Jul 2012 20:19:56 -0000      1.112
+++ gdb/testsuite/lib/mi-support.exp    1 Oct 2012 16:04:18 -0000
@@ -923,7 +923,7 @@

   set test "mi runto $func"
   mi_gdb_test "200-break-insert -t $func" \
-    "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",times=\"0\",original-location=\".*\"\}" \
+    "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \
     "breakpoint at $func"

   if {![regexp {number="[0-9]+"} $expect_out(buffer) str]
@@ -1205,9 +1205,9 @@

 # Creates a breakpoint and checks the reported fields are as expected
 proc mi_create_breakpoint { location number disp func file line address test } {
-    verbose -log "Expecting: 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-location=\".*\"\}"
+    verbose -log "Expecting: 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",thread-groups=\\\[\".*\"\\\],times=\"0\",original-location=\".*\"\}"
     mi_gdb_test "222-break-insert $location" \
-        "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-location=\".*\"\}" \
+        "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",thread-groups=\\\[\".*\"\\\],times=\"0\",original-location=\".*\"\}" \
         $test
 }

@@ -1228,7 +1228,7 @@
         set file [lindex $item 3]
         set line [lindex $item 4]
         set address [lindex $item 5]
-        set body "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\".*$file\",${fullname},line=\"$line\",times=\"0\",original-location=\".*\"\}"
+        set body "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\".*$file\",${fullname},line=\"$line\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}"
         set first 0
     }


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [MI][patch v2] -break-list to specify "thread-group"
  2012-10-01 16:10           ` Marc Khouzam
@ 2012-10-01 16:17             ` Eli Zaretskii
  2012-10-15 10:39             ` Marc Khouzam
  1 sibling, 0 replies; 23+ messages in thread
From: Eli Zaretskii @ 2012-10-01 16:17 UTC (permalink / raw)
  To: Marc Khouzam; +Cc: tromey, yao, gdb-patches

> From: Marc Khouzam <marc.khouzam@ericsson.com>
> CC: "'Yao Qi'" <yao@codesourcery.com>,        "'gdb-patches@sourceware.org'"	<gdb-patches@sourceware.org>
> Date: Mon, 1 Oct 2012 12:09:32 -0400
> 
> > However, I think you should still update the docs for your change.
> 
> The below patch now does this.

The documentation part of this patch is OK.  Thanks.


^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [MI][patch v2] -break-list to specify "thread-group"
  2012-10-01 16:10           ` Marc Khouzam
  2012-10-01 16:17             ` Eli Zaretskii
@ 2012-10-15 10:39             ` Marc Khouzam
  2012-10-24 18:43               ` Marc Khouzam
  1 sibling, 1 reply; 23+ messages in thread
From: Marc Khouzam @ 2012-10-15 10:39 UTC (permalink / raw)
  To: 'Tom Tromey'
  Cc: 'Yao Qi', 'gdb-patches@sourceware.org'


Polite ping.
(http://sourceware.org/ml/gdb-patches/2012-10/msg00006.html)

Thanks

> -----Original Message-----
> From: gdb-patches-owner@sourceware.org
> [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Marc Khouzam
> Sent: Monday, October 01, 2012 12:10 PM
> To: 'Tom Tromey'
> Cc: 'Yao Qi'; 'gdb-patches@sourceware.org'
> Subject: RE: [MI][patch v2] -break-list to specify "thread-group"
>
>
> > Marc> Here's a second stab at it using the "i" prefix for MI.
> >
> > I think the general idea is great.
> >
> > Marc> The below patch adds the new field "thread-group".
> >
> > My recollection, reinforced by browsing the MI docs just
> now, is that
> > generally the field name "thread-group" is used to specify a single
> > group.  However, with this patch it is actually list-valued.  So, I
> > think a different name would be somewhat better, maybe
> > "thread-groups".
>
> I've made the field "thread-groups" for now, since the patch still
> returns a list of inferiors.
>
> > Marc> or (if the bp applies to multiple inferiors, which I
> didn't quite
> > Marc> out how to officially trigger, so I hacked the code
> to make sure
> > Marc> the output was done properly in that case):
> >
> > Hm.  I think a given location can only apply to a single inferior.
> > I am not totally sure.
> >
> > So maybe making it "thread-group" and giving it a single
> value is the
> > right thing to do.
>
> I'd prefer this.  And it would make things simpler for the
> frontend code.
>
> > Yao> I don't know ether.  I can't think of a case that
> > Yao> multiple inferiors share a single pspace.
> >
> > Thinking about it more -- maybe an inferior which just vforked?
>
> Since we're still not sure if a list is needed or not, I kept
> the patch returning a list, to be safe.
>
> > Marc> I was going to update the doc, but when I looked at it
> > Marc> I realized it was completely out-of-date with respect to
> > Marc> -break-list _and_ that the MI output itself does not to have
> > Marc> the right content in the  'hdr' part.  I wasn't sure if I can
> > Marc> change such MI output or not due to backwards compatibility.
> >
> > The very best thing would be to fix the -break-list documentation.
> >
> > But, I understand if you don't want to do that.  But maybe you could
> > file a bug report in this case.
>
> Thanks for understanding.  I've opened
> Bug 14651 - [doc] -break-list command not documented properly
> http://sourceware.org/bugzilla/show_bug.cgi?id=14651
>
> > However, I think you should still update the docs for your change.
>
> The below patch now does this.
>
> > I think changing the 'hdr' part of the MI output is ok, if it
> > is useful to you somehow.  I think it has to be done with care to
> > avoid  messing up the CLI output.
>
> I haven't ventured down that path :)
>
> > Marc> I had forgotten to update the tests to take into
> > consideration the
> > Marc> new parameter.  Those tests use -break-list in
> multiple places.
> > Marc> The new patch below does update the testsuite.
> > Marc> Only one new regression happens:
> >
> > Marc> FAIL: gdb.mi/mi-nsmoribund.exp: thread specific
> > breakpoint at thread_function
> >
> > Marc> This was a latent problem where the unexpected 'thread'
> > field was
> > Marc> being sucked into a '.*' pattern, which hid the
> error.  Because
> > Marc> the problem is in lib/mi-support.exp it is not as
> simple to fix.
> > Marc> Since the problem is not caused by my patch, I suggest
> > not to fix
> > Marc> it right away.
> >
> > We try not to let any regressions in.
> > So I think it does need to be fixed before this patch can go in.
>
> I've updated that test and fixed the regression.
>
> > Marc> +  /* Go through list in reverse order to print
> inferiors ids in
> > Marc> +     increasing order. */
> > Marc> +  for (index = len - 1; index >= 0; index--)
> >
> > It isn't clear to me that it is reliable to assume that the inferior
> > list is sorted.
> >
> > However, this shouldn't really matter for clients, either.
>
> I didn't like seeing "inf 4, 3, 2 ,1", but I agree that the order
> is not guaranteed anyway.  Besides, we still don't know how
> to actually
> see a list of inferior for a single breakpoint :)  I therefore
> iterate over the VEC in whatever order it is.
>
> > Marc> +       {
> > Marc> +         char mi_group[10];
> > Marc> +         sprintf (mi_group, "i%d", inf_num[index]);
> >
> > Blank line between declarations and code.
>
> Done.
>
> > Marc> +      int inf_num[number_of_inferiors ()];
> >
> > I think you'd have to use alloca here -- but it is better
> to use a VEC
> > anyway.
>
> Nice.  It is the first time I use the VEC macros.  Done.
>
> No regressions with this patch.
>
> Thanks!
>
> Marc
>
>
> 2012-10-01  Marc Khouzam  <marc.khouzam@ericsson.com>
>
>         * breakpoint.c (print_one_breakpoint_location): Add MI
>         field 'thread-groups' when printing a breakpoint.
>         (output_thread_groups): New function.
>
> 2012-10-01  Marc Khouzam  <marc.khouzam@ericsson.com>
>
>         * gdb.mi/mi-break.exp: Expect new 'thread-groups' field.
>         * gdb.mi/mi-nsmoribund.exp: Expect new 'thread-groups' field.
>         Also handle 'thread' field.
>         * gdb.mi/mi-simplerun.exp: Expect new 'thread-groups' field.
>         * gdb.mi/mi-watch.exp: Ditto.
>         * gdb.mi/mi2-break.exp: Ditto.
>         * gdb.mi/mi2-simplerun.exp: Ditto.
>         * gdb.mi/mi2-watch.exp: Ditto.
>         * lib/mi-support.exp: Ditto.
>
> 2012-10-01  Marc Khouzam  <marc.khouzam@ericsson.com>
>
>         * gdb.texinfo (GDB/MI Breakpoint Commands): Document new
>         `thread-group' field when printing a breakpoint in MI.
>
> ### Eclipse Workspace Patch 1.0
> #P src
> Index: gdb/breakpoint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/breakpoint.c,v
> retrieving revision 1.707
> diff -u -r1.707 breakpoint.c
> --- gdb/breakpoint.c    26 Sep 2012 16:35:59 -0000      1.707
> +++ gdb/breakpoint.c    1 Oct 2012 16:04:16 -0000
> @@ -5778,6 +5778,51 @@
>    return bptypes[(int) type].description;
>  }
>
> +DEF_VEC_I(int);
> +
> +/* For MI, output a field named 'thread-groups' with a list
> as the value.
> +   For CLI, prefix the list with the string 'inf'. */
> +
> +static void
> +output_thread_groups (struct ui_out *uiout,
> +                     const char *field_name,
> +                     VEC(int) *inf_num,
> +                     int mi_only)
> +{
> +  struct cleanup *back_to =
> make_cleanup_ui_out_list_begin_end (uiout,
> +
>   field_name);
> +  int is_mi = ui_out_is_mi_like_p (uiout);
> +  int inf;
> +  int i;
> +
> +  /* For backward compatibility, don't display inferiors in
> CLI unless
> +     there are several.  Always display them for MI. */
> +  if (!is_mi && mi_only)
> +    return;
> +
> +  for (i = 0; VEC_iterate (int, inf_num, i, inf); ++i)
> +    {
> +      if (is_mi)
> +       {
> +         char mi_group[10];
> +
> +         sprintf (mi_group, "i%d", inf);
> +         ui_out_field_string (uiout, NULL, mi_group);
> +       }
> +      else
> +       {
> +         if (i == 0)
> +           ui_out_text (uiout, " inf ");
> +         else
> +           ui_out_text (uiout, ", ");
> +
> +         ui_out_text (uiout, plongest (inf));
> +       }
> +    }
> +
> +  do_cleanups (back_to);
> +}
> +
>  /* Print B to gdb_stdout.  */
>
>  static void
> @@ -5929,35 +5974,30 @@
>        }
>
>
> -  /* For backward compatibility, don't display inferiors unless there
> -     are several.  */
> -  if (loc != NULL
> -      && !header_of_multiple
> -      && (allflag
> -         || (!gdbarch_has_global_breakpoints (target_gdbarch)
> -             && (number_of_program_spaces () > 1
> -                 || number_of_inferiors () > 1)
> -             /* LOC is for existing B, it cannot be in
> -                moribund_locations and thus having NULL OWNER.  */
> -             && loc->owner->type != bp_catchpoint)))
> +  if (loc != NULL && !header_of_multiple)
>      {
>        struct inferior *inf;
> -      int first = 1;
> +      VEC(int) *inf_num = NULL;
> +      int mi_only = 1;
>
> -      for (inf = inferior_list; inf != NULL; inf = inf->next)
> +      ALL_INFERIORS (inf)
>         {
>           if (inf->pspace == loc->pspace)
> -           {
> -             if (first)
> -               {
> -                 first = 0;
> -                 ui_out_text (uiout, " inf ");
> -               }
> -             else
> -               ui_out_text (uiout, ", ");
> -             ui_out_text (uiout, plongest (inf->num));
> -           }
> +           VEC_safe_push (int, inf_num, inf->num);
>         }
> +
> +      /* For backward compatibility, don't display inferiors
> in CLI unless
> +         there are several.  Always display for MI. */
> +      if (allflag
> +         || (!gdbarch_has_global_breakpoints (target_gdbarch)
> +             && (number_of_program_spaces () > 1
> +                 || number_of_inferiors () > 1)
> +             /* LOC is for existing B, it cannot be in
> +                moribund_locations and thus having NULL OWNER.  */
> +             && loc->owner->type != bp_catchpoint))
> +        mi_only = 0;
> +      output_thread_groups (uiout, "thread-groups", inf_num,
> mi_only);
> +      VEC_free (int, inf_num);
>      }
>
>    if (!part_of_multiple)
> @@ -7902,8 +7942,6 @@
>    catch_load_or_unload (arg, from_tty, 0, command);
>  }
>
> -DEF_VEC_I(int);
> -
>  /* An instance of this type is used to represent a syscall
> catchpoint.
>     It includes a "struct breakpoint" as a kind of base class; users
>     downcast to "struct breakpoint *" when needed.  A breakpoint is
> Index: gdb/doc/gdb.texinfo
> ===================================================================
> RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
> retrieving revision 1.1012
> diff -u -r1.1012 gdb.texinfo
> --- gdb/doc/gdb.texinfo 21 Sep 2012 01:46:42 -0000      1.1012
> +++ gdb/doc/gdb.texinfo 1 Oct 2012 16:04:18 -0000
> @@ -27763,7 +27763,8 @@
>  -> -break-insert main
>  <- ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
>      enabled="y",addr="0x08048564",func="main",file="myprog.c",
> -    fullname="/home/nickrob/myprog.c",line="68",times="0"@}
> +    fullname="/home/nickrob/myprog.c",line="68",thread-groups=["i1"],
> +    times="0"@}
>  <- (gdb)
>  @end smallexample
>
> @@ -27887,7 +27888,8 @@
>  -break-insert main
>  ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
>  enabled="y",addr="0x000100d0",func="main",file="hello.c",
> -fullname="/home/foo/hello.c",line="5",times="0"@}
> +fullname="/home/foo/hello.c",line="5",thread-groups=["i1"]
> +,times="0"@}
>  (gdb)
>  -break-after 1 3
>  ~
> @@ -27903,7 +27905,7 @@
>  @{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",fullname="/home/f
> oo/hello.c",
> -line="5",times="0",ignore="3"@}]@}
> +line="5",thread-groups=["i1"],times="0",ignore="3"@}]@}
>  (gdb)
>  @end smallexample
>
> @@ -27939,7 +27941,8 @@
>  -break-insert main
>  ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
>  enabled="y",addr="0x000100d0",func="main",file="hello.c",
> -fullname="/home/foo/hello.c",line="5",times="0"@}
> +fullname="/home/foo/hello.c",line="5",thread-groups=["i1"],
> +times="0"@}
>  (gdb)
>  -break-commands 1 "print v" "continue"
>  ^done
> @@ -27981,7 +27984,7 @@
>  @{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",fullname="/home/f
> oo/hello.c",
> -line="5",cond="1",times="0",ignore="3"@}]@}
> +line="5",cond="1",thread-groups=["i1"],times="0",ignore="3"@}]@}
>  (gdb)
>  @end smallexample
>
> @@ -28053,7 +28056,7 @@
>  @{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",fullname="/home/f
> oo/hello.c",
> -line="5",times="0"@}]@}
> +line="5",thread-groups=["i1"],times="0"@}]@}
>  (gdb)
>  @end smallexample
>
> @@ -28089,7 +28092,7 @@
>  @{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",fullname="/home/f
> oo/hello.c",
> -line="5",times="0"@}]@}
> +line="5",thread-groups=["i1"],times="0"@}]@}
>  (gdb)
>  @end smallexample
>
> @@ -28170,14 +28173,15 @@
>
> ^done,bkpt=@{number="@var{number}",type="@var{type}",disp="del
> "|"keep",
>
> enabled="y"|"n",addr="@var{hex}",func="@var{funcname}",file="@
> var{filename}",
>
> fullname="@var{full_filename}",line="@var{lineno}",[thread="@v
> ar{threadno},]
> -times="@var{times}"@}
> +thread-groups=["@var{group1}","@var{group2}"],times="@var{times}"@}
>  @end smallexample
>
>  @noindent
>  where @var{number} is the @value{GDBN} number for this breakpoint,
>  @var{funcname} is the name of the function where the breakpoint was
>  inserted, @var{filename} is the name of the source file
> which contains
> -this function, @var{lineno} is the source line number within
> that file
> +this function, @var{lineno} is the source line number within
> that file,
> +@var{thread-groups} is the list of inferiors to which this
> breakpoint applies,
>  and @var{times} the number of times that the breakpoint has been hit
>  (always 0 for -break-insert but may be greater for
> -break-info or -break-list
>  which use the same output).
> @@ -28196,11 +28200,13 @@
>  (gdb)
>  -break-insert main
>  ^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",
> -fullname="/home/foo/recursive2.c,line="4",times="0"@}
> +fullname="/home/foo/recursive2.c,line="4",thread-groups=["i1"],
> +times="0"@}
>  (gdb)
>  -break-insert -t foo
>  ^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",
> -fullname="/home/foo/recursive2.c,line="11",times="0"@}
> +fullname="/home/foo/recursive2.c,line="11",thread-groups=["i1"],
> +times="0"@}
>  (gdb)
>  -break-list
>  ^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
> @@ -28212,15 +28218,18 @@
>  @{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",
> -fullname="/home/foo/recursive2.c,"line="4",times="0"@},
> +fullname="/home/foo/recursive2.c,"line="4",thread-groups=["i1"],
> +times="0"@},
>  bkpt=@{number="2",type="breakpoint",disp="del",enabled="y",
>  addr="0x00010774",func="foo",file="recursive2.c",
> -fullname="/home/foo/recursive2.c",line="11",times="0"@}]@}
> +fullname="/home/foo/recursive2.c",line="11",thread-groups=["i1"],
> +times="0"@}]@}
>  (gdb)
>  @c -break-insert -r foo.*
>  @c ~int foo(int, int);
>  @c ^done,bkpt=@{number="3",addr="0x00010774",file="recursive2.c,
> -@c "fullname="/home/foo/recursive2.c",line="11",times="0"@}
> +@c "fullname="/home/foo/recursive2.c",line="11",thread-groups=["i1"],
> +@c times="0"@}
>  @c (gdb)
>  @end smallexample
>
> @@ -28250,6 +28259,8 @@
>  @item What
>  logical location of the breakpoint, expressed by function name, file
>  name, line number
> +@item Thread-groups
> +list of inferiors to which this breakpoint applies
>  @item Times
>  number of times the breakpoint has been hit
>  @end table
> @@ -28277,7 +28288,7 @@
>  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",fullname="/home/fo
> o/hello.c",
> -line="13",times="0"@}]@}
> +line="13",thread-groups=["i1"],times="0"@}]@}
>  (gdb)
>  @end smallexample
>
> Index: gdb/testsuite/gdb.mi/mi-break.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-break.exp,v
> retrieving revision 1.36
> diff -u -r1.36 mi-break.exp
> --- gdb/testsuite/gdb.mi/mi-break.exp   10 Jul 2012 15:32:51
> -0000      1.36
> +++ gdb/testsuite/gdb.mi/mi-break.exp   1 Oct 2012 16:04:18 -0000
> @@ -93,7 +93,7 @@
>               "insert temp breakpoint at
> \"<fullfilename>\":\$line_callee4_head"
>
>      mi_gdb_test "666-break-list" \
> -
> "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
r=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=> \"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"
$line_main_body\",times=\"0\",original-location=\".*\"\}.*> \\\]\}" \
> +
> "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
r=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=> \"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"
$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0> \",original-location=\".*\"\}.*\\\]\}" \
>                  "list of breakpoints"
>
>      mi_gdb_test "777-break-delete" \
> @@ -142,7 +142,7 @@
>
>      setup_kfail "*-*-*" mi/14270
>      mi_gdb_test "166-break-list" \
> -
> "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\
\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=> \"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$
> hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body
> \",times=\"0\"\},.*\}\\\]\}" \
> +
> "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\
\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=> \"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$
> hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body
> \",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
>                  "list of breakpoints"
>
>      mi_gdb_test "177-break-delete" \
> @@ -190,7 +190,7 @@
>      global line_callee2_body
>
>      mi_gdb_test "-break-insert -d basics.c:callee2" \
> -
> "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\"
,enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c> \",fullname=\".*\",line=\"$line_callee2_body\",times=\"0\",ori
ginal-location=\".*\"\}" \
> +
> "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\"
,enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c> \",fullname=\".*\",line=\"$line_callee2_body\",thread-groups=\
\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \
>          "test disabled creation"
>
>      mi_gdb_test "-break-delete" \
> @@ -211,7 +211,7 @@
>          "breakpoint commands: set commands"
>
>      mi_gdb_test "-break-info 7" \
> -
> "\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\
[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=> \"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$
> hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"
$line_callee2_body\",times=\"0\",script=\{\"print 10\",> \"continue\"\},original-location=\".*\"\}.*\\\]\}" \
> +
> "\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\
[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=> \"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$
> hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"
$line_callee2_body\",thread-groups=\\\[\"i1\"\\\],times=\"0> \",script=\{\"print
> 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \
>          "breakpoint commands: check that commands are set"
>
>      mi_gdb_test "-break-commands 7" \
> Index: gdb/testsuite/gdb.mi/mi-nsmoribund.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-nsmoribund.exp,v
> retrieving revision 1.17
> diff -u -r1.17 mi-nsmoribund.exp
> --- gdb/testsuite/gdb.mi/mi-nsmoribund.exp      10 Jul 2012
> 15:32:51 -0000      1.17
> +++ gdb/testsuite/gdb.mi/mi-nsmoribund.exp      1 Oct 2012
> 16:04:18 -0000
> @@ -79,8 +79,11 @@
>  mi_delete_breakpoints
>
>  # Recreate the same breakpoint, but this time, specific to thread 5.
> -mi_create_breakpoint "-p 5 $srcfile:$bkpt_line" 3 keep
> thread_function .* .* .* \
> -    "thread specific breakpoint at thread_function"
> +mi_gdb_test "234-break-insert -p 5 $srcfile:$bkpt_line" \
> +
> "234\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"kee
p\",enabled=\"y\",addr=\".*\",\
> +
> func=\"thread_function\",file=\".*\",fullname=\".*\",line=\".*
> \",thread-groups=\\\[\".*\"\\\],\
> +
> thread=\"5\",thread=\"5\",times=\"0\",original-location=\".*\"\}" \
> +    "thread specific breakpoint at thread_function"
>
>  # Resume all threads.  Only thread 5 should report a stop.
>
> Index: gdb/testsuite/gdb.mi/mi-simplerun.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-simplerun.exp,v
> retrieving revision 1.29
> diff -u -r1.29 mi-simplerun.exp
> --- gdb/testsuite/gdb.mi/mi-simplerun.exp       10 Jul 2012
> 15:32:51 -0000      1.29
> +++ gdb/testsuite/gdb.mi/mi-simplerun.exp       1 Oct 2012
> 16:04:18 -0000
> @@ -79,7 +79,7 @@
>               "insert breakpoint at
> \"<fullfilename>\":\$line_callee4_head"
>
>      mi_gdb_test "204-break-list" \
> -
> "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> \{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=> \"$line_main_body\",times=\"0\",original-location=\".*\"\},.*\
}\\\]\}" \
> +
> "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> \{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=> \"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",o
riginal-location=\".*\"\},.*\}\\\]\}" \
>                  "list of breakpoints"
>
>      mi_gdb_test "205-break-disable 2 3 4" \
> Index: gdb/testsuite/gdb.mi/mi-watch.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-watch.exp,v
> retrieving revision 1.32
> diff -u -r1.32 mi-watch.exp
> --- gdb/testsuite/gdb.mi/mi-watch.exp   10 Jul 2012 15:32:52
> -0000      1.32
> +++ gdb/testsuite/gdb.mi/mi-watch.exp   1 Oct 2012 16:04:18 -0000
> @@ -58,7 +58,7 @@
>               "break-watch operation"
>
>      mi_gdb_test "222-break-list" \
> -
> "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
r=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=> \"C\",times=\"0\",original-location=\"C\"\}\\\]\}" \
> +
> "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
r=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=> \"C\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-locati
on=\"C\"\}\\\]\}" \
>                  "list of watchpoints"
>
>  }
> @@ -82,7 +82,7 @@
>               "break-watch -a operation"
>
>      mi_gdb_test "444-break-list" \
> -
> "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> \{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",
addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=> \"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
> +
> "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> \{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",
addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=> \"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}
> ,.*\}\\\]\}" \
>                  "list of watchpoints awatch"
>
>      mi_gdb_test "777-break-delete 3" \
> @@ -109,7 +109,7 @@
>               "break-insert -r operation"
>
>      mi_gdb_test "300-break-list" \
> -
> "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> \{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=> \"$line_main_body\",times=\"0\"\},.*\}\\\}\}" \
> +
> "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> \{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=> \"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}
> ,.*\}\\\}\}" \
>                  "list of breakpoints"
>
>      mi_gdb_test "177-break-delete 4" \
> Index: gdb/testsuite/gdb.mi/mi2-break.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-break.exp,v
> retrieving revision 1.18
> diff -u -r1.18 mi2-break.exp
> --- gdb/testsuite/gdb.mi/mi2-break.exp  10 Jul 2012 15:32:52
> -0000      1.18
> +++ gdb/testsuite/gdb.mi/mi2-break.exp  1 Oct 2012 16:04:18 -0000
> @@ -92,7 +92,7 @@
>               "insert temp breakpoint at
> \"<fullfilename>\":\$line_callee4_head"
>
>      mi_gdb_test "666-break-list" \
> -
> "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
r=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=> \"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"
$line_main_body\",times=\"0\",original-location=\".*\"\}.*> \\\]\}" \
> +
> "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
r=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=> \"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"
$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0> \",original-location=\".*\"\}.*\\\]\}" \
>                  "list of breakpoints"
>
>      mi_gdb_test "777-break-delete" \
> @@ -142,7 +142,7 @@
>
>      setup_xfail "*-*-*"
>      mi_gdb_test "166-break-list" \
> -
> "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\
\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=> \"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$
> hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$li
ne_main_body\",times=\"0\"\},.*\}\\\]\}" \
> +
> "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\
\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=> \"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$
> hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$li
ne_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*> \}\\\]\}" \
>                  "list of breakpoints"
>
>      mi_gdb_test "177-break-delete" \
> Index: gdb/testsuite/gdb.mi/mi2-simplerun.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-simplerun.exp,v
> retrieving revision 1.20
> diff -u -r1.20 mi2-simplerun.exp
> --- gdb/testsuite/gdb.mi/mi2-simplerun.exp      10 Jul 2012
> 15:32:52 -0000      1.20
> +++ gdb/testsuite/gdb.mi/mi2-simplerun.exp      1 Oct 2012
> 16:04:18 -0000
> @@ -79,7 +79,7 @@
>               "insert breakpoint at
> \"<fullfilename>\":\$line_callee4_head"
>
>      mi_gdb_test "204-break-list" \
> -
> "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> \{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=> \"$line_main_body\",times=\"0\",original-location=\".*\"\},.*\
}\\\]\}" \
> +
> "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> \{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=> \"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",o
riginal-location=\".*\"\},.*\}\\\]\}" \
>                  "list of breakpoints"
>
>      mi_gdb_test "205-break-disable 2 3 4" \
> Index: gdb/testsuite/gdb.mi/mi2-watch.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-watch.exp,v
> retrieving revision 1.23
> diff -u -r1.23 mi2-watch.exp
> --- gdb/testsuite/gdb.mi/mi2-watch.exp  10 Jul 2012 15:32:52
> -0000      1.23
> +++ gdb/testsuite/gdb.mi/mi2-watch.exp  1 Oct 2012 16:04:18 -0000
> @@ -57,7 +57,7 @@
>               "break-watch operation"
>
>      mi_gdb_test "222-break-list" \
> -
> "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
r=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=> \"C\",times=\"0\",original-location=\"C\"\}\\\]\}" \
> +
> "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
r=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=> \"C\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-locati
on=\"C\"\}\\\]\}" \
>                  "list of watchpoints"
>
>  }
> @@ -81,7 +81,7 @@
>               "break-watch -a operation"
>
>      mi_gdb_test "444-break-list" \
> -
> "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> \{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",
addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=> \"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
> +
> "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> \{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",
addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=> \"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}
> ,.*\}\\\]\}" \
>                  "list of watchpoints awatch"
>
>      mi_gdb_test "777-break-delete 3" \
> @@ -108,7 +108,7 @@
>               "break-insert -r operation"
>
>      mi_gdb_test "300-break-list" \
> -
> "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> \{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=> \"$line_main_body\",times=\"0\"\},.*\}\\\}\}" \
> +
> "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> \{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=> \"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}
> ,.*\}\\\}\}" \
>                  "list of breakpoints"
>
>      mi_gdb_test "177-break-delete 4" \
> Index: gdb/testsuite/lib/mi-support.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
> retrieving revision 1.112
> diff -u -r1.112 mi-support.exp
> --- gdb/testsuite/lib/mi-support.exp    25 Jul 2012 20:19:56
> -0000      1.112
> +++ gdb/testsuite/lib/mi-support.exp    1 Oct 2012 16:04:18 -0000
> @@ -923,7 +923,7 @@
>
>    set test "mi runto $func"
>    mi_gdb_test "200-break-insert -t $func" \
> -
> "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",dis
p=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*> \\\)\)?\",file=\".*\",line=\"\[0-9\]*\",times=\"0\",original-l
ocation=\".*\"\}" \
> +
> "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",dis
p=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*> \\\)\)?\",file=\".*\",line=\"\[0-9\]*\",thread-groups=\\\[\"i1
> \"\\\],times=\"0\",original-location=\".*\"\}" \
>      "breakpoint at $func"
>
>    if {![regexp {number="[0-9]+"} $expect_out(buffer) str]
> @@ -1205,9 +1205,9 @@
>
>  # Creates a breakpoint and checks the reported fields are as expected
>  proc mi_create_breakpoint { location number disp func file
> line address test } {
> -    verbose -log "Expecting:
> 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=
> \"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=
> \"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-
> location=\".*\"\}"
> +    verbose -log "Expecting:
> 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=
> \"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=
> \"$file\",fullname=\".*\",line=\"$line\",thread-groups=\\\[\".
> *\"\\\],times=\"0\",original-location=\".*\"\}"
>      mi_gdb_test "222-break-insert $location" \
> -
> "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp
=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=> \"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-
> location=\".*\"\}" \
> +
> "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp
=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=> \"$file\",fullname=\".*\",line=\"$line\",thread-groups=\\\[\".
> *\"\\\],times=\"0\",original-location=\".*\"\}" \
>          $test
>  }
>
> @@ -1228,7 +1228,7 @@
>          set file [lindex $item 3]
>          set line [lindex $item 4]
>          set address [lindex $item 5]
> -        set body
> "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$
disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\".*> $file\",${fullname},line=\"$line\",times=\"0\",original-locati
on=\".*\"\}"
> +        set body
> "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$
disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\".*> $file\",${fullname},line=\"$line\",thread-groups=\\\[\"i1\"\\\
],times=\"0\",original-location=\".*\"\}"
>          set first 0
>      }
>


^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [MI][patch v2] -break-list to specify "thread-group"
  2012-10-15 10:39             ` Marc Khouzam
@ 2012-10-24 18:43               ` Marc Khouzam
  2012-11-27 19:56                 ` Marc Khouzam
  0 siblings, 1 reply; 23+ messages in thread
From: Marc Khouzam @ 2012-10-24 18:43 UTC (permalink / raw)
  To: 'Tom Tromey', 'gdb-patches@sourceware.org'
  Cc: 'Yao Qi'


Polite re-ping :)
(http://sourceware.org/ml/gdb-patches/2012-10/msg00006.html)

Turns out Eclipse is also missing the extra information this patch
is adding in the case of processing =breakpoint-create MI
notifications because it cannot tell what inferior the breakpoint
was created for.

Thanks

Marc

> -----Original Message-----
> From: gdb-patches-owner@sourceware.org
> [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Marc Khouzam
> Sent: Monday, October 15, 2012 6:39 AM
> To: 'Tom Tromey'
> Cc: 'Yao Qi'; 'gdb-patches@sourceware.org'
> Subject: RE: [MI][patch v2] -break-list to specify "thread-group"
>
>
> Polite ping.
> (http://sourceware.org/ml/gdb-patches/2012-10/msg00006.html)
>
> Thanks
>
> > -----Original Message-----
> > From: gdb-patches-owner@sourceware.org
> > [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Marc Khouzam
> > Sent: Monday, October 01, 2012 12:10 PM
> > To: 'Tom Tromey'
> > Cc: 'Yao Qi'; 'gdb-patches@sourceware.org'
> > Subject: RE: [MI][patch v2] -break-list to specify "thread-group"
> >
> >
> > > Marc> Here's a second stab at it using the "i" prefix for MI.
> > >
> > > I think the general idea is great.
> > >
> > > Marc> The below patch adds the new field "thread-group".
> > >
> > > My recollection, reinforced by browsing the MI docs just
> > now, is that
> > > generally the field name "thread-group" is used to
> specify a single
> > > group.  However, with this patch it is actually
> list-valued.  So, I
> > > think a different name would be somewhat better, maybe
> > > "thread-groups".
> >
> > I've made the field "thread-groups" for now, since the patch still
> > returns a list of inferiors.
> >
> > > Marc> or (if the bp applies to multiple inferiors, which I
> > didn't quite
> > > Marc> out how to officially trigger, so I hacked the code
> > to make sure
> > > Marc> the output was done properly in that case):
> > >
> > > Hm.  I think a given location can only apply to a single inferior.
> > > I am not totally sure.
> > >
> > > So maybe making it "thread-group" and giving it a single
> > value is the
> > > right thing to do.
> >
> > I'd prefer this.  And it would make things simpler for the
> > frontend code.
> >
> > > Yao> I don't know ether.  I can't think of a case that
> > > Yao> multiple inferiors share a single pspace.
> > >
> > > Thinking about it more -- maybe an inferior which just vforked?
> >
> > Since we're still not sure if a list is needed or not, I kept
> > the patch returning a list, to be safe.
> >
> > > Marc> I was going to update the doc, but when I looked at it
> > > Marc> I realized it was completely out-of-date with respect to
> > > Marc> -break-list _and_ that the MI output itself does not to have
> > > Marc> the right content in the  'hdr' part.  I wasn't
> sure if I can
> > > Marc> change such MI output or not due to backwards compatibility.
> > >
> > > The very best thing would be to fix the -break-list documentation.
> > >
> > > But, I understand if you don't want to do that.  But
> maybe you could
> > > file a bug report in this case.
> >
> > Thanks for understanding.  I've opened
> > Bug 14651 - [doc] -break-list command not documented properly
> > http://sourceware.org/bugzilla/show_bug.cgi?id=14651
> >
> > > However, I think you should still update the docs for your change.
> >
> > The below patch now does this.
> >
> > > I think changing the 'hdr' part of the MI output is ok, if it
> > > is useful to you somehow.  I think it has to be done with care to
> > > avoid  messing up the CLI output.
> >
> > I haven't ventured down that path :)
> >
> > > Marc> I had forgotten to update the tests to take into
> > > consideration the
> > > Marc> new parameter.  Those tests use -break-list in
> > multiple places.
> > > Marc> The new patch below does update the testsuite.
> > > Marc> Only one new regression happens:
> > >
> > > Marc> FAIL: gdb.mi/mi-nsmoribund.exp: thread specific
> > > breakpoint at thread_function
> > >
> > > Marc> This was a latent problem where the unexpected 'thread'
> > > field was
> > > Marc> being sucked into a '.*' pattern, which hid the
> > error.  Because
> > > Marc> the problem is in lib/mi-support.exp it is not as
> > simple to fix.
> > > Marc> Since the problem is not caused by my patch, I suggest
> > > not to fix
> > > Marc> it right away.
> > >
> > > We try not to let any regressions in.
> > > So I think it does need to be fixed before this patch can go in.
> >
> > I've updated that test and fixed the regression.
> >
> > > Marc> +  /* Go through list in reverse order to print
> > inferiors ids in
> > > Marc> +     increasing order. */
> > > Marc> +  for (index = len - 1; index >= 0; index--)
> > >
> > > It isn't clear to me that it is reliable to assume that
> the inferior
> > > list is sorted.
> > >
> > > However, this shouldn't really matter for clients, either.
> >
> > I didn't like seeing "inf 4, 3, 2 ,1", but I agree that the order
> > is not guaranteed anyway.  Besides, we still don't know how
> > to actually
> > see a list of inferior for a single breakpoint :)  I therefore
> > iterate over the VEC in whatever order it is.
> >
> > > Marc> +       {
> > > Marc> +         char mi_group[10];
> > > Marc> +         sprintf (mi_group, "i%d", inf_num[index]);
> > >
> > > Blank line between declarations and code.
> >
> > Done.
> >
> > > Marc> +      int inf_num[number_of_inferiors ()];
> > >
> > > I think you'd have to use alloca here -- but it is better
> > to use a VEC
> > > anyway.
> >
> > Nice.  It is the first time I use the VEC macros.  Done.
> >
> > No regressions with this patch.
> >
> > Thanks!
> >
> > Marc
> >
> >
> > 2012-10-01  Marc Khouzam  <marc.khouzam@ericsson.com>
> >
> >         * breakpoint.c (print_one_breakpoint_location): Add MI
> >         field 'thread-groups' when printing a breakpoint.
> >         (output_thread_groups): New function.
> >
> > 2012-10-01  Marc Khouzam  <marc.khouzam@ericsson.com>
> >
> >         * gdb.mi/mi-break.exp: Expect new 'thread-groups' field.
> >         * gdb.mi/mi-nsmoribund.exp: Expect new
> 'thread-groups' field.
> >         Also handle 'thread' field.
> >         * gdb.mi/mi-simplerun.exp: Expect new 'thread-groups' field.
> >         * gdb.mi/mi-watch.exp: Ditto.
> >         * gdb.mi/mi2-break.exp: Ditto.
> >         * gdb.mi/mi2-simplerun.exp: Ditto.
> >         * gdb.mi/mi2-watch.exp: Ditto.
> >         * lib/mi-support.exp: Ditto.
> >
> > 2012-10-01  Marc Khouzam  <marc.khouzam@ericsson.com>
> >
> >         * gdb.texinfo (GDB/MI Breakpoint Commands): Document new
> >         `thread-group' field when printing a breakpoint in MI.
> >
> > ### Eclipse Workspace Patch 1.0
> > #P src
> > Index: gdb/breakpoint.c
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/breakpoint.c,v
> > retrieving revision 1.707
> > diff -u -r1.707 breakpoint.c
> > --- gdb/breakpoint.c    26 Sep 2012 16:35:59 -0000      1.707
> > +++ gdb/breakpoint.c    1 Oct 2012 16:04:16 -0000
> > @@ -5778,6 +5778,51 @@
> >    return bptypes[(int) type].description;
> >  }
> >
> > +DEF_VEC_I(int);
> > +
> > +/* For MI, output a field named 'thread-groups' with a list
> > as the value.
> > +   For CLI, prefix the list with the string 'inf'. */
> > +
> > +static void
> > +output_thread_groups (struct ui_out *uiout,
> > +                     const char *field_name,
> > +                     VEC(int) *inf_num,
> > +                     int mi_only)
> > +{
> > +  struct cleanup *back_to =
> > make_cleanup_ui_out_list_begin_end (uiout,
> > +
> >   field_name);
> > +  int is_mi = ui_out_is_mi_like_p (uiout);
> > +  int inf;
> > +  int i;
> > +
> > +  /* For backward compatibility, don't display inferiors in
> > CLI unless
> > +     there are several.  Always display them for MI. */
> > +  if (!is_mi && mi_only)
> > +    return;
> > +
> > +  for (i = 0; VEC_iterate (int, inf_num, i, inf); ++i)
> > +    {
> > +      if (is_mi)
> > +       {
> > +         char mi_group[10];
> > +
> > +         sprintf (mi_group, "i%d", inf);
> > +         ui_out_field_string (uiout, NULL, mi_group);
> > +       }
> > +      else
> > +       {
> > +         if (i == 0)
> > +           ui_out_text (uiout, " inf ");
> > +         else
> > +           ui_out_text (uiout, ", ");
> > +
> > +         ui_out_text (uiout, plongest (inf));
> > +       }
> > +    }
> > +
> > +  do_cleanups (back_to);
> > +}
> > +
> >  /* Print B to gdb_stdout.  */
> >
> >  static void
> > @@ -5929,35 +5974,30 @@
> >        }
> >
> >
> > -  /* For backward compatibility, don't display inferiors
> unless there
> > -     are several.  */
> > -  if (loc != NULL
> > -      && !header_of_multiple
> > -      && (allflag
> > -         || (!gdbarch_has_global_breakpoints (target_gdbarch)
> > -             && (number_of_program_spaces () > 1
> > -                 || number_of_inferiors () > 1)
> > -             /* LOC is for existing B, it cannot be in
> > -                moribund_locations and thus having NULL OWNER.  */
> > -             && loc->owner->type != bp_catchpoint)))
> > +  if (loc != NULL && !header_of_multiple)
> >      {
> >        struct inferior *inf;
> > -      int first = 1;
> > +      VEC(int) *inf_num = NULL;
> > +      int mi_only = 1;
> >
> > -      for (inf = inferior_list; inf != NULL; inf = inf->next)
> > +      ALL_INFERIORS (inf)
> >         {
> >           if (inf->pspace == loc->pspace)
> > -           {
> > -             if (first)
> > -               {
> > -                 first = 0;
> > -                 ui_out_text (uiout, " inf ");
> > -               }
> > -             else
> > -               ui_out_text (uiout, ", ");
> > -             ui_out_text (uiout, plongest (inf->num));
> > -           }
> > +           VEC_safe_push (int, inf_num, inf->num);
> >         }
> > +
> > +      /* For backward compatibility, don't display inferiors
> > in CLI unless
> > +         there are several.  Always display for MI. */
> > +      if (allflag
> > +         || (!gdbarch_has_global_breakpoints (target_gdbarch)
> > +             && (number_of_program_spaces () > 1
> > +                 || number_of_inferiors () > 1)
> > +             /* LOC is for existing B, it cannot be in
> > +                moribund_locations and thus having NULL OWNER.  */
> > +             && loc->owner->type != bp_catchpoint))
> > +        mi_only = 0;
> > +      output_thread_groups (uiout, "thread-groups", inf_num,
> > mi_only);
> > +      VEC_free (int, inf_num);
> >      }
> >
> >    if (!part_of_multiple)
> > @@ -7902,8 +7942,6 @@
> >    catch_load_or_unload (arg, from_tty, 0, command);
> >  }
> >
> > -DEF_VEC_I(int);
> > -
> >  /* An instance of this type is used to represent a syscall
> > catchpoint.
> >     It includes a "struct breakpoint" as a kind of base class; users
> >     downcast to "struct breakpoint *" when needed.  A breakpoint is
> > Index: gdb/doc/gdb.texinfo
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
> > retrieving revision 1.1012
> > diff -u -r1.1012 gdb.texinfo
> > --- gdb/doc/gdb.texinfo 21 Sep 2012 01:46:42 -0000      1.1012
> > +++ gdb/doc/gdb.texinfo 1 Oct 2012 16:04:18 -0000
> > @@ -27763,7 +27763,8 @@
> >  -> -break-insert main
> >  <- ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
> >      enabled="y",addr="0x08048564",func="main",file="myprog.c",
> > -    fullname="/home/nickrob/myprog.c",line="68",times="0"@}
> > +
> fullname="/home/nickrob/myprog.c",line="68",thread-groups=["i1"],
> > +    times="0"@}
> >  <- (gdb)
> >  @end smallexample
> >
> > @@ -27887,7 +27888,8 @@
> >  -break-insert main
> >  ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
> >  enabled="y",addr="0x000100d0",func="main",file="hello.c",
> > -fullname="/home/foo/hello.c",line="5",times="0"@}
> > +fullname="/home/foo/hello.c",line="5",thread-groups=["i1"]
> > +,times="0"@}
> >  (gdb)
> >  -break-after 1 3
> >  ~
> > @@ -27903,7 +27905,7 @@
> >  @{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",fullname="/home/f
> > oo/hello.c",
> > -line="5",times="0",ignore="3"@}]@}
> > +line="5",thread-groups=["i1"],times="0",ignore="3"@}]@}
> >  (gdb)
> >  @end smallexample
> >
> > @@ -27939,7 +27941,8 @@
> >  -break-insert main
> >  ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
> >  enabled="y",addr="0x000100d0",func="main",file="hello.c",
> > -fullname="/home/foo/hello.c",line="5",times="0"@}
> > +fullname="/home/foo/hello.c",line="5",thread-groups=["i1"],
> > +times="0"@}
> >  (gdb)
> >  -break-commands 1 "print v" "continue"
> >  ^done
> > @@ -27981,7 +27984,7 @@
> >  @{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",fullname="/home/f
> > oo/hello.c",
> > -line="5",cond="1",times="0",ignore="3"@}]@}
> > +line="5",cond="1",thread-groups=["i1"],times="0",ignore="3"@}]@}
> >  (gdb)
> >  @end smallexample
> >
> > @@ -28053,7 +28056,7 @@
> >  @{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",fullname="/home/f
> > oo/hello.c",
> > -line="5",times="0"@}]@}
> > +line="5",thread-groups=["i1"],times="0"@}]@}
> >  (gdb)
> >  @end smallexample
> >
> > @@ -28089,7 +28092,7 @@
> >  @{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",fullname="/home/f
> > oo/hello.c",
> > -line="5",times="0"@}]@}
> > +line="5",thread-groups=["i1"],times="0"@}]@}
> >  (gdb)
> >  @end smallexample
> >
> > @@ -28170,14 +28173,15 @@
> >
> > ^done,bkpt=@{number="@var{number}",type="@var{type}",disp="del
> > "|"keep",
> >
> > enabled="y"|"n",addr="@var{hex}",func="@var{funcname}",file="@
> > var{filename}",
> >
> > fullname="@var{full_filename}",line="@var{lineno}",[thread="@v
> > ar{threadno},]
> > -times="@var{times}"@}
> > +thread-groups=["@var{group1}","@var{group2}"],times="@var{times}"@}
> >  @end smallexample
> >
> >  @noindent
> >  where @var{number} is the @value{GDBN} number for this breakpoint,
> >  @var{funcname} is the name of the function where the breakpoint was
> >  inserted, @var{filename} is the name of the source file
> > which contains
> > -this function, @var{lineno} is the source line number within
> > that file
> > +this function, @var{lineno} is the source line number within
> > that file,
> > +@var{thread-groups} is the list of inferiors to which this
> > breakpoint applies,
> >  and @var{times} the number of times that the breakpoint
> has been hit
> >  (always 0 for -break-insert but may be greater for
> > -break-info or -break-list
> >  which use the same output).
> > @@ -28196,11 +28200,13 @@
> >  (gdb)
> >  -break-insert main
> >  ^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",
> > -fullname="/home/foo/recursive2.c,line="4",times="0"@}
> > +fullname="/home/foo/recursive2.c,line="4",thread-groups=["i1"],
> > +times="0"@}
> >  (gdb)
> >  -break-insert -t foo
> >  ^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",
> > -fullname="/home/foo/recursive2.c,line="11",times="0"@}
> > +fullname="/home/foo/recursive2.c,line="11",thread-groups=["i1"],
> > +times="0"@}
> >  (gdb)
> >  -break-list
> >  ^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
> > @@ -28212,15 +28218,18 @@
> >  @{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",
> > -fullname="/home/foo/recursive2.c,"line="4",times="0"@},
> > +fullname="/home/foo/recursive2.c,"line="4",thread-groups=["i1"],
> > +times="0"@},
> >  bkpt=@{number="2",type="breakpoint",disp="del",enabled="y",
> >  addr="0x00010774",func="foo",file="recursive2.c",
> > -fullname="/home/foo/recursive2.c",line="11",times="0"@}]@}
> > +fullname="/home/foo/recursive2.c",line="11",thread-groups=["i1"],
> > +times="0"@}]@}
> >  (gdb)
> >  @c -break-insert -r foo.*
> >  @c ~int foo(int, int);
> >  @c ^done,bkpt=@{number="3",addr="0x00010774",file="recursive2.c,
> > -@c "fullname="/home/foo/recursive2.c",line="11",times="0"@}
> > +@c
> "fullname="/home/foo/recursive2.c",line="11",thread-groups=["i1"],
> > +@c times="0"@}
> >  @c (gdb)
> >  @end smallexample
> >
> > @@ -28250,6 +28259,8 @@
> >  @item What
> >  logical location of the breakpoint, expressed by function
> name, file
> >  name, line number
> > +@item Thread-groups
> > +list of inferiors to which this breakpoint applies
> >  @item Times
> >  number of times the breakpoint has been hit
> >  @end table
> > @@ -28277,7 +28288,7 @@
> >  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",fullname="/home/fo
> > o/hello.c",
> > -line="13",times="0"@}]@}
> > +line="13",thread-groups=["i1"],times="0"@}]@}
> >  (gdb)
> >  @end smallexample
> >
> > Index: gdb/testsuite/gdb.mi/mi-break.exp
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-break.exp,v
> > retrieving revision 1.36
> > diff -u -r1.36 mi-break.exp
> > --- gdb/testsuite/gdb.mi/mi-break.exp   10 Jul 2012 15:32:51
> > -0000      1.36
> > +++ gdb/testsuite/gdb.mi/mi-break.exp   1 Oct 2012 16:04:18 -0000
> > @@ -93,7 +93,7 @@
> >               "insert temp breakpoint at
> > \"<fullfilename>\":\$line_callee4_head"
> >
> >      mi_gdb_test "666-break-list" \
> > -
> > "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
> =\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhd
> r=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> > olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
> r=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=>
> \"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"
> $line_main_body\",times=\"0\",original-location=\".*\"\}.*> \\\]\}" \
> > +
> > "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
> =\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhd
> r=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> > olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
> r=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=>
> \"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"
> $line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0>
> \",original-location=\".*\"\}.*\\\]\}" \
> >                  "list of breakpoints"
> >
> >      mi_gdb_test "777-break-delete" \
> > @@ -142,7 +142,7 @@
> >
> >      setup_kfail "*-*-*" mi/14270
> >      mi_gdb_test "166-break-list" \
> > -
> > "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\
> \\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=
> > \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
> r=> \"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$
> > hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body
> > \",times=\"0\"\},.*\}\\\]\}" \
> > +
> > "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\
> \\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=
> > \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
> r=> \"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$
> > hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body
> > \",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
> >                  "list of breakpoints"
> >
> >      mi_gdb_test "177-break-delete" \
> > @@ -190,7 +190,7 @@
> >      global line_callee2_body
> >
> >      mi_gdb_test "-break-insert -d basics.c:callee2" \
> > -
> > "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\"
> ,enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.
> c> \",fullname=\".*\",line=\"$line_callee2_body\",times=\"0\",ori
> ginal-location=\".*\"\}" \
> > +
> > "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\"
> ,enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.
> c> \",fullname=\".*\",line=\"$line_callee2_body\",thread-groups=\
> \\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \
> >          "test disabled creation"
> >
> >      mi_gdb_test "-break-delete" \
> > @@ -211,7 +211,7 @@
> >          "breakpoint commands: set commands"
> >
> >      mi_gdb_test "-break-info 7" \
> > -
> > "\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\
> [\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=>
> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
> r=> \"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$
> > hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"
> $line_callee2_body\",times=\"0\",script=\{\"print 10\",>
> \"continue\"\},original-location=\".*\"\}.*\\\]\}" \
> > +
> > "\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\
> [\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=>
> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
> r=> \"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$
> > hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"
> $line_callee2_body\",thread-groups=\\\[\"i1\"\\\],times=\"0>
> \",script=\{\"print
> > 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \
> >          "breakpoint commands: check that commands are set"
> >
> >      mi_gdb_test "-break-commands 7" \
> > Index: gdb/testsuite/gdb.mi/mi-nsmoribund.exp
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-nsmoribund.exp,v
> > retrieving revision 1.17
> > diff -u -r1.17 mi-nsmoribund.exp
> > --- gdb/testsuite/gdb.mi/mi-nsmoribund.exp      10 Jul 2012
> > 15:32:51 -0000      1.17
> > +++ gdb/testsuite/gdb.mi/mi-nsmoribund.exp      1 Oct 2012
> > 16:04:18 -0000
> > @@ -79,8 +79,11 @@
> >  mi_delete_breakpoints
> >
> >  # Recreate the same breakpoint, but this time, specific to
> thread 5.
> > -mi_create_breakpoint "-p 5 $srcfile:$bkpt_line" 3 keep
> > thread_function .* .* .* \
> > -    "thread specific breakpoint at thread_function"
> > +mi_gdb_test "234-break-insert -p 5 $srcfile:$bkpt_line" \
> > +
> > "234\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"kee
> p\",enabled=\"y\",addr=\".*\",\
> > +
> > func=\"thread_function\",file=\".*\",fullname=\".*\",line=\".*
> > \",thread-groups=\\\[\".*\"\\\],\
> > +
> > thread=\"5\",thread=\"5\",times=\"0\",original-location=\".*\"\}" \
> > +    "thread specific breakpoint at thread_function"
> >
> >  # Resume all threads.  Only thread 5 should report a stop.
> >
> > Index: gdb/testsuite/gdb.mi/mi-simplerun.exp
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-simplerun.exp,v
> > retrieving revision 1.29
> > diff -u -r1.29 mi-simplerun.exp
> > --- gdb/testsuite/gdb.mi/mi-simplerun.exp       10 Jul 2012
> > 15:32:51 -0000      1.29
> > +++ gdb/testsuite/gdb.mi/mi-simplerun.exp       1 Oct 2012
> > 16:04:18 -0000
> > @@ -79,7 +79,7 @@
> >               "insert breakpoint at
> > \"<fullfilename>\":\$line_callee4_head"
> >
> >      mi_gdb_test "204-break-list" \
> > -
> > "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> > \{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
> ,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=>
> \"$line_main_body\",times=\"0\",original-location=\".*\"\},.*\
> }\\\]\}" \
> > +
> > "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> > \{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
> ,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=>
> \"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",o
> riginal-location=\".*\"\},.*\}\\\]\}" \
> >                  "list of breakpoints"
> >
> >      mi_gdb_test "205-break-disable 2 3 4" \
> > Index: gdb/testsuite/gdb.mi/mi-watch.exp
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-watch.exp,v
> > retrieving revision 1.32
> > diff -u -r1.32 mi-watch.exp
> > --- gdb/testsuite/gdb.mi/mi-watch.exp   10 Jul 2012 15:32:52
> > -0000      1.32
> > +++ gdb/testsuite/gdb.mi/mi-watch.exp   1 Oct 2012 16:04:18 -0000
> > @@ -58,7 +58,7 @@
> >               "break-watch operation"
> >
> >      mi_gdb_test "222-break-list" \
> > -
> > "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
> =\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhd
> r=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> > olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
> r=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what
> => \"C\",times=\"0\",original-location=\"C\"\}\\\]\}" \
> > +
> > "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
> =\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhd
> r=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> > olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
> r=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what
> => \"C\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-locati
> on=\"C\"\}\\\]\}" \
> >                  "list of watchpoints"
> >
> >  }
> > @@ -82,7 +82,7 @@
> >               "break-watch -a operation"
> >
> >      mi_gdb_test "444-break-list" \
> > -
> > "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> > \{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",
> addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=>
> \"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
> > +
> > "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> > \{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",
> addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=>
> \"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}
> > ,.*\}\\\]\}" \
> >                  "list of watchpoints awatch"
> >
> >      mi_gdb_test "777-break-delete 3" \
> > @@ -109,7 +109,7 @@
> >               "break-insert -r operation"
> >
> >      mi_gdb_test "300-break-list" \
> > -
> > "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> > \{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
> ,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=>
> \"$line_main_body\",times=\"0\"\},.*\}\\\}\}" \
> > +
> > "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> > \{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
> ,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=>
> \"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}
> > ,.*\}\\\}\}" \
> >                  "list of breakpoints"
> >
> >      mi_gdb_test "177-break-delete 4" \
> > Index: gdb/testsuite/gdb.mi/mi2-break.exp
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-break.exp,v
> > retrieving revision 1.18
> > diff -u -r1.18 mi2-break.exp
> > --- gdb/testsuite/gdb.mi/mi2-break.exp  10 Jul 2012 15:32:52
> > -0000      1.18
> > +++ gdb/testsuite/gdb.mi/mi2-break.exp  1 Oct 2012 16:04:18 -0000
> > @@ -92,7 +92,7 @@
> >               "insert temp breakpoint at
> > \"<fullfilename>\":\$line_callee4_head"
> >
> >      mi_gdb_test "666-break-list" \
> > -
> > "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
> =\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhd
> r=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> > olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
> r=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=>
> \"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"
> $line_main_body\",times=\"0\",original-location=\".*\"\}.*> \\\]\}" \
> > +
> > "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
> =\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhd
> r=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> > olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
> r=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=>
> \"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"
> $line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0>
> \",original-location=\".*\"\}.*\\\]\}" \
> >                  "list of breakpoints"
> >
> >      mi_gdb_test "777-break-delete" \
> > @@ -142,7 +142,7 @@
> >
> >      setup_xfail "*-*-*"
> >      mi_gdb_test "166-break-list" \
> > -
> > "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\
> \\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=
> > \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
> r=> \"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$
> > hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$li
> ne_main_body\",times=\"0\"\},.*\}\\\]\}" \
> > +
> > "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\
> \\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=
> > \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
> r=> \"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$
> > hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$li
> ne_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*>
> \}\\\]\}" \
> >                  "list of breakpoints"
> >
> >      mi_gdb_test "177-break-delete" \
> > Index: gdb/testsuite/gdb.mi/mi2-simplerun.exp
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-simplerun.exp,v
> > retrieving revision 1.20
> > diff -u -r1.20 mi2-simplerun.exp
> > --- gdb/testsuite/gdb.mi/mi2-simplerun.exp      10 Jul 2012
> > 15:32:52 -0000      1.20
> > +++ gdb/testsuite/gdb.mi/mi2-simplerun.exp      1 Oct 2012
> > 16:04:18 -0000
> > @@ -79,7 +79,7 @@
> >               "insert breakpoint at
> > \"<fullfilename>\":\$line_callee4_head"
> >
> >      mi_gdb_test "204-break-list" \
> > -
> > "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> > \{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
> ,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=>
> \"$line_main_body\",times=\"0\",original-location=\".*\"\},.*\
> }\\\]\}" \
> > +
> > "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> > \{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
> ,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=>
> \"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",o
> riginal-location=\".*\"\},.*\}\\\]\}" \
> >                  "list of breakpoints"
> >
> >      mi_gdb_test "205-break-disable 2 3 4" \
> > Index: gdb/testsuite/gdb.mi/mi2-watch.exp
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-watch.exp,v
> > retrieving revision 1.23
> > diff -u -r1.23 mi2-watch.exp
> > --- gdb/testsuite/gdb.mi/mi2-watch.exp  10 Jul 2012 15:32:52
> > -0000      1.23
> > +++ gdb/testsuite/gdb.mi/mi2-watch.exp  1 Oct 2012 16:04:18 -0000
> > @@ -57,7 +57,7 @@
> >               "break-watch operation"
> >
> >      mi_gdb_test "222-break-list" \
> > -
> > "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
> =\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhd
> r=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> > olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
> r=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what
> => \"C\",times=\"0\",original-location=\"C\"\}\\\]\}" \
> > +
> > "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr
> =\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhd
> r=> \"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*c
> > olhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{numbe
> r=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what
> => \"C\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-locati
> on=\"C\"\}\\\]\}" \
> >                  "list of watchpoints"
> >
> >  }
> > @@ -81,7 +81,7 @@
> >               "break-watch -a operation"
> >
> >      mi_gdb_test "444-break-list" \
> > -
> > "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> > \{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",
> addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=>
> \"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
> > +
> > "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> > \{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",
> addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=>
> \"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}
> > ,.*\}\\\]\}" \
> >                  "list of watchpoints awatch"
> >
> >      mi_gdb_test "777-break-delete 3" \
> > @@ -108,7 +108,7 @@
> >               "break-insert -r operation"
> >
> >      mi_gdb_test "300-break-list" \
> > -
> > "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> > \{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
> ,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=>
> \"$line_main_body\",times=\"0\"\},.*\}\\\}\}" \
> > +
> > "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=
> > \{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\"
> ,addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=>
> \"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}
> > ,.*\}\\\}\}" \
> >                  "list of breakpoints"
> >
> >      mi_gdb_test "177-break-delete 4" \
> > Index: gdb/testsuite/lib/mi-support.exp
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
> > retrieving revision 1.112
> > diff -u -r1.112 mi-support.exp
> > --- gdb/testsuite/lib/mi-support.exp    25 Jul 2012 20:19:56
> > -0000      1.112
> > +++ gdb/testsuite/lib/mi-support.exp    1 Oct 2012 16:04:18 -0000
> > @@ -923,7 +923,7 @@
> >
> >    set test "mi runto $func"
> >    mi_gdb_test "200-break-insert -t $func" \
> > -
> > "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",dis
> p=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*>
> \\\)\)?\",file=\".*\",line=\"\[0-9\]*\",times=\"0\",original-l
> ocation=\".*\"\}" \
> > +
> > "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",dis
> p=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*>
> \\\)\)?\",file=\".*\",line=\"\[0-9\]*\",thread-groups=\\\[\"i1
> > \"\\\],times=\"0\",original-location=\".*\"\}" \
> >      "breakpoint at $func"
> >
> >    if {![regexp {number="[0-9]+"} $expect_out(buffer) str]
> > @@ -1205,9 +1205,9 @@
> >
> >  # Creates a breakpoint and checks the reported fields are
> as expected
> >  proc mi_create_breakpoint { location number disp func file
> > line address test } {
> > -    verbose -log "Expecting:
> > 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=
> > \"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=
> > \"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-
> > location=\".*\"\}"
> > +    verbose -log "Expecting:
> > 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=
> > \"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=
> > \"$file\",fullname=\".*\",line=\"$line\",thread-groups=\\\[\".
> > *\"\\\],times=\"0\",original-location=\".*\"\}"
> >      mi_gdb_test "222-break-insert $location" \
> > -
> > "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp
> =\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file
> => \"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-
> > location=\".*\"\}" \
> > +
> > "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp
> =\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file
> => \"$file\",fullname=\".*\",line=\"$line\",thread-groups=\\\[\".
> > *\"\\\],times=\"0\",original-location=\".*\"\}" \
> >          $test
> >  }
> >
> > @@ -1228,7 +1228,7 @@
> >          set file [lindex $item 3]
> >          set line [lindex $item 4]
> >          set address [lindex $item 5]
> > -        set body
> > "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$
> disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\".
> *> $file\",${fullname},line=\"$line\",times=\"0\",original-locati
> on=\".*\"\}"
> > +        set body
> > "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$
> disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\".
> *> $file\",${fullname},line=\"$line\",thread-groups=\\\[\"i1\"\\\
> ],times=\"0\",original-location=\".*\"\}"
> >          set first 0
> >      }
> >
>


^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [MI][patch v2] -break-list to specify "thread-group"
  2012-10-24 18:43               ` Marc Khouzam
@ 2012-11-27 19:56                 ` Marc Khouzam
  2012-11-28  6:07                   ` Abid, Hafiz
  0 siblings, 1 reply; 23+ messages in thread
From: Marc Khouzam @ 2012-11-27 19:56 UTC (permalink / raw)
  To: 'gdb-patches@sourceware.org', 'Tom Tromey'
  Cc: 'Yao Qi'


> -----Original Message-----
> From: gdb-patches-owner@sourceware.org 
> [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Marc Khouzam
> Sent: Wednesday, October 24, 2012 2:43 PM
> To: 'Tom Tromey'; 'gdb-patches@sourceware.org'
> Cc: 'Yao Qi'
> Subject: RE: [MI][patch v2] -break-list to specify "thread-group"
> 
> Polite re-ping :)
> (http://sourceware.org/ml/gdb-patches/2012-10/msg00006.html)
> 
> Turns out Eclipse is also missing the extra information this patch
> is adding in the case of processing =breakpoint-create MI
> notifications because it cannot tell what inferior the breakpoint
> was created for.

Hi,

I've updated the proposed patch to current head.
It is a little smaller since there is no more mi2-*.exp tests.

As a reminder, this patch add a "thread-groups" field to the 
different breakpoint MI printouts.  This information is important 
for a  frontend but is currently only available through CLI.

Doc was already approved here:
http://sourceware.org/ml/gdb-patches/2012-10/msg00007.html

No regressions

Thanks

Marc

2012-11-27  Marc Khouzam  <marc.khouzam@ericsson.com>

        * breakpoint.c (print_one_breakpoint_location): Add MI
        field 'thread-groups' when printing a breakpoint.
        (output_thread_groups): New function.

2012-11-27  Marc Khouzam  <marc.khouzam@ericsson.com>

        * gdb.texinfo (GDB/MI Breakpoint Commands): Document new
        `thread-group' field when printing a breakpoint in MI.

2012-11-27  Marc Khouzam  <marc.khouzam@ericsson.com>

        * gdb.mi/mi-break.exp: Expect new 'thread-groups' field.
        * gdb.mi/mi-nsmoribund.exp: Expect new 'thread-groups' field.
        Also handle 'thread' field.
        * gdb.mi/mi-simplerun.exp: Expect new 'thread-groups' field.
        * gdb.mi/mi-watch.exp: Ditto.
        * lib/mi-support.exp: Ditto.

### Eclipse Workspace Patch 1.0
#P src
Index: gdb/breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.719
diff -u -r1.719 breakpoint.c
--- gdb/breakpoint.c    20 Nov 2012 22:51:04 -0000      1.719
+++ gdb/breakpoint.c    27 Nov 2012 19:06:38 -0000
@@ -5781,6 +5781,51 @@
   return bptypes[(int) type].description;
 }
 
+DEF_VEC_I(int);
+
+/* For MI, output a field named 'thread-groups' with a list as the value.
+   For CLI, prefix the list with the string 'inf'. */
+
+static void
+output_thread_groups (struct ui_out *uiout,
+                     const char *field_name,
+                     VEC(int) *inf_num,
+                     int mi_only)
+{
+  struct cleanup *back_to = make_cleanup_ui_out_list_begin_end (uiout,
+                                                               field_name);
+  int is_mi = ui_out_is_mi_like_p (uiout);
+  int inf;
+  int i;
+
+  /* For backward compatibility, don't display inferiors in CLI unless
+     there are several.  Always display them for MI. */
+  if (!is_mi && mi_only)
+    return;
+
+  for (i = 0; VEC_iterate (int, inf_num, i, inf); ++i)
+    {
+      if (is_mi)
+       {
+         char mi_group[10];
+
+         sprintf (mi_group, "i%d", inf);
+         ui_out_field_string (uiout, NULL, mi_group);
+       }
+      else
+       {
+         if (i == 0)
+           ui_out_text (uiout, " inf ");
+         else
+           ui_out_text (uiout, ", ");
+
+         ui_out_text (uiout, plongest (inf));
+       }
+    }
+
+  do_cleanups (back_to);
+}
+
 /* Print B to gdb_stdout.  */
 
 static void
@@ -5932,35 +5977,30 @@
       }
 
 
-  /* For backward compatibility, don't display inferiors unless there
-     are several.  */
-  if (loc != NULL
-      && !header_of_multiple
-      && (allflag
-         || (!gdbarch_has_global_breakpoints (target_gdbarch ())
-             && (number_of_program_spaces () > 1
-                 || number_of_inferiors () > 1)
-             /* LOC is for existing B, it cannot be in
-                moribund_locations and thus having NULL OWNER.  */
-             && loc->owner->type != bp_catchpoint)))
+  if (loc != NULL && !header_of_multiple)
     {
       struct inferior *inf;
-      int first = 1;
+      VEC(int) *inf_num = NULL;
+      int mi_only = 1;
 
-      for (inf = inferior_list; inf != NULL; inf = inf->next)
+      ALL_INFERIORS (inf)
        {
          if (inf->pspace == loc->pspace)
-           {
-             if (first)
-               {
-                 first = 0;
-                 ui_out_text (uiout, " inf ");
-               }
-             else
-               ui_out_text (uiout, ", ");
-             ui_out_text (uiout, plongest (inf->num));
-           }
+           VEC_safe_push (int, inf_num, inf->num);
        }
+
+        /* For backward compatibility, don't display inferiors in CLI unless
+          there are several.  Always display for MI. */
+       if (allflag
+           || (!gdbarch_has_global_breakpoints (target_gdbarch ())
+               && (number_of_program_spaces () > 1
+                   || number_of_inferiors () > 1)
+               /* LOC is for existing B, it cannot be in
+                  moribund_locations and thus having NULL OWNER.  */
+               && loc->owner->type != bp_catchpoint))
+       mi_only = 0;
+      output_thread_groups (uiout, "thread-groups", inf_num, mi_only);
+      VEC_free (int, inf_num);
     }
 
   if (!part_of_multiple)
@@ -7905,8 +7945,6 @@
   catch_load_or_unload (arg, from_tty, 0, command);
 }
 
-DEF_VEC_I(int);
-
 /* An instance of this type is used to represent a syscall catchpoint.
    It includes a "struct breakpoint" as a kind of base class; users
    downcast to "struct breakpoint *" when needed.  A breakpoint is
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.1026
diff -u -r1.1026 gdb.texinfo
--- gdb/doc/gdb.texinfo 16 Nov 2012 19:43:39 -0000      1.1026
+++ gdb/doc/gdb.texinfo 27 Nov 2012 19:06:39 -0000
@@ -27969,7 +27969,8 @@
 -> -break-insert main
 <- ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
     enabled="y",addr="0x08048564",func="main",file="myprog.c",
-    fullname="/home/nickrob/myprog.c",line="68",times="0"@}
+    fullname="/home/nickrob/myprog.c",line="68",thread-groups=["i1"],
+    times="0"@}
 <- (gdb)
 @end smallexample
 
@@ -28093,7 +28094,8 @@
 -break-insert main
 ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
 enabled="y",addr="0x000100d0",func="main",file="hello.c",
-fullname="/home/foo/hello.c",line="5",times="0"@}
+fullname="/home/foo/hello.c",line="5",thread-groups=["i1"]
+,times="0"@}
 (gdb)
 -break-after 1 3
 ~
@@ -28109,7 +28111,7 @@
 @{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",fullname="/home/foo/hello.c",
-line="5",times="0",ignore="3"@}]@}
+line="5",thread-groups=["i1"],times="0",ignore="3"@}]@}
 (gdb)
 @end smallexample
 
@@ -28145,7 +28147,8 @@
 -break-insert main
 ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
 enabled="y",addr="0x000100d0",func="main",file="hello.c",
-fullname="/home/foo/hello.c",line="5",times="0"@}
+fullname="/home/foo/hello.c",line="5",thread-groups=["i1"],
+times="0"@}
 (gdb)
 -break-commands 1 "print v" "continue"
 ^done
@@ -28187,7 +28190,7 @@
 @{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",fullname="/home/foo/hello.c",
-line="5",cond="1",times="0",ignore="3"@}]@}
+line="5",cond="1",thread-groups=["i1"],times="0",ignore="3"@}]@}
 (gdb)
 @end smallexample
 
@@ -28259,7 +28262,7 @@
 @{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",fullname="/home/foo/hello.c",
-line="5",times="0"@}]@}
+line="5",thread-groups=["i1"],times="0"@}]@}
 (gdb)
 @end smallexample
 
@@ -28295,7 +28298,7 @@
 @{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",fullname="/home/foo/hello.c",
-line="5",times="0"@}]@}
+line="5",thread-groups=["i1"],times="0"@}]@}
 (gdb)
 @end smallexample
 
@@ -28376,14 +28379,15 @@
 ^done,bkpt=@{number="@var{number}",type="@var{type}",disp="del"|"keep",
 enabled="y"|"n",addr="@var{hex}",func="@var{funcname}",file="@var{filename}",
 fullname="@var{full_filename}",line="@var{lineno}",[thread="@var{threadno},]
-times="@var{times}"@}
+thread-groups=["@var{group1}","@var{group2}"],times="@var{times}"@}
 @end smallexample
 
 @noindent
 where @var{number} is the @value{GDBN} number for this breakpoint,
 @var{funcname} is the name of the function where the breakpoint was
 inserted, @var{filename} is the name of the source file which contains
-this function, @var{lineno} is the source line number within that file
+this function, @var{lineno} is the source line number within that file,
+@var{thread-groups} is the list of inferiors to which this breakpoint applies,
 and @var{times} the number of times that the breakpoint has been hit
 (always 0 for -break-insert but may be greater for -break-info or -break-list
 which use the same output).
@@ -28402,11 +28406,13 @@
 (gdb)
 -break-insert main
 ^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",
-fullname="/home/foo/recursive2.c,line="4",times="0"@}
+fullname="/home/foo/recursive2.c,line="4",thread-groups=["i1"],
+times="0"@}
 (gdb)
 -break-insert -t foo
 ^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",
-fullname="/home/foo/recursive2.c,line="11",times="0"@}
+fullname="/home/foo/recursive2.c,line="11",thread-groups=["i1"],
+times="0"@}
 (gdb)
 -break-list
 ^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
@@ -28418,15 +28424,18 @@
 @{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",
-fullname="/home/foo/recursive2.c,"line="4",times="0"@},
+fullname="/home/foo/recursive2.c,"line="4",thread-groups=["i1"],
+times="0"@},
 bkpt=@{number="2",type="breakpoint",disp="del",enabled="y",
 addr="0x00010774",func="foo",file="recursive2.c",
-fullname="/home/foo/recursive2.c",line="11",times="0"@}]@}
+fullname="/home/foo/recursive2.c",line="11",thread-groups=["i1"],
+times="0"@}]@}
 (gdb)
 @c -break-insert -r foo.*
 @c ~int foo(int, int);
 @c ^done,bkpt=@{number="3",addr="0x00010774",file="recursive2.c,
-@c "fullname="/home/foo/recursive2.c",line="11",times="0"@}
+@c "fullname="/home/foo/recursive2.c",line="11",thread-groups=["i1"],
+@c times="0"@}
 @c (gdb)
 @end smallexample
 
@@ -28456,6 +28465,8 @@
 @item What
 logical location of the breakpoint, expressed by function name, file
 name, line number
+@item Thread-groups
+list of inferiors to which this breakpoint applies
 @item Times
 number of times the breakpoint has been hit
 @end table
@@ -28483,7 +28494,7 @@
 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",fullname="/home/foo/hello.c",
-line="13",times="0"@}]@}
+line="13",thread-groups=["i1"],times="0"@}]@}
 (gdb)
 @end smallexample
 
Index: gdb/testsuite/gdb.mi/mi-break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-break.exp,v
retrieving revision 1.37
diff -u -r1.37 mi-break.exp
--- gdb/testsuite/gdb.mi/mi-break.exp   9 Nov 2012 07:21:03 -0000       1.37
+++ gdb/testsuite/gdb.mi/mi-break.exp   27 Nov 2012 19:06:39 -0000
@@ -93,7 +93,7 @@
              "insert temp breakpoint at \"<fullfilename>\":\$line_callee4_head"
 
     mi_gdb_test "666-break-list" \
-           "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",times=\"0\",original-location=\".*\"\}.*\\\]\}" \
+           "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}.*\\\]\}" \
                 "list of breakpoints"
 
     mi_gdb_test "777-break-delete" \
@@ -142,7 +142,7 @@
 
     setup_kfail "*-*-*" mi/14270
     mi_gdb_test "166-break-list" \
-           "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
+           "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
                 "list of breakpoints"
 
     mi_gdb_test "177-break-delete" \
@@ -208,7 +208,7 @@
     global line_callee2_body
 
     mi_gdb_test "-break-insert -d basics.c:callee2" \
-        "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\",enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",fullname=\".*\",line=\"$line_callee2_body\",times=\"0\",original-location=\".*\"\}" \
+        "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\",enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",fullname=\".*\",line=\"$line_callee2_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \
         "test disabled creation"
 
     mi_gdb_test "-break-delete" \
@@ -229,7 +229,7 @@
         "breakpoint commands: set commands"
 
     mi_gdb_test "-break-info 7" \
-       "\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"$line_callee2_body\",times=\"0\",script=\{\"print 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \
+       "\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"$line_callee2_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",script=\{\"print 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \
         "breakpoint commands: check that commands are set"
 
     mi_gdb_test "-break-commands 7" \
Index: gdb/testsuite/gdb.mi/mi-nsmoribund.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-nsmoribund.exp,v
retrieving revision 1.17
diff -u -r1.17 mi-nsmoribund.exp
--- gdb/testsuite/gdb.mi/mi-nsmoribund.exp      10 Jul 2012 15:32:51 -0000      1.17
+++ gdb/testsuite/gdb.mi/mi-nsmoribund.exp      27 Nov 2012 19:06:39 -0000
@@ -79,8 +79,11 @@
 mi_delete_breakpoints
 
 # Recreate the same breakpoint, but this time, specific to thread 5.
-mi_create_breakpoint "-p 5 $srcfile:$bkpt_line" 3 keep thread_function .* .* .* \
-    "thread specific breakpoint at thread_function"
+mi_gdb_test "234-break-insert -p 5 $srcfile:$bkpt_line" \
+    "234\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\".*\",\
+    func=\"thread_function\",file=\".*\",fullname=\".*\",line=\".*\",thread-groups=\\\[\".*\"\\\],\
+    thread=\"5\",thread=\"5\",times=\"0\",original-location=\".*\"\}" \
+    "thread specific breakpoint at thread_function" 
 
 # Resume all threads.  Only thread 5 should report a stop.
 
Index: gdb/testsuite/gdb.mi/mi-simplerun.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-simplerun.exp,v
retrieving revision 1.29
diff -u -r1.29 mi-simplerun.exp
--- gdb/testsuite/gdb.mi/mi-simplerun.exp       10 Jul 2012 15:32:51 -0000      1.29
+++ gdb/testsuite/gdb.mi/mi-simplerun.exp       27 Nov 2012 19:06:39 -0000
@@ -79,7 +79,7 @@
              "insert breakpoint at \"<fullfilename>\":\$line_callee4_head"
 
     mi_gdb_test "204-break-list" \
-           "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
+           "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
                 "list of breakpoints"
 
     mi_gdb_test "205-break-disable 2 3 4" \
Index: gdb/testsuite/gdb.mi/mi-watch.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-watch.exp,v
retrieving revision 1.33
diff -u -r1.33 mi-watch.exp
--- gdb/testsuite/gdb.mi/mi-watch.exp   9 Nov 2012 02:30:49 -0000       1.33
+++ gdb/testsuite/gdb.mi/mi-watch.exp   27 Nov 2012 19:06:39 -0000
@@ -58,7 +58,7 @@
              "break-watch operation"
 
     mi_gdb_test "222-break-list" \
-           "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",times=\"0\",original-location=\"C\"\}\\\]\}" \
+           "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\"C\"\}\\\]\}" \
                 "list of watchpoints"
 
 }
@@ -82,7 +82,7 @@
              "break-watch -a operation"
 
     mi_gdb_test "444-break-list" \
-           "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
+           "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
                 "list of watchpoints awatch"
 
     mi_gdb_test "777-break-delete 3" \
@@ -109,7 +109,7 @@
              "break-watch -r operation"
 
     mi_gdb_test "300-break-list" \
-           "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\}\}" \
+           "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\}\}" \
                 "list of breakpoints"
 
     mi_gdb_test "177-break-delete 4" \
Index: gdb/testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.112
diff -u -r1.112 mi-support.exp
--- gdb/testsuite/lib/mi-support.exp    25 Jul 2012 20:19:56 -0000      1.112
+++ gdb/testsuite/lib/mi-support.exp    27 Nov 2012 19:06:39 -0000
@@ -923,7 +923,7 @@
 
   set test "mi runto $func"
   mi_gdb_test "200-break-insert -t $func" \
-    "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",times=\"0\",original-location=\".*\"\}" \
+    "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \
     "breakpoint at $func"
 
   if {![regexp {number="[0-9]+"} $expect_out(buffer) str]
@@ -1205,9 +1205,9 @@
 
 # Creates a breakpoint and checks the reported fields are as expected
 proc mi_create_breakpoint { location number disp func file line address test } {
-    verbose -log "Expecting: 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-location=\".*\"\}"
+    verbose -log "Expecting: 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",thread-groups=\\\[\".*\"\\\],times=\"0\",original-location=\".*\"\}"
     mi_gdb_test "222-break-insert $location" \
-        "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-location=\".*\"\}" \
+        "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",thread-groups=\\\[\".*\"\\\],times=\"0\",original-location=\".*\"\}" \
         $test
 }
 
@@ -1228,7 +1228,7 @@
         set file [lindex $item 3]
         set line [lindex $item 4]
         set address [lindex $item 5]
-        set body "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\".*$file\",${fullname},line=\"$line\",times=\"0\",original-location=\".*\"\}"
+        set body "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\".*$file\",${fullname},line=\"$line\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}"
         set first 0
     }


^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [MI][patch v2] -break-list to specify "thread-group"
  2012-11-27 19:56                 ` Marc Khouzam
@ 2012-11-28  6:07                   ` Abid, Hafiz
  2012-11-30 18:35                     ` Tom Tromey
  0 siblings, 1 reply; 23+ messages in thread
From: Abid, Hafiz @ 2012-11-28  6:07 UTC (permalink / raw)
  To: Marc Khouzam, 'gdb-patches@sourceware.org', 'Tom Tromey'
  Cc: Qi, Yao


> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Marc Khouzam
> Sent: Tuesday, November 27, 2012 7:56 PM
> To: 'gdb-patches@sourceware.org'; 'Tom Tromey'
> Cc: Qi, Yao
> Subject: RE: [MI][patch v2] -break-list to specify "thread-group"
> 
> 
> > -----Original Message-----
> > From: gdb-patches-owner@sourceware.org
> > [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Marc Khouzam
> > Sent: Wednesday, October 24, 2012 2:43 PM
> > To: 'Tom Tromey'; 'gdb-patches@sourceware.org'
> > Cc: 'Yao Qi'
> > Subject: RE: [MI][patch v2] -break-list to specify "thread-group"
> >
> > Polite re-ping :)
> > (http://sourceware.org/ml/gdb-patches/2012-10/msg00006.html)
> >
> > Turns out Eclipse is also missing the extra information this patch
> > is adding in the case of processing =breakpoint-create MI
> > notifications because it cannot tell what inferior the breakpoint
> > was created for.
> 
> Hi,
> 
> I've updated the proposed patch to current head.
> It is a little smaller since there is no more mi2-*.exp tests.
> 
> As a reminder, this patch add a "thread-groups" field to the
> different breakpoint MI printouts.  This information is important
> for a  frontend but is currently only available through CLI.
> 
> Doc was already approved here:
> http://sourceware.org/ml/gdb-patches/2012-10/msg00007.html
> 
> No regressions
> 
> Thanks
> 
> Marc
> 
> 2012-11-27  Marc Khouzam  <marc.khouzam@ericsson.com>
> 
>         * breakpoint.c (print_one_breakpoint_location): Add MI
>         field 'thread-groups' when printing a breakpoint.
>         (output_thread_groups): New function.
> 
> 2012-11-27  Marc Khouzam  <marc.khouzam@ericsson.com>
> 
>         * gdb.texinfo (GDB/MI Breakpoint Commands): Document new
>         `thread-group' field when printing a breakpoint in MI.
> 
> 2012-11-27  Marc Khouzam  <marc.khouzam@ericsson.com>
> 
>         * gdb.mi/mi-break.exp: Expect new 'thread-groups' field.
>         * gdb.mi/mi-nsmoribund.exp: Expect new 'thread-groups' field.
>         Also handle 'thread' field.
>         * gdb.mi/mi-simplerun.exp: Expect new 'thread-groups' field.
>         * gdb.mi/mi-watch.exp: Ditto.
>         * lib/mi-support.exp: Ditto.
> 
> ### Eclipse Workspace Patch 1.0
> #P src
> Index: gdb/breakpoint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/breakpoint.c,v
> retrieving revision 1.719
> diff -u -r1.719 breakpoint.c
> --- gdb/breakpoint.c    20 Nov 2012 22:51:04 -0000      1.719
> +++ gdb/breakpoint.c    27 Nov 2012 19:06:38 -0000
> @@ -5781,6 +5781,51 @@
>    return bptypes[(int) type].description;
>  }
> 
> +DEF_VEC_I(int);
> +
> +/* For MI, output a field named 'thread-groups' with a list as the
> value.
> +   For CLI, prefix the list with the string 'inf'. */
> +
> +static void
> +output_thread_groups (struct ui_out *uiout,
> +                     const char *field_name,
> +                     VEC(int) *inf_num,
> +                     int mi_only)
> +{
> +  struct cleanup *back_to = make_cleanup_ui_out_list_begin_end (uiout,
> +
> field_name);
> +  int is_mi = ui_out_is_mi_like_p (uiout);
> +  int inf;
> +  int i;
> +
> +  /* For backward compatibility, don't display inferiors in CLI unless
> +     there are several.  Always display them for MI. */
> +  if (!is_mi && mi_only)
> +    return;
> +
> +  for (i = 0; VEC_iterate (int, inf_num, i, inf); ++i)
> +    {
> +      if (is_mi)
> +       {
> +         char mi_group[10];
> +
> +         sprintf (mi_group, "i%d", inf);
Please use xsnprintf instead.

> +         ui_out_field_string (uiout, NULL, mi_group);
> +       }
> +      else
> +       {
> +         if (i == 0)
> +           ui_out_text (uiout, " inf ");
> +         else
> +           ui_out_text (uiout, ", ");
> +
> +         ui_out_text (uiout, plongest (inf));
> +       }
> +    }
> +
> +  do_cleanups (back_to);
> +}
> +
>  /* Print B to gdb_stdout.  */
> 
>  static void
> @@ -5932,35 +5977,30 @@
>        }
> 
> 
> -  /* For backward compatibility, don't display inferiors unless there
> -     are several.  */
> -  if (loc != NULL
> -      && !header_of_multiple
> -      && (allflag
> -         || (!gdbarch_has_global_breakpoints (target_gdbarch ())
> -             && (number_of_program_spaces () > 1
> -                 || number_of_inferiors () > 1)
> -             /* LOC is for existing B, it cannot be in
> -                moribund_locations and thus having NULL OWNER.  */
> -             && loc->owner->type != bp_catchpoint)))
> +  if (loc != NULL && !header_of_multiple)
>      {
>        struct inferior *inf;
> -      int first = 1;
> +      VEC(int) *inf_num = NULL;
> +      int mi_only = 1;
> 
> -      for (inf = inferior_list; inf != NULL; inf = inf->next)
> +      ALL_INFERIORS (inf)
>         {
>           if (inf->pspace == loc->pspace)
> -           {
> -             if (first)
> -               {
> -                 first = 0;
> -                 ui_out_text (uiout, " inf ");
> -               }
> -             else
> -               ui_out_text (uiout, ", ");
> -             ui_out_text (uiout, plongest (inf->num));
> -           }
> +           VEC_safe_push (int, inf_num, inf->num);
>         }
> +
> +        /* For backward compatibility, don't display inferiors in CLI
> unless
> +          there are several.  Always display for MI. */
> +       if (allflag
> +           || (!gdbarch_has_global_breakpoints (target_gdbarch ())
> +               && (number_of_program_spaces () > 1
> +                   || number_of_inferiors () > 1)
> +               /* LOC is for existing B, it cannot be in
> +                  moribund_locations and thus having NULL OWNER.  */
> +               && loc->owner->type != bp_catchpoint))
> +       mi_only = 0;
> +      output_thread_groups (uiout, "thread-groups", inf_num, mi_only);
> +      VEC_free (int, inf_num);
>      }
> 
>    if (!part_of_multiple)
> @@ -7905,8 +7945,6 @@
>    catch_load_or_unload (arg, from_tty, 0, command);
>  }
> 
> -DEF_VEC_I(int);
> -
>  /* An instance of this type is used to represent a syscall catchpoint.
>     It includes a "struct breakpoint" as a kind of base class; users
>     downcast to "struct breakpoint *" when needed.  A breakpoint is
> Index: gdb/doc/gdb.texinfo
> ===================================================================
> RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
> retrieving revision 1.1026
> diff -u -r1.1026 gdb.texinfo
> --- gdb/doc/gdb.texinfo 16 Nov 2012 19:43:39 -0000      1.1026
> +++ gdb/doc/gdb.texinfo 27 Nov 2012 19:06:39 -0000
> @@ -27969,7 +27969,8 @@
>  -> -break-insert main
>  <- ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
>      enabled="y",addr="0x08048564",func="main",file="myprog.c",
> -    fullname="/home/nickrob/myprog.c",line="68",times="0"@}
> +    fullname="/home/nickrob/myprog.c",line="68",thread-groups=["i1"],
> +    times="0"@}
>  <- (gdb)
>  @end smallexample
> 
> @@ -28093,7 +28094,8 @@
>  -break-insert main
>  ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
>  enabled="y",addr="0x000100d0",func="main",file="hello.c",
> -fullname="/home/foo/hello.c",line="5",times="0"@}
> +fullname="/home/foo/hello.c",line="5",thread-groups=["i1"]
> +,times="0"@}
>  (gdb)
>  -break-after 1 3
>  ~
> @@ -28109,7 +28111,7 @@
>  @{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",fullname="/home/foo/hello.
> c",
> -line="5",times="0",ignore="3"@}]@}
> +line="5",thread-groups=["i1"],times="0",ignore="3"@}]@}
>  (gdb)
>  @end smallexample
> 
> @@ -28145,7 +28147,8 @@
>  -break-insert main
>  ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
>  enabled="y",addr="0x000100d0",func="main",file="hello.c",
> -fullname="/home/foo/hello.c",line="5",times="0"@}
> +fullname="/home/foo/hello.c",line="5",thread-groups=["i1"],
> +times="0"@}
>  (gdb)
>  -break-commands 1 "print v" "continue"
>  ^done
> @@ -28187,7 +28190,7 @@
>  @{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",fullname="/home/foo/hello.
> c",
> -line="5",cond="1",times="0",ignore="3"@}]@}
> +line="5",cond="1",thread-groups=["i1"],times="0",ignore="3"@}]@}
>  (gdb)
>  @end smallexample
> 
> @@ -28259,7 +28262,7 @@
>  @{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",fullname="/home/foo/hello.
> c",
> -line="5",times="0"@}]@}
> +line="5",thread-groups=["i1"],times="0"@}]@}
>  (gdb)
>  @end smallexample
> 
> @@ -28295,7 +28298,7 @@
>  @{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",fullname="/home/foo/hello.
> c",
> -line="5",times="0"@}]@}
> +line="5",thread-groups=["i1"],times="0"@}]@}
>  (gdb)
>  @end smallexample
> 
> @@ -28376,14 +28379,15 @@
> 
> ^done,bkpt=@{number="@var{number}",type="@var{type}",disp="del"|"keep",
> 
> enabled="y"|"n",addr="@var{hex}",func="@var{funcname}",file="@var{filen
> ame}",
> 
> fullname="@var{full_filename}",line="@var{lineno}",[thread="@var{thread
> no},]
> -times="@var{times}"@}
> +thread-groups=["@var{group1}","@var{group2}"],times="@var{times}"@}
>  @end smallexample
> 
>  @noindent
>  where @var{number} is the @value{GDBN} number for this breakpoint,
>  @var{funcname} is the name of the function where the breakpoint was
>  inserted, @var{filename} is the name of the source file which contains
> -this function, @var{lineno} is the source line number within that file
> +this function, @var{lineno} is the source line number within that
> file,
> +@var{thread-groups} is the list of inferiors to which this breakpoint
> applies,
>  and @var{times} the number of times that the breakpoint has been hit
>  (always 0 for -break-insert but may be greater for -break-info or -
> break-list
>  which use the same output).
> @@ -28402,11 +28406,13 @@
>  (gdb)
>  -break-insert main
>  ^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",
> -fullname="/home/foo/recursive2.c,line="4",times="0"@}
> +fullname="/home/foo/recursive2.c,line="4",thread-groups=["i1"],
> +times="0"@}
>  (gdb)
>  -break-insert -t foo
>  ^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",
> -fullname="/home/foo/recursive2.c,line="11",times="0"@}
> +fullname="/home/foo/recursive2.c,line="11",thread-groups=["i1"],
> +times="0"@}
>  (gdb)
>  -break-list
>  ^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
> @@ -28418,15 +28424,18 @@
>  @{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",
> -fullname="/home/foo/recursive2.c,"line="4",times="0"@},
> +fullname="/home/foo/recursive2.c,"line="4",thread-groups=["i1"],
> +times="0"@},
>  bkpt=@{number="2",type="breakpoint",disp="del",enabled="y",
>  addr="0x00010774",func="foo",file="recursive2.c",
> -fullname="/home/foo/recursive2.c",line="11",times="0"@}]@}
> +fullname="/home/foo/recursive2.c",line="11",thread-groups=["i1"],
> +times="0"@}]@}
>  (gdb)
>  @c -break-insert -r foo.*
>  @c ~int foo(int, int);
>  @c ^done,bkpt=@{number="3",addr="0x00010774",file="recursive2.c,
> -@c "fullname="/home/foo/recursive2.c",line="11",times="0"@}
> +@c "fullname="/home/foo/recursive2.c",line="11",thread-groups=["i1"],
> +@c times="0"@}
>  @c (gdb)
>  @end smallexample
> 
> @@ -28456,6 +28465,8 @@
>  @item What
>  logical location of the breakpoint, expressed by function name, file
>  name, line number
> +@item Thread-groups
> +list of inferiors to which this breakpoint applies
>  @item Times
>  number of times the breakpoint has been hit
>  @end table
> @@ -28483,7 +28494,7 @@
>  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",fullname="/home/foo/hello.c
> ",
> -line="13",times="0"@}]@}
> +line="13",thread-groups=["i1"],times="0"@}]@}
>  (gdb)
>  @end smallexample
> 
> Index: gdb/testsuite/gdb.mi/mi-break.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-break.exp,v
> retrieving revision 1.37
> diff -u -r1.37 mi-break.exp
> --- gdb/testsuite/gdb.mi/mi-break.exp   9 Nov 2012 07:21:03 -0000
> 1.37
> +++ gdb/testsuite/gdb.mi/mi-break.exp   27 Nov 2012 19:06:39 -0000
> @@ -93,7 +93,7 @@
>               "insert temp breakpoint at
> \"<fullfilename>\":\$line_callee4_head"
> 
>      mi_gdb_test "666-break-list" \
> -
> "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{wi
> dth=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhd
> r=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr
> =\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\
> "del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${
> fullname},line=\"$line_main_body\",times=\"0\",original-
> location=\".*\"\}.*\\\]\}" \
> +
> "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{wi
> dth=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhd
> r=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr
> =\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\
> "del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${
> fullname},line=\"$line_main_body\",thread-
> groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}.*\\\]\}" \
>                  "list of breakpoints"
> 
>      mi_gdb_test "777-break-delete" \
> @@ -142,7 +142,7 @@
> 
>      setup_kfail "*-*-*" mi/14270
>      mi_gdb_test "166-break-list" \
> -
> "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{widt
> h=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=
> \"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\
> "What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"k
> eep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",lin
> e=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
> +
> "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{widt
> h=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=
> \"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\
> "What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"k
> eep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",lin
> e=\"$line_main_body\",thread-
> groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
>                  "list of breakpoints"
> 
>      mi_gdb_test "177-break-delete" \
> @@ -208,7 +208,7 @@
>      global line_callee2_body
> 
>      mi_gdb_test "-break-insert -d basics.c:callee2" \
> -
> "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\",enabled=
> \"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",fullname=\".*\
> ",line=\"$line_callee2_body\",times=\"0\",original-location=\".*\"\}" \
> +
> "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\",enabled=
> \"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",fullname=\".*\
> ",line=\"$line_callee2_body\",thread-
> groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \
>          "test disabled creation"
> 
>      mi_gdb_test "-break-delete" \
> @@ -229,7 +229,7 @@
>          "breakpoint commands: set commands"
> 
>      mi_gdb_test "-break-info 7" \
> -
> "\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=
> \".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"
> Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"W
> hat\".*\\\],body=\\\[bkpt=\{number=\"7\",type=\"breakpoint\",disp=\"kee
> p\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${
> fullname},line=\"$line_callee2_body\",times=\"0\",script=\{\"print
> 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \
> +
> "\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=
> \".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"
> Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"W
> hat\".*\\\],body=\\\[bkpt=\{number=\"7\",type=\"breakpoint\",disp=\"kee
> p\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${
> fullname},line=\"$line_callee2_body\",thread-
> groups=\\\[\"i1\"\\\],times=\"0\",script=\{\"print
> 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \
>          "breakpoint commands: check that commands are set"
> 
>      mi_gdb_test "-break-commands 7" \
> Index: gdb/testsuite/gdb.mi/mi-nsmoribund.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-nsmoribund.exp,v
> retrieving revision 1.17
> diff -u -r1.17 mi-nsmoribund.exp
> --- gdb/testsuite/gdb.mi/mi-nsmoribund.exp      10 Jul 2012 15:32:51 -
> 0000      1.17
> +++ gdb/testsuite/gdb.mi/mi-nsmoribund.exp      27 Nov 2012 19:06:39 -
> 0000
> @@ -79,8 +79,11 @@
>  mi_delete_breakpoints
> 
>  # Recreate the same breakpoint, but this time, specific to thread 5.
> -mi_create_breakpoint "-p 5 $srcfile:$bkpt_line" 3 keep thread_function
> .* .* .* \
> -    "thread specific breakpoint at thread_function"
> +mi_gdb_test "234-break-insert -p 5 $srcfile:$bkpt_line" \
> +
> "234\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabl
> ed=\"y\",addr=\".*\",\
> +
> func=\"thread_function\",file=\".*\",fullname=\".*\",line=\".*\",thread
> -groups=\\\[\".*\"\\\],\
> +    thread=\"5\",thread=\"5\",times=\"0\",original-location=\".*\"\}"
> \
> +    "thread specific breakpoint at thread_function"
> 
>  # Resume all threads.  Only thread 5 should report a stop.
> 
> Index: gdb/testsuite/gdb.mi/mi-simplerun.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-simplerun.exp,v
> retrieving revision 1.29
> diff -u -r1.29 mi-simplerun.exp
> --- gdb/testsuite/gdb.mi/mi-simplerun.exp       10 Jul 2012 15:32:51 -
> 0000      1.29
> +++ gdb/testsuite/gdb.mi/mi-simplerun.exp       27 Nov 2012 19:06:39 -
> 0000
> @@ -79,7 +79,7 @@
>               "insert breakpoint at
> \"<fullfilename>\":\$line_callee4_head"
> 
>      mi_gdb_test "204-break-list" \
> -
> "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=
> \"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",fun
> c=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\",ori
> ginal-location=\".*\"\},.*\}\\\]\}" \
> +
> "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=
> \"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",fun
> c=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-
> groups=\\\[\"i1\"\\\],times=\"0\",original-
> location=\".*\"\},.*\}\\\]\}" \
>                  "list of breakpoints"
> 
>      mi_gdb_test "205-break-disable 2 3 4" \
> Index: gdb/testsuite/gdb.mi/mi-watch.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-watch.exp,v
> retrieving revision 1.33
> diff -u -r1.33 mi-watch.exp
> --- gdb/testsuite/gdb.mi/mi-watch.exp   9 Nov 2012 02:30:49 -0000
> 1.33
> +++ gdb/testsuite/gdb.mi/mi-watch.exp   27 Nov 2012 19:06:39 -0000
> @@ -58,7 +58,7 @@
>               "break-watch operation"
> 
>      mi_gdb_test "222-break-list" \
> -
> "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{wi
> dth=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhd
> r=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr
> =\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp
> =\"keep\",enabled=\"y\",what=\"C\",times=\"0\",original-
> location=\"C\"\}\\\]\}" \
> +
> "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{wi
> dth=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhd
> r=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr
> =\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp
> =\"keep\",enabled=\"y\",what=\"C\",thread-
> groups=\\\[\"i1\"\\\],times=\"0\",original-location=\"C\"\}\\\]\}" \
>                  "list of watchpoints"
> 
>  }
> @@ -82,7 +82,7 @@
>               "break-watch -a operation"
> 
>      mi_gdb_test "444-break-list" \
> -
> "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=
> \"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func
> =\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*
> \}\\\]\}" \
> +
> "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=
> \"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func
> =\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-
> groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
>                  "list of watchpoints awatch"
> 
>      mi_gdb_test "777-break-delete 3" \
> @@ -109,7 +109,7 @@
>               "break-watch -r operation"
> 
>      mi_gdb_test "300-break-list" \
> -
> "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=
> \"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",fun
> c=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.
> *\}\\\}\}" \
> +
> "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=
> \"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",fun
> c=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-
> groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\}\}" \
>                  "list of breakpoints"
> 
>      mi_gdb_test "177-break-delete 4" \
> Index: gdb/testsuite/lib/mi-support.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
> retrieving revision 1.112
> diff -u -r1.112 mi-support.exp
> --- gdb/testsuite/lib/mi-support.exp    25 Jul 2012 20:19:56 -0000
> 1.112
> +++ gdb/testsuite/lib/mi-support.exp    27 Nov 2012 19:06:39 -0000
> @@ -923,7 +923,7 @@
> 
>    set test "mi runto $func"
>    mi_gdb_test "200-break-insert -t $func" \
> -    "200\\^done,bkpt=\{number=\"\[0-
> 9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",fun
> c=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-
> 9\]*\",times=\"0\",original-location=\".*\"\}" \
> +    "200\\^done,bkpt=\{number=\"\[0-
> 9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",fun
> c=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",thread-
> groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \
>      "breakpoint at $func"
> 
>    if {![regexp {number="[0-9]+"} $expect_out(buffer) str]
> @@ -1205,9 +1205,9 @@
> 
>  # Creates a breakpoint and checks the reported fields are as expected
>  proc mi_create_breakpoint { location number disp func file line
> address test } {
> -    verbose -log "Expecting:
> 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\"
> ,enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname
> =\".*\",line=\"$line\",times=\"0\",original-location=\".*\"\}"
> +    verbose -log "Expecting:
> 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\"
> ,enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname
> =\".*\",line=\"$line\",thread-
> groups=\\\[\".*\"\\\],times=\"0\",original-location=\".*\"\}"
>      mi_gdb_test "222-break-insert $location" \
> -
> "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\
> ",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullnam
> e=\".*\",line=\"$line\",times=\"0\",original-location=\".*\"\}" \
> +
> "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\
> ",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullnam
> e=\".*\",line=\"$line\",thread-
> groups=\\\[\".*\"\\\],times=\"0\",original-location=\".*\"\}" \
>          $test
>  }
> 
> @@ -1228,7 +1228,7 @@
>          set file [lindex $item 3]
>          set line [lindex $item 4]
>          set address [lindex $item 5]
> -        set body
> "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",en
> abled=\"y\",addr=\"$address\",func=\"$func\",file=\".*$file\",${fullnam
> e},line=\"$line\",times=\"0\",original-location=\".*\"\}"
> +        set body
> "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",en
> abled=\"y\",addr=\"$address\",func=\"$func\",file=\".*$file\",${fullnam
> e},line=\"$line\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-
> location=\".*\"\}"
>          set first 0
>      }


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [MI][patch v2] -break-list to specify "thread-group"
  2012-11-28  6:07                   ` Abid, Hafiz
@ 2012-11-30 18:35                     ` Tom Tromey
  0 siblings, 0 replies; 23+ messages in thread
From: Tom Tromey @ 2012-11-30 18:35 UTC (permalink / raw)
  To: Abid, Hafiz; +Cc: Marc Khouzam, 'gdb-patches@sourceware.org', Qi, Yao

>>>>> "Hafiz" == Abid, Hafiz <Hafiz_Abid@mentor.com> writes:

>> +         sprintf (mi_group, "i%d", inf);

Hafiz> Please use xsnprintf instead.

Yes, please.

Tom


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [MI][patch v2] -break-list to specify "thread-group"
  2012-09-22 13:00     ` Yao Qi
  2012-09-26 10:05       ` Marc Khouzam
  2012-09-28 19:21       ` Tom Tromey
@ 2012-12-07 15:37       ` Pedro Alves
  2012-12-07 15:44         ` Pedro Alves
  2 siblings, 1 reply; 23+ messages in thread
From: Pedro Alves @ 2012-12-07 15:37 UTC (permalink / raw)
  To: Yao Qi; +Cc: Marc Khouzam, gdb-patches

On 09/22/2012 01:58 PM, Yao Qi wrote:
> On 09/21/2012 10:46 PM, Marc Khouzam wrote:
>> or (if the bp applies to multiple inferiors, which I didn't quite
>> out how to officially trigger, so I hacked the code to make sure
>> the output was done properly in that case):
>>
> 
> I don't know ether.  I can't think of a case that multiple inferiors share a single pspace.

See the intro comment to program spaces in progspace.h.  It gives some examples, such
as after a vfork (and before exit/exec), or some targets that work
that way, like Ericsson's DICOS.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [MI][patch v2] -break-list to specify "thread-group"
  2012-12-07 15:37       ` Pedro Alves
@ 2012-12-07 15:44         ` Pedro Alves
  2013-01-16 16:58           ` Marc Khouzam
  0 siblings, 1 reply; 23+ messages in thread
From: Pedro Alves @ 2012-12-07 15:44 UTC (permalink / raw)
  Cc: Yao Qi, Marc Khouzam, gdb-patches

On 12/07/2012 03:36 PM, Pedro Alves wrote:
> On 09/22/2012 01:58 PM, Yao Qi wrote:
>> On 09/21/2012 10:46 PM, Marc Khouzam wrote:
>>> or (if the bp applies to multiple inferiors, which I didn't quite
>>> out how to officially trigger, so I hacked the code to make sure
>>> the output was done properly in that case):
>>>
>>
>> I don't know ether.  I can't think of a case that multiple inferiors share a single pspace.
> 
> See the intro comment to program spaces in progspace.h.  It gives some examples, such
> as after a vfork (and before exit/exec), or some targets that work
> that way, like Ericsson's DICOS.
> 

Mandatory screenshot:

>./gdb ./testsuite/gdb.base/foll-vfork
(gdb) set detach-on-fork off
(gdb) set follow-fork-mode child
(gdb) start
Temporary breakpoint 1 at 0x4006f4: file ../../../src/gdb/testsuite/gdb.base/foll-vfork.c, line 29.
Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/foll-vfork
Temporary breakpoint 1, main () at ../../../src/gdb/testsuite/gdb.base/foll-vfork.c:29
29        pid = vfork ();
(gdb) n
[New process 9882]
[Switching to process 9882]
30        if (pid == 0) {
(gdb) info inferiors
  Num  Description       Executable
* 2    process 9882      /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/foll-vfork
        is vfork child of inferior 1
  1    process 9878      /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.base/foll-vfork
        is vfork parent of inferior 2
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) b main
Breakpoint 2 at 0x4006f4: file ../../../src/gdb/testsuite/gdb.base/foll-vfork.c, line 29.
(gdb) info breakpoints
Num     Type           Disp Enb Address            What
2       breakpoint     keep y   0x00000000004006f4 in main at ../../../src/gdb/testsuite/gdb.base/foll-vfork.c:29 inf 2, 1
(gdb)

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [MI][patch v2] -break-list to specify "thread-group"
  2012-12-07 15:44         ` Pedro Alves
@ 2013-01-16 16:58           ` Marc Khouzam
  2013-01-21 18:54             ` Pedro Alves
  0 siblings, 1 reply; 23+ messages in thread
From: Marc Khouzam @ 2013-01-16 16:58 UTC (permalink / raw)
  To: 'Pedro Alves', 'Tom Tromey'
  Cc: 'Yao Qi', 'gdb-patches@sourceware.org'

> -----Original Message-----
> From: gdb-patches-owner@sourceware.org 
> [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Pedro Alves
> Sent: Friday, December 07, 2012 10:45 AM
> Cc: Yao Qi; Marc Khouzam; gdb-patches@sourceware.org
> Subject: Re: [MI][patch v2] -break-list to specify "thread-group"
> 
> On 12/07/2012 03:36 PM, Pedro Alves wrote:
> > On 09/22/2012 01:58 PM, Yao Qi wrote:
> >> On 09/21/2012 10:46 PM, Marc Khouzam wrote:
> >>> or (if the bp applies to multiple inferiors, which I didn't quite
> >>> out how to officially trigger, so I hacked the code to make sure
> >>> the output was done properly in that case):
> >>>
> >>
> >> I don't know ether.  I can't think of a case that multiple 
> inferiors share a single pspace.
> > 
> > See the intro comment to program spaces in progspace.h.  It 
> gives some examples, such
> > as after a vfork (and before exit/exec), or some targets that work
> > that way, like Ericsson's DICOS.

Thanks Pedro for this clarification.  So clearly we need to keep the
support for listing multiple inferiors for each breakpoint.

I've updated the path for HEAD, and here it is again.
I've created with git; I hope that is ok for you guys.

As a reminder, this patch adds a "thread-groups" field to the 
different breakpoint MI printouts.  This information is important 
for a frontend but is currently only available through CLI.

The patch has documentation and testsuite repetitive changes
which make it seem big, but the code changes are not that big.
It would be cool (for me only maybe?) to get this in before 
the 7.6 branch ;)

Doc was already approved here, although I had to make slight
updates due to changes in HEAD:
http://sourceware.org/ml/gdb-patches/2012-10/msg00007.html

No regressions

Thanks

Marc

2013-01-16  Marc Khouzam  <marc.khouzam@ericsson.com>

	* breakpoint.c (print_one_breakpoint_location): Add MI
	field 'thread-groups' when printing a breakpoint.
	(output_thread_groups): New function.

2013-01-16  Marc Khouzam  <marc.khouzam@ericsson.com>

	* gdb.texinfo (GDB/MI Breakpoint Commands): Document new
	'thread-groups' field when printing a breakpoint in MI.

2013-01-16  Marc Khouzam  <marc.khouzam@ericsson.com>

	* gdb.mi/mi-break.exp: Expect new 'thread-groups' field.
	* gdb.mi/mi-catch-load.exp: Ditto.
	* gdb.mi/mi-nsmoribund.exp: Expect new 'thread-groups' field.
	Also handle 'thread' field.
	* gdb.mi/mi-simplerun.exp: Expect new 'thread-groups' field.
	* gdb.mi/mi-watch.exp: Ditto.
	* lib/mi-support.exp: Ditto.

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 4d76fa1..4e78dbb 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -5787,6 +5787,51 @@ bptype_string (enum bptype type)
   return bptypes[(int) type].description;
 }
 
+DEF_VEC_I(int);
+
+/* For MI, output a field named 'thread-groups' with a list as the value.
+   For CLI, prefix the list with the string 'inf'. */
+
+static void
+output_thread_groups (struct ui_out *uiout,
+		      const char *field_name,
+		      VEC(int) *inf_num,
+		      int mi_only)
+{
+  struct cleanup *back_to = make_cleanup_ui_out_list_begin_end (uiout,
+								field_name);
+  int is_mi = ui_out_is_mi_like_p (uiout);
+  int inf;
+  int i;
+
+  /* For backward compatibility, don't display inferiors in CLI unless
+     there are several.  Always display them for MI. */
+  if (!is_mi && mi_only)
+    return;
+
+  for (i = 0; VEC_iterate (int, inf_num, i, inf); ++i)
+    {
+      if (is_mi)
+	{
+	  char mi_group[10];
+
+	  sprintf (mi_group, "i%d", inf);
+	  ui_out_field_string (uiout, NULL, mi_group);
+	}
+      else
+	{
+	  if (i == 0)
+	    ui_out_text (uiout, " inf ");
+	  else
+	    ui_out_text (uiout, ", ");
+
+	  ui_out_text (uiout, plongest (inf));
+	}
+    }
+
+  do_cleanups (back_to);
+}
+
 /* Print B to gdb_stdout.  */
 
 static void
@@ -5938,35 +5983,30 @@ print_one_breakpoint_location (struct breakpoint *b,
       }
 
 
-  /* For backward compatibility, don't display inferiors unless there
-     are several.  */
-  if (loc != NULL
-      && !header_of_multiple
-      && (allflag
-	  || (!gdbarch_has_global_breakpoints (target_gdbarch ())
-	      && (number_of_program_spaces () > 1
-		  || number_of_inferiors () > 1)
-	      /* LOC is for existing B, it cannot be in
-		 moribund_locations and thus having NULL OWNER.  */
-	      && loc->owner->type != bp_catchpoint)))
+  if (loc != NULL && !header_of_multiple)
     {
       struct inferior *inf;
-      int first = 1;
+      VEC(int) *inf_num = NULL;
+      int mi_only = 1;
 
-      for (inf = inferior_list; inf != NULL; inf = inf->next)
+      ALL_INFERIORS (inf)
 	{
 	  if (inf->pspace == loc->pspace)
-	    {
-	      if (first)
-		{
-		  first = 0;
-		  ui_out_text (uiout, " inf ");
-		}
-	      else
-		ui_out_text (uiout, ", ");
-	      ui_out_text (uiout, plongest (inf->num));
-	    }
+	    VEC_safe_push (int, inf_num, inf->num);
 	}
+
+        /* For backward compatibility, don't display inferiors in CLI unless
+	   there are several.  Always display for MI. */
+	if (allflag
+	    || (!gdbarch_has_global_breakpoints (target_gdbarch ())
+		&& (number_of_program_spaces () > 1
+		    || number_of_inferiors () > 1)
+		/* LOC is for existing B, it cannot be in
+		   moribund_locations and thus having NULL OWNER.  */
+		&& loc->owner->type != bp_catchpoint))
+	mi_only = 0;
+      output_thread_groups (uiout, "thread-groups", inf_num, mi_only);
+      VEC_free (int, inf_num);
     }
 
   if (!part_of_multiple)
@@ -7941,8 +7981,6 @@ catch_unload_command_1 (char *arg, int from_tty,
   catch_load_or_unload (arg, from_tty, 0, command);
 }
 
-DEF_VEC_I(int);
-
 /* An instance of this type is used to represent a syscall catchpoint.
    It includes a "struct breakpoint" as a kind of base class; users
    downcast to "struct breakpoint *" when needed.  A breakpoint is
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index f973263..0fce163 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -28056,7 +28056,8 @@ For example, here is what the output of @code{-break-insert}
 -> -break-insert main
 <- ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
     enabled="y",addr="0x08048564",func="main",file="myprog.c",
-    fullname="/home/nickrob/myprog.c",line="68",times="0"@}
+    fullname="/home/nickrob/myprog.c",line="68",thread-groups=["i1"],
+    times="0"@}
 <- (gdb)
 @end smallexample
 
@@ -28151,7 +28152,8 @@ information of the breakpoint.
 -> -break-insert main
 <- ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
     enabled="y",addr="0x08048564",func="main",file="myprog.c",
-    fullname="/home/nickrob/myprog.c",line="68",times="0"@}
+    fullname="/home/nickrob/myprog.c",line="68",thread-groups=["i1"],
+    times="0"@}
 <- (gdb)
 @end smallexample
 
@@ -28275,7 +28277,8 @@ The corresponding @value{GDBN} command is @samp{ignore}.
 -break-insert main
 ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
 enabled="y",addr="0x000100d0",func="main",file="hello.c",
-fullname="/home/foo/hello.c",line="5",times="0"@}
+fullname="/home/foo/hello.c",line="5",thread-groups=["i1"],
+times="0"@}
 (gdb)
 -break-after 1 3
 ~
@@ -28291,7 +28294,7 @@ hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
 @{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",fullname="/home/foo/hello.c",
-line="5",times="0",ignore="3"@}]@}
+line="5",thread-groups=["i1"],times="0",ignore="3"@}]@}
 (gdb)
 @end smallexample
 
@@ -28327,7 +28330,8 @@ The corresponding @value{GDBN} command is @samp{commands}.
 -break-insert main
 ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
 enabled="y",addr="0x000100d0",func="main",file="hello.c",
-fullname="/home/foo/hello.c",line="5",times="0"@}
+fullname="/home/foo/hello.c",line="5",thread-groups=["i1"],
+times="0"@}
 (gdb)
 -break-commands 1 "print v" "continue"
 ^done
@@ -28369,7 +28373,7 @@ hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
 @{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",fullname="/home/foo/hello.c",
-line="5",cond="1",times="0",ignore="3"@}]@}
+line="5",cond="1",thread-groups=["i1"],times="0",ignore="3"@}]@}
 (gdb)
 @end smallexample
 
@@ -28441,7 +28445,7 @@ hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
 @{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",fullname="/home/foo/hello.c",
-line="5",times="0"@}]@}
+line="5",thread-groups=["i1"],times="0"@}]@}
 (gdb)
 @end smallexample
 
@@ -28477,7 +28481,7 @@ hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
 @{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",fullname="/home/foo/hello.c",
-line="5",times="0"@}]@}
+line="5",thread-groups=["i1"],times="0"@}]@}
 (gdb)
 @end smallexample
 
@@ -28573,11 +28577,13 @@ The corresponding @value{GDBN} commands are @samp{break}, @samp{tbreak},
 (gdb)
 -break-insert main
 ^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",
-fullname="/home/foo/recursive2.c,line="4",times="0"@}
+fullname="/home/foo/recursive2.c,line="4",thread-groups=["i1"],
+times="0"@}
 (gdb)
 -break-insert -t foo
 ^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",
-fullname="/home/foo/recursive2.c,line="11",times="0"@}
+fullname="/home/foo/recursive2.c,line="11",thread-groups=["i1"],
+times="0"@}
 (gdb)
 -break-list
 ^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
@@ -28589,15 +28595,18 @@ hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
 @{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",
-fullname="/home/foo/recursive2.c,"line="4",times="0"@},
+fullname="/home/foo/recursive2.c,"line="4",thread-groups=["i1"],
+times="0"@},
 bkpt=@{number="2",type="breakpoint",disp="del",enabled="y",
 addr="0x00010774",func="foo",file="recursive2.c",
-fullname="/home/foo/recursive2.c",line="11",times="0"@}]@}
+fullname="/home/foo/recursive2.c",line="11",thread-groups=["i1"],
+times="0"@}]@}
 (gdb)
 @c -break-insert -r foo.*
 @c ~int foo(int, int);
 @c ^done,bkpt=@{number="3",addr="0x00010774",file="recursive2.c,
-@c "fullname="/home/foo/recursive2.c",line="11",times="0"@}
+@c "fullname="/home/foo/recursive2.c",line="11",thread-groups=["i1"],
+@c times="0"@}
 @c (gdb)
 @end smallexample
 
@@ -28627,6 +28636,8 @@ memory location at which the breakpoint is set
 @item What
 logical location of the breakpoint, expressed by function name, file
 name, line number
+@item Thread-groups
+list of inferiors to which this breakpoint applies
 @item Times
 number of times the breakpoint has been hit
 @end table
@@ -28651,10 +28662,11 @@ hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
 @{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"@},
+addr="0x000100d0",func="main",file="hello.c",line="5",thread-groups=["i1"],
+times="0"@},
 bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
 addr="0x00010114",func="foo",file="hello.c",fullname="/home/foo/hello.c",
-line="13",times="0"@}]@}
+line="13",thread-groups=["i1"],times="0"@}]@}
 (gdb)
 @end smallexample
 
@@ -28782,9 +28794,10 @@ hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
 body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
 addr="0x00010734",func="callee4",
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
-fullname="/home/foo/devo/gdb/testsuite/gdb.mi/basics.c"line="8",times="1"@},
+fullname="/home/foo/devo/gdb/testsuite/gdb.mi/basics.c"line="8",thread-groups=["i1"],
+times="1"@},
 bkpt=@{number="2",type="watchpoint",disp="keep",
-enabled="y",addr="",what="C",times="0"@}]@}
+enabled="y",addr="",what="C",thread-groups=["i1"],times="0"@}]@}
 (gdb)
 -exec-continue
 ^running
@@ -28806,9 +28819,10 @@ hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
 body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
 addr="0x00010734",func="callee4",
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
-fullname="/home/foo/devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@},
+fullname="/home/foo/devo/gdb/testsuite/gdb.mi/basics.c",line="8",thread-groups=["i1"],
+times="1"@},
 bkpt=@{number="2",type="watchpoint",disp="keep",
-enabled="y",addr="",what="C",times="-5"@}]@}
+enabled="y",addr="",what="C",thread-groups=["i1"],times="-5"@}]@}
 (gdb)
 -exec-continue
 ^running
@@ -28830,7 +28844,7 @@ body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
 addr="0x00010734",func="callee4",
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
 fullname="/home/foo/devo/gdb/testsuite/gdb.mi/basics.c",line="8",
-times="1"@}]@}
+thread-groups=["i1"],times="1"@}]@}
 (gdb)
 @end smallexample
 
@@ -33427,7 +33441,8 @@ No equivalent.
 -break-insert main
 ^done,bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
 addr="0x080484ed",func="main",file="myprog.c",
-fullname="/home/nickrob/myprog.c",line="73",times="0"@},
+fullname="/home/nickrob/myprog.c",line="73",thread-groups=["i1"],
+times="0"@},
 time=@{wallclock="0.05185",user="0.00800",system="0.00000"@}
 (gdb)
 -enable-timings no
diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp
index 4c99a24..41f9dc1 100644
--- a/gdb/testsuite/gdb.mi/mi-break.exp
+++ b/gdb/testsuite/gdb.mi/mi-break.exp
@@ -93,7 +93,7 @@ proc test_tbreak_creation_and_listing {} {
              "insert temp breakpoint at \"<fullfilename>\":\$line_callee4_head"
 
     mi_gdb_test "666-break-list" \
-     	    "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",times=\"0\",original-location=\".*\"\}.*\\\]\}" \
+     	    "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}.*\\\]\}" \
                 "list of breakpoints"
 
     mi_gdb_test "777-break-delete" \
@@ -142,7 +142,7 @@ proc test_rbreak_creation_and_listing {} {
 
     setup_kfail "*-*-*" mi/14270
     mi_gdb_test "166-break-list" \
-	    "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
+	    "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
                 "list of breakpoints"
 
     mi_gdb_test "177-break-delete" \
@@ -208,7 +208,7 @@ proc test_disabled_creation {} {
     global line_callee2_body
 
     mi_gdb_test "-break-insert -d basics.c:callee2" \
-        "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\",enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",fullname=\".*\",line=\"$line_callee2_body\",times=\"0\",original-location=\".*\"\}" \
+        "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\",enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",fullname=\".*\",line=\"$line_callee2_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \
         "test disabled creation"
 
     mi_gdb_test "-break-delete" \
@@ -229,7 +229,7 @@ proc test_breakpoint_commands {} {
         "breakpoint commands: set commands"
 
     mi_gdb_test "-break-info 7" \
-    	"\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"$line_callee2_body\",times=\"0\",script=\{\"print 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \
+    	"\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"$line_callee2_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",script=\{\"print 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \
         "breakpoint commands: check that commands are set"
 
     mi_gdb_test "-break-commands 7" \
diff --git a/gdb/testsuite/gdb.mi/mi-catch-load.exp b/gdb/testsuite/gdb.mi/mi-catch-load.exp
index 34494a2..2ed4340 100644
--- a/gdb/testsuite/gdb.mi/mi-catch-load.exp
+++ b/gdb/testsuite/gdb.mi/mi-catch-load.exp
@@ -49,7 +49,7 @@ mi_run_to_main
 # test -catch-load
 mi_gdb_test "111-gdb-set auto-solib-add on" "111\\^done" "catch-load: auto-solib-add on"
 mi_gdb_test "222-catch-load -t mi-catch-load-so.so*" \
-    "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"load of library matching mi-catch-load-so\.so\\*\",times=\"0\"\}" \
+    "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"load of library matching mi-catch-load-so\.so\\*\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}" \
     "catch-load: catch load"
 mi_send_resuming_command "exec-continue" "catch-load: continue"
 
@@ -76,7 +76,7 @@ mi_run_to_main
 # test -catch-unload
 mi_gdb_test "111-gdb-set auto-solib-add on" "111\\^done" "catch-unload: auto-solib-add on"
 mi_gdb_test "222-catch-unload -t mi-catch-load-so.so*" \
-    "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"unload of library matching mi-catch-load-so\.so\\*\",times=\"0\"\}" \
+    "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"unload of library matching mi-catch-load-so\.so\\*\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}" \
     "catch-unload: catch unload"
 mi_send_resuming_command "exec-continue" "catch-unload: continue"
 
diff --git a/gdb/testsuite/gdb.mi/mi-nsmoribund.exp b/gdb/testsuite/gdb.mi/mi-nsmoribund.exp
index ba64dd6..5965873 100644
--- a/gdb/testsuite/gdb.mi/mi-nsmoribund.exp
+++ b/gdb/testsuite/gdb.mi/mi-nsmoribund.exp
@@ -79,8 +79,9 @@ mi_gdb_test "-thread-select 5" "\\^done.*" "select thread 5"
 mi_delete_breakpoints
 
 # Recreate the same breakpoint, but this time, specific to thread 5.
-mi_create_breakpoint "-p 5 $srcfile:$bkpt_line" 3 keep thread_function .* .* .* \
-    "thread specific breakpoint at thread_function"
+mi_gdb_test "234-break-insert -p 5 $srcfile:$bkpt_line" \
+    "234\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\".*\",func=\"thread_function\",file=\".*\",fullname=\".*\",line=\".*\",thread-groups=\\\[\".*\"\\\],thread=\"5\",thread=\"5\",times=\"0\",original-location=\".*\"\}" \
+    "thread specific breakpoint at thread_function" 
 
 # Resume all threads.  Only thread 5 should report a stop.
 
diff --git a/gdb/testsuite/gdb.mi/mi-simplerun.exp b/gdb/testsuite/gdb.mi/mi-simplerun.exp
index 8807645..ea03c16 100644
--- a/gdb/testsuite/gdb.mi/mi-simplerun.exp
+++ b/gdb/testsuite/gdb.mi/mi-simplerun.exp
@@ -79,7 +79,7 @@ proc test_breakpoints_creation_and_listing {} {
              "insert breakpoint at \"<fullfilename>\":\$line_callee4_head"
 
     mi_gdb_test "204-break-list" \
-	    "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
+	    "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
                 "list of breakpoints"
 
     mi_gdb_test "205-break-disable 2 3 4" \
diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp
index efec081..1b9ae44 100644
--- a/gdb/testsuite/gdb.mi/mi-watch.exp
+++ b/gdb/testsuite/gdb.mi/mi-watch.exp
@@ -57,7 +57,7 @@ proc test_watchpoint_creation_and_listing {type} {
              "break-watch operation"
 
     mi_gdb_test "222-break-list" \
-	    "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",times=\"0\",original-location=\"C\"\}\\\]\}" \
+	    "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\"C\"\}\\\]\}" \
                 "list of watchpoints"
 
 }
@@ -81,7 +81,7 @@ proc test_awatch_creation_and_listing {type} {
              "break-watch -a operation"
 
     mi_gdb_test "444-break-list" \
-	    "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
+	    "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
                 "list of watchpoints awatch"
 
     mi_gdb_test "777-break-delete 3" \
@@ -108,7 +108,7 @@ proc test_rwatch_creation_and_listing {type} {
              "break-watch -r operation"
 
     mi_gdb_test "300-break-list" \
-	    "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\}\}" \
+	    "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\}\}" \
                 "list of breakpoints"
 
     mi_gdb_test "177-break-delete 4" \
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 31b601f..afb255e 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -922,7 +922,7 @@ proc mi_runto_helper {func run_or_continue} {
 
   set test "mi runto $func"
   mi_gdb_test "200-break-insert -t $func" \
-    "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",times=\"0\",original-location=\".*\"\}" \
+    "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \
     "breakpoint at $func"
 
   if {![regexp {number="[0-9]+"} $expect_out(buffer) str]
@@ -1204,9 +1204,9 @@ proc mi0_continue_to { bkptno func args file line test } {
 
 # Creates a breakpoint and checks the reported fields are as expected
 proc mi_create_breakpoint { location number disp func file line address test } {
-    verbose -log "Expecting: 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-location=\".*\"\}"
+    verbose -log "Expecting: 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",thread-groups=\\\[\".*\"\\\],times=\"0\",original-location=\".*\"\}"
     mi_gdb_test "222-break-insert $location" \
-        "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-location=\".*\"\}" \
+        "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",thread-groups=\\\[\".*\"\\\],times=\"0\",original-location=\".*\"\}" \
         $test
 }
 
@@ -1227,7 +1227,7 @@ proc mi_list_breakpoints { expected test } {
         set file [lindex $item 3]
         set line [lindex $item 4]
         set address [lindex $item 5]
-        set body "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\".*$file\",${fullname},line=\"$line\",times=\"0\",original-location=\".*\"\}"
+        set body "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\".*$file\",${fullname},line=\"$line\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}"
         set first 0
     }



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [MI][patch v2] -break-list to specify "thread-group"
  2013-01-16 16:58           ` Marc Khouzam
@ 2013-01-21 18:54             ` Pedro Alves
  2013-01-22  0:09               ` Marc Khouzam
  0 siblings, 1 reply; 23+ messages in thread
From: Pedro Alves @ 2013-01-21 18:54 UTC (permalink / raw)
  To: Marc Khouzam
  Cc: 'Tom Tromey', 'Yao Qi',
	'gdb-patches@sourceware.org'

On 01/16/2013 04:58 PM, Marc Khouzam wrote:

> +  for (i = 0; VEC_iterate (int, inf_num, i, inf); ++i)
> +    {
> +      if (is_mi)
> +	{
> +	  char mi_group[10];
> +
> +	  sprintf (mi_group, "i%d", inf);

xsnprintf.

> @@ -28627,6 +28636,8 @@ memory location at which the breakpoint is set
>  @item What
>  logical location of the breakpoint, expressed by function name, file
>  name, line number
> +@item Thread-groups
> +list of inferiors to which this breakpoint applies

Should be, "list of thread groups".

Otherwise looks good to me.

Thanks,
-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 23+ messages in thread

* RE: [MI][patch v2] -break-list to specify "thread-group"
  2013-01-21 18:54             ` Pedro Alves
@ 2013-01-22  0:09               ` Marc Khouzam
  0 siblings, 0 replies; 23+ messages in thread
From: Marc Khouzam @ 2013-01-22  0:09 UTC (permalink / raw)
  To: Pedro Alves
  Cc: 'Tom Tromey', 'Yao Qi',
	'gdb-patches@sourceware.org'


> From: Pedro Alves [palves@redhat.com]
> Sent: January 21, 2013 1:54 PM
> To: Marc Khouzam
> Cc: 'Tom Tromey'; 'Yao Qi'; 'gdb-patches@sourceware.org'
> Subject: Re: [MI][patch v2] -break-list to specify "thread-group"
> 
> On 01/16/2013 04:58 PM, Marc Khouzam wrote:
> 
> > +  for (i = 0; VEC_iterate (int, inf_num, i, inf); ++i)
> > +    {
> > +      if (is_mi)
> > +     {
> > +       char mi_group[10];
> > +
> > +       sprintf (mi_group, "i%d", inf);
> 
> xsnprintf.
> 
> > @@ -28627,6 +28636,8 @@ memory location at which the breakpoint is set
> >  @item What
> >  logical location of the breakpoint, expressed by function name, file
> >  name, line number
> > +@item Thread-groups
> > +list of inferiors to which this breakpoint applies
> 
> Should be, "list of thread groups".
> 
> Otherwise looks good to me.
> 
> Thanks,

Thanks!  Much appreciated!

I committed the following (although I had to do a second commit
because I made a slight mistake on the Changelog files):

2013-01-21  Marc Khouzam  <marc.khouzam@ericsson.com>

        * breakpoint.c (print_one_breakpoint_location): Add MI
        field 'thread-groups' when printing a breakpoint.
        (output_thread_groups): New function.

2013-01-21  Marc Khouzam  <marc.khouzam@ericsson.com>

        * gdb.texinfo (GDB/MI Breakpoint Commands): Document new
        'thread-groups' field when printing a breakpoint in MI.

2013-01-21  Marc Khouzam  <marc.khouzam@ericsson.com>

        * gdb.mi/mi-break.exp: Expect new 'thread-groups' field.
        * gdb.mi/mi-catch-load.exp: Ditto.
        * gdb.mi/mi-nsmoribund.exp: Expect new 'thread-groups' field.
        Also handle 'thread' field.
        * gdb.mi/mi-simplerun.exp: Expect new 'thread-groups' field.
        * gdb.mi/mi-watch.exp: Ditto.
        * lib/mi-support.exp: Ditto.

### Eclipse Workspace Patch 1.0
#P src
Index: gdb/breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.735
diff -u -r1.735 breakpoint.c
--- gdb/breakpoint.c    16 Jan 2013 17:31:37 -0000      1.735
+++ gdb/breakpoint.c    21 Jan 2013 23:43:24 -0000
@@ -5805,6 +5805,51 @@
   return bptypes[(int) type].description;
 }
 
+DEF_VEC_I(int);
+
+/* For MI, output a field named 'thread-groups' with a list as the value.
+   For CLI, prefix the list with the string 'inf'. */
+
+static void
+output_thread_groups (struct ui_out *uiout,
+                     const char *field_name,
+                     VEC(int) *inf_num,
+                     int mi_only)
+{
+  struct cleanup *back_to = make_cleanup_ui_out_list_begin_end (uiout,
+                                                               field_name);
+  int is_mi = ui_out_is_mi_like_p (uiout);
+  int inf;
+  int i;
+
+  /* For backward compatibility, don't display inferiors in CLI unless
+     there are several.  Always display them for MI. */
+  if (!is_mi && mi_only)
+    return;
+
+  for (i = 0; VEC_iterate (int, inf_num, i, inf); ++i)
+    {
+      if (is_mi)
+       {
+         char mi_group[10];
+
+         xsnprintf (mi_group, sizeof (mi_group), "i%d", inf);
+         ui_out_field_string (uiout, NULL, mi_group);
+       }
+      else
+       {
+         if (i == 0)
+           ui_out_text (uiout, " inf ");
+         else
+           ui_out_text (uiout, ", ");
+
+         ui_out_text (uiout, plongest (inf));
+       }
+    }
+
+  do_cleanups (back_to);
+}
+
 /* Print B to gdb_stdout.  */
 
 static void
@@ -5956,35 +6001,30 @@
       }
 
 
-  /* For backward compatibility, don't display inferiors unless there
-     are several.  */
-  if (loc != NULL
-      && !header_of_multiple
-      && (allflag
-         || (!gdbarch_has_global_breakpoints (target_gdbarch ())
-             && (number_of_program_spaces () > 1
-                 || number_of_inferiors () > 1)
-             /* LOC is for existing B, it cannot be in
-                moribund_locations and thus having NULL OWNER.  */
-             && loc->owner->type != bp_catchpoint)))
+  if (loc != NULL && !header_of_multiple)
     {
       struct inferior *inf;
-      int first = 1;
+      VEC(int) *inf_num = NULL;
+      int mi_only = 1;
 
-      for (inf = inferior_list; inf != NULL; inf = inf->next)
+      ALL_INFERIORS (inf)
        {
          if (inf->pspace == loc->pspace)
-           {
-             if (first)
-               {
-                 first = 0;
-                 ui_out_text (uiout, " inf ");
-               }
-             else
-               ui_out_text (uiout, ", ");
-             ui_out_text (uiout, plongest (inf->num));
-           }
+           VEC_safe_push (int, inf_num, inf->num);
        }
+
+        /* For backward compatibility, don't display inferiors in CLI unless
+          there are several.  Always display for MI. */
+       if (allflag
+           || (!gdbarch_has_global_breakpoints (target_gdbarch ())
+               && (number_of_program_spaces () > 1
+                   || number_of_inferiors () > 1)
+               /* LOC is for existing B, it cannot be in
+                  moribund_locations and thus having NULL OWNER.  */
+               && loc->owner->type != bp_catchpoint))
+       mi_only = 0;
+      output_thread_groups (uiout, "thread-groups", inf_num, mi_only);
+      VEC_free (int, inf_num);
     }
 
   if (!part_of_multiple)
@@ -7969,8 +8009,6 @@
   catch_load_or_unload (arg, from_tty, 0, command);
 }
 
-DEF_VEC_I(int);
-
 /* An instance of this type is used to represent a syscall catchpoint.
    It includes a "struct breakpoint" as a kind of base class; users
    downcast to "struct breakpoint *" when needed.  A breakpoint is
Index: gdb/doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.1043
diff -u -r1.1043 gdb.texinfo
--- gdb/doc/gdb.texinfo 17 Jan 2013 14:17:16 -0000      1.1043
+++ gdb/doc/gdb.texinfo 21 Jan 2013 23:43:31 -0000
@@ -28089,7 +28089,8 @@
 -> -break-insert main
 <- ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
     enabled="y",addr="0x08048564",func="main",file="myprog.c",
-    fullname="/home/nickrob/myprog.c",line="68",times="0"@}
+    fullname="/home/nickrob/myprog.c",line="68",thread-groups=["i1"],
+    times="0"@}
 <- (gdb)
 @end smallexample
 
@@ -28184,7 +28185,8 @@
 -> -break-insert main
 <- ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
     enabled="y",addr="0x08048564",func="main",file="myprog.c",
-    fullname="/home/nickrob/myprog.c",line="68",times="0"@}
+    fullname="/home/nickrob/myprog.c",line="68",thread-groups=["i1"],
+    times="0"@}
 <- (gdb)
 @end smallexample
 
@@ -28308,7 +28310,8 @@
 -break-insert main
 ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
 enabled="y",addr="0x000100d0",func="main",file="hello.c",
-fullname="/home/foo/hello.c",line="5",times="0"@}
+fullname="/home/foo/hello.c",line="5",thread-groups=["i1"],
+times="0"@}
 (gdb)
 -break-after 1 3
 ~
@@ -28324,7 +28327,7 @@
 @{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",fullname="/home/foo/hello.c",
-line="5",times="0",ignore="3"@}]@}
+line="5",thread-groups=["i1"],times="0",ignore="3"@}]@}
 (gdb)
 @end smallexample
 
@@ -28360,7 +28363,8 @@
 -break-insert main
 ^done,bkpt=@{number="1",type="breakpoint",disp="keep",
 enabled="y",addr="0x000100d0",func="main",file="hello.c",
-fullname="/home/foo/hello.c",line="5",times="0"@}
+fullname="/home/foo/hello.c",line="5",thread-groups=["i1"],
+times="0"@}
 (gdb)
 -break-commands 1 "print v" "continue"
 ^done
@@ -28402,7 +28406,7 @@
 @{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",fullname="/home/foo/hello.c",
-line="5",cond="1",times="0",ignore="3"@}]@}
+line="5",cond="1",thread-groups=["i1"],times="0",ignore="3"@}]@}
 (gdb)
 @end smallexample
 
@@ -28474,7 +28478,7 @@
 @{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",fullname="/home/foo/hello.c",
-line="5",times="0"@}]@}
+line="5",thread-groups=["i1"],times="0"@}]@}
 (gdb)
 @end smallexample
 
@@ -28510,7 +28514,7 @@
 @{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",fullname="/home/foo/hello.c",
-line="5",times="0"@}]@}
+line="5",thread-groups=["i1"],times="0"@}]@}
 (gdb)
 @end smallexample
 
@@ -28606,11 +28610,13 @@
 (gdb)
 -break-insert main
 ^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",
-fullname="/home/foo/recursive2.c,line="4",times="0"@}
+fullname="/home/foo/recursive2.c,line="4",thread-groups=["i1"],
+times="0"@}
 (gdb)
 -break-insert -t foo
 ^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",
-fullname="/home/foo/recursive2.c,line="11",times="0"@}
+fullname="/home/foo/recursive2.c,line="11",thread-groups=["i1"],
+times="0"@}
 (gdb)
 -break-list
 ^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
@@ -28622,15 +28628,18 @@
 @{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",
-fullname="/home/foo/recursive2.c,"line="4",times="0"@},
+fullname="/home/foo/recursive2.c,"line="4",thread-groups=["i1"],
+times="0"@},
 bkpt=@{number="2",type="breakpoint",disp="del",enabled="y",
 addr="0x00010774",func="foo",file="recursive2.c",
-fullname="/home/foo/recursive2.c",line="11",times="0"@}]@}
+fullname="/home/foo/recursive2.c",line="11",thread-groups=["i1"],
+times="0"@}]@}
 (gdb)
 @c -break-insert -r foo.*
 @c ~int foo(int, int);
 @c ^done,bkpt=@{number="3",addr="0x00010774",file="recursive2.c,
-@c "fullname="/home/foo/recursive2.c",line="11",times="0"@}
+@c "fullname="/home/foo/recursive2.c",line="11",thread-groups=["i1"],
+@c times="0"@}
 @c (gdb)
 @end smallexample
 
@@ -28660,6 +28669,8 @@
 @item What
 logical location of the breakpoint, expressed by function name, file
 name, line number
+@item Thread-groups
+list of thread groups to which this breakpoint applies
 @item Times
 number of times the breakpoint has been hit
 @end table
@@ -28684,10 +28695,11 @@
 @{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"@},
+addr="0x000100d0",func="main",file="hello.c",line="5",thread-groups=["i1"],
+times="0"@},
 bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
 addr="0x00010114",func="foo",file="hello.c",fullname="/home/foo/hello.c",
-line="13",times="0"@}]@}
+line="13",thread-groups=["i1"],times="0"@}]@}
 (gdb)
 @end smallexample
 
@@ -28815,9 +28827,10 @@
 body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
 addr="0x00010734",func="callee4",
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
-fullname="/home/foo/devo/gdb/testsuite/gdb.mi/basics.c"line="8",times="1"@},
+fullname="/home/foo/devo/gdb/testsuite/gdb.mi/basics.c"line="8",thread-groups=["i1"],
+times="1"@},
 bkpt=@{number="2",type="watchpoint",disp="keep",
-enabled="y",addr="",what="C",times="0"@}]@}
+enabled="y",addr="",what="C",thread-groups=["i1"],times="0"@}]@}
 (gdb)
 -exec-continue
 ^running
@@ -28839,9 +28852,10 @@
 body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
 addr="0x00010734",func="callee4",
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
-fullname="/home/foo/devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@},
+fullname="/home/foo/devo/gdb/testsuite/gdb.mi/basics.c",line="8",thread-groups=["i1"],
+times="1"@},
 bkpt=@{number="2",type="watchpoint",disp="keep",
-enabled="y",addr="",what="C",times="-5"@}]@}
+enabled="y",addr="",what="C",thread-groups=["i1"],times="-5"@}]@}
 (gdb)
 -exec-continue
 ^running
@@ -28863,7 +28877,7 @@
 addr="0x00010734",func="callee4",
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
 fullname="/home/foo/devo/gdb/testsuite/gdb.mi/basics.c",line="8",
-times="1"@}]@}
+thread-groups=["i1"],times="1"@}]@}
 (gdb)
 @end smallexample
 
@@ -33460,7 +33474,8 @@
 -break-insert main
 ^done,bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
 addr="0x080484ed",func="main",file="myprog.c",
-fullname="/home/nickrob/myprog.c",line="73",times="0"@},
+fullname="/home/nickrob/myprog.c",line="73",thread-groups=["i1"],
+times="0"@},
 time=@{wallclock="0.05185",user="0.00800",system="0.00000"@}
 (gdb)
 -enable-timings no
Index: gdb/testsuite/gdb.mi/mi-break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-break.exp,v
retrieving revision 1.38
diff -u -r1.38 mi-break.exp
--- gdb/testsuite/gdb.mi/mi-break.exp   1 Jan 2013 06:41:24 -0000       1.38
+++ gdb/testsuite/gdb.mi/mi-break.exp   21 Jan 2013 23:43:35 -0000
@@ -93,7 +93,7 @@
              "insert temp breakpoint at \"<fullfilename>\":\$line_callee4_head"
 
     mi_gdb_test "666-break-list" \
-           "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",times=\"0\",original-location=\".*\"\}.*\\\]\}" \
+           "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}.*\\\]\}" \
                 "list of breakpoints"
 
     mi_gdb_test "777-break-delete" \
@@ -142,7 +142,7 @@
 
     setup_kfail "*-*-*" mi/14270
     mi_gdb_test "166-break-list" \
-           "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
+           "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
                 "list of breakpoints"
 
     mi_gdb_test "177-break-delete" \
@@ -208,7 +208,7 @@
     global line_callee2_body
 
     mi_gdb_test "-break-insert -d basics.c:callee2" \
-        "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\",enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",fullname=\".*\",line=\"$line_callee2_body\",times=\"0\",original-location=\".*\"\}" \
+        "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\",enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",fullname=\".*\",line=\"$line_callee2_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \
         "test disabled creation"
 
     mi_gdb_test "-break-delete" \
@@ -229,7 +229,7 @@
         "breakpoint commands: set commands"
 
     mi_gdb_test "-break-info 7" \
-       "\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"$line_callee2_body\",times=\"0\",script=\{\"print 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \
+       "\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"$line_callee2_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",script=\{\"print 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \
         "breakpoint commands: check that commands are set"
 
     mi_gdb_test "-break-commands 7" \
Index: gdb/testsuite/gdb.mi/mi-catch-load.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-catch-load.exp,v
retrieving revision 1.3
diff -u -r1.3 mi-catch-load.exp
--- gdb/testsuite/gdb.mi/mi-catch-load.exp      16 Jan 2013 17:27:53 -0000      1.3
+++ gdb/testsuite/gdb.mi/mi-catch-load.exp      21 Jan 2013 23:43:35 -0000
@@ -49,7 +49,7 @@
 # test -catch-load
 mi_gdb_test "111-gdb-set auto-solib-add on" "111\\^done" "catch-load: auto-solib-add on"
 mi_gdb_test "222-catch-load -t mi-catch-load-so.so*" \
-    "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"load of library matching mi-catch-load-so\.so\\*\",catch-type=\"load\",times=\"0\"\}" \
+    "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"load of library matching mi-catch-load-so\.so\\*\",catch-type=\"load\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}" \
     "catch-load: catch load"
 mi_send_resuming_command "exec-continue" "catch-load: continue"
 
@@ -76,7 +76,7 @@
 # test -catch-unload
 mi_gdb_test "111-gdb-set auto-solib-add on" "111\\^done" "catch-unload: auto-solib-add on"
 mi_gdb_test "222-catch-unload -t mi-catch-load-so.so*" \
-    "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"unload of library matching mi-catch-load-so\.so\\*\",catch-type=\"unload\",times=\"0\"\}" \
+    "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"unload of library matching mi-catch-load-so\.so\\*\",catch-type=\"unload\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\}" \
     "catch-unload: catch unload"
 mi_send_resuming_command "exec-continue" "catch-unload: continue"
 
Index: gdb/testsuite/gdb.mi/mi-nsmoribund.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-nsmoribund.exp,v
retrieving revision 1.18
diff -u -r1.18 mi-nsmoribund.exp
--- gdb/testsuite/gdb.mi/mi-nsmoribund.exp      1 Jan 2013 06:41:24 -0000       1.18
+++ gdb/testsuite/gdb.mi/mi-nsmoribund.exp      21 Jan 2013 23:43:35 -0000
@@ -79,8 +79,9 @@
 mi_delete_breakpoints
 
 # Recreate the same breakpoint, but this time, specific to thread 5.
-mi_create_breakpoint "-p 5 $srcfile:$bkpt_line" 3 keep thread_function .* .* .* \
-    "thread specific breakpoint at thread_function"
+mi_gdb_test "234-break-insert -p 5 $srcfile:$bkpt_line" \
+    "234\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\".*\",func=\"thread_function\",file=\".*\",fullname=\".*\",line=\".*\",thread-groups=\\\[\".*\"\\\],thread=\"5\",thread=\"5\",times=\"0\",original-location=\".*\"\}" \
+    "thread specific breakpoint at thread_function" 
 
 # Resume all threads.  Only thread 5 should report a stop.
 
Index: gdb/testsuite/gdb.mi/mi-simplerun.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-simplerun.exp,v
retrieving revision 1.30
diff -u -r1.30 mi-simplerun.exp
--- gdb/testsuite/gdb.mi/mi-simplerun.exp       1 Jan 2013 06:41:24 -0000       1.30
+++ gdb/testsuite/gdb.mi/mi-simplerun.exp       21 Jan 2013 23:43:35 -0000
@@ -79,7 +79,7 @@
              "insert breakpoint at \"<fullfilename>\":\$line_callee4_head"
 
     mi_gdb_test "204-break-list" \
-           "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
+           "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \
                 "list of breakpoints"
 
     mi_gdb_test "205-break-disable 2 3 4" \
Index: gdb/testsuite/gdb.mi/mi-watch.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-watch.exp,v
retrieving revision 1.34
diff -u -r1.34 mi-watch.exp
--- gdb/testsuite/gdb.mi/mi-watch.exp   1 Jan 2013 06:41:24 -0000       1.34
+++ gdb/testsuite/gdb.mi/mi-watch.exp   21 Jan 2013 23:43:35 -0000
@@ -57,7 +57,7 @@
              "break-watch operation"
 
     mi_gdb_test "222-break-list" \
-           "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",times=\"0\",original-location=\"C\"\}\\\]\}" \
+           "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\"C\"\}\\\]\}" \
                 "list of watchpoints"
 
 }
@@ -81,7 +81,7 @@
              "break-watch -a operation"
 
     mi_gdb_test "444-break-list" \
-           "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \
+           "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \
                 "list of watchpoints awatch"
 
     mi_gdb_test "777-break-delete 3" \
@@ -108,7 +108,7 @@
              "break-watch -r operation"
 
     mi_gdb_test "300-break-list" \
-           "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\}\}" \
+           "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\}\}" \
                 "list of breakpoints"
 
     mi_gdb_test "177-break-delete 4" \
Index: gdb/testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.113
diff -u -r1.113 mi-support.exp
--- gdb/testsuite/lib/mi-support.exp    1 Jan 2013 06:41:28 -0000       1.113
+++ gdb/testsuite/lib/mi-support.exp    21 Jan 2013 23:43:36 -0000
@@ -922,7 +922,7 @@
 
   set test "mi runto $func"
   mi_gdb_test "200-break-insert -t $func" \
-    "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",times=\"0\",original-location=\".*\"\}" \
+    "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \
     "breakpoint at $func"
 
   if {![regexp {number="[0-9]+"} $expect_out(buffer) str]
@@ -1204,9 +1204,9 @@
 
 # Creates a breakpoint and checks the reported fields are as expected
 proc mi_create_breakpoint { location number disp func file line address test } {
-    verbose -log "Expecting: 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-location=\".*\"\}"
+    verbose -log "Expecting: 222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",thread-groups=\\\[\".*\"\\\],times=\"0\",original-location=\".*\"\}"
     mi_gdb_test "222-break-insert $location" \
-        "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",times=\"0\",original-location=\".*\"\}" \
+        "222\\^done,bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\"$file\",fullname=\".*\",line=\"$line\",thread-groups=\\\[\".*\"\\\],times=\"0\",original-location=\".*\"\}" \
         $test
 }
 
@@ -1227,7 +1227,7 @@
         set file [lindex $item 3]
         set line [lindex $item 4]
         set address [lindex $item 5]
-        set body "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\".*$file\",${fullname},line=\"$line\",times=\"0\",original-location=\".*\"\}"
+        set body "${body}bkpt=\{number=\"$number\",type=\"breakpoint\",disp=\"$disp\",enabled=\"y\",addr=\"$address\",func=\"$func\",file=\".*$file\",${fullname},line=\"$line\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}"
         set first 0
     }
 


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2013-01-22  0:09 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-21 10:01 [MI][patch] -break-list to specify "thread-group" Marc Khouzam
2012-09-21 10:45 ` Marc Khouzam
2012-09-21 14:47   ` [MI][patch v2] " Marc Khouzam
2012-09-22 13:00     ` Yao Qi
2012-09-26 10:05       ` Marc Khouzam
2012-09-28 19:23         ` Tom Tromey
2012-10-01 16:10           ` Marc Khouzam
2012-10-01 16:17             ` Eli Zaretskii
2012-10-15 10:39             ` Marc Khouzam
2012-10-24 18:43               ` Marc Khouzam
2012-11-27 19:56                 ` Marc Khouzam
2012-11-28  6:07                   ` Abid, Hafiz
2012-11-30 18:35                     ` Tom Tromey
2012-09-28 19:21       ` Tom Tromey
2012-12-07 15:37       ` Pedro Alves
2012-12-07 15:44         ` Pedro Alves
2013-01-16 16:58           ` Marc Khouzam
2013-01-21 18:54             ` Pedro Alves
2013-01-22  0:09               ` Marc Khouzam
2012-09-28 19:10     ` Tom Tromey
2012-09-28 19:18     ` Tom Tromey
2012-09-21 18:12 ` [MI][patch] " André Pönitz
2012-09-21 18:54   ` Marc Khouzam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox