From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31994 invoked by alias); 17 Mar 2008 16:18:21 -0000 Received: (qmail 31986 invoked by uid 22791); 17 Mar 2008 16:18:21 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 17 Mar 2008 16:18:01 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id D2E99983BF; Mon, 17 Mar 2008 16:17:59 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id A664C98011; Mon, 17 Mar 2008 16:17:59 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JbI2A-0003iS-WB; Mon, 17 Mar 2008 12:17:59 -0400 Date: Mon, 17 Mar 2008 16:18:00 -0000 From: Daniel Jacobowitz To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: attach& support, and attach "async + sync_execution" support. Message-ID: <20080317161758.GA13212@caradoc.them.org> Mail-Followup-To: Pedro Alves , gdb-patches@sourceware.org References: <200803140805.40116.pedro@codesourcery.com> <20080314191821.GG31663@caradoc.them.org> <200803171548.09531.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200803171548.09531.pedro@codesourcery.com> User-Agent: Mutt/1.5.17 (2007-12-11) 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: 2008-03/txt/msg00232.txt.bz2 On Mon, Mar 17, 2008 at 03:48:09PM +0000, Pedro Alves wrote: > A Friday 14 March 2008 19:18:21, Daniel Jacobowitz wrote: > > Could you do some refactoring on this, please? It duplicates code > > from attach_command. When I fixed up step last year I moved the > > common code into its own function. Makes it much easier to see > > the differences between async and sync operation. And for instance > > it lets me see that you're calling deprecated_attach_hook twice > > in async mode :-) > > I don't think I was :-) There were three different exit points. > sync, async/sync_execution, and true async. Yep, you're correct. OK, it lets me confuse myself. > (P.S. Am I the only one that thinks that continuation > arguments suck? IMHO, we should move the continuation_arg data > union into the continuation proper, and force people to use > structs for the compound args. Oh, and who is responsible for > freeing the continuation args? Nobody seems to be doing that.) Yes, this is a mess. Maybe we should go back to just passing a void *... > + if (args) > + { > + async_exec = strip_bg_char (&args); > + > + /* If we get a request for running in the bg but the target > + doesn't support it, error out. */ > + if (async_exec && !target_can_async_p ()) > + error (_("Asynchronous execution not supported on this target.")); > + > + /* If we don't get a request of running in the bg, then we need > + to simulate synchronous (fg) execution. */ > + if (!async_exec && target_can_async_p ()) > + { > + /* Simulate synchronous execution */ > + async_disable_stdin (); > + } > + } This logic will work, since args should never be NULL anyway, but the call to async_disable_stdin is not dependent on args I think? Otherwise OK. -- Daniel Jacobowitz CodeSourcery