From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28665 invoked by alias); 29 Jan 2013 14:36:58 -0000 Received: (qmail 28541 invoked by uid 22791); 29 Jan 2013 14:36:57 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 29 Jan 2013 14:36:49 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 29 Jan 2013 06:36:48 -0800 X-ExtLoop1: 1 Received: from swsutil001.isw.intel.com ([10.237.237.11]) by fmsmga002.fm.intel.com with ESMTP; 29 Jan 2013 06:36:46 -0800 Received: from ulslx001.iul.intel.com (ulslx001.iul.intel.com [172.28.207.63]) by swsutil001.isw.intel.com (8.13.6/8.13.6/MailSET/Hub) with ESMTP id r0TEagvT007989; Tue, 29 Jan 2013 14:36:44 GMT Received: from ulslx001.iul.intel.com (localhost [127.0.0.1]) by ulslx001.iul.intel.com with ESMTP id r0TEafhf032181; Tue, 29 Jan 2013 15:36:41 +0100 Received: (from mgherza1@localhost) by ulslx001.iul.intel.com with id r0TEaeDj032177; Tue, 29 Jan 2013 15:36:40 +0100 From: Mircea Gherzan To: tromey@redhat.com, vladimir@codesourcery.com, marc.khouzam@ericsson.com Cc: gdb-patches@sourceware.org, mircea.gherzan@intel.com Subject: [RFC] Fix the MI result of -break-insert with multiple locations Date: Tue, 29 Jan 2013 14:36:00 -0000 Message-Id: <1359470164-32004-1-git-send-email-mircea.gherzan@intel.com> 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/msg00680.txt.bz2 The current MI output when printing a breakpoint with multiple locations is not conformant to the MI specification: bkpt={number="1", ...},{number="1.1", ...},{number="1.2", ...} This patch fixes this issue by moving the locations to a list inside the first tuple: bkpt={number="1", ... , locations=[{number="1.1", ...}, ...]} 2013-01-28 Mircea Gherzan * breakpoint.c (print_one_breakpoint): Use a list of breakpoint locations that adheres to the MI specification. Signed-off-by: Mircea Gherzan --- gdb/breakpoint.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) 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 = make_cleanup_ui_out_tuple_begin_end (uiout, "bkpt"); print_one_breakpoint_location (b, NULL, 0, last_loc, allflag); - do_cleanups (bkpt_chain); /* 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 = 1; + loc_list = make_cleanup_ui_out_list_begin_end (uiout, "locations"); + for (loc = b->loc; loc; loc = loc->next, ++n) { struct cleanup *inner2 = @@ -6244,8 +6246,12 @@ print_one_breakpoint (struct breakpoint *b, print_one_breakpoint_location (b, loc, n, last_loc, allflag); do_cleanups (inner2); } + + do_cleanups (loc_list); } } + + do_cleanups (bkpt_chain); } static int -- 1.7.1