From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19163 invoked by alias); 21 Jun 2006 01:34:42 -0000 Received: (qmail 19155 invoked by uid 22791); 21 Jun 2006 01:34:42 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 21 Jun 2006 01:34:39 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1Fsrc5-0004gk-96; Tue, 20 Jun 2006 21:34:37 -0400 Date: Wed, 21 Jun 2006 02:23:00 -0000 From: Daniel Jacobowitz To: Nick Roberts Cc: gdb@sourceware.org Subject: Re: MI: event notification Message-ID: <20060621013437.GA17956@nevyn.them.org> Mail-Followup-To: Nick Roberts , gdb@sourceware.org References: <17560.40409.61785.698765@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17560.40409.61785.698765@kahikatea.snap.net.nz> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00164.txt.bz2 On Wed, Jun 21, 2006 at 01:16:09PM +1200, Nick Roberts wrote: > In the past there have been discussions about the performance of certain > MI commands. To reduce the overhead, I would like to add some event > notification where GDB informs that front end when something has changed > > I think this has always been the intention but that nothing has so far > been implemented. As a start, and by way of an example, I attach a patch > that tries to say when the stack has changed so that MI command(s) > -stack-list-frames, -stack-list-arguments need not be issued while stepping > within the same frame, for example. > > From the manual: > > `NOTIFY-ASYNC-OUTPUT ==>' > `[ TOKEN ] "=" ASYNC-OUTPUT' > > > Using the patch, "=stack-changed\n" gets printed every time the stack changes > e.g Good idea in general, bad choice of example. This is not a valid optimization, at least not where you put it. - Stepping within a frame can change the values displayed by -stack-list-arguments. On most targets + compilers they are sometimes corrupt at the beginning of a function. On many targets the "incoming" value of the argument changes when that variable is assigned to. - You can encounter the same frame ID for two consecutive stops but have a different backtrace, e.g. if you continued and then hit a breakpoint near the same function. A good place to start might be asking the Xcode folks where they put events. I know they put a bunch of them, e.g. shlib related. I don't know if they're all suitable for GDB/MI, but I bet most of them are. (And I think I talked with Jim about this particular one at some point, and they either didn't have one, or didn't use it for much). -- Daniel Jacobowitz CodeSourcery