From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15479 invoked by alias); 29 Jan 2013 15:39:56 -0000 Received: (qmail 15390 invoked by uid 22791); 29 Jan 2013 15:39:55 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from usevmg21.ericsson.net (HELO usevmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 29 Jan 2013 15:39:47 +0000 Received: from EUSAAHC004.ericsson.se (Unknown_Domain [147.117.188.84]) by usevmg21.ericsson.net (Symantec Mail Security) with SMTP id 25.C4.03705.24DE7015; Tue, 29 Jan 2013 16:39:46 +0100 (CET) Received: from EUSAAMB103.ericsson.se ([147.117.188.120]) by EUSAAHC004.ericsson.se ([147.117.188.84]) with mapi id 14.02.0318.004; Tue, 29 Jan 2013 10:39:46 -0500 From: Marc Khouzam To: 'Mircea Gherzan' , "'tromey@redhat.com'" , "'vladimir@codesourcery.com'" CC: "'gdb-patches@sourceware.org'" Subject: RE: [RFC] Fix the MI result of -break-insert with multiple locations Date: Tue, 29 Jan 2013 15:39:00 -0000 Message-ID: References: <1359470164-32004-1-git-send-email-mircea.gherzan@intel.com> In-Reply-To: <1359470164-32004-1-git-send-email-mircea.gherzan@intel.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-01/txt/msg00683.txt.bz2 > -----Original Message----- > From: Mircea Gherzan [mailto:mircea.gherzan@intel.com]=20 > Sent: Tuesday, January 29, 2013 9:36 AM > To: tromey@redhat.com; vladimir@codesourcery.com; Marc Khouzam > Cc: gdb-patches@sourceware.org; mircea.gherzan@intel.com > Subject: [RFC] Fix the MI result of -break-insert with=20 > multiple locations >=20 > The current MI output when printing a breakpoint with=20 > multiple locations > is not conformant to the MI specification: >=20 > bkpt=3D{number=3D"1", ...},{number=3D"1.1", ...},{number=3D"1.2", ...} The above is an excerpt of the slightly more complete excerpt: body=3D[bkpt=3D{number=3D"1", ...},{number=3D"1.1", ...},{number=3D"1.2", .= ..}] and I think this fits with MI grammar: "body" =3D> variable =3D [bkpt=3D*] =3D> value which is a list and a list can be composed of many values which can be tuples: {number=3D"1", ...},{number=3D"1.1", ...},{number=3D"1.2", ...} So, I believe the current syntax is valid, no? BTW, Eclipse does not parse it properly currently because we made the assumption there would be only one tuple. We'll need to fix=20 that in Eclipse. Marc > This patch fixes this issue by moving the locations to a list=20 > inside the > first tuple: >=20 > bkpt=3D{number=3D"1", ... , locations=3D[{number=3D"1.1", ...}, ...]} >=20 > 2013-01-28 Mircea Gherzan >=20 > * breakpoint.c (print_one_breakpoint): Use a list of breakpoint > locations that adheres to the MI specification. >=20 > Signed-off-by: Mircea Gherzan > --- > gdb/breakpoint.c | 8 +++++++- > 1 files changed, 7 insertions(+), 1 deletions(-) >=20 > diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c > index 216ac73..7050f96 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -6216,7 +6216,6 @@ print_one_breakpoint (struct breakpoint *b, > bkpt_chain =3D make_cleanup_ui_out_tuple_begin_end (uiout, "bkpt"); >=20=20 > print_one_breakpoint_location (b, NULL, 0, last_loc, allflag); > - do_cleanups (bkpt_chain); >=20=20 > /* If this breakpoint has custom print function, > it's already printed. Otherwise, print individual > @@ -6235,8 +6234,11 @@ print_one_breakpoint (struct breakpoint *b, > && (b->loc->next || !b->loc->enabled)) > { > struct bp_location *loc; > + struct cleanup *loc_list; > int n =3D 1; >=20=20 > + loc_list =3D make_cleanup_ui_out_list_begin_end (uiout,=20 > "locations"); > + > for (loc =3D b->loc; loc; loc =3D loc->next, ++n) > { > struct cleanup *inner2 =3D > @@ -6244,8 +6246,12 @@ print_one_breakpoint (struct breakpoint *b, > print_one_breakpoint_location (b, loc, n,=20 > last_loc, allflag); > do_cleanups (inner2); > } > + > + do_cleanups (loc_list); > } > } > + > + do_cleanups (bkpt_chain); > } >=20=20 > static int > --=20 > 1.7.1 >=20 >=20