if (len + 1 > sizeof sndbuf) abort ();
if (monitor_debug_p) { char *safe_string = (char *) alloca ((len * 4) + 1); monitor_printable_string (safe_string, sndbuf, 0); fprintf_unfiltered (gdb_stdlog, "sent[%s]\n", safe_string); }
monitor_printf (va_alist)     va_dcl#endif{  va_list args;  char sndbuf[2000];  int len;#ifdef ANSI_PROTOTYPES  va_start (args, pattern);#else  char *pattern;  va_start (args);  pattern = va_arg (args, char *);#endif  vsprintf (sndbuf, pattern, args);  if (remote_debug > 0)    monitor_debug ("sent -->", sndbuf, "<--");  len = strlen (sndbuf);  if (len + 1 > sizeof sndbuf)    abort ();  if (SERIAL_WRITE(monitor_desc, sndbuf, len))    fprintf_unfiltered (stderr, "SERIAL_WRITE failed: %s\n", safe_strerror (errno));  /* We used to expect that the next immediate output was the characters we     just output, but sometimes some extra junk appeared before the characters     we expected, like an extra prompt, or a portmaster sending telnet negotiations.     So, just start searching for what we sent, and skip anything unknown.  */  monitor_expect (sndbuf, (char *)0, 0);}