aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/infcmd.c10
2 files changed, 13 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5c51ae1..1062823 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2015-08-04 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ PR gdb/18767
+ * infcmd.c (attach_command): Move ARGS_CHAIN cleanup after last ARGS
+ use.
+
2015-08-04 Pedro Alves <palves@redhat.com>
* nat/gdb_thread_db.h (td_init_ftype, td_ta_new_ftype)
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 4948d27..5cd8dd7 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -2617,9 +2617,6 @@ attach_command (char *args, int from_tty)
shouldn't refer to attach_target again. */
attach_target = NULL;
- /* Done with ARGS. */
- do_cleanups (args_chain);
-
/* Set up the "saved terminal modes" of the inferior
based on what modes we are starting it with. */
target_terminal_init ();
@@ -2684,12 +2681,19 @@ attach_command (char *args, int from_tty)
a->async_exec = async_exec;
add_inferior_continuation (attach_command_continuation, a,
attach_command_continuation_free_args);
+
+ /* Done with ARGS. */
+ do_cleanups (args_chain);
+
return;
}
wait_for_inferior ();
}
+ /* Done with ARGS. */
+ do_cleanups (args_chain);
+
attach_command_post_wait (args, from_tty, async_exec);
}