From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25989 invoked by alias); 7 Aug 2002 19:31:05 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 25981 invoked from network); 7 Aug 2002 19:31:04 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 7 Aug 2002 19:31:04 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 0ED683E9C; Wed, 7 Aug 2002 15:31:03 -0400 (EDT) Message-ID: <3D517576.2070001@ges.redhat.com> Date: Wed, 07 Aug 2002 12:31:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020802 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: RFC: ``detach remote'' References: <20020806210009.GA29965@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-08/txt/msg00168.txt.bz2 > So, the GDB manual has this to say about remote debugging: > > To resume the remote program and stop debugging it, use the `detach' > command. > > This is not how gdbserver works, and it isn't how any stubs I've worked with > behave, either. They'll sit and wait for a reconnection. Rather than > change the status quo, I would like to update the documentation and provide > a way to get the previously documented behavior. This uses the "K" packet > described in my email to gdb@ last week. The new command is `detach remote' > which I'm not thrilled with but I'm a little short on ideas. It's hard to > find something to call this. > > GDB and gdbserver patches attached. Comments? I don't think this is right - either for GDB or for the remote debug agent. Local or remote, the user should be able to use: [attach PID] detach The remote protocol has two modes -- ``remote'' and ``extended-remote''. In the latter case, GDB doesn't drop the connection -- it assumes that the remote end will stay around. (Lets ignore my desire to merge the pair and instead have remote probe the other end for extended-remote support :-) Hence: In ``remote'' mode. A detach command should: drop the tcp connection; set the process free. In ``extended-remote'' mode. A detach coommand should: set the process free. (Lets also ignore that there is no attach mechanism :-). That leaves the question of how to implement it using protocol mechanisms. The ``D'' is messed up, GDB sends the D and then totally ignores the reply. As for remote debug agents, the ones I've used (pretty sure this applied to gdbserver when I last used it) quit as soon as the connection went down. An explict daemon mode was required to make them hang around. enjoy, Andrew