From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11431 invoked by alias); 8 Oct 2008 22:56:04 -0000 Received: (qmail 11414 invoked by uid 22791); 8 Oct 2008 22:56:04 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.113.40.141) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 08 Oct 2008 22:55:28 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id DA31868BC; Wed, 8 Oct 2008 15:55:26 -0700 (PDT) Received: from [10.20.92.59] (promb-2s-dhcp59.eng.vmware.com [10.20.92.59]) by mailhost4.vmware.com (Postfix) with ESMTP id DA09BC9A2F; Wed, 8 Oct 2008 15:55:26 -0700 (PDT) Message-ID: <48ED39DB.8070408@vmware.com> Date: Wed, 08 Oct 2008 22:56:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: "Anmol P. Paralkar" CC: "gdb@sourceware.org" Subject: Re: Detaching from a remote progam: Why does GDB retain breakpoints? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00032.txt.bz2 Anmol P. Paralkar wrote: > Hello, > > I am trying to understand the 'detach' command and need your help. > > The documentation says: > > "After the detach command, gdb is free to connect to another target." > > So, why does GDB retain breakpoints after detaching from the remote target? > > The documentation for 'disconnect' indicates that GDB could possibly re-connect > to the same remote target so I can see why it makes sense to retain breakpoints > on a 'disconnect'. But, with a 'detach', a D-packet is sent and I suppose stubs > will then typically relinquish control and have the target proper take over. > > Should'nt GDB clear out all its target related debug-state on a 'detach'? It does clear out the target-related part. The breakpoints in the "info breakpoint" list are debugger state, not target state. Just like the symbol table. Detaching from the target doesn't clear symbols either. The premise is, you might want them again. You might, for instance, reset your target and begin a new debug session, with the same symbols and breakpoints.