From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9378 invoked by alias); 22 Nov 2011 20:05:42 -0000 Received: (qmail 9364 invoked by uid 22791); 22 Nov 2011 20:05:40 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Nov 2011 20:05:23 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pAMK5Jhg002235 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 22 Nov 2011 15:05:20 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pAMK5JpL007543; Tue, 22 Nov 2011 15:05:19 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id pAMK5Huk025589; Tue, 22 Nov 2011 15:05:18 -0500 From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [2/3] RFC: *stopped and CLI commands References: <201111221508.30259.pedro@codesourcery.com> Date: Tue, 22 Nov 2011 20:05:00 -0000 In-Reply-To: <201111221508.30259.pedro@codesourcery.com> (Pedro Alves's message of "Tue, 22 Nov 2011 15:08:30 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2011-11/txt/msg00603.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> On Wednesday 16 November 2011 20:00:30, Tom Tromey wrote: >> diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c >> index 805e3f8..2aec1c7 100644 >> --- a/gdb/mi/mi-interp.c >> +++ b/gdb/mi/mi-interp.c >> @@ -429,6 +429,7 @@ mi_on_normal_stop (struct bpstats *bs, int print_frame) >> struct ui_out *saved_uiout = current_uiout; >> >> current_uiout = mi_uiout; >> + bpstat_print (bs); >> print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC); >> current_uiout = saved_uiout; >> } Pedro> Hmm, I should have read this one first. This means that with Pedro> patch 3 we'll print "Stopped due to ..." twice? Yes, I hadn't noticed that. Oops. However, we still need this call in order to get the reason= output in the MI notification when the command was a CLI command. That is, if you omit this call, you get: (gdb) run &"run\n" ~"Starting program: /home/tromey/Space/SecondArcher/build/gdb/testsuite/gdb.mi/solib-main \n" =thread-group-started,id="i1",pid="32683" =thread-created,id="1",group-id="i1" ^running *running,thread-id="all" (gdb) =library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1" ~"Stopped due to shared library event\n" *stopped,frame={addr="0x0000003a15c0ea20",func="__GI__dl_debug_state",args=[],file="dl-debug.c",fullname="/usr/src/debug/glibc-2.14-34-ge2a3090/elf/dl-debug.c",line="77"},thread-id="1",stopped-threads="all",core="2" Note how the *stopped doesn't have a reason. The fix is to leave this call to bpstat_print, but to change the printing of "Stopped due to shared library event" to use ui_out_text rather than printf_filtered. This eliminates the double printing. Tom