From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11495 invoked by alias); 7 Sep 2005 13:14:15 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 10821 invoked by uid 22791); 7 Sep 2005 13:13:22 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 07 Sep 2005 13:13:22 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1ECzjr-0000pF-FZ; Wed, 07 Sep 2005 09:13:19 -0400 Date: Wed, 07 Sep 2005 13:14:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb@sources.redhat.com Subject: Re: The 'x' command: size problem Message-ID: <20050907131319.GA2963@nevyn.them.org> Mail-Followup-To: Vladimir Prus , gdb@sources.redhat.com References: <20050906152448.GA2444@nevyn.them.org> <200509061935.12549.ghost@cs.msu.su> <20050906154249.GA3270@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-09/txt/msg00047.txt.bz2 On Wed, Sep 07, 2005 at 10:53:34AM +0400, Vladimir Prus wrote: > By "asynchronous" I mean that after sending a command to gdb, I can't just > immediately get the result. I need to return to Qt message loop and wait > why gdb reply is sent to my object. So, instead of: > > unsigned size = gdb_eval("sizeof(g)"); > > I need to add another method to my class that will be called when result of > "sizeof" arrives, and this complicates the implementation quite a bit. This is a problem people have solved a thousand times... > > And it'll give you a whole new host of issues keeping up with the > > changing interface. > > But at least (assuming the interface is a nice C++ one), something like: > > get_memory(std::vector& c) > > is crystal clear, while documentation of MI's -data-read-memory output > format is very unclear. It does not document what's "table", or "next page" > is and does not link to any definitions of those terms. Please, then, feel free to improve the documentation. Really, a C++ interface would be just as complicated. Even in your example. Where would you get the memory from? How much would you get? What would it do on errors? > > I don't see how it would eliminate the need for asynchronous > > interfaces, either. > > I'd be talking with gdb in a separate thread. At least in Qt4, it will be > possible to send requests from GUI thread to debugger controller thread, > fully transparently. For Qt3, I'd implement such > across-threads-command-queue myself. Then you're going to need to asynchronously wait for the gdb thread to return data to your GUI thread. If you're willing to block waiting for that, then block waiting for GDB to print output! Really, it takes about the same amount of time. -- Daniel Jacobowitz CodeSourcery, LLC