From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28485 invoked by alias); 19 Mar 2007 13:48:10 -0000 Received: (qmail 28469 invoked by uid 22791); 19 Mar 2007 13:48:09 -0000 X-Spam-Check-By: sourceware.org Received: from lon-del-03.spheriq.net (HELO lon-del-03.spheriq.net) (195.46.50.99) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 19 Mar 2007 13:48:01 +0000 Received: from lon-out-03.spheriq.net ([195.46.50.131]) by lon-del-03.spheriq.net with ESMTP id l2JDlxRI025412 for ; Mon, 19 Mar 2007 13:47:59 GMT Received: from lon-cus-01.spheriq.net (lon-cus-01.spheriq.net [195.46.50.37]) by lon-out-03.spheriq.net with ESMTP id l2JDlwXa003195 for ; Mon, 19 Mar 2007 13:47:58 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 l2JDlv0e000831 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Mon, 19 Mar 2007 13:47:57 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 C1DCEDA41 for ; Mon, 19 Mar 2007 13:47:56 +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 945FB47561 for ; Mon, 19 Mar 2007 13:47:56 +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 CKA05507 (AUTH "denis pilat"); Mon, 19 Mar 2007 14:47:55 +0100 (CET) Message-ID: <45FE948B.9090007@st.com> Date: Mon, 19 Mar 2007 13:48:00 -0000 From: Denis PILAT User-Agent: Thunderbird 1.5.0.10 (X11/20070221) MIME-Version: 1.0 To: gdb-patches Subject: [RFC] -thread-select double print stack frame Content-Type: multipart/mixed; boundary="------------030009040006010804010804" 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/msg00166.txt.bz2 This is a multi-part message in MIME format. --------------030009040006010804010804 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 904 Following discussion with Nick (http://sources.redhat.com/ml/gdb-patches/2007-03/msg00156.html), about mi output of -thread-info new command, here is a patch that fix a problem with *-thread-select* that double print the stack frame. Example: -thread-select 1 ^done,new-thread-id="1",frame={level="0",func="done_making_threads",args=[],file="/project/flexdbug/user/pd10/gdb/sts-gdb-repository/vendor/cvs/head/src/gdb/testsuite/gdb.mi/pthreads.c",fullname="/project/flexdbug/user/pd10/gdb/sts-gdb-repository/vendor/cvs/head/src/gdb/testsuite/gdb.mi/pthreads.c",line="61"},line="61",file="/project/flexdbug/user/pd10/gdb/sts-gdb-repository/vendor/cvs/head/src/gdb/testsuite/gdb.mi/pthreads.c" (gdb) As noticed by Nick, this "double printing" is not documented neither tested. I propose to remove it, it does not involved any regression in the testsuite( done for linux native target). -- Denis --------------030009040006010804010804 Content-Type: text/plain; name="thread-select.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="thread-select.patch" Content-length: 875 2007-03-19 Denis Pilat * thread.c (do_captured_thread_select): print_stack_frame use LOC_AND_ADDRESS for mi output. Index: thread.c =================================================================== RCS file: /cvs/src/src/gdb/thread.c,v retrieving revision 1.51 diff -u -p -r1.51 thread.c --- thread.c 28 Feb 2007 17:35:01 -0000 1.51 +++ thread.c 19 Mar 2007 13:27:53 -0000 @@ -700,7 +700,12 @@ do_captured_thread_select (struct ui_out ui_out_text (uiout, target_tid_to_str (inferior_ptid)); ui_out_text (uiout, ")]"); - print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC); + /* For mi, we just print location. */ + if (ui_out_is_mi_like_p (uiout)) + print_stack_frame (get_selected_frame (NULL), 1, LOC_AND_ADDRESS); + else + print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC); + return GDB_RC_OK; } --------------030009040006010804010804--