aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 7f53944..944d601 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1676,6 +1676,10 @@ target_preopen (int from_tty)
void
target_detach (char *args, int from_tty)
{
+ /* If we're in breakpoints-always-inserted mode, have to
+ remove them before detaching. */
+ remove_breakpoints ();
+
(current_target.to_detach) (args, from_tty);
}
@@ -1684,6 +1688,10 @@ target_disconnect (char *args, int from_tty)
{
struct target_ops *t;
+ /* If we're in breakpoints-always-inserted mode, have to
+ remove them before disconnecting. */
+ remove_breakpoints ();
+
for (t = current_target.beneath; t != NULL; t = t->beneath)
if (t->to_disconnect != NULL)
{