From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25693 invoked by alias); 15 Jan 2007 16:21:35 -0000 Received: (qmail 25678 invoked by uid 22791); 15 Jan 2007 16:21:34 -0000 X-Spam-Check-By: sourceware.org Received: from vir-del-03.spheriq.net (HELO vir-del-03.spheriq.net) (194.50.41.42) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 15 Jan 2007 16:21:24 +0000 Received: from vir-out-01.spheriq.net ([194.50.41.30]) by vir-del-03.spheriq.net with ESMTP id l0FG6fcu024950 for ; Mon, 15 Jan 2007 16:06:41 GMT Received: from vir-cus-01.spheriq.net (vir-cus-01.spheriq.net [194.50.41.85]) by vir-out-01.spheriq.net with ESMTP id l0FG6eYF020888 for ; Mon, 15 Jan 2007 16:06:40 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by vir-cus-01.spheriq.net with ESMTP id l0FG6PP7012662 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 15 Jan 2007 16:06:38 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 659C0DAC7 for ; Mon, 15 Jan 2007 15:15:13 +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 3036047579 for ; Mon, 15 Jan 2007 15:15:13 +0000 (GMT) Received: from [164.129.44.95] (crx595.cro.st.com [164.129.44.95]) by mail1.cro.st.com (MOS 3.5.8-GR) with ESMTP id CJK61010 (AUTH "denis pilat"); Mon, 15 Jan 2007 16:15:11 +0100 (CET) Message-ID: <45AB9A7F.1090502@st.com> Date: Mon, 15 Jan 2007 16:21:00 -0000 From: Denis PILAT User-Agent: Thunderbird 1.5.0.9 (X11/20061206) MIME-Version: 1.0 To: gdb-patches Subject: [RFC] Prints the frame id when target stops Content-Type: multipart/mixed; boundary="------------010703050506080502000802" 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-01/txt/msg00347.txt.bz2 This is a multi-part message in MIME format. --------------010703050506080502000802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 699 We are optimizing the usage of MI commands into our Eclipse based UI. In some cases, it could take a while (and sometime more!) to refresh the thread list and the stack frame, and Eclipse does it very often. We'd like to avoid refreshing the thread and the frame view when the user perform a step (or a next) and when the program stops in the same thread and in the same frame. In the stop reason we got the current thread id, but we are missing something to identify the frame. That patch lets gdb emits on the MI output a string that could be used to easily identify the current frame. If you are ok with this approach then I'll update the testsuite. -- Denis PILAT / STMicroelectronics --------------010703050506080502000802 Content-Type: text/plain; name="stack.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="stack.c.patch" Content-length: 1210 Index: stack.c =================================================================== --- stack.c (revision 549) +++ stack.c (working copy) @@ -516,6 +516,8 @@ print_frame (struct frame_info *frame, i enum language funlang = language_unknown; struct ui_stream *stb; struct cleanup *old_chain, *list_chain; + struct frame_id this_frame_id; + char *frame_id_str = NULL; stb = ui_out_stream_new (uiout); old_chain = make_cleanup_ui_out_stream_delete (stb); @@ -674,6 +676,16 @@ print_frame (struct frame_info *frame, i } } + /* Print a string that represents the frame_id. This could be used by the UI + for comparison with the previous frame_id. */ + this_frame_id= get_frame_id (frame); + frame_id_str = xstrprintf ("%s,%s,%s", + (this_frame_id.stack_addr_p ? paddr (this_frame_id.stack_addr) : "!stack"), + (this_frame_id.code_addr_p ? paddr (this_frame_id.code_addr) : "!code"), + (this_frame_id.special_addr_p ? paddr (this_frame_id.special_addr) : "!special")); + ui_out_field_string (uiout, "frame_id", frame_id_str); + xfree (frame_id_str); + /* do_cleanups will call ui_out_tuple_end() for us. */ do_cleanups (list_chain); ui_out_text (uiout, "\n"); --------------010703050506080502000802--