From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29176 invoked by alias); 28 Mar 2007 05:56:15 -0000 Received: (qmail 29167 invoked by uid 22791); 28 Mar 2007 05:56:14 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 28 Mar 2007 06:56:11 +0100 Received: from farnswood.snap.net.nz (74.61.255.123.dynamic.snap.net.nz [123.255.61.74]) by viper.snap.net.nz (Postfix) with ESMTP id 8E7CD3D88FF; Wed, 28 Mar 2007 17:56:04 +1200 (NZST) Received: by farnswood.snap.net.nz (Postfix, from userid 500) id D580C627ED; Wed, 28 Mar 2007 06:53:16 +0100 (BST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17930.715.767042.438147@farnswood.snap.net.nz> Date: Wed, 28 Mar 2007 05:56:00 -0000 To: Daniel Jacobowitz Cc: Denis PILAT , gdb-patches@sourceware.org Subject: Re: [RFC] -thread-select double print stack frame In-Reply-To: <20070328021123.GA28506@caradoc.them.org> References: <45FE948B.9090007@st.com> <17919.12645.81319.568064@kahikatea.snap.net.nz> <4607C863.7080405@st.com> <20070327193257.GM28164@caradoc.them.org> <17929.36634.510715.364996@farnswood.snap.net.nz> <20070328021123.GA28506@caradoc.them.org> X-Mailer: VM 7.19 under Emacs 22.0.96.1 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/msg00285.txt.bz2 > > But why do you think that while file and line details are currenly > > duplicated in MI, they are not in CLI? (I mean what is the underlying > > logic/cause, not the just the code differences). > > Here's what I get from the CLI: > > [Switching to thread 1 (Thread 46912506009296 (LWP 28747))]#0 main > (argc=1, argv=0x7fffffffe178) > at /space/fsf/commit/src/gdb/gdb.c:28 > 28 { > > The first line is the frame description and becomes the new-thread-id > and the frame={} tuple. The second line ("28 {") comes from > print_source_lines (from lack of ui_source_list). I think we need > both, because we use print_source_lines in other contexts too, but I'm > not sure about that. > > So the short answer is that they are duplicated in the CLI too. The > two copies are just formatted so differently that it isn't obvious. OK. I think I understand the second call now. I was looking specifically at this clause in print_source_lines_base: if (desc < 0) { last_source_error = desc; if (!noerror) { char *name = alloca (strlen (s->filename) + 100); sprintf (name, "%d\t%s", line, s->filename); print_sys_errmsg (name, errno); } else ui_out_field_int (uiout, "line", line); ui_out_text (uiout, "\tin "); ui_out_field_string (uiout, "file", s->filename); ui_out_text (uiout, "\n"); return; } I think this code may only be reached when there is duplicated MI output. > This does make me wonder about the patch though. Denis, could you > hold off on committing it? Which duplicate copy are you eliminating? > Maybe we should diff two testsuite runs to see what else changes. No, I think this change is alright (I haven't run the testsuite though.). It's your decision but the next release is a long way off and if these changes are not the right ones they are not far off. So I would suggest committing them all i.e this one, yours and Denis's -thread-* commands now. That way if there are problems we will quite likely discover them before the release. -- Nick http://www.inet.net.nz/~nickrob