From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27708 invoked by alias); 26 Mar 2007 13:19:48 -0000 Received: (qmail 27696 invoked by uid 22791); 26 Mar 2007 13:19:46 -0000 X-Spam-Check-By: sourceware.org Received: from lon-del-02.spheriq.net (HELO lon-del-02.spheriq.net) (195.46.50.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 26 Mar 2007 14:19:40 +0100 Received: from lon-out-02.spheriq.net ([195.46.50.130]) by lon-del-02.spheriq.net with ESMTP id l2QDJxi9017237 for ; Mon, 26 Mar 2007 14:19:59 +0100 Received: from lon-cus-01.spheriq.net (lon-cus-01.spheriq.net [195.46.50.37]) by lon-out-02.spheriq.net with ESMTP id l2QDJbsI030608 for ; Mon, 26 Mar 2007 13:19:37 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by lon-cus-01.spheriq.net with ESMTP id l2QDJYQo004802 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Mon, 26 Mar 2007 13:19:36 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id F01F8DA41; Mon, 26 Mar 2007 13:19:32 +0000 (GMT) Received: from mail1.cro.st.com (mail1.cro.st.com [164.129.40.131]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id ACC81475FB; Mon, 26 Mar 2007 13:19:32 +0000 (GMT) Received: from [164.129.44.95] (crx595.cro.st.com [164.129.44.95]) by mail1.cro.st.com (MOS 3.7.5a-GA) with ESMTP id CKB99821 (AUTH "denis pilat"); Mon, 26 Mar 2007 15:19:31 +0200 (CEST) Message-ID: <4607C863.7080405@st.com> Date: Mon, 26 Mar 2007 13:19:00 -0000 From: Denis PILAT User-Agent: Thunderbird 1.5.0.10 (X11/20070221) MIME-Version: 1.0 To: gdb-patches@sourceware.org Cc: Nick Roberts Subject: Re: [RFC] -thread-select double print stack frame References: <45FE948B.9090007@st.com> <17919.12645.81319.568064@kahikatea.snap.net.nz> In-Reply-To: <17919.12645.81319.568064@kahikatea.snap.net.nz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2007-03/txt/msg00228.txt.bz2 > args.print_what = ui_out_is_mi_like_p (uiout) ? LOC_AND_ADDRESS : print_what > > in print_stack_frame, to centralise things and remove the need for the clause > in normal_stop. > > > Attach is a patch that fits Nick's comments and fixes the "double print" bug. Stack frame printing under MI is centralized into print_stack_frame which alway prints location and address. We don't need anymore specific code in infrun.c, but also is the -thread-info command I've submitted last week. Ok for commit ? -- Denis 2007-03-26 Denis Pilat * stack.c (print_stack_frame): alway use LOC_AND_ADDRESS in mi output. * infrun.c (normal_stop): remove mi specific frame printing treatment. Index: stack.c =================================================================== RCS file: /cvs/src/src/gdb/stack.c,v retrieving revision 1.142 diff -u -p -r1.142 stack.c --- stack.c 27 Feb 2007 19:46:04 -0000 1.142 +++ stack.c 26 Mar 2007 13:14:25 -0000 @@ -105,7 +105,8 @@ print_stack_frame (struct frame_info *fr args.frame = frame; args.print_level = print_level; - args.print_what = print_what; + /* For mi, alway print location and address. */ + args.print_what = ui_out_is_mi_like_p (uiout) ? LOC_AND_ADDRESS : print_what; args.print_args = 1; catch_errors (print_stack_frame_stub, &args, "", RETURN_MASK_ALL); Index: infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.223 diff -u -p -r1.223 infrun.c --- infrun.c 9 Mar 2007 16:20:42 -0000 1.223 +++ infrun.c 26 Mar 2007 13:14:39 -0000 @@ -3200,10 +3200,6 @@ Further execution is probably impossible default: internal_error (__FILE__, __LINE__, _("Unknown value.")); } - /* For mi, have the same behavior every time we stop: - print everything but the source line. */ - if (ui_out_is_mi_like_p (uiout)) - source_flag = LOC_AND_ADDRESS; if (ui_out_is_mi_like_p (uiout)) ui_out_field_int (uiout, "thread-id",