From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28609 invoked by alias); 28 Feb 2013 18:30:25 -0000 Received: (qmail 28586 invoked by uid 22791); 28 Feb 2013 18:30:22 -0000 X-SWARE-Spam-Status: No, hits=-7.4 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 mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Feb 2013 18:30:17 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 28 Feb 2013 10:28:51 -0800 X-ExtLoop1: 1 Received: from swsutil001.isw.intel.com ([10.237.237.11]) by orsmga002.jf.intel.com with ESMTP; 28 Feb 2013 10:30:15 -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 r1SIUBrn013389; Thu, 28 Feb 2013 18:30:12 GMT Received: from ulslx001.iul.intel.com (localhost [127.0.0.1]) by ulslx001.iul.intel.com with ESMTP id r1SIUBG5015586; Thu, 28 Feb 2013 19:30:11 +0100 Received: (from mgherza1@localhost) by ulslx001.iul.intel.com with id r1SIUArn015582; Thu, 28 Feb 2013 19:30:10 +0100 From: Mircea Gherzan To: tromey@redhat.com, vladimir@codesourcery.com, marc.khouzam@ericsson.com Cc: gdb-patches@sourceware.org, mgherzan@gmail.com, Mircea Gherzan Subject: [PATCH 1/3] MI: fix the result of -break-insert with multiple locations Date: Thu, 28 Feb 2013 18:30:00 -0000 Message-Id: <1362076197-15363-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-02/txt/msg00754.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 gdb: * 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 fb57a57..67da346 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -6213,7 +6213,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 @@ -6232,8 +6231,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 = @@ -6241,8 +6243,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