- struct remote_state *rs = get_remote_state ();
- if (name == 0)
- error ("To open a remote debug connection, you need to specify what\n"
- "serial device is attached to the remote system\n"
- "(e.g. /dev/ttyS0, /dev/ttya, COM1, etc.).");
-
- /* See FIXME above */
- wait_forever_enabled_p = 1;
-
- target_preopen (from_tty);
-
- unpush_target (target);
-
- remote_desc = serial_open (name);
- if (!remote_desc)
- perror_with_name (name);
-
- if (baud_rate != -1)
- {
- if (serial_setbaudrate (remote_desc, baud_rate))
- {
- serial_close (remote_desc);
- perror_with_name (name);
- }
- }
-
- serial_raw (remote_desc);
-
- /* If there is something sitting in the buffer we might take it as a
- response to a command, which would be bad. */
- serial_flush_input (remote_desc);
-
- if (from_tty)
- {
- puts_filtered ("Remote debugging using ");
- puts_filtered (name);
- puts_filtered ("\n");
- }
- push_target (target); /* Switch to using remote target now */
-
- init_all_packet_configs ();
-
- general_thread = -2;
- continue_thread = -2;
-
- /* Probe for ability to use "ThreadInfo" query, as required. */
- use_threadinfo_query = 1;
- use_threadextra_query = 1;