This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Detaching from a remote progam: Why does GDB retain breakpoints?
- From: Michael Snyder <msnyder at vmware dot com>
- To: "Anmol P. Paralkar" <b07584 at freescale dot com>
- Cc: "gdb at sourceware dot org" <gdb at sourceware dot org>
- Date: Wed, 08 Oct 2008 15:53:15 -0700
- Subject: Re: Detaching from a remote progam: Why does GDB retain breakpoints?
- References: <Pine.LNX.4.64.0810081207460.8437@ld0159-tx32>
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.