+2008-05-08 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * remote.c (extended_remote_attach_1): Call target_find_description.
+
2008-05-08 Daniel Jacobowitz <dan@codesourcery.com>
* remote.c (extended_remote_create_inferior_1): Clean up
struct remote_state *rs = get_remote_state ();
int pid;
char *dummy;
+ char *wait_status = NULL;
if (!args)
error_no_arg (_("process-id to attach"));
printf_unfiltered (_("Attached to %s\n"),
target_pid_to_str (pid_to_ptid (pid)));
- /* We have a wait response; reuse it. */
- rs->cached_wait_status = 1;
+ /* Save the reply for later. */
+ wait_status = alloca (strlen (rs->buf) + 1);
+ strcpy (wait_status, rs->buf);
}
else if (remote_protocol_packets[PACKET_vAttach].support == PACKET_DISABLE)
error (_("This target does not support attaching to a process"));
target_mark_running (target);
inferior_ptid = pid_to_ptid (pid);
attach_flag = 1;
+
+ /* Next, if the target can specify a description, read it. We do
+ this before anything involving memory or registers. */
+ target_find_description ();
+
+ /* Use the previously fetched status. */
+ gdb_assert (wait_status != NULL);
+ strcpy (rs->buf, wait_status);
+ rs->cached_wait_status = 1;
}
static void