From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9572 invoked by alias); 15 Jan 2007 21:37:31 -0000 Received: (qmail 9560 invoked by uid 22791); 15 Jan 2007 21:37:30 -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; Mon, 15 Jan 2007 21:37:23 +0000 Received: from kahikatea.snap.net.nz (unknown [123.255.63.189]) by viper.snap.net.nz (Postfix) with ESMTP id 6348F3D82C4; Tue, 16 Jan 2007 10:37:19 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id 0DAE84F6D0; Tue, 16 Jan 2007 10:37:17 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17835.62476.374968.62992@kahikatea.snap.net.nz> Date: Mon, 15 Jan 2007 21:37:00 -0000 To: Denis PILAT Cc: gdb-patches Subject: Re: [RFC] Prints the frame id when target stops In-Reply-To: <45AB9A7F.1090502@st.com> References: <45AB9A7F.1090502@st.com> X-Mailer: VM 7.19 under Emacs 22.0.92.9 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/msg00348.txt.bz2 > 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. frame_id_str = xstrprintf ("%s,%s,%s", ^^^^^^^^^^ "%x,%x,%x" ? (Except this would break when paddr returned 0, so it needs a bit more detail). (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" ^^^^^^^^ "false" ? Why not include it in the frame field e.g *stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x08048520",id="0xbfd4e620,0x08048509,!special",func="main",args=[{name="argc",value="1"},{name="argv",value="0xbf8a5854"}],file="myprog.c",fullname="/home/nickrob/myprog.c",line="79"} Or even *stopped,reason="breakpoint-hit",bkptno="1",thread-id="0",frame={addr="0x08048520",id={stack="0xbfd4e620,code=0x08048509,special="false"},func="main",args=[{name="argc",value="1"},{name="argv",value="0xbf8a5854"}],file="myprog.c",fullname="/home/nickrob/myprog.c",line="79"} If this field is included in other output e.g -stack-info-frame, then maybe a separate function would be a good idea. -- Nick http://www.inet.net.nz/~nickrob