60 #include "gdb/fileio.h"
90 static int getpkt_sane (
char **buf,
long *sizeof_buf,
int forever);
92 int forever,
int *is_notif);
109 static int remote_vkill (
int pid,
struct remote_state *rs);
142 static long read_frame (
char **buf_p,
long *sizeof_buf);
256 #define OPAQUETHREADBYTES 8
263 #define MAXTHREADLISTRESULTS 32
437 static struct remote_state *
446 static struct remote_state *
449 struct remote_state *result = XCNEW (
struct remote_state);
508 error (
_(
"remote.c: error in outgoing packet."));
510 error (
_(
"remote.c: error in outgoing packet at field #%ld."),
511 strtol (buf, NULL, 16));
513 error (
_(
"Target returns error code '%s'."), buf);
527 getpkt (buf_p, sizeof_buf, 0);
536 int adjusted_size = 0;
539 p = buf + strlen (
"qRelocInsn:");
542 error (
_(
"invalid qRelocInsn packet: %s"), buf);
571 _(
"warning: relocating instruction: "));
579 adjusted_size = to - org_to;
581 xsnprintf (buf, *sizeof_buf,
"qRelocInsn:%x", adjusted_size);
585 else if (buf[0] ==
'O' && buf[1] !=
'K')
604 static struct remote_state *
623 if ((*lhs)->pnum < (*rhs)->pnum)
625 else if ((*lhs)->pnum == (*rhs)->pnum)
654 remote_regs = alloca (gdbarch_num_regs (gdbarch)
656 for (num_remote_regs = 0, regnum = 0;
659 if (regs[regnum].
pnum != -1)
660 remote_regs[num_remote_regs++] = ®s[
regnum];
665 for (regnum = 0, offset = 0; regnum < num_remote_regs; regnum++)
669 offset +=
register_size (gdbarch, remote_regs[regnum]->regnum);
683 int *
pnum,
int *poffset)
834 if (interrupt_sequence_mode == interrupt_sequence_control_c)
836 _(
"Send the ASCII ETX character (Ctrl-c) "
837 "to the remote target to interrupt the "
838 "execution of the program.\n"));
839 else if (interrupt_sequence_mode == interrupt_sequence_break)
841 _(
"send a break signal to the remote target "
842 "to interrupt the execution of the program.\n"));
843 else if (interrupt_sequence_mode == interrupt_sequence_break_g)
845 _(
"Send a break signal and 'g' a.k.a. Magic SysRq g to "
846 "the remote target to interrupt the execution "
847 "of Linux kernel.\n"));
850 _(
"Invalid value for interrupt_sequence_mode: %s."),
851 interrupt_sequence_mode);
933 #ifndef MAX_REMOTE_PACKET_SIZE
934 #define MAX_REMOTE_PACKET_SIZE 16384
937 #ifndef MIN_REMOTE_PACKET_SIZE
938 #define MIN_REMOTE_PACKET_SIZE 20
943 if (config->
size <= 0)
946 what_they_get = config->
size;
953 && what_they_get > config->
size)
954 what_they_get = config->
size;
970 if (rs->
buf_size < what_they_get + 1)
976 return what_they_get;
989 error (
_(
"Argument required (integer, `fixed' or `limited')."));
990 else if (strcmp (args,
"hard") == 0
991 || strcmp (args,
"fixed") == 0)
993 else if (strcmp (args,
"soft") == 0
994 || strcmp (args,
"limit") == 0)
1000 size = strtoul (args, &end, 0);
1002 error (
_(
"Invalid %s (bad syntax)."), config->
name);
1009 error (
_(
"Invalid %s (too large)."), config->
name);
1013 if (fixed_p && !config->
fixed_p)
1015 if (!
query (
_(
"The target may not be able to correctly handle a %s\n"
1016 "of %ld bytes. Change the packet size? "),
1017 config->
name, size))
1018 error (
_(
"Packet size not changed."));
1039 "memory-write-packet-size",
1062 "memory-read-packet-size",
1134 char *support =
"internal-error";
1139 support =
"enabled";
1142 support =
"disabled";
1145 support =
"unknown";
1152 "is auto-detected, currently %s.\n"),
1153 config->
name, support);
1158 config->
name, support);
1165 const char *title,
int legacy)
1172 config->
title = title;
1173 set_doc =
xstrprintf (
"Set use of remote protocol `%s' (%s) packet",
1175 show_doc =
xstrprintf (
"Show current use of remote "
1176 "protocol `%s' (%s) packet",
1181 &config->
detect, set_doc,
1185 &remote_set_cmdlist, &remote_show_cmdlist);
1194 legacy_name =
xstrprintf (
"%s-packet", name);
1196 &remote_set_cmdlist);
1198 &remote_show_cmdlist);
1210 && isxdigit (buf[1]) && isxdigit (buf[2])
1217 if (buf[0] ==
'E' && buf[1] ==
'.')
1236 _(
"packet_ok: attempt to use a disabled packet"));
1248 "Packet %s (%s) is supported\n",
1260 error (
_(
"Protocol error: %s (%s) conflicting enabled responses."),
1266 error (
_(
"Enabled packet %s (%s) not recognized by stub"),
1272 "Packet %s (%s) is NOT supported\n",
1464 internal_error (__FILE__, __LINE__,
_(
"Could not find config for %s"),
1612 if (strcmp (rs->
buf,
"1") == 0)
1823 int numsigs,
unsigned char *pass_signals)
1827 char *pass_packet, *p;
1832 for (i = 0; i < numsigs; i++)
1834 if (pass_signals[i])
1837 pass_packet =
xmalloc (count * 3 + strlen (
"QPassSignals:") + 1);
1838 strcpy (pass_packet,
"QPassSignals:");
1839 p = pass_packet + strlen (pass_packet);
1840 for (i = 0; i < numsigs; i++)
1842 if (pass_signals[i])
1845 *p++ =
tohex (i >> 4);
1846 *p++ =
tohex (i & 15);
1865 xfree (pass_packet);
1874 int numsigs,
unsigned char *
signals)
1883 for (i = 0; i < numsigs; i++)
1888 packet =
xmalloc (count * 3 + strlen (
"QProgramSignals:") + 1);
1889 strcpy (packet,
"QProgramSignals:");
1890 p = packet + strlen (packet);
1891 for (i = 0; i < numsigs; i++)
1896 *p++ =
tohex (i >> 4);
1897 *p++ =
tohex (i & 15);
1936 *buf++ = gen ?
'g' :
'c';
2034 return (rs->
buf[0] ==
'O' && rs->
buf[1] ==
'K');
2072 #define TAG_THREADID 1
2073 #define TAG_EXISTS 2
2074 #define TAG_DISPLAY 4
2075 #define TAG_THREADNAME 8
2076 #define TAG_MOREDISPLAY 16
2078 #define BUF_THREAD_ID_SIZE (OPAQUETHREADBYTES * 2)
2088 static char *
unpack_string (
char *src,
char *dest,
int length);
2100 static int threadmatch (threadref *dest, threadref *src);
2106 threadref *expectedref,
2117 threadref *nextthread);
2121 threadref *original_echo,
2122 threadref *resultlist,
2126 threadref *nextthread,
2130 threadref *threadlist);
2135 void *context,
int looplimit);
2154 buf +=
xsnprintf (buf, endbuf - buf,
"p-%x.", -pid);
2156 buf +=
xsnprintf (buf, endbuf - buf,
"p%x.", pid);
2160 buf +=
xsnprintf (buf, endbuf - buf,
"-%x", -tid);
2162 buf +=
xsnprintf (buf, endbuf - buf,
"%x", tid);
2182 error (
_(
"invalid remote ptid: %s"), p);
2211 if (ch >=
'a' && ch <=
'f')
2212 return ch -
'a' + 10;
2213 if (ch >=
'0' && ch <=
'9')
2215 if (ch >=
'A' && ch <=
'F')
2216 return ch -
'A' + 10;
2232 retval = retval << 4;
2269 static char *pack_string (
char *pkt,
char *
string);
2272 pack_string (
char *pkt,
char *
string)
2277 len = strlen (
string);
2284 if ((ch ==
'\0') || (ch ==
'#'))
2305 unsigned char *altid;
2307 altid = (
unsigned char *)
id;
2322 altref = (
char *)
id;
2324 while (inbuf < limit)
2328 *altref++ = (x << 4) | y;
2341 unsigned char *
scan;
2343 scan = (
unsigned char *)
id;
2349 *scan++ = (value >> 24) & 0xff;
2350 *scan++ = (value >> 16) & 0xff;
2351 *scan++ = (value >> 8) & 0xff;
2352 *scan++ = (value & 0xff);
2359 unsigned char *
scan;
2365 value = (value << 8) | ((*scan++) & 0xff);
2373 unsigned char *csrc, *cdest;
2375 csrc = (
unsigned char *) src;
2376 cdest = (
unsigned char *) dest;
2387 unsigned char *srcp, *destp;
2389 srcp = (
char *) src;
2390 destp = (
char *) dest;
2394 result &= (*srcp++ == *destp++) ? 1 : 0;
2425 #define TAG_THREADID 1
2426 #define TAG_EXISTS 2
2428 #define TAG_DISPLAY 4
2429 #define TAG_THREADNAME 8
2430 #define TAG_MOREDISPLAY 16
2456 warning (
_(
"Incomplete response to threadinfo request."));
2459 warning (
_(
"ERROR RMT Thread info mismatch."));
2467 while ((pkt < limit) && mask && *pkt)
2473 warning (
_(
"ERROR RMT: threadinfo tag mismatch."));
2481 warning (
_(
"ERROR RMT: length of threadid is not 16."));
2496 warning (
_(
"ERROR RMT: 'exists' length too long."));
2520 warning (
_(
"ERROR RMT: unknown thread info tag."));
2537 if (rs->
buf[0] ==
'\0')
2549 threadref *nextthread)
2564 threadref *original_echo, threadref *resultlist,
2569 int count, resultcount, done;
2579 while ((count-- > 0) && (pkt < limit))
2582 if (resultcount++ >= result_limit)
2595 int *done,
int *result_count, threadref *threadlist)
2608 if (*rs->
buf ==
'\0')
2628 warning (
_(
"HMM: threadlist did not echo arg thread, dropping it."));
2631 if (*result_count <= 0)
2635 warning (
_(
"RMT ERROR : failed to get remote thread list."));
2640 if (*result_count > result_limit)
2643 warning (
_(
"RMT ERROR: threadlist response longer than requested."));
2660 int done, i, result_count;
2668 if (loopcount++ > looplimit)
2671 warning (
_(
"Remote fetch threadlist -infinite loop-."));
2676 &done, &result_count,
2683 if (result_count >= 1)
2687 while (result_count--)
2776 #define CRAZY_MAX_THREADS 1000
2785 if (rs->
buf[0] ==
'Q' && rs->
buf[1] ==
'C')
2804 #if defined(HAVE_LIBEXPAT)
2834 void *user_data,
const char *body_text)
2838 if (body_text && *body_text)
2873 #if defined(HAVE_LIBEXPAT)
2879 if (xml != NULL && *xml !=
'\0')
2882 threads_elements, xml, context);
2908 if (bufp[0] !=
'\0')
2910 while (*bufp++ ==
'm')
2922 while (*bufp++ ==
',');
2950 context.items = NULL;
3056 static char display_buf[100];
3061 _(
"remote_threads_extra_info"));
3073 if (info && info->
priv)
3084 xsnprintf (b, endb - b,
"qThreadExtraInfo,");
3090 if (rs->
buf[0] != 0)
3092 n =
min (strlen (rs->
buf) / 2, sizeof (display_buf));
3094 display_buf [result] =
'\0';
3108 n +=
xsnprintf (&display_buf[0],
sizeof (display_buf) - n,
3111 n +=
xsnprintf (&display_buf[n],
sizeof (display_buf) - n,
3112 " State: %s,", threadinfo.
display);
3114 n +=
xsnprintf (&display_buf[n],
sizeof (display_buf) - n,
3120 if (
',' == display_buf[n-1])
3121 display_buf[n-1] =
' ';
3144 error (
_(
"Remote failure reply: %s"), p);
3156 remote_static_tracepoint_markers_by_strid (
struct target_ops *
self,
3171 error (
_(
"Remote failure reply: %s"), p);
3184 if (strid == NULL || strcmp (strid, marker->
str_id) == 0)
3193 memset (marker, 0,
sizeof (*marker));
3196 while (*p++ ==
',');
3260 if (remote_async_inferior_event_token)
3276 int lose, num_segments = 0, do_sections, do_segments;
3277 CORE_ADDR text_addr, data_addr, bss_addr, segments[2];
3288 if (buf[0] ==
'\000')
3293 warning (
_(
"Remote failure reply: %s"), buf);
3301 text_addr = data_addr = bss_addr = 0;
3309 while (*ptr && *ptr !=
';')
3310 text_addr = (text_addr << 4) +
fromhex (*ptr++);
3315 while (*ptr && *ptr !=
';')
3316 data_addr = (data_addr << 4) +
fromhex (*ptr++);
3324 while (*ptr && *ptr !=
';')
3325 bss_addr = (bss_addr << 4) +
fromhex (*ptr++);
3327 if (bss_addr != data_addr)
3328 warning (
_(
"Target reported unsupported offsets: %s"), buf);
3337 while (*ptr && *ptr !=
';')
3338 text_addr = (text_addr << 4) +
fromhex (*ptr++);
3344 while (*ptr && *ptr !=
';')
3345 data_addr = (data_addr << 4) +
fromhex (*ptr++);
3353 error (
_(
"Malformed response to offset query, %s"), buf);
3354 else if (*ptr !=
'\0')
3355 warning (
_(
"Target reported unsupported offsets: %s"), buf);
3363 do_segments = (data != NULL);
3364 do_sections = num_segments == 0;
3366 if (num_segments > 0)
3368 segments[0] = text_addr;
3369 segments[1] = data_addr;
3398 offs, num_segments, segments);
3400 if (ret == 0 && !do_sections)
3401 error (
_(
"Can not handle qOffsets TextSeg "
3402 "response with this symbol file"));
3448 if (interrupt_sequence_mode == interrupt_sequence_control_c)
3450 else if (interrupt_sequence_mode == interrupt_sequence_break)
3452 else if (interrupt_sequence_mode == interrupt_sequence_break_g)
3459 _(
"Invalid value for interrupt_sequence_mode: %s."),
3460 interrupt_sequence_mode);
3470 if (stop_reply[0] ==
'T' && strlen (stop_reply) > 3)
3482 p1 = strchr (p,
':');
3486 if (strncmp (p,
"thread", p1 - p) == 0)
3489 p1 = strchr (p,
';');
3515 if (wait_status != NULL)
3574 char *wait_status = NULL;
3579 if (interrupt_on_connect)
3614 putpkt (
"QStartNoAckMode");
3647 error (
_(
"Non-stop mode requested, but remote "
3648 "does not support non-stop"));
3653 if (strcmp (rs->
buf,
"OK") != 0)
3654 error (
_(
"Remote refused setting non-stop mode with: %s"), rs->
buf);
3669 if (strcmp (rs->
buf,
"OK") != 0)
3670 error (
_(
"Remote refused setting all-stop mode with: %s"), rs->
buf);
3694 if (rs->
buf[0] ==
'W' || rs->
buf[0] ==
'X')
3697 error (
_(
"The target is not running (try extended-remote?)"));
3707 wait_status = alloca (strlen (rs->
buf) + 1);
3708 strcpy (wait_status, rs->
buf);
3767 strcpy (rs->
buf, wait_status);
3787 if (strcmp (rs->
buf,
"OK") != 0)
3808 error (
_(
"The target is not running (try extended-remote?)"));
3824 error (
_(
"remote didn't report the current thread in non-stop mode"));
3918 char *msg, *reply, *tmp;
3970 phex_nz (sym_addr, addr_size), &reply[8]);
3982 static int udp_warning = 0;
3988 if (!udp_warning &&
startswith (name,
"udp:"))
3990 warning (
_(
"The remote protocol may be unreliable over UDP.\n"
3991 "Some events may be lost, rendering further debugging "
4014 "WriteReg:%x;WriteMem:%x;"
4015 "InsertBreak:%x;InsertTrace:%x;"
4016 "InsertFastTrace:%x;Stop:%x",
4025 if (strcmp (rs->
buf,
"OK") != 0)
4026 warning (
_(
"Remote refused setting permissions with: %s"), rs->
buf);
4059 const char *argument)
4063 warning (
_(
"Remote qSupported response supplied an unexpected value for"
4064 " \"%s\"."), feature->
name);
4083 if (value == NULL || *value ==
'\0')
4085 warning (
_(
"Remote target reported \"%s\" without a size."),
4091 packet_size = strtol (value, &value_end, 16);
4092 if (errno != 0 || *value_end !=
'\0' || packet_size < 0)
4094 warning (
_(
"Remote target reported \"%s\" with a bad size: \"%s\"."),
4095 feature->
name, value);
4101 warning (
_(
"limiting remote suggested packet size (%d bytes) to %d"),
4209 #if defined(HAVE_LIBEXPAT)
4210 if (remote_support_xml == NULL)
4211 remote_support_xml = concat (
"xmlRegisters=", xml, (
char *) NULL);
4214 char *copy = xstrdup (remote_support_xml + 13);
4215 char *p = strtok (copy,
",");
4219 if (strcmp (p, xml) == 0)
4226 while ((p = strtok (NULL,
",")) != NULL);
4229 remote_support_xml = reconcat (remote_support_xml,
4230 remote_support_xml,
",", xml,
4240 return reconcat (msg, msg,
";", append, (
char *) NULL);
4242 return xstrdup (append);
4251 unsigned char seen [ARRAY_SIZE (remote_protocol_features)];
4273 if (remote_support_xml)
4288 q = reconcat (q,
"qSupported:", q, (
char *) NULL);
4305 memset (seen, 0,
sizeof (seen));
4311 char *p, *end, *name_end, *
value;
4317 end = strchr (p,
';');
4320 end = p + strlen (p);
4330 warning (
_(
"empty item in \"qSupported\" response"));
4335 name_end = strchr (p,
'=');
4340 value = name_end + 1;
4361 warning (
_(
"unrecognized item \"%s\" "
4362 "in \"qSupported\" response"), p);
4368 for (i = 0; i < ARRAY_SIZE (remote_protocol_features); i++)
4369 if (strcmp (remote_protocol_features[i].
name, p) == 0)
4374 feature = &remote_protocol_features[i];
4375 feature->
func (feature, is_supported, value);
4391 for (i = 0; i < ARRAY_SIZE (remote_protocol_features); i++)
4396 feature = &remote_protocol_features[i];
4417 error (
_(
"To open a remote debug connection, you need to specify what\n"
4418 "serial device is attached to the remote system\n"
4419 "(e.g. /dev/ttyS0, /dev/ttya, COM1, etc.)."));
4423 wait_forever_enabled_p = 1;
4431 && !
query (
_(
"Already connected to a remote target. Disconnect? ")))
4432 error (
_(
"Still connected."));
4485 remote_async_inferior_event_token
4513 remote_async_terminal_ours_p = 1;
4522 wait_forever_enabled_p = 0;
4559 wait_forever_enabled_p = 1;
4568 wait_forever_enabled_p = 1;
4581 strcpy (rs->
buf,
"D");
4586 if (rs->
buf[0] ==
'O' && rs->
buf[1] ==
'K')
4588 else if (rs->
buf[0] ==
'\0')
4589 error (
_(
"Remote doesn't know how to detach"));
4591 error (
_(
"Can't detach process."));
4609 error (
_(
"Argument given to \"detach\" when remotely debugging."));
4612 error (
_(
"No process to detach from."));
4617 if (exec_file == NULL)
4632 is_fork_parent = (tp != NULL
4637 if (!is_fork_parent)
4681 if (detach_fork && !follow_child)
4703 error (
_(
"Argument given to \"disconnect\" when remotely debugging."));
4723 char *wait_status = NULL;
4731 error (
_(
"This target does not support attaching to a process"));
4758 wait_status = alloca (strlen (rs->
buf) + 1);
4759 strcpy (wait_status, rs->
buf);
4761 else if (strcmp (rs->
buf,
"OK") != 0)
4762 error (
_(
"Attaching to %s failed with: %s"),
4767 error (
_(
"This target does not support attaching to a process"));
4769 error (
_(
"Attaching to %s failed"),
4823 strcpy (rs->
buf, wait_status);
4854 strcpy (rs->
buf,
"vCont?");
4863 int support_s, support_S, support_c, support_C;
4871 while (p && *p ==
';')
4874 if (*p ==
's' && (*(p + 1) ==
';' || *(p + 1) == 0))
4876 else if (*p ==
'S' && (*(p + 1) ==
';' || *(p + 1) == 0))
4878 else if (*p ==
'c' && (*(p + 1) ==
';' || *(p + 1) == 0))
4880 else if (*p ==
'C' && (*(p + 1) ==
';' || *(p + 1) == 0))
4882 else if (*p ==
't' && (*(p + 1) ==
';' || *(p + 1) == 0))
4884 else if (*p ==
'r' && (*(p + 1) ==
';' || *(p + 1) == 0))
4887 p = strchr (p,
';');
4892 if (!support_s || !support_S || !support_c || !support_C)
4911 ptid_t ptid,
int step,
enum gdb_signal siggnal)
4915 if (step && siggnal != GDB_SIGNAL_0)
4916 p +=
xsnprintf (p, endp - p,
";S%02x", siggnal);
4919 && use_range_stepping
4955 else if (siggnal != GDB_SIGNAL_0)
4956 p +=
xsnprintf (p, endp - p,
";C%02x", siggnal);
5046 if (step || siggnal != GDB_SIGNAL_0)
5074 if (strcmp (rs->
buf,
"OK") != 0)
5075 error (
_(
"Unexpected vCont reply in non-stop mode: %s"), rs->
buf);
5085 ptid_t ptid,
int step,
enum gdb_signal siggnal)
5120 warning (
_(
" - Can't pass signal %d to target in reverse: ignored."),
5124 error (
_(
"Remote reverse-step not supported."));
5126 error (
_(
"Remote reverse-continue not supported."));
5128 strcpy (buf, step ?
"bs" :
"bc");
5130 else if (siggnal != GDB_SIGNAL_0)
5132 buf[0] = step ?
'S' :
'C';
5133 buf[1] =
tohex (((
int) siggnal >> 4) & 0xf);
5134 buf[2] =
tohex (((
int) siggnal) & 0xf);
5138 strcpy (buf, step ?
"s" :
"c");
5261 signal (signo,
ofunc);
5281 error (
_(
"Remote server does not support stopping threads"));
5285 p +=
xsnprintf (p, endp - p,
"vCont;t");
5290 p +=
xsnprintf (p, endp - p,
"vCont;t:");
5313 if (strcmp (rs->
buf,
"OK") != 0)
5367 if (
query (
_(
"The target is not responding to interrupt requests.\n"
5368 "Stop debugging it? ")))
5376 if (
query (
_(
"Interrupted while waiting for the program.\n"
5377 "Give up waiting? ")))
5402 if (!remote_async_terminal_ours_p)
5405 remote_async_terminal_ours_p = 0;
5420 if (remote_async_terminal_ours_p)
5424 remote_async_terminal_ours_p = 1;
5432 for (p = msg; p[0] && p[1]; p += 2)
5510 putpkt ((
char *) self->ack_command);
5514 error (
_(
"Unknown stop reply"));
5582 if (event_pid == -1 || event_pid ==
ptid_get_pid (thread_ptid))
5640 param.
input = context;
5710 struct remote_state *rs = param->
input;
5712 if (event->
rs == rs)
5765 param.
input = &ptid;
5772 "notif: discard queued event: 'Stop' in %s\n",
5806 "notif: push 'Stop' %s to queue %d\n",
5840 while (*p !=
'\0' && *p !=
';')
5849 strprefix (
const char *p,
const char *pend,
const char *prefix)
5851 for ( ; p < pend; p++, prefix++)
5854 return *prefix ==
'\0';
5870 event->ws.value.integer = 0;
5872 event->regcache = NULL;
5891 p1 = strchr (p,
':');
5893 error (
_(
"Malformed packet(a) (missing colon): %s\n\
5897 error (
_(
"Malformed packet(a) (missing register number): %s\n\
5916 event->watch_data_address = (
CORE_ADDR) addr;
5925 error (
_(
"Unexpected swbreak stop reason"));
5939 error (
_(
"Unexpected hwbreak stop reason"));
5949 else if (
strprefix (p, p1,
"replaylog"))
5965 event->ws.value.related_pid =
read_ptid (++p1, &p);
5970 event->ws.value.related_pid =
read_ptid (++p1, &p);
5973 else if (
strprefix (p, p1,
"vforkdone"))
5994 error (
_(
"Remote sent bad register number %s: %s\n\
6007 warning (
_(
"Remote reply is too short: %s"), buf);
6020 error (
_(
"Remote register badly formatted: %s\nhere: %s"),
6036 event->ws.value.sig = (
enum gdb_signal) sig;
6038 event->ws.value.sig = GDB_SIGNAL_UNKNOWN;
6057 event->ws.value.integer = value;
6064 event->ws.value.sig = (
enum gdb_signal) value;
6066 event->ws.value.sig = GDB_SIGNAL_UNKNOWN;
6083 p +=
sizeof (
"process:") - 1;
6088 error (
_(
"unknown stop reply packet: %s"), buf);
6091 error (
_(
"unknown stop reply packet: %s"), buf);
6098 error (
_(
"No process or thread specified in stop reply: %s"), buf);
6152 "notif: process: '%s' ack pending event\n",
6162 if (strcmp (rs->
buf,
"OK") == 0)
6172 "notif: process: '%s' no pending reply\n",
6187 *status = stop_reply->
ws;
6188 ptid = stop_reply->
ptid;
6201 if (stop_reply->regcache)
6243 if (ret != -1 && !is_notif)
6267 if (stop_reply != NULL)
6301 if (stop_reply != NULL)
6329 wait_forever_enabled_p, &is_notif);
6332 signal (SIGINT,
ofunc);
6336 if (ret != -1 && is_notif)
6349 if (buf[0] !=
'F' && buf[0] !=
'O')
6357 warning (
_(
"Remote failure reply: %s"), buf);
6365 case 'T':
case 'S':
case 'X':
case 'W':
6367 struct stop_reply *stop_reply
6388 (
"Can't send signals to this remote system. %s not sent.\n",
6403 warning (
_(
"Invalid remote reply: %s"), buf);
6471 if (reg->
pnum == -1)
6490 error (
_(
"Could not fetch register \"%s\"; remote failure reply '%s'"),
6509 error (
_(
"fetch_register_using_p: early buf termination"));
6532 while ((rs->
buf[0] <
'0' || rs->
buf[0] >
'9')
6533 && (rs->
buf[0] <
'A' || rs->
buf[0] >
'F')
6534 && (rs->
buf[0] <
'a' || rs->
buf[0] >
'f')
6535 && rs->
buf[0] !=
'x')
6539 "Bad register packet; fetching a new packet\n");
6543 buf_len = strlen (rs->
buf);
6546 if (buf_len % 2 != 0)
6547 error (
_(
"Remote 'g' packet reply is of odd length: %s"), rs->
buf);
6562 buf_len = strlen (rs->
buf);
6566 error (
_(
"Remote 'g' packet reply is too long: %s"), rs->
buf);
6606 if (p[0] == 0 || p[1] == 0)
6609 _(
"unexpected end of 'g' packet reply"));
6611 if (p[0] ==
'x' && p[1] ==
'x')
6627 _(
"unexpected end of 'g' packet reply"));
6669 warning (
_(
"could not set remote traceframe"));
6762 if (reg->
pnum == -1)
6766 p = buf + strlen (buf);
6777 error (
_(
"Could not write register \"%s\"; remote failure reply '%s'"),
6823 error (
_(
"Could not write registers; remote failure reply '%s'"),
6881 for (i = 0; num != 0; i++)
6907 for (i = width - 1; i >= 0; i--)
6909 buf[i] =
"0123456789abcdef"[(num & 0xf)];
6927 if (address_size > 0
6928 && address_size < (
sizeof (
ULONGEST) * 8))
6934 mask = (mask << address_size) - 1;
6977 if (rs->
buf[0] ==
'\0')
6981 "binary downloading NOT "
6982 "supported by target\n");
6989 "binary downloading supported by target\n");
7045 int unit_size,
ULONGEST *xfered_len_units,
7046 char packet_format,
int use_length)
7054 int payload_capacity_bytes;
7055 int payload_length_bytes;
7057 if (packet_format !=
'X' && packet_format !=
'M')
7059 _(
"remote_write_bytes_aux: bad packet format"));
7073 payload_capacity_bytes -= strlen (
"$,:#NN");
7076 payload_capacity_bytes += 1;
7077 payload_capacity_bytes -= strlen (header);
7078 payload_capacity_bytes -=
hexnumlen (memaddr);
7082 strcat (rs->
buf, header);
7083 p = rs->
buf + strlen (header);
7086 if (packet_format ==
'X')
7089 todo_units =
min (len_units, payload_capacity_bytes / unit_size);
7091 payload_capacity_bytes -=
hexnumlen (todo_units);
7092 todo_units =
min (todo_units, payload_capacity_bytes / unit_size);
7097 todo_units =
min (len_units, (payload_capacity_bytes / unit_size) / 2);
7099 payload_capacity_bytes -=
hexnumlen (todo_units);
7100 todo_units =
min (todo_units, (payload_capacity_bytes / unit_size) / 2);
7103 if (todo_units <= 0)
7105 _(
"minimum packet size too small to write data"));
7133 if (packet_format ==
'X')
7138 payload_length_bytes =
7140 &units_written, payload_capacity_bytes);
7151 if (new_todo_units != units_written)
7152 payload_length_bytes =
7155 payload_capacity_bytes);
7158 p += payload_length_bytes;
7159 if (use_length && units_written < todo_units)
7175 p += 2 *
bin2hex (myaddr, p, todo_units * unit_size);
7176 units_written = todo_units;
7182 if (rs->
buf[0] ==
'E')
7187 *xfered_len_units = (
ULONGEST) units_written;
7203 int unit_size,
ULONGEST *xfered_len)
7205 char *packet_format = 0;
7213 packet_format =
"X";
7216 packet_format =
"M";
7220 _(
"remote_write_bytes: bad internal state"));
7226 memaddr, myaddr, len, unit_size, xfered_len,
7227 packet_format[0], 1);
7246 int unit_size,
ULONGEST *xfered_len_units)
7259 todo_units =
min (len_units, (buf_size_bytes / unit_size) / 2);
7271 if (rs->
buf[0] ==
'E'
7272 && isxdigit (rs->
buf[1]) && isxdigit (rs->
buf[2])
7273 && rs->
buf[3] ==
'\0')
7278 decoded_bytes =
hex2bin (p, myaddr, todo_units * unit_size);
7280 *xfered_len_units = (
ULONGEST) (decoded_bytes / unit_size);
7293 int unit_size,
ULONGEST *xfered_len)
7309 for (p = table->
sections; p < table->sections_end; p++)
7311 if (memaddr >= p->
addr)
7319 else if (memaddr >= p->
endaddr)
7383 len, unit_size, xfered_len);
7424 va_start (ap, format);
7427 if (vsnprintf (rs->
buf, max_size, format, ap) >= max_size)
7431 error (
_(
"Communication problem with target."));
7442 int value = *(
int *)p;
7450 static const int remote_flash_timeout = 1000;
7460 &saved_remote_timeout);
7465 phex (address, addr_size),
7470 error (
_(
"Remote target does not support flash erase"));
7472 error (
_(
"Error erasing flash with vFlashErase packet"));
7488 &saved_remote_timeout);
7504 &saved_remote_timeout);
7513 error (
_(
"Remote target does not support vFlashDone"));
7515 error (
_(
"Error finishing flash operation"));
7539 int saved_errno = errno;
7567 "Target disconnected."));
7586 "Target disconnected."));
7600 getpkt (buf, sizeof_buf, 0);
7602 if ((*buf)[0] ==
'E')
7603 error (
_(
"Remote failure reply: %s"), *buf);
7655 unsigned char csum = 0;
7656 char *buf2 = alloca (cnt + 6);
7672 error (
_(
"Cannot execute this command while the target is running.\n"
7673 "Use the \"interrupt\" command to stop the target\n"
7674 "and then try again."));
7687 for (i = 0; i < cnt; i++)
7693 *p++ =
tohex ((csum >> 4) & 0xf);
7694 *p++ =
tohex (csum & 0xf);
7700 int started_error_output = 0;
7736 if (started_error_output)
7739 started_error_output = 0;
7763 "Packet instead of Ack, ignoring it\n");
7792 " Notification received: %s\n",
7804 if (!started_error_output)
7806 started_error_output = 1;
7819 if (!started_error_output)
7821 started_error_output = 1;
7921 unsigned char pktcsum;
7938 else if (check_0 < 0 || check_1 < 0)
7953 if (csum == pktcsum)
7964 "Bad checksum, sentsum=0x%x, "
7965 "csum=0x%x, buf=%s\n",
7966 pktcsum, csum, str);
7980 repeat = c -
' ' + 3;
7984 if (repeat > 0 && repeat <= 255 && bc > 0)
7986 if (bc + repeat - 1 >= *sizeof_buf - 1)
7989 *sizeof_buf += repeat;
7990 *buf_p =
xrealloc (*buf_p, *sizeof_buf);
7994 memset (&buf[bc], buf[bc - 1], repeat);
8004 if (bc >= *sizeof_buf - 1)
8008 *buf_p =
xrealloc (*buf_p, *sizeof_buf);
8035 timed_out =
getpkt_sane (buf, sizeof_buf, forever);
8053 int expecting_notif,
int *is_notif)
8065 strcpy (*buf,
"timeout");
8069 else if (expecting_notif)
8083 for (tries = 1; tries <=
MAX_TRIES; tries++)
8100 if (expecting_notif)
8109 _(
"Watchdog timeout has expired. "
8110 "Target detached."));
8156 if (is_notif != NULL)
8175 " Notification received: %s\n",
8179 if (is_notif != NULL)
8186 if (expecting_notif)
8216 int parent_pid = *(
int *) param->
input;
8226 error (
_(
"Can't kill fork child process %d"), child_pid);
8256 error (
_(
"Can't kill fork child process %d"), child_pid);
8352 if (rs->
buf[0] !=
'O' || rs->
buf[0] !=
'K')
8362 error (
_(
"Can't kill process"));
8425 if (rs->
buf[0] ==
'S' || rs->
buf[0] ==
'T')
8454 error (
_(
"Target does not support QDisableRandomization."));
8455 if (strcmp (reply,
"OK") != 0)
8456 error (
_(
"Bogus QDisableRandomization reply from target: %s"), reply);
8470 strcpy (rs->
buf,
"vRun;");
8471 len = strlen (rs->
buf);
8474 error (
_(
"Remote file name too long for run packet"));
8476 strlen (remote_exec_file));
8487 for (i = 0; argv[i] != NULL; i++)
8490 error (
_(
"Argument list too long for run packet"));
8491 rs->
buf[len++] =
';';
8498 rs->
buf[len++] =
'\0';
8511 if (remote_exec_file[0] ==
'\0')
8512 error (
_(
"Running the default executable on the remote target failed; "
8513 "try \"set remote exec-file\"?"));
8515 error (
_(
"Running \"%s\" on the remote target failed"),
8530 char *exec_file,
char *args,
8531 char **env,
int from_tty)
8552 if (remote_exec_file[0])
8553 error (
_(
"Remote target does not support \"set remote exec-file\""));
8555 error (
_(
"Remote target does not support \"set args\" or run <ARGS>"));
8571 stop_reply = run_worked ? rs->
buf : NULL;
8592 char *buf_start =
buf;
8597 buf += strlen (buf);
8598 xsnprintf (buf, buf_end - buf,
"%s",
";");
8607 buf += strlen (buf);
8608 for (i = 0; i < aexpr->
len; ++i)
8625 buf += strlen (buf);
8627 sprintf (buf,
";cmds:%x,", bp_tgt->
persist);
8628 buf += strlen (buf);
8636 sprintf (buf,
"X%x,", aexpr->
len);
8637 buf += strlen (buf);
8638 for (i = 0; i < aexpr->
len; ++i)
8661 struct remote_state *rs;
8664 struct condition_list *cond = NULL;
8682 xsnprintf (p, endbuf - p,
",%d", bpsize);
8710 Target doesn't support breakpoints that have target side commands."));
8744 return (rs->
buf[0] ==
'E');
8766 _(
"hw_bp_to_z: bad watchpoint type %d"), type);
8789 p = strchr (rs->
buf,
'\0');
8807 _(
"remote_insert_watchpoint: reached end of function"));
8816 return diff < length;
8839 p = strchr (rs->
buf,
'\0');
8855 _(
"remote_remove_watchpoint: reached end of function"));
8859 int remote_hw_watchpoint_limit = -1;
8860 int remote_hw_watchpoint_length_limit = -1;
8861 int remote_hw_breakpoint_limit = -1;
8867 if (remote_hw_watchpoint_length_limit == 0)
8869 else if (remote_hw_watchpoint_length_limit < 0)
8871 else if (len <= remote_hw_watchpoint_length_limit)
8879 int type,
int cnt,
int ot)
8883 if (remote_hw_breakpoint_limit == 0)
8885 else if (remote_hw_breakpoint_limit < 0)
8887 else if (cnt <= remote_hw_breakpoint_limit)
8892 if (remote_hw_watchpoint_limit == 0)
8894 else if (remote_hw_watchpoint_limit < 0)
8898 else if (cnt <= remote_hw_watchpoint_limit)
8975 struct remote_state *rs;
9003 xsnprintf (p, endbuf - p,
",%x", bpsize);
9017 if (rs->
buf[1] ==
'.')
9019 message = strchr (rs->
buf + 2,
'.');
9021 error (
_(
"Remote failure reply: %s"), message + 1);
9032 _(
"remote_insert_hw_breakpoint: reached end of function"));
9073 _(
"remote_remove_hw_breakpoint: reached end of function"));
9083 unsigned long host_crc, target_crc;
9097 (
long) lma, (
long) size);
9102 host_crc = xcrc32 (data, size, 0xffffffff);
9112 for (target_crc = 0, tmp = &rs->
buf[1]; *tmp; tmp++)
9113 target_crc = target_crc * 16 +
fromhex (*tmp);
9115 return (host_crc == target_crc);
9134 const char *sectname;
9143 error (
_(
"command cannot be used without an exec file"));
9148 if (args != NULL && strcmp (args,
"-r") == 0)
9154 for (s =
exec_bfd->sections; s; s = s->next)
9156 if (!(s->flags & SEC_LOAD))
9159 if (read_only && (s->flags & SEC_READONLY) == 0)
9162 size = bfd_get_section_size (s);
9166 sectname = bfd_get_section_name (
exec_bfd, s);
9167 if (args && strcmp (args, sectname) != 0)
9175 bfd_get_section_contents (
exec_bfd, s, sectdata, 0, size);
9180 error (
_(
"target memory fault, section %s, range %s -- %s"), sectname,
9198 warning (
_(
"One or more sections of the target image does not match\n\
9199 the loaded file\n"));
9200 if (args && !matched)
9210 const char *annex,
const gdb_byte *writebuf,
9223 i = snprintf (rs->
buf, max_size,
9224 "qXfer:%s:write:%s:%s:",
9225 object_name, annex ? annex :
"",
9226 phex_nz (offset,
sizeof offset));
9227 max_size -= (i + 1);
9231 (writebuf, len, 1, (
gdb_byte *) rs->
buf + i, &max_size, max_size);
9288 object_name, annex ? annex :
"",
9289 phex_nz (offset,
sizeof offset),
9300 if (rs->
buf[0] !=
'l' && rs->
buf[0] !=
'm')
9301 error (
_(
"Unknown remote qXfer reply: %s"), rs->
buf);
9306 if (rs->
buf[0] ==
'm' && packet_len == 1)
9307 error (
_(
"Remote qXfer reply contained no data."));
9311 packet_len - 1, readbuf, n);
9316 if (rs->
buf[0] ==
'l' && offset + i > 0)
9334 const char *annex,
gdb_byte *readbuf,
9338 struct remote_state *rs;
9358 if (writebuf != NULL)
9388 writebuf, offset, len, xfered_len,
9397 readbuf, offset, len, xfered_len,
9405 if (writebuf != NULL)
9436 (ops,
"features", annex, readbuf, offset, len, xfered_len,
9441 (ops,
"libraries", annex, readbuf, offset, len, xfered_len,
9446 (ops,
"libraries-svr4", annex, readbuf, offset, len, xfered_len,
9459 (ops,
"osdata", annex, readbuf, offset, len, xfered_len,
9471 (ops,
"traceframe-info", annex, readbuf, offset, len, xfered_len,
9511 error (
_(
"remote query is only available after target open"));
9529 gdb_assert (isprint (annex[i]) && annex[i] !=
'$' && annex[i] !=
'#');
9541 strcpy ((
char *) readbuf, rs->
buf);
9543 *xfered_len = strlen ((
char *) readbuf);
9560 int escaped_pattern_len;
9562 int used_pattern_len;
9570 if (pattern_len > search_space_len)
9572 if (pattern_len == 0)
9574 *found_addrp = start_addr;
9586 pattern, pattern_len, found_addrp);
9593 i = snprintf (rs->
buf, max_size,
9594 "qSearch:memory:%s;%s;",
9595 phex_nz (start_addr, addr_size),
9596 phex_nz (search_space_len,
sizeof (search_space_len)));
9597 max_size -= (i + 1);
9600 escaped_pattern_len =
9602 &used_pattern_len, max_size);
9605 if (used_pattern_len != pattern_len)
9606 error (
_(
"Pattern is too large to transmit to remote target."));
9617 pattern, pattern_len, found_addrp);
9622 if (rs->
buf[0] ==
'0')
9624 else if (rs->
buf[0] ==
'1')
9627 if (rs->
buf[1] !=
',')
9628 error (
_(
"Unknown qSearch:memory reply: %s"), rs->
buf);
9630 *found_addrp = found_addr;
9633 error (
_(
"Unknown qSearch:memory reply: %s"), rs->
buf);
9646 error (
_(
"remote rcmd is only available after target open"));
9649 if (command == NULL)
9653 strcpy (rs->
buf,
"qRcmd,");
9654 p = strchr (rs->
buf,
'\0');
9656 if ((strlen (rs->
buf) + strlen (command) * 2 + 8)
9658 error (
_(
"\"monitor\" command ``%s'' is too long."), command);
9664 error (
_(
"Communication problem with target."));
9685 error (
_(
"Target does not support this command."));
9686 if (buf[0] ==
'O' && buf[1] !=
'K')
9691 if (strcmp (buf,
"OK") == 0)
9693 if (strlen (buf) == 3 && buf[0] ==
'E'
9694 && isdigit (buf[1]) && isdigit (buf[2]))
9696 error (
_(
"Protocol error with Rcmd"));
9698 for (p = buf; p[0] !=
'\0' && p[1] !=
'\0'; p += 2)
9719 result = parse_memory_map (text);
9732 error (
_(
"command can only be used with remote target"));
9735 error (
_(
"remote-packet command requires packet text as argument"));
9753 static void threadset_test_cmd (
char *cmd,
int tty);
9755 static void threadalive_test (
char *cmd,
int tty);
9757 static void threadlist_test_cmd (
char *cmd,
int tty);
9759 int get_and_display_threadinfo (threadref *ref);
9761 static void threadinfo_test_cmd (
char *cmd,
int tty);
9763 static int thread_display_step (threadref *ref,
void *context);
9765 static void threadlist_update_test_cmd (
char *cmd,
int tty);
9767 static void init_remote_threadtests (
void);
9769 #define SAMPLE_THREAD 0x05060708
9772 threadset_test_cmd (
char *cmd,
int tty)
9774 int sample_thread = SAMPLE_THREAD;
9782 threadalive_test (
char *cmd,
int tty)
9784 int sample_thread = SAMPLE_THREAD;
9794 void output_threadid (
char *title, threadref *ref);
9797 output_threadid (
char *title, threadref *ref)
9807 threadlist_test_cmd (
char *cmd,
int tty)
9811 int done, result_count;
9812 threadref threadlist[3];
9816 &result_count, &threadlist[0]))
9820 threadref *
scan = threadlist;
9821 threadref *limit = scan + result_count;
9823 while (scan < limit)
9824 output_threadid (
" thread ", scan++);
9831 output_threadid (
"Threadid: ", &info->
threadid);
9838 get_and_display_threadinfo (threadref *ref)
9847 display_thread_info (&threadinfo);
9852 threadinfo_test_cmd (
char *cmd,
int tty)
9854 int athread = SAMPLE_THREAD;
9860 if (!get_and_display_threadinfo (&thread))
9865 thread_display_step (threadref *ref,
void *context)
9868 return get_and_display_threadinfo (ref);
9872 threadlist_update_test_cmd (
char *cmd,
int tty)
9879 init_remote_threadtests (
void)
9882 _(
"Fetch and print the remote list of "
9883 "thread identifiers, one pkt only"));
9885 _(
"Fetch and display info about one thread"));
9887 _(
"Test setting to a different thread"));
9889 _(
"Iterate through updating all remote thread info"));
9891 _(
" Remote thread alive test "));
9902 static char buf[64];
9922 xsnprintf (buf,
sizeof buf,
"Remote target");
9931 xsnprintf (buf,
sizeof buf,
"Thread <main>");
9936 xsnprintf (buf,
sizeof buf,
"Thread %d.%ld",
9939 xsnprintf (buf,
sizeof buf,
"Thread %ld",
9959 strcpy (p,
"qGetTLSAddr:");
9981 _(
"Remote target doesn't support qGetTLSAddr packet"));
9984 _(
"Remote target failed to process qGetTLSAddr request"));
9988 _(
"TLS not supported or disabled on this target"));
10006 strcpy (p,
"qGetTIBAddr:");
10025 error (
_(
"Remote target doesn't support qGetTIBAddr packet"));
10027 error (
_(
"Remote target failed to process qGetTIBAddr request"));
10030 error (
_(
"qGetTIBAddr not supported or disabled on this target"));
10067 =
gdbarch_data (gdbarch, remote_g_packet_data_handle);
10076 if (guess->
bytes == bytes)
10078 _(
"Duplicate g packet description added for size %d"),
10121 if (guess->
bytes == bytes)
10122 return guess->
tdesc;
10142 int len = strlen (
string);
10145 error (
_(
"Packet too long for target."));
10147 memcpy (*buffer,
string, len);
10165 if (2 * len > *left)
10166 error (
_(
"Packet too long for target."));
10168 bin2hex (bytes, *buffer, len);
10169 *buffer += 2 *
len;
10188 error (
_(
"Packet too long for target."));
10211 int *remote_errno,
char **attachment)
10216 *attachment = NULL;
10218 if (buffer[0] !=
'F')
10222 *retcode = strtol (&buffer[1], &p, 16);
10223 if (errno != 0 || p == &buffer[1])
10230 *remote_errno = strtol (p + 1, &p2, 16);
10231 if (errno != 0 || p + 1 == p2)
10240 *attachment = p + 1;
10243 else if (*p ==
'\0')
10267 int *remote_errno,
char **attachment,
10268 int *attachment_len)
10271 int ret, bytes_read;
10272 char *attachment_tmp;
10277 *remote_errno = FILEIO_ENOSYS;
10286 if (bytes_read < 0)
10288 *remote_errno = FILEIO_EINVAL;
10295 *remote_errno = FILEIO_EINVAL;
10298 *remote_errno = FILEIO_ENOSYS;
10307 *remote_errno = FILEIO_EINVAL;
10312 if ((attachment_tmp == NULL && attachment != NULL)
10313 || (attachment_tmp != NULL && attachment == NULL))
10315 *remote_errno = FILEIO_EINVAL;
10321 if (attachment_tmp != NULL)
10323 *attachment = attachment_tmp;
10324 *attachment_len = bytes_read - (*attachment - rs->
buf);
10359 int required_pid = (inf == NULL || inf->
fake_pid_p) ? 0 : inf->
pid;
10373 xsnprintf (arg,
sizeof (arg),
"%x", required_pid);
10377 remote_errno, NULL, NULL);
10383 rs->
fs_pid = required_pid;
10393 int flags,
int mode,
int warn_if_slow,
10402 static int warning_issued = 0;
10407 if (!warning_issued)
10409 warning (
_(
"File transfers from remote targets can be slow."
10410 " Use \"set sysroot\" to access files locally"
10412 warning_issued = 1;
10422 strlen (filename));
10431 remote_errno, NULL, NULL);
10438 int fd,
const gdb_byte *write_buf,
int len,
10460 remote_errno, NULL, NULL);
10468 int fd,
gdb_byte *read_buf,
int len,
10475 int ret, attachment_len;
10489 remote_errno, &attachment,
10497 if (read_len != ret)
10498 error (
_(
"Read returned %d, but %d bytes."), ret, (
int) read_len);
10508 int fd,
gdb_byte *read_buf,
size_t len,
10513 if (cache->
fd == fd
10514 && cache->
offset <= offset
10515 && offset < cache->offset + cache->
bufsize)
10519 if (offset + len > max)
10522 memcpy (read_buf, cache->
buf + offset - cache->
offset, len);
10562 cache->
offset, remote_errno);
10589 remote_errno, NULL, NULL);
10609 strlen (filename));
10612 remote_errno, NULL, NULL);
10626 int len, attachment_len;
10636 strlen (filename));
10639 remote_errno, &attachment,
10649 if (read_len != len)
10650 error (
_(
"Readlink returned %d, but %d bytes."), len, read_len);
10660 int fd,
struct stat *st,
10666 int attachment_len, ret;
10668 struct fio_stat fst;
10676 remote_errno, &attachment,
10680 if (*remote_errno != FILEIO_ENOSYS)
10696 memset (st, 0,
sizeof (
struct stat));
10704 if (read_len != ret)
10705 error (
_(
"vFile:fstat returned %d, but %d bytes."), ret, read_len);
10707 if (read_len !=
sizeof (fst))
10708 error (
_(
"vFile:fstat returned %d bytes, but expecting %d."),
10709 read_len, (
int)
sizeof (fst));
10733 int fd, remote_errno;
10739 FILEIO_O_RDONLY, 0700, 0,
10750 static int warning_issued = 0;
10752 if (!warning_issued)
10754 warning (
_(
"remote target does not support file"
10755 " transfer, attempting to access files"
10756 " from local filesystem."));
10757 warning_issued = 1;
10774 case FILEIO_ENOENT:
10782 case FILEIO_EACCES:
10784 case FILEIO_EFAULT:
10788 case FILEIO_EEXIST:
10790 case FILEIO_ENODEV:
10792 case FILEIO_ENOTDIR:
10794 case FILEIO_EISDIR:
10796 case FILEIO_EINVAL:
10798 case FILEIO_ENFILE:
10800 case FILEIO_EMFILE:
10804 case FILEIO_ENOSPC:
10806 case FILEIO_ESPIPE:
10810 case FILEIO_ENOSYS:
10812 case FILEIO_ENAMETOOLONG:
10813 return ENAMETOOLONG;
10823 if (host_error == -1)
10824 error (
_(
"Unknown remote I/O error %d"), errnum);
10832 int fd = *(
int *) opaque;
10841 struct cleanup *back_to, *close_cleanup;
10842 int retcode, fd, remote_errno, bytes, io_size;
10845 int bytes_in_buffer;
10851 error (
_(
"command can only be used with remote target"));
10859 remote_file, (FILEIO_O_WRONLY | FILEIO_O_CREAT
10861 0700, 0, &remote_errno);
10873 bytes_in_buffer = 0;
10876 while (bytes_in_buffer || !saw_eof)
10880 bytes = fread (buffer + bytes_in_buffer, 1,
10881 io_size - bytes_in_buffer,
10886 error (
_(
"Error reading %s."), local_file);
10892 if (bytes_in_buffer == 0)
10900 bytes += bytes_in_buffer;
10901 bytes_in_buffer = 0;
10905 offset, &remote_errno);
10909 else if (retcode == 0)
10910 error (
_(
"Remote write of %d bytes returned 0!"), bytes);
10911 else if (retcode < bytes)
10915 bytes_in_buffer = bytes - retcode;
10916 memmove (buffer, buffer + retcode, bytes_in_buffer);
10934 struct cleanup *back_to, *close_cleanup;
10935 int fd, remote_errno, bytes, io_size;
10942 error (
_(
"command can only be used with remote target"));
10945 remote_file, FILEIO_O_RDONLY, 0, 0,
10967 fd, buffer, io_size, offset, &remote_errno);
10976 bytes = fwrite (buffer, 1, bytes, file);
10993 int retcode, remote_errno;
10997 error (
_(
"command can only be used with remote target"));
11000 NULL, remote_file, &remote_errno);
11019 if (argv[0] == NULL || argv[1] == NULL || argv[2] != NULL)
11020 error (
_(
"Invalid parameters to remote put"));
11038 if (argv[0] == NULL || argv[1] == NULL || argv[2] != NULL)
11039 error (
_(
"Invalid parameters to remote get"));
11057 if (argv[0] == NULL || argv[1] != NULL)
11058 error (
_(
"Invalid parameters to remote delete"));
11160 if (strcmp (target_buf,
"OK") != 0)
11161 error (
_(
"Target does not support this command."));
11177 if (actions_list == 0)
11180 for (ndx = 0; actions_list[ndx]; ndx++)
11181 xfree (actions_list[ndx]);
11183 xfree (actions_list);
11196 for (cmd = cmds; cmd; cmd = cmd->
next)
11199 strcpy (rs->
buf,
"QTDPsrc:");
11201 rs->
buf + strlen (rs->
buf),
11205 if (strcmp (target_buf,
"OK"))
11206 warning (
_(
"Target does not support source download."));
11214 strcpy (rs->
buf,
"QTDPsrc:");
11216 rs->
buf + strlen (rs->
buf),
11220 if (strcmp (target_buf,
"OK"))
11221 warning (
_(
"Target does not support source download."));
11229 #define BUF_SIZE 2048
11234 char **tdp_actions;
11235 char **stepping_actions;
11237 struct cleanup *old_chain = NULL;
11239 struct cleanup *aexpr_chain = NULL;
11251 sprintf_vma (addrbuf, tpaddr);
11268 tpaddr, &isize, NULL))
11275 _(
"Fast tracepoint not "
11276 "valid during download"));
11282 warning (
_(
"Target does not support fast tracepoints, "
11283 "downloading %d as regular tracepoint"), b->
number);
11294 strcat (buf,
":S");
11296 error (
_(
"Static tracepoint not valid during download"));
11302 error (
_(
"Target does not support static tracepoints"));
11316 pkt = buf + strlen (buf);
11317 for (ndx = 0; ndx < aexpr->
len; ++ndx)
11323 warning (
_(
"Target does not support conditional tracepoints, "
11324 "ignoring tp %d cond"), b->
number);
11331 if (strcmp (target_buf,
"OK"))
11332 error (
_(
"Target does not support tracepoints."));
11337 for (ndx = 0; tdp_actions[ndx]; ndx++)
11343 ((tdp_actions[ndx + 1] || stepping_actions)
11348 if (strcmp (target_buf,
"OK"))
11349 error (
_(
"Error on target while setting tracepoints."));
11352 if (stepping_actions)
11354 for (ndx = 0; stepping_actions[ndx]; ndx++)
11359 ((ndx == 0) ?
"S" :
""),
11360 stepping_actions[ndx],
11361 (stepping_actions[ndx + 1] ?
"-" :
""));
11365 if (strcmp (target_buf,
"OK"))
11366 error (
_(
"Error on target while setting tracepoints."));
11374 strcpy (buf,
"QTDPsrc:");
11377 2048 - strlen (buf));
11381 if (strcmp (target_buf,
"OK"))
11382 warning (
_(
"Target does not support source download."));
11386 strcpy (buf,
"QTDPsrc:");
11389 2048 - strlen (buf));
11392 if (strcmp (target_buf,
"OK"))
11393 warning (
_(
"Target does not support source download."));
11440 p = rs->
buf + strlen (rs->
buf);
11442 error (
_(
"Trace state variable name too long for tsv definition packet"));
11447 if (*target_buf ==
'\0')
11448 error (
_(
"Target does not support this command."));
11449 if (strcmp (target_buf,
"OK") != 0)
11450 error (
_(
"Error on target while downloading trace state variable."));
11460 sprintf_vma (addr_buf, location->
address);
11465 if (*rs->
buf ==
'\0')
11466 error (
_(
"Target does not support enabling tracepoints while a trace run is ongoing."));
11467 if (strcmp (rs->
buf,
"OK") != 0)
11468 error (
_(
"Error on target while enabling tracepoint."));
11478 sprintf_vma (addr_buf, location->
address);
11483 if (*rs->
buf ==
'\0')
11484 error (
_(
"Target does not support disabling tracepoints while a trace run is ongoing."));
11485 if (strcmp (rs->
buf,
"OK") != 0)
11486 error (
_(
"Error on target while disabling tracepoint."));
11494 bfd_size_type
size;
11502 strcpy (target_buf,
"QTro");
11503 offset = strlen (target_buf);
11504 for (s =
exec_bfd->sections; s; s = s->next)
11506 char tmp1[40], tmp2[40];
11509 if ((s->flags & SEC_LOAD) == 0 ||
11511 (s->flags & SEC_READONLY) == 0)
11515 vma = bfd_get_section_vma (abfd, s);
11516 size = bfd_get_section_size (s);
11517 sprintf_vma (tmp1, vma);
11518 sprintf_vma (tmp2, vma + size);
11519 sec_length = 1 + strlen (tmp1) + 1 + strlen (tmp2);
11520 if (offset + sec_length + 1 > target_buf_size)
11524 Too many sections for read-only sections definition packet."));
11527 xsnprintf (target_buf + offset, target_buf_size - offset,
":%s,%s",
11529 offset += sec_length;
11534 getpkt (&target_buf, &target_buf_size, 0);
11543 if (*target_buf ==
'\0')
11544 error (
_(
"Target does not support this command."));
11545 if (strcmp (target_buf,
"OK") != 0)
11546 error (
_(
"Bogus reply from target: %s"), target_buf);
11590 error (
_(
"Bogus trace status reply from target: %s"), target_buf);
11623 if (reply && *reply)
11638 if (reply && *reply)
11651 if (*target_buf ==
'\0')
11652 error (
_(
"Target does not support this command."));
11653 if (strcmp (target_buf,
"OK") != 0)
11654 error (
_(
"Bogus reply from target: %s"), target_buf);
11666 int target_frameno = -1, target_tracept = -1;
11675 strcpy (p,
"QTFrame:");
11676 p = strchr (p,
'\0');
11686 xsnprintf (p, endbuf - p,
"tdp:%x", num);
11697 error (
_(
"Unknown trace find type %d"), type);
11702 if (*reply ==
'\0')
11703 error (
_(
"Target does not support this command."));
11705 while (reply && *reply)
11710 target_frameno = (
int) strtol (p, &reply, 16);
11712 error (
_(
"Unable to parse trace frame number"));
11715 if (target_frameno == -1)
11720 target_tracept = (
int) strtol (p, &reply, 16);
11722 error (
_(
"Unable to parse tracepoint number"));
11725 if (reply[1] ==
'K' && reply[2] ==
'\0')
11728 error (
_(
"Bogus reply from target: %s"), reply);
11731 error (
_(
"Bogus reply from target: %s"), reply);
11734 *tpp = target_tracept;
11737 return target_frameno;
11753 if (reply && *reply)
11772 strcpy (p,
"QTSave:");
11775 error (
_(
"Remote file name too long for trace save packet"));
11780 if (*reply ==
'\0')
11781 error (
_(
"Target does not support this command."));
11782 if (strcmp (reply,
"OK") != 0)
11783 error (
_(
"Bogus reply from target: %s"), reply);
11802 strcpy (p,
"qTBuffer:");
11811 if (reply && *reply)
11823 rslt =
hex2bin (target_buf, buf, len);
11843 if (*reply ==
'\0')
11844 error (
_(
"Target does not support this command."));
11845 if (strcmp (reply,
"OK") != 0)
11846 error (
_(
"Bogus reply from target: %s"), reply);
11849 warning (
_(
"Target does not support disconnected tracing."));
11857 if (info && info->
priv)
11871 if (*reply ==
'\0')
11872 error (
_(
"Target does not support this command."));
11873 if (strcmp (reply,
"OK") != 0)
11874 error (
_(
"Bogus reply from target: %s"), reply);
11919 if (*reply ==
'\0')
11927 return (
int) min_insn_len;
11942 buf +=
xsnprintf (buf, endbuf - buf,
"QTBuffer:size:");
11958 warning (
_(
"Bogus reply from target: %s"), rs->
buf);
11964 const char *user,
const char *notes,
11965 const char *stop_notes)
11973 buf +=
xsnprintf (buf, endbuf - buf,
"QTNotes:");
11976 buf +=
xsnprintf (buf, endbuf - buf,
"user:");
11983 buf +=
xsnprintf (buf, endbuf - buf,
"notes:");
11990 buf +=
xsnprintf (buf, endbuf - buf,
"tstop:");
11991 nbytes =
bin2hex ((
gdb_byte *) stop_notes, buf, strlen (stop_notes));
12000 if (*reply ==
'\0')
12003 if (strcmp (reply,
"OK") != 0)
12004 error (
_(
"Bogus reply from target: %s"), reply);
12021 if (strcmp (rs->
buf,
"OK") == 0)
12077 #if defined (HAVE_LIBIPT)
12084 internal_error (__FILE__, __LINE__,
_(
"Unknown branch trace format"));
12093 struct remote_state *rs;
12094 char *
buf, *pos, *endbuf;
12105 pos +=
xsnprintf (pos, endbuf - pos,
"%s=0x%x", packet->
name,
12113 if (buf[0] ==
'E' && buf[1] ==
'.')
12114 error (
_(
"Failed to configure the BTS buffer size: %s"), buf + 2);
12116 error (
_(
"Failed to configure the BTS buffer size."));
12127 pos +=
xsnprintf (pos, endbuf - pos,
"%s=0x%x", packet->
name,
12135 if (buf[0] ==
'E' && buf[1] ==
'.')
12136 error (
_(
"Failed to configure the trace buffer size: %s"), buf + 2);
12138 error (
_(
"Failed to configure the trace buffer size."));
12189 error (
_(
"Target does not support branch tracing."));
12201 if (rs->
buf[0] ==
'E' && rs->
buf[1] ==
'.')
12202 error (
_(
"Could not enable branch tracing for %s: %s"),
12205 error (
_(
"Could not enable branch tracing for %s."),
12209 tinfo =
xzalloc (
sizeof (*tinfo));
12210 tinfo->
ptid = ptid;
12220 if (
err.message != NULL)
12240 error (
_(
"Target does not support branch tracing."));
12250 if (rs->
buf[0] ==
'E' && rs->
buf[1] ==
'.')
12251 error (
_(
"Could not disable branch tracing for %s: %s"),
12254 error (
_(
"Could not disable branch tracing for %s."),
12286 error (
_(
"Target does not support branch tracing."));
12288 #if !defined(HAVE_LIBEXPAT)
12289 error (
_(
"Cannot process branch tracing result. XML parsing not supported."));
12305 _(
"Bad branch tracing read type: %u."),
12306 (
unsigned int) type);
12325 return &tinfo->
conf;
12350 static char *filename = NULL;
12352 char *annex = NULL;
12357 if (filename != NULL)
12363 _(
"not currently attached to process %d"), pid);
12367 const int annex_size = 9;
12369 annex = alloca (annex_size);
12370 xsnprintf (annex, annex_size,
"%x", pid);
12385 "Use a remote computer via a serial line, using a gdb-specific protocol.\n\
12386 Specify the serial device it is connected to\n\
12387 (e.g. /dev/ttyS0, /dev/ttya, COM1, etc.).";
12441 remote_ops.to_memory_map = remote_memory_map;
12498 remote_ops.to_static_tracepoint_markers_by_strid
12499 = remote_static_tracepoint_markers_by_strid;
12523 "Extended remote serial target in gdb-specific protocol";
12525 "Use a remote computer via a serial line, using a gdb-specific protocol.\n\
12526 Specify the serial device it is connected to (e.g. /dev/ttya).";
12582 struct remote_state *rs = context;
12627 struct cleanup *showlist_chain;
12632 for (; list != NULL; list = list->
next)
12633 if (strcmp (list->
name,
"Z-packet") == 0)
12684 while (*p && *p !=
'l')
12706 while (*p && *p !=
'l')
12725 _(
"Debugger's willingness to use range stepping "
12726 "is %s.\n"), value);
12739 if (use_range_stepping)
12751 warning (
_(
"Range stepping is not supported by the current target"));
12758 struct remote_state *rs;
12760 const char *cmd_name;
12763 remote_gdbarch_data_handle =
12765 remote_g_packet_data_handle =
12786 async_sigint_remote_token =
12788 async_sigint_remote_twice_token =
12792 init_remote_threadtests ();
12799 Remote protocol specific variables\n\
12800 Configure various remote-protocol specific variables such as\n\
12801 the packets being used"),
12802 &remote_set_cmdlist,
"set remote ",
12805 Remote protocol specific variables\n\
12806 Configure various remote-protocol specific variables such as\n\
12807 the packets being used"),
12808 &remote_show_cmdlist,
"show remote ",
12812 Compare section data on target to the exec file.\n\
12813 Argument is a single section name (default: all loaded sections).\n\
12814 To compare only read-only loaded sections, specify the -r option."),
12818 Send an arbitrary packet to a remote target.\n\
12819 maintenance packet TEXT\n\
12820 If GDB is talking to an inferior via the GDB serial protocol, then\n\
12821 this command sends the string TEXT to the inferior, and displays the\n\
12822 response packet. GDB supplies the initial `$' character, and the\n\
12823 terminating `#' character and checksum."),
12827 Set whether to send break if interrupted."),
_(
"\
12828 Show whether to send break if interrupted."),
_(
"\
12829 If set, a break, instead of a cntrl-c, is sent to the remote target."),
12832 cmd_name =
"remotebreak";
12835 cmd_name =
"remotebreak";
12840 interrupt_sequence_modes, &interrupt_sequence_mode,
12842 Set interrupt sequence to remote target."),
_(
"\
12843 Show interrupt sequence to remote target."),
_(
"\
12844 Valid value is \"Ctrl-C\", \"BREAK\" or \"BREAK-g\". The default is \"Ctrl-C\"."),
12846 &remote_set_cmdlist,
12847 &remote_show_cmdlist);
12850 &interrupt_on_connect,
_(
"\
12851 Set whether interrupt-sequence is sent to remote target when gdb connects to."),
_(
" \
12852 Show whether interrupt-sequence is sent to remote target when gdb connects to."),
_(
" \
12853 If set, interrupt sequence is sent to remote target."),
12855 &remote_set_cmdlist, &remote_show_cmdlist);
12860 Set the maximum number of bytes per memory write packet (deprecated)."),
12863 Show the maximum number of bytes per memory write packet (deprecated)."),
12867 Set the maximum number of bytes per memory-write packet.\n\
12868 Specify the number of bytes in a packet or 0 (zero) for the\n\
12869 default packet size. The actual limit is further reduced\n\
12870 dependent on the target. Specify ``fixed'' to disable the\n\
12871 further restriction and ``limit'' to enable that restriction."),
12872 &remote_set_cmdlist);
12875 Set the maximum number of bytes per memory-read packet.\n\
12876 Specify the number of bytes in a packet or 0 (zero) for the\n\
12877 default packet size. The actual limit is further reduced\n\
12878 dependent on the target. Specify ``fixed'' to disable the\n\
12879 further restriction and ``limit'' to enable that restriction."),
12880 &remote_set_cmdlist);
12883 _(
"Show the maximum number of bytes per memory-write packet."),
12884 &remote_show_cmdlist);
12887 _(
"Show the maximum number of bytes per memory-read packet."),
12888 &remote_show_cmdlist);
12891 &remote_hw_watchpoint_limit,
_(
"\
12892 Set the maximum number of target hardware watchpoints."),
_(
"\
12893 Show the maximum number of target hardware watchpoints."),
_(
"\
12894 Specify a negative limit for unlimited."),
12898 &remote_set_cmdlist, &remote_show_cmdlist);
12900 &remote_hw_watchpoint_length_limit,
_(
"\
12901 Set the maximum length (in bytes) of a target hardware watchpoint."),
_(
"\
12902 Show the maximum length (in bytes) of a target hardware watchpoint."),
_(
"\
12903 Specify a negative limit for unlimited."),
12907 &remote_set_cmdlist, &remote_show_cmdlist);
12909 &remote_hw_breakpoint_limit,
_(
"\
12910 Set the maximum number of target hardware breakpoints."),
_(
"\
12911 Show the maximum number of target hardware breakpoints."),
_(
"\
12912 Specify a negative limit for unlimited."),
12916 &remote_set_cmdlist, &remote_show_cmdlist);
12919 &remote_address_size,
_(
"\
12920 Set the maximum size of the address (in bits) in a memory packet."),
_(
"\
12921 Show the maximum size of the address (in bits) in a memory packet."), NULL,
12929 "X",
"binary-download", 1);
12932 "vCont",
"verbose-resume", 0);
12935 "QPassSignals",
"pass-signals", 0);
12938 "QProgramSignals",
"program-signals", 0);
12941 "qSymbol",
"symbol-lookup", 0);
12944 "P",
"set-register", 1);
12947 "p",
"fetch-register", 1);
12950 "Z0",
"software-breakpoint", 0);
12953 "Z1",
"hardware-breakpoint", 0);
12956 "Z2",
"write-watchpoint", 0);
12959 "Z3",
"read-watchpoint", 0);
12962 "Z4",
"access-watchpoint", 0);
12965 "qXfer:auxv:read",
"read-aux-vector", 0);
12968 "qXfer:exec-file:read",
"pid-to-exec-file", 0);
12971 "qXfer:features:read",
"target-features", 0);
12974 "qXfer:libraries:read",
"library-info", 0);
12977 "qXfer:libraries-svr4:read",
"library-info-svr4", 0);
12980 "qXfer:memory-map:read",
"memory-map", 0);
12983 "qXfer:spu:read",
"read-spu-object", 0);
12986 "qXfer:spu:write",
"write-spu-object", 0);
12989 "qXfer:osdata:read",
"osdata", 0);
12992 "qXfer:threads:read",
"threads", 0);
12995 "qXfer:siginfo:read",
"read-siginfo-object", 0);
12998 "qXfer:siginfo:write",
"write-siginfo-object", 0);
13002 "qXfer:traceframe-info:read",
"traceframe-info", 0);
13005 "qXfer:uib:read",
"unwind-info-block", 0);
13008 "qGetTLSAddr",
"get-thread-local-storage-address",
13012 "qGetTIBAddr",
"get-thread-information-block-address",
13016 "bc",
"reverse-continue", 0);
13019 "bs",
"reverse-step", 0);
13022 "qSupported",
"supported-packets", 0);
13025 "qSearch:memory",
"search-memory", 0);
13028 "qTStatus",
"trace-status", 0);
13031 "vFile:setfs",
"hostio-setfs", 0);
13034 "vFile:open",
"hostio-open", 0);
13037 "vFile:pread",
"hostio-pread", 0);
13040 "vFile:pwrite",
"hostio-pwrite", 0);
13043 "vFile:close",
"hostio-close", 0);
13046 "vFile:unlink",
"hostio-unlink", 0);
13049 "vFile:readlink",
"hostio-readlink", 0);
13052 "vFile:fstat",
"hostio-fstat", 0);
13055 "vAttach",
"attach", 0);
13061 "QStartNoAckMode",
"noack", 0);
13064 "vKill",
"kill", 0);
13067 "qAttached",
"query-attached", 0);
13070 "ConditionalTracepoints",
13071 "conditional-tracepoints", 0);
13074 "ConditionalBreakpoints",
13075 "conditional-breakpoints", 0);
13078 "BreakpointCommands",
13079 "breakpoint-commands", 0);
13082 "FastTracepoints",
"fast-tracepoints", 0);
13085 "TracepointSource",
"TracepointSource", 0);
13088 "QAllow",
"allow", 0);
13091 "StaticTracepoints",
"static-tracepoints", 0);
13094 "InstallInTrace",
"install-in-trace", 0);
13097 "qXfer:statictrace:read",
"read-sdata-object", 0);
13100 "qXfer:fdpic:read",
"read-fdpic-loadmap", 0);
13103 "QDisableRandomization",
"disable-randomization", 0);
13106 "QAgent",
"agent", 0);
13109 "QTBuffer:size",
"trace-buffer-size", 0);
13112 "Qbtrace:off",
"disable-btrace", 0);
13115 "Qbtrace:bts",
"enable-btrace-bts", 0);
13118 "Qbtrace:pt",
"enable-btrace-pt", 0);
13121 "qXfer:btrace",
"read-btrace", 0);
13124 "qXfer:btrace-conf",
"read-btrace-conf", 0);
13127 "Qbtrace-conf:bts:size",
"btrace-conf-bts-size", 0);
13130 "swbreak-feature",
"swbreak-feature", 0);
13133 "hwbreak-feature",
"hwbreak-feature", 0);
13136 "fork-event-feature",
"fork-event-feature", 0);
13139 "vfork-event-feature",
"vfork-event-feature", 0);
13142 "Qbtrace-conf:pt:size",
"btrace-conf-pt-size", 0);
13184 &remote_Z_packet_detect,
_(
"\
13185 Set use of remote protocol `Z' packets"),
_(
"\
13186 Show use of remote protocol `Z' packets "),
_(
"\
13187 When set, GDB will attempt to use the remote breakpoint and watchpoint\n\
13193 &remote_set_cmdlist, &remote_show_cmdlist);
13196 Manipulate files on the remote system\n\
13197 Transfer files to and from the remote target system."),
13198 &remote_cmdlist,
"remote ",
13202 _(
"Copy a local file to the remote system."),
13206 _(
"Copy a remote file to the local system."),
13210 _(
"Delete a remote file."),
13213 remote_exec_file = xstrdup (
"");
13215 &remote_exec_file,
_(
"\
13216 Set the remote pathname for \"run\""),
_(
"\
13217 Show the remote pathname for \"run\""), NULL, NULL, NULL,
13218 &remote_set_cmdlist, &remote_show_cmdlist);
13221 &use_range_stepping,
_(
"\
13222 Enable or disable range stepping."),
_(
"\
13223 Show whether target-assisted range stepping is enabled."),
_(
"\
13224 If on, and the target supports it, when stepping a source line, GDB\n\
13225 tells the target to step the corresponding range of addresses itself instead\n\
13226 of issuing multiple single-steps. This speeds up source level\n\
13227 stepping. If off, GDB always issues single-steps, even if range\n\
13228 stepping is supported by the target. The default is on."),
13239 magic_null_ptid =
ptid_build (42000, -1, 1);
13243 target_buf_size = 2048;
13244 target_buf =
xmalloc (target_buf_size);
void error_no_arg(const char *why)
int(* to_fileio_pread)(struct target_ops *, int fd, gdb_byte *read_buf, int len, ULONGEST offset, int *target_errno)
static int remote_notif_remove_once_on_match(QUEUE(stop_reply_p)*q, QUEUE_ITER(stop_reply_p)*iter, stop_reply_p event, void *data)
struct gdbarch * target_gdbarch(void)
long actual_register_packet_size
static const struct btrace_config * remote_btrace_conf(struct target_ops *self, const struct btrace_target_info *tinfo)
struct cleanup * make_cleanup_freeargv(char **arg)
static void extended_remote_mourn(struct target_ops *)
#define target_can_async_p()
static enum packet_result remote_send_printf(const char *format,...) ATTRIBUTE_PRINTF(1
static int hexnumstr(char *, ULONGEST)
static int remote_use_agent(struct target_ops *self, int use)
void add_target(struct target_ops *t)
static int remote_multi_process_p(struct remote_state *rs)
int default_child_has_stack(struct target_ops *ops)
void target_terminal_ours(void)
int serial_is_async_p(struct serial *scb)
struct cleanup * make_cleanup_free_agent_expr(struct agent_expr *x)
static void init_remote_ops(void)
struct btrace_config_bts bts
char * hex_string(LONGEST num)
static void interrupt_query(void)
struct private_thread_info * priv
static struct remote_state * new_remote_state(void)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
static void remote_set_permissions(struct target_ops *self)
const char interrupt_sequence_control_c[]
void release_static_tracepoint_marker(struct static_tracepoint_marker *marker)
static void remote_flash_erase(struct target_ops *ops, ULONGEST address, LONGEST length)
static void show_interrupt_sequence(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
struct command_line * breakpoint_commands(struct breakpoint *b)
static int remote_insert_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, int type, struct expression *cond)
void reopen_exec_file(void)
struct cmd_list_element * next
struct thread_info * add_thread(ptid_t ptid)
struct address_space * maybe_new_address_space(void)
static void extended_remote_post_attach(struct target_ops *ops, int pid)
struct thread_info * find_thread_ptid(ptid_t ptid)
static int remote_get_trace_state_variable_value(struct target_ops *self, int tsvnum, LONGEST *val)
static int remote_remove_hw_breakpoint(struct target_ops *self, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
int(* to_supports_stopped_by_hw_breakpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static int remote_watchpoint_addr_within_range(struct target_ops *target, CORE_ADDR addr, CORE_ADDR start, int length)
int remote_unescape_input(const gdb_byte *buffer, int len, gdb_byte *out_buf, int out_maxlen)
static enum target_xfer_status remote_read_bytes_1(CORE_ADDR memaddr, gdb_byte *myaddr, ULONGEST len_units, int unit_size, ULONGEST *xfered_len_units)
int(* to_supports_disable_randomization)(struct target_ops *)
const struct target_desc *(* to_read_description)(struct target_ops *ops) TARGET_DEFAULT_RETURN(NULL)
int(* to_is_async_p)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static int remote_newthread_step(threadref *ref, void *context)
int(* to_upload_tracepoints)(struct target_ops *, struct uploaded_tp **utpp) TARGET_DEFAULT_RETURN(0)
int putchar_unfiltered(int c)
void(* to_trace_init)(struct target_ops *) TARGET_DEFAULT_NORETURN(tcomplain())
static ptid_t stop_reply_extract_thread(char *stop_reply)
int(* to_supports_evaluation_of_breakpoint_conditions)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static enum packet_support packet_config_support(struct packet_config *config)
#define SECT_OFF_TEXT(objfile)
static int map_regcache_remote_table(struct gdbarch *gdbarch, struct packet_reg *regs)
void(* to_program_signals)(struct target_ops *, int, unsigned char *TARGET_DEBUG_PRINTER(target_debug_print_signals)) TARGET_DEFAULT_IGNORE()
void target_stop(ptid_t ptid)
static char * skip_to_semicolon(char *p)
static int remote_hostio_parse_result(char *buffer, int *retcode, int *remote_errno, char **attachment)
static int remote_static_tracepoint_marker_at(struct target_ops *self, CORE_ADDR addr, struct static_tracepoint_marker *marker)
static char * pack_threadlist_request(char *pkt, int startflag, int threadcount, threadref *nextthread)
CORE_ADDR step_range_start
static int remote_upload_trace_state_variables(struct target_ops *self, struct uploaded_tsv **utsvp)
int ptid_is_pid(ptid_t ptid)
void parse_xml_btrace(struct btrace_data *btrace, const char *buffer)
static void extended_remote_attach(struct target_ops *target, const char *args, int from_tty)
const char interrupt_sequence_break[]
const char interrupt_sequence_break_g[]
int remote_traceframe_number
void add_setshow_zinteger_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void add_setshow_zuinteger_cmd(const char *name, enum command_class theclass, unsigned int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static void kill_new_fork_children(int pid, struct remote_state *rs)
void clear_async_signal_handler(async_signal_handler *async_handler_ptr)
static void set_memory_write_packet_size(char *args, int from_tty)
static int set_stop_requested_callback(struct thread_info *thread, void *data)
int ptid_equal(ptid_t ptid1, ptid_t ptid2)
static void sync_remote_interrupt_twice(int signo)
void remote_notif_process(struct remote_notif_state *state, struct notif_client *except)
static int remote_can_execute_reverse(struct target_ops *self)
static void remote_terminal_ours(struct target_ops *self)
static int remote_can_download_tracepoint(struct target_ops *self)
void insert_breakpoints(void)
int(* to_fileio_close)(struct target_ops *, int fd, int *target_errno)
static void show_remote_protocol_Z_packet_cmd(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static int remote_augmented_libraries_svr4_read(struct target_ops *self)
static int remote_hostio_send_command(int command_bytes, int which_packet, int *remote_errno, char **attachment, int *attachment_len)
void fputs_unfiltered(const char *buf, struct ui_file *file)
static struct serial * remote_serial_open(const char *name)
struct thread_item thread_item_t
void delete_thread(ptid_t)
static void remote_stop_as(ptid_t ptid)
static int peek_stop_reply(ptid_t ptid)
static char * remote_support_xml
static const char * interrupt_sequence_mode
static int threadmatch(threadref *dest, threadref *src)
int target_verify_memory(const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size)
static struct remote_state * get_remote_state_raw(void)
int may_insert_fast_tracepoints
void set_running(ptid_t ptid, int running)
int(* rmt_thread_action)(threadref *ref, void *context)
static void remote_vcont_probe(struct remote_state *rs)
static void show_range_stepping(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
struct target_waitstatus pending_follow
static char * unpack_string(char *src, char *dest, int length)
void parse_tracepoint_definition(char *line, struct uploaded_tp **utpp)
__extension__ enum cmd_types type
static void remote_get_command(char *args, int from_tty)
static char * unpack_threadid(char *inbuf, threadref *id)
int gdbarch_has_global_solist(struct gdbarch *gdbarch)
#define GDBARCH_OBSTACK_CALLOC(GDBARCH, NR, TYPE)
static int remote_supports_disable_randomization(struct target_ops *self)
void no_shared_libraries(char *ignored, int from_tty)
static ptid_t remote_get_ada_task_ptid(struct target_ops *self, long lwp, long thread)
struct gdbarch * get_regcache_arch(const struct regcache *regcache)
static void set_general_process(void)
static struct async_event_handler * remote_async_inferior_event_token
static void remote_parse_stop_reply(char *, struct stop_reply *)
void clear_quit_flag(void)
static char * unpack_byte(char *buf, int *value)
static int remote_check_watch_resources(struct target_ops *self, int type, int cnt, int ot)
void add_setshow_enum_cmd(const char *name, enum command_class theclass, const char *const *enumlist, const char **var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
#define QUEUE_enque(TYPE, Q, V)
#define BMSYMBOL_VALUE_ADDRESS(symbol)
int(* to_has_memory)(struct target_ops *)
void warning(const char *fmt,...)
static void remote_flash_done(struct target_ops *ops)
struct cmd_list_element * deprecate_cmd(struct cmd_list_element *cmd, const char *replacement)
void(* to_trace_start)(struct target_ops *) TARGET_DEFAULT_NORETURN(tcomplain())
struct counted_command_line * commands
static int remote_get_min_fast_tracepoint_insn_len(struct target_ops *self)
CORE_ADDR * segment_bases
char *(* to_pid_to_str)(struct target_ops *, ptid_t) TARGET_DEFAULT_FUNC(default_pid_to_str)
void getpkt(char **buf, long *sizeof_buf, int forever)
static void scan(struct macro_buffer *dest, struct macro_buffer *src, struct macro_name_list *no_loop, macro_lookup_ftype *lookup_func, void *lookup_baton)
void(* to_flash_done)(struct target_ops *) TARGET_DEFAULT_NORETURN(tcomplain())
struct type ** const(pascal_builtin_types[])
int query(const char *ctlstr,...)
enum gdb_signal last_sent_signal
void init_wait_for_inferior(void)
int disable_randomization
static void restore_remote_timeout(void *p)
static const struct @41 signals[]
int(* to_has_stack)(struct target_ops *)
char * ui_file_xstrdup(struct ui_file *file, long *length)
void push_target(struct target_ops *t)
int(* to_insert_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_FUNC(memory_insert_breakpoint)
int bin2hex(const gdb_byte *bin, char *hex, int count)
void * gdbarch_data(struct gdbarch *gdbarch, struct gdbarch_data *data)
static void set_remote_traceframe(void)
char *(* to_extra_thread_info)(struct target_ops *, struct thread_info *) TARGET_DEFAULT_RETURN(NULL)
static void set_remote_cmd(char *args, int from_tty)
static void remote_new_objfile(struct objfile *objfile)
void register_remote_support_xml(const char *xml)
#define QUEUE_length(TYPE, Q)
void(* to_rcmd)(struct target_ops *, const char *command, struct ui_file *output) TARGET_DEFAULT_FUNC(default_rcmd)
static enum btrace_error remote_read_btrace(struct target_ops *self, struct btrace_data *btrace, struct btrace_target_info *tinfo, enum btrace_read_type type)
static void async_remote_interrupt(gdb_client_data arg)
static int remote_hostio_unlink(struct target_ops *self, struct inferior *inf, const char *filename, int *remote_errno)
static void btrace_sync_conf(const struct btrace_config *conf)
struct ui_file * gdb_stdout
#define QUEUE_is_empty(TYPE, Q)
static void remote_pass_signals(struct target_ops *self, int numsigs, unsigned char *pass_signals)
char * phex(ULONGEST l, int sizeof_l)
int(* to_core_of_thread)(struct target_ops *, ptid_t ptid) TARGET_DEFAULT_RETURN(-1)
int unpush_target(struct target_ops *t)
int(* to_follow_fork)(struct target_ops *, int, int) TARGET_DEFAULT_FUNC(default_follow_fork)
void call_async_signal_handler(struct async_signal_handler *handler)
int ptid_match(ptid_t ptid, ptid_t filter)
void internal_error(const char *file, int line, const char *fmt,...)
struct thread_info * inferior_thread(void)
static enum target_xfer_status remote_write_bytes(CORE_ADDR memaddr, const gdb_byte *myaddr, ULONGEST len, int unit_size, ULONGEST *xfered_len)
void delete_async_event_handler(async_event_handler **async_handler_ptr)
static void compare_sections_command(char *, int)
static int wait_forever_enabled_p
void generic_mourn_inferior(void)
static enum target_xfer_status remote_flash_write(struct target_ops *ops, ULONGEST address, ULONGEST length, ULONGEST *xfered_len, const gdb_byte *data)
static void remote_rcmd(struct target_ops *self, const char *command, struct ui_file *outbuf)
void(* to_close)(struct target_ops *)
void objfile_relocate(struct objfile *objfile, const struct section_offsets *new_offsets)
void parse_static_tracepoint_marker_definition(char *line, char **pp, struct static_tracepoint_marker *marker)
int traceframe_available_memory(VEC(mem_range_s)**result, CORE_ADDR memaddr, ULONGEST len)
void mark_async_event_handler(async_event_handler *async_handler_ptr)
int serial_write(struct serial *scb, const void *buf, size_t count)
static void remote_console_output(char *msg)
static void stop_reply_dtr(struct notif_event *event)
static int align_for_efficient_write(int todo, CORE_ADDR memaddr)
CORE_ADDR remote_watch_data_address
static void remote_trace_start(struct target_ops *self)
void remote_file_delete(const char *remote_file, int from_tty)
static int remote_stopped_by_watchpoint(struct target_ops *ops)
static int remote_supports_stopped_by_hw_breakpoint(struct target_ops *ops)
static int remote_remove_vfork_catchpoint(struct target_ops *ops, int pid)
static struct cmd_list_element * remote_cmdlist
void reread_symbols(void)
struct notif_event * pending_event[REMOTE_NOTIF_LAST]
static int kill_child_of_pending_fork(QUEUE(stop_reply_p)*q, QUEUE_ITER(stop_reply_p)*iter, stop_reply_p event, void *data)
void remote_notif_get_pending_events(struct notif_client *nc)
static ptid_t remote_wait_as(ptid_t ptid, struct target_waitstatus *status, int options)
struct observer * observer_attach_inferior_exit(observer_inferior_exit_ftype *f)
static void extended_remote_detach(struct target_ops *ops, const char *args, int from_tty)
static struct cmd_list_element * remote_show_cmdlist
#define VEC_safe_push(T, V, O)
void(* to_set_disconnected_tracing)(struct target_ops *, int val) TARGET_DEFAULT_IGNORE()
static void remote_set_disconnected_tracing(struct target_ops *self, int val)
struct readahead_cache readahead_cache
struct cmd_list_element * cmdlist
void(* to_check_pending_interrupt)(struct target_ops *) TARGET_DEFAULT_IGNORE()
static int remote_unpack_thread_info_response(char *pkt, threadref *expectedref, struct gdb_ext_thread_info *info)
FILE * gdb_fopen_cloexec(const char *filename, const char *opentype)
int(* to_remove_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_FUNC(memory_remove_breakpoint)
static CORE_ADDR remote_get_thread_local_address(struct target_ops *ops, ptid_t ptid, CORE_ADDR lm, CORE_ADDR offset)
#define QUEUE_remove_elem(TYPE, Q, ITER)
int(* to_supports_enable_disable_tracepoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static void reset_all_packet_configs_support(void)
static int remote_upload_tracepoints(struct target_ops *self, struct uploaded_tp **utpp)
int(* to_region_ok_for_hw_watchpoint)(struct target_ops *, CORE_ADDR, int) TARGET_DEFAULT_FUNC(default_region_ok_for_hw_watchpoint)
struct gdbarch_data * gdbarch_data_register_pre_init(gdbarch_data_pre_init_ftype *pre_init)
struct thread_info * first_thread_of_process(int pid)
int gdbarch_num_regs(struct gdbarch *gdbarch)
ptid_t(* to_wait)(struct target_ops *, ptid_t, struct target_waitstatus *, int TARGET_DEBUG_PRINTER(target_debug_print_options)) TARGET_DEFAULT_NORETURN(noprocess())
void gdbarch_relocate_instruction(struct gdbarch *gdbarch, CORE_ADDR *to, CORE_ADDR from)
int remote_escape_output(const gdb_byte *buffer, int len_units, int unit_size, gdb_byte *out_buf, int *out_len_units, int out_maxlen_bytes)
static void store_registers_using_G(const struct regcache *regcache)
static void remote_kill(struct target_ops *ops)
char * target_pid_to_str(ptid_t ptid)
static void remote_async(struct target_ops *ops, int enable)
static int remote_supports_stopped_by_sw_breakpoint(struct target_ops *ops)
enum gdb_signal stop_signal
int putpkt(const char *buf)
static int is_pending_fork_parent(struct target_waitstatus *ws, int event_pid, ptid_t thread_ptid)
void(* to_trace_stop)(struct target_ops *) TARGET_DEFAULT_NORETURN(tcomplain())
ULONGEST traceframe_usage
static void * remote_g_packet_data_init(struct obstack *obstack)
void initialize_remote_fileio(struct cmd_list_element *remote_set_cmdlist, struct cmd_list_element *remote_show_cmdlist)
static int remove_stop_reply_of_remote_state(QUEUE(stop_reply_p)*q, QUEUE_ITER(stop_reply_p)*iter, stop_reply_p event, void *data)
static char * pack_threadinfo_request(char *pkt, int mode, threadref *id)
int default_child_has_execution(struct target_ops *ops, ptid_t the_ptid)
struct cmd_list_element * lookup_cmd(const char **line, struct cmd_list_element *list, char *cmdtype, int allow_unknown, int ignore_help_classes)
static const struct target_desc * remote_read_description(struct target_ops *target)
static void set_remote_protocol_Z_packet_cmd(char *args, int from_tty, struct cmd_list_element *c)
int(* to_supports_string_tracing)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static void remote_teardown_btrace(struct target_ops *self, struct btrace_target_info *tinfo)
void(* to_set_trace_buffer_size)(struct target_ops *, LONGEST val) TARGET_DEFAULT_IGNORE()
void serial_async(struct serial *scb, serial_event_ftype *handler, void *context)
static int remote_vkill(int pid, struct remote_state *rs)
static unsigned int remote_address_size
static void free_private_thread_info(struct private_thread_info *info)
struct serial * remote_desc
void ui_out_text(struct ui_out *uiout, const char *string)
int(* to_get_trace_state_variable_value)(struct target_ops *, int tsv, LONGEST *val) TARGET_DEFAULT_RETURN(0)
static void stop_reply_xfree(struct stop_reply *)
int may_insert_tracepoints
static int use_range_stepping
static void unpush_and_perror(const char *string)
static int remote_supports_cond_breakpoints(struct target_ops *self)
void printf_filtered(const char *format,...)
static void end_thread(struct gdb_xml_parser *parser, const struct gdb_xml_element *element, void *user_data, const char *body_text)
#define GDBARCH_OBSTACK_ZALLOC(GDBARCH, TYPE)
struct traceframe_info *(* to_traceframe_info)(struct target_ops *) TARGET_DEFAULT_NORETURN(tcomplain())
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
static void skip_frame(void)
static void set_remotebreak(char *args, int from_tty, struct cmd_list_element *c)
void add_file_handler(int fd, handler_func *proc, gdb_client_data client_data)
static ptid_t remote_wait_ns(ptid_t ptid, struct target_waitstatus *status, int options)
static void extended_remote_disable_randomization(int val)
static int remote_get_trace_status(struct target_ops *self, struct trace_status *ts)
ptid_t ptid_build(int pid, long lwp, long tid)
void notice_new_inferior(ptid_t ptid, int leave_running, int from_tty)
struct cmd_list_element * add_setshow_string_noescape_cmd(const char *name, enum command_class theclass, char **var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void parse_tsv_definition(char *line, struct uploaded_tsv **utsvp)
static int remote_core_of_thread(struct target_ops *ops, ptid_t ptid)
#define CRAZY_MAX_THREADS
void(* to_files_info)(struct target_ops *) TARGET_DEFAULT_IGNORE()
static struct target_ops extended_remote_ops
#define TARGET_SYSROOT_PREFIX
struct trace_status * current_trace_status(void)
static int remote_filesystem_is_local(struct target_ops *self)
static void show_packet_config_cmd(struct packet_config *config)
static void remote_disable_btrace(struct target_ops *self, struct btrace_target_info *tinfo)
static void async_handle_remote_sigint_twice(int)
int gdbarch_addressable_memory_unit_size(struct gdbarch *gdbarch)
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
static void remote_trace_stop(struct target_ops *self)
int default_child_has_memory(struct target_ops *ops)
int in_thread_list(ptid_t ptid)
void cmd_func(struct cmd_list_element *cmd, char *args, int from_tty)
static enum target_xfer_status remote_read_bytes(struct target_ops *ops, CORE_ADDR memaddr, gdb_byte *myaddr, ULONGEST len, int unit_size, ULONGEST *xfered_len)
struct thread_info * iterate_over_threads(thread_callback_func, void *)
static int remote_supports_btrace(struct target_ops *self, enum btrace_format format)
static void * init_remote_state(struct gdbarch *gdbarch)
static void start_thread(struct gdb_xml_parser *parser, const struct gdb_xml_element *element, void *user_data, VEC(gdb_xml_value_s)*attributes)
static void remote_fetch_registers(struct target_ops *ops, struct regcache *regcache, int regnum)
#define SIZEOF_N_SECTION_OFFSETS(n)
int(* to_insert_watchpoint)(struct target_ops *, CORE_ADDR, int, int, struct expression *) TARGET_DEFAULT_RETURN(-1)
int gdbarch_fast_tracepoint_valid_at(struct gdbarch *gdbarch, CORE_ADDR addr, int *isize, char **msg)
static void set_memory_read_packet_size(char *args, int from_tty)
static ptid_t any_thread_ptid
static void clear_threads_listing_context(void *p)
static void remote_check_pending_interrupt(struct target_ops *self)
struct cmd_list_element * setlist
static void remote_async_inferior_event_handler(gdb_client_data)
int(* to_remove_fork_catchpoint)(struct target_ops *, int) TARGET_DEFAULT_RETURN(1)
void add_setshow_auto_boolean_cmd(const char *name, enum command_class theclass, enum auto_boolean *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void(* to_disable_tracepoint)(struct target_ops *, struct bp_location *location) TARGET_DEFAULT_NORETURN(tcomplain())
static int remote_insert_fork_catchpoint(struct target_ops *ops, int pid)
static void remote_trace_init(struct target_ops *self)
static char * unpack_int(char *buf, int *value)
static enum target_xfer_status remote_read_qxfer(struct target_ops *ops, const char *object_name, const char *annex, gdb_byte *readbuf, ULONGEST offset, LONGEST len, ULONGEST *xfered_len, struct packet_config *packet)
void serial_log_command(struct target_ops *self, const char *cmd)
#define VEC_iterate(T, V, I, P)
#define target_trace_find(type, num, addr1, addr2, tpp)
static void remote_unpush_target(void)
static int strprefix(const char *p, const char *pend, const char *prefix)
static void remote_store_registers(struct target_ops *ops, struct regcache *regcache, int regnum)
struct bp_location * next
static void remote_command(char *args, int from_tty)
static void remote_add_thread(ptid_t ptid, int running)
static void remove_new_fork_children(struct threads_listing_context *)
static int remote_save_trace_data(struct target_ops *self, const char *filename)
struct notif_event * remote_notif_parse(struct notif_client *nc, char *buf)
#define CATCH(EXCEPTION, MASK)
struct address_space * aspace
static void remote_notice_new_inferior(ptid_t currthread, int running)
void register_remote_g_packet_guess(struct gdbarch *gdbarch, int bytes, const struct target_desc *tdesc)
static int remote_is_async_p(struct target_ops *)
static void fetch_registers_using_g(struct regcache *regcache)
void merge_uploaded_tracepoints(struct uploaded_tp **uploaded_tps)
static void push_stop_reply(struct stop_reply *)
static struct remote_arch_state * get_remote_arch_state(void)
static void remote_put_command(char *args, int from_tty)
void update_signals_program_target(void)
int fputc_unfiltered(int c, struct ui_file *stream)
int gdb_xml_parse_quick(const char *name, const char *dtd_name, const struct gdb_xml_element *elements, const char *document, void *user_data)
void inferior_event_handler(enum inferior_event_type event_type, gdb_client_data client_data)
struct target_ops current_target
static QUEUE(stop_reply_p)
static void set_memory_packet_size(char *args, struct memory_packet_config *config)
static int remote_async_terminal_ours_p
int(* to_trace_find)(struct target_ops *, enum trace_find_type type, int num, CORE_ADDR addr1, CORE_ADDR addr2, int *tpp) TARGET_DEFAULT_RETURN(-1)
static enum packet_result packet_ok(const char *buf, struct packet_config *config)
static char * append_pending_thread_resumptions(char *p, char *endp, ptid_t ptid)
struct cleanup * make_cleanup_ui_out_tuple_begin_end(struct ui_out *uiout, const char *id)
void target_clear_description(void)
static int interrupt_on_connect
struct program_space * pspace
#define MIN_REMOTE_PACKET_SIZE
static void extended_remote_kill(struct target_ops *ops)
void merge_uploaded_trace_state_variables(struct uploaded_tsv **uploaded_tsvs)
int(* to_watchpoint_addr_within_range)(struct target_ops *, CORE_ADDR, CORE_ADDR, int) TARGET_DEFAULT_FUNC(default_watchpoint_addr_within_range)
static void remote_update_thread_list(struct target_ops *ops)
static int remote_notif_stop_can_get_pending_events(struct notif_client *self)
LONGEST(* to_get_raw_trace_data)(struct target_ops *, gdb_byte *buf, ULONGEST offset, LONGEST len) TARGET_DEFAULT_NORETURN(tcomplain())
void fprintf_filtered(struct ui_file *stream, const char *format,...)
void free_current_marker(void *arg)
static char * pack_threadid(char *pkt, threadref *id)
static void extended_remote_open(const char *name, int from_tty)
struct symfile_segment_data * get_symfile_segment_data(bfd *abfd)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t err
void * xzalloc(size_t size)
int async_signal_handler_is_marked(async_signal_handler *async_handler_ptr)
static int remote_region_ok_for_hw_watchpoint(struct target_ops *self, CORE_ADDR addr, int len)
struct inferior * add_inferior(int pid)
static void remote_add_target_side_commands(struct gdbarch *gdbarch, struct bp_target_info *bp_tgt, char *buf)
static char * remote_pid_to_exec_file(struct target_ops *self, int pid)
void trace_reset_local_state(void)
int simple_verify_memory(struct target_ops *ops, const gdb_byte *data, CORE_ADDR lma, ULONGEST size)
int(* to_remove_vfork_catchpoint)(struct target_ops *, int) TARGET_DEFAULT_RETURN(1)
CORE_ADDR gdbarch_convert_from_func_ptr_addr(struct gdbarch *gdbarch, CORE_ADDR addr, struct target_ops *targ)
int(* to_remove_watchpoint)(struct target_ops *, CORE_ADDR, int, int, struct expression *) TARGET_DEFAULT_RETURN(-1)
static enum target_xfer_status remote_write_qxfer(struct target_ops *ops, const char *object_name, const char *annex, const gdb_byte *writebuf, ULONGEST offset, LONGEST len, ULONGEST *xfered_len, struct packet_config *packet)
void target_terminal_inferior(void)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
static struct stop_reply * queued_stop_reply(ptid_t ptid)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int status
int(* to_supports_stopped_by_sw_breakpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
void(* to_resume)(struct target_ops *, ptid_t, int TARGET_DEBUG_PRINTER(target_debug_print_step), enum gdb_signal) TARGET_DEFAULT_NORETURN(noprocess())
static int remote_set_trace_notes(struct target_ops *self, const char *user, const char *notes, const char *stop_notes)
static int parse_threadlist_response(char *pkt, int result_limit, threadref *original_echo, threadref *resultlist, int *doneflag)
int waiting_for_stop_reply
static void readahead_cache_invalidate(void)
struct cmd_list_element * showlist
static void remote_send(char **buf, long *sizeof_buf_p)
static enum auto_boolean packet_set_cmd_state(int packet)
static struct gdbarch_data * remote_g_packet_data_handle
int(* to_get_min_fast_tracepoint_insn_len)(struct target_ops *) TARGET_DEFAULT_RETURN(-1)
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
int serial_setbaudrate(struct serial *scb, int rate)
void update_address_spaces(void)
static enum target_xfer_status remote_xfer_live_readonly_partial(struct target_ops *ops, gdb_byte *readbuf, ULONGEST memaddr, ULONGEST len, int unit_size, ULONGEST *xfered_len)
void puts_filtered(const char *string)
int encode_source_string(int tpnum, ULONGEST addr, char *srctype, char *src, char *buf, int buf_size)
#define gdb_assert_not_reached(message)
#define OPAQUETHREADBYTES
void discard_all_inferiors(void)
int serial_flush_input(struct serial *scb)
void generic_load(const char *name, int from_tty)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **list)
#define SECT_OFF_DATA(objfile)
void free_current_contents(void *ptr)
static enum packet_result packet_check_result(const char *buf)
ptid_t pid_to_ptid(int pid)
async_event_handler * create_async_event_handler(async_event_handler_func *proc, gdb_client_data client_data)
CORE_ADDR(* to_get_thread_local_address)(struct target_ops *ops, ptid_t ptid, CORE_ADDR load_module_addr, CORE_ADDR offset) TARGET_DEFAULT_NORETURN(generic_tls_error())
int default_child_has_all_memory(struct target_ops *ops)
static const char *const interrupt_sequence_modes[]
void remote_notif_state_xfree(struct remote_notif_state *state)
static void remote_buffer_add_int(char **buffer, int *left, ULONGEST value)
int get_traceframe_number(void)
static int remote_trace_find(struct target_ops *self, enum trace_find_type type, int num, CORE_ADDR addr1, CORE_ADDR addr2, int *tpp)
void solib_add(const char *pattern, int from_tty, struct target_ops *target, int readsyms)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
threadref resultthreadlist[MAXTHREADLISTRESULTS]
struct target_section * sections
void(* to_set_permissions)(struct target_ops *) TARGET_DEFAULT_IGNORE()
union target_waitstatus::@161 value
struct btrace_target_info *(* to_enable_btrace)(struct target_ops *, ptid_t ptid, const struct btrace_config *conf) TARGET_DEFAULT_NORETURN(tcomplain())
static void remote_disable_tracepoint(struct target_ops *self, struct bp_location *location)
char * pulongest(ULONGEST u)
const struct gdb_xml_attribute thread_attributes[]
int(* to_has_execution)(struct target_ops *, ptid_t)
static void remote_serial_write(const char *str, int len)
int gdbarch_has_global_breakpoints(struct gdbarch *gdbarch)
void exec_file_locate_attach(int pid, int from_tty)
static int store_register_using_P(const struct regcache *regcache, struct packet_reg *reg)
static char * remote_exec_file
struct inferior * find_inferior_pid(int pid)
void fputstrn_unfiltered(const char *str, int n, int quoter, struct ui_file *stream)
static int remote_get_threadlist(int startflag, threadref *nextthread, int result_limit, int *done, int *result_count, threadref *threadlist)
void(* to_trace_set_readonly_regions)(struct target_ops *) TARGET_DEFAULT_NORETURN(tcomplain())
struct thread_control_state control
static int remote_get_threadinfo(threadref *threadid, int fieldset, struct gdb_ext_thread_info *info)
char * target_read_stralloc(struct target_ops *ops, enum target_object object, const char *annex)
static void remote_download_command_source(int num, ULONGEST addr, struct command_line *cmds)
int serial_send_break(struct serial *scb)
struct cached_reg cached_reg_t
static void show_memory_packet_size(struct memory_packet_config *config)
#define VEC_index(T, V, I)
static struct private_thread_info * demand_private_info(ptid_t ptid)
static ptid_t magic_null_ptid
static void remote_enable_tracepoint(struct target_ops *self, struct bp_location *location)
static int remote_remove_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, int type, struct expression *cond)
static struct remote_state * remote_state
static int remote_fork_event_p(struct remote_state *rs)
static int getpkt_sane(char **buf, long *sizeof_buf, int forever)
int(* to_fileio_fstat)(struct target_ops *, int fd, struct stat *sb, int *target_errno)
static void remote_notif_stop_ack(struct notif_client *self, char *buf, struct notif_event *event)
const struct target_desc * tdesc
void(* to_get_tracepoint_status)(struct target_ops *, struct breakpoint *tp, struct uploaded_tp *utp) TARGET_DEFAULT_NORETURN(tcomplain())
static struct remote_state * get_remote_state(void)
int(* to_upload_trace_state_variables)(struct target_ops *, struct uploaded_tsv **utsvp) TARGET_DEFAULT_RETURN(0)
static void remote_packet_size(const struct protocol_feature *feature, enum packet_support support, const char *value)
async_signal_handler * create_async_signal_handler(sig_handler_func *proc, gdb_client_data client_data)
void target_mourn_inferior(void)
void thread_change_ptid(ptid_t old_ptid, ptid_t new_ptid)
int(* to_augmented_libraries_svr4_read)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static void(* ofunc)(int)
static void free_actions_list(char **actions_list)
void exception_fprintf(struct ui_file *file, struct gdb_exception e, const char *prefix,...)
void serial_raw(struct serial *scb)
static void remote_buffer_add_bytes(char **buffer, int *left, const gdb_byte *bytes, int len)
const char * gdbarch_register_name(struct gdbarch *gdbarch, int regnr)
int(* to_insert_fork_catchpoint)(struct target_ops *, int) TARGET_DEFAULT_RETURN(1)
#define target_is_async_p()
static void set_general_thread(struct ptid ptid)
static char * unpack_nibble(char *buf, int *val)
static int startswith(const char *string, const char *pattern)
static void remote_query_supported(void)
static void add_packet_config_cmd(struct packet_config *config, const char *name, const char *title, int legacy)
char * pack_nibble(char *buf, int nibble)
static int remote_thread_always_alive(struct target_ops *ops, ptid_t ptid)
DECLARE_QUEUE_P(stop_reply_p)
struct cmd_list_element * add_alias_cmd(const char *name, const char *oldname, enum command_class theclass, int abbrev_flag, struct cmd_list_element **list)
static int remote_supports_string_tracing(struct target_ops *self)
int gdbarch_addr_bit(struct gdbarch *gdbarch)
struct thread_info * add_thread_silent(ptid_t ptid)
const char * gdb_signal_to_name(enum gdb_signal)
const struct btrace_config *(* to_btrace_conf)(struct target_ops *self, const struct btrace_target_info *) TARGET_DEFAULT_RETURN(NULL)
#define target_has_execution
static serial_event_ftype remote_async_serial_handler
struct agent_expr * gen_eval_for_expr(CORE_ADDR scope, struct expression *expr)
enum target_xfer_status(* to_xfer_partial)(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) TARGET_DEFAULT_RETURN(TARGET_XFER_E_IO)
struct btrace_config conf
static struct traceframe_info * remote_traceframe_info(struct target_ops *self)
int(* to_search_memory)(struct target_ops *ops, CORE_ADDR start_addr, ULONGEST search_space_len, const gdb_byte *pattern, ULONGEST pattern_len, CORE_ADDR *found_addrp) TARGET_DEFAULT_FUNC(default_search_memory)
char * xstrprintf(const char *format,...)
char * unpack_varlen_hex(char *buff, ULONGEST *result)
static ptid_t remote_current_thread(ptid_t oldptid)
static void set_continue_thread(struct ptid ptid)
static void remote_detach(struct target_ops *ops, const char *args, int from_tty)
static int hexnumnstr(char *, ULONGEST, int)
static char * remote_hostio_error(int errnum)
void(* func)(const struct protocol_feature *, enum packet_support, const char *)
long explicit_packet_size
void printf_unfiltered(const char *format,...)
int(* to_get_tib_address)(struct target_ops *, ptid_t ptid, CORE_ADDR *addr) TARGET_DEFAULT_NORETURN(tcomplain())
static int remote_stopped_data_address(struct target_ops *target, CORE_ADDR *addr_p)
static int remote_insert_vfork_catchpoint(struct target_ops *ops, int pid)
struct traceframe_info * parse_traceframe_info(const char *tframe_info)
static int remote_read_description_p(struct target_ops *target)
int use_threadextra_query
void(* to_detach)(struct target_ops *ops, const char *, int) TARGET_DEFAULT_IGNORE()
static void copy_threadref(threadref *dest, threadref *src)
void(* to_async)(struct target_ops *, int) TARGET_DEFAULT_NORETURN(tcomplain())
static void remote_delete_command(char *args, int from_tty)
struct bfd_section * the_bfd_section
static enum target_xfer_status remote_write_bytes_aux(const char *header, CORE_ADDR memaddr, const gdb_byte *myaddr, ULONGEST len_units, int unit_size, ULONGEST *xfered_len_units, char packet_format, int use_length)
static void remote_program_signals(struct target_ops *self, int numsigs, unsigned char *signals)
static void btrace_read_config(struct btrace_config *conf)
static int send_g_packet(void)
static int remote_supports_fast_tracepoints(void)
static void remote_download_trace_state_variable(struct target_ops *self, struct trace_state_variable *tsv)
static void remote_files_info(struct target_ops *ignore)
struct ui_file * gdb_stdlog
void remote_fileio_reset(void)
static long target_buf_size
struct ui_file * mem_fileopen(void)
enum packet_support default_support
static int getpkt_or_notif_sane(char **buf, long *sizeof_buf, int forever, int *is_notif)
static ptid_t not_sent_ptid
int(* to_insert_hw_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_RETURN(-1)
char *(* to_pid_to_exec_file)(struct target_ops *, int pid) TARGET_DEFAULT_RETURN(NULL)
static void set_range_stepping(char *ignore_args, int from_tty, struct cmd_list_element *c)
int(* to_can_run_breakpoint_commands)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
void serial_close(struct serial *scb)
static long get_memory_read_packet_size(void)
char * normal_pid_to_str(ptid_t ptid)
static void remote_detach_pid(int pid)
static void process_g_packet(struct regcache *regcache)
struct serial * serial_open(const char *name)
void(* to_disconnect)(struct target_ops *, const char *, int) TARGET_DEFAULT_NORETURN(tcomplain())
static int remote_remove_breakpoint(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static void free_actions_list_cleanup_wrapper(void *)
static void async_remote_interrupt_twice(gdb_client_data arg)
static int hexnumlen(ULONGEST num)
static int remote_hostio_open(struct target_ops *self, struct inferior *inf, const char *filename, int flags, int mode, int warn_if_slow, int *remote_errno)
int(* to_can_download_tracepoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static void remote_buffer_add_string(char **buffer, int *left, char *string)
void(* to_log_command)(struct target_ops *, const char *) TARGET_DEFAULT_IGNORE()
static void remote_btrace_reset(void)
static int extended_remote_supports_disable_randomization(struct target_ops *self)
int ptid_get_pid(ptid_t ptid)
#define QUEUE_alloc(TYPE, FREE_FUNC)
static void sync_remote_interrupt(int signo)
static void remote_terminal_inferior(struct target_ops *self)
static void threads_listing_context_remove(struct target_waitstatus *ws, struct threads_listing_context *context)
int signal_pass_state(int signo)
enum btrace_error(* to_read_btrace)(struct target_ops *self, struct btrace_data *data, struct btrace_target_info *btinfo, enum btrace_read_type type) TARGET_DEFAULT_NORETURN(tcomplain())
struct btrace_config_pt pt
PTR xrealloc(PTR ptr, size_t size)
int(* to_verify_memory)(struct target_ops *, const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size) TARGET_DEFAULT_FUNC(default_verify_memory)
static void set_thread(struct ptid ptid, int gen)
void remote_notif_ack(struct notif_client *nc, char *buf)
static struct async_signal_handler * async_sigint_remote_token
struct btrace_config btrace_config
int(* to_fileio_open)(struct target_ops *, struct inferior *inf, const char *filename, int flags, int mode, int warn_if_slow, int *target_errno)
struct cleanup * make_cleanup_fclose(FILE *file)
void(* to_download_tracepoint)(struct target_ops *, struct bp_location *location) TARGET_DEFAULT_NORETURN(tcomplain())
static void async_initialize_sigint_signal_handler(void)
void remote_file_get(const char *remote_file, const char *local_file, int from_tty)
static char * remote_hostio_readlink(struct target_ops *self, struct inferior *inf, const char *filename, int *remote_errno)
static VEC(static_tracepoint_marker_p)
void throw_exception(struct gdb_exception exception)
struct command_line * next
int(* to_remove_hw_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_RETURN(-1)
const char const char int
static int remote_vfork_event_p(struct remote_state *rs)
static CORE_ADDR remote_address_masked(CORE_ADDR)
void target_update_thread_list(void)
enum command_control_type control_type
int in_inferior_list(int pid)
void start_remote(int from_tty)
static void remote_get_tracepoint_status(struct target_ops *self, struct breakpoint *bp, struct uploaded_tp *utp)
int simple_search_memory(struct target_ops *ops, CORE_ADDR start_addr, ULONGEST search_space_len, const gdb_byte *pattern, ULONGEST pattern_len, CORE_ADDR *found_addrp)
void help_list(struct cmd_list_element *list, const char *cmdtype, enum command_class theclass, struct ui_file *stream)
void remote_file_put(const char *local_file, const char *remote_file, int from_tty)
struct gdb_xml_value * xml_find_attribute(VEC(gdb_xml_value_s)*attributes, const char *name)
void discard_cleanups(struct cleanup *old_chain)
void(* to_flash_erase)(struct target_ops *, ULONGEST address, LONGEST length) TARGET_DEFAULT_NORETURN(tcomplain())
static int threadref_to_int(threadref *ref)
void parse_tracepoint_status(char *p, struct breakpoint *bp, struct uploaded_tp *utp)
void(* to_fetch_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_IGNORE()
static ptid_t process_stop_reply(struct stop_reply *stop_reply, struct target_waitstatus *status)
void encode_actions_rsp(struct bp_location *tloc, char ***tdp_actions, char ***stepping_actions)
void(* to_mourn_inferior)(struct target_ops *) TARGET_DEFAULT_FUNC(default_mourn_inferior)
static const int remote_flash_timeout
char * phex_nz(ULONGEST l, int sizeof_l)
static void remote_close(struct target_ops *self)
void void void void void void void void void perror_with_name(const char *string) ATTRIBUTE_NORETURN
#define QUEUE_iterate(TYPE, Q, OPERATE, PARAM)
static int remote_hostio_pread_from_cache(struct remote_state *rs, int fd, gdb_byte *read_buf, size_t len, ULONGEST offset)
static int remote_verify_memory(struct target_ops *ops, const gdb_byte *data, CORE_ADDR lma, ULONGEST size)
int(* to_set_trace_notes)(struct target_ops *, const char *user, const char *notes, const char *stopnotes) TARGET_DEFAULT_RETURN(0)
static void send_interrupt_sequence(void)
static int watchpoint_to_Z_packet(int type)
#define ALL_NON_EXITED_THREADS(T)
int serial_can_async_p(struct serial *scb)
int(* to_can_use_hw_breakpoint)(struct target_ops *, int, int, int) TARGET_DEFAULT_RETURN(0)
int default_child_has_registers(struct target_ops *ops)
static int remote_stopped_by_sw_breakpoint(struct target_ops *ops)
int may_insert_breakpoints
struct cleanup * make_cleanup_ui_file_delete(struct ui_file *arg)
void(* to_pass_signals)(struct target_ops *, int, unsigned char *TARGET_DEBUG_PRINTER(target_debug_print_signals)) TARGET_DEFAULT_IGNORE()
void(* to_stop)(struct target_ops *, ptid_t) TARGET_DEFAULT_IGNORE()
void(* to_teardown_btrace)(struct target_ops *, struct btrace_target_info *tinfo) TARGET_DEFAULT_NORETURN(tcomplain())
ULONGEST traceframe_usage
static long get_remote_packet_size(void)
static long get_memory_packet_size(struct memory_packet_config *config)
int(* to_save_trace_data)(struct target_ops *, const char *filename) TARGET_DEFAULT_NORETURN(tcomplain())
static int compare_pnums(const void *lhs_, const void *rhs_)
void(* to_download_trace_state_variable)(struct target_ops *, struct trace_state_variable *tsv) TARGET_DEFAULT_NORETURN(tcomplain())
int xsnprintf(char *str, size_t size, const char *format,...)
int target_async_permitted
static struct gdbarch_data * remote_gdbarch_data_handle
static void check_binary_download(CORE_ADDR addr)
struct remote_notif_state * remote_notif_state_allocate(void)
static void remote_detach_1(const char *args, int from_tty)
int(* to_fileio_pwrite)(struct target_ops *, int fd, const gdb_byte *write_buf, int len, ULONGEST offset, int *target_errno)
enum register_status regcache_raw_read(struct regcache *regcache, int regnum, gdb_byte *buf)
int check_quit_flag(void)
enum target_waitkind kind
static void init_extended_remote_ops(void)
static int stop_reply_match_ptid_and_ws(QUEUE(stop_reply_p)*q, QUEUE_ITER(stop_reply_p)*iter, struct stop_reply *event, void *data)
static int extended_remote_run(char *args)
static int remote_hostio_pread_vFile(struct target_ops *self, int fd, gdb_byte *read_buf, int len, ULONGEST offset, int *remote_errno)
void(* to_kill)(struct target_ops *) TARGET_DEFAULT_NORETURN(noprocess())
static void remote_check_symbols(void)
struct ui_file * gdb_stderr
void notif_event_xfree(struct notif_event *event)
static int remote_threadlist_iterator(rmt_thread_action stepfunction, void *context, int looplimit)
static int remote_insert_hw_breakpoint(struct target_ops *self, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static int remote_follow_fork(struct target_ops *ops, int follow_child, int detach_fork)
void( serial_event_ftype)(struct serial *scb, void *context)
void detach_inferior(int pid)
struct minimal_symbol * minsym
char * safe_strerror(int)
static void show_memory_read_packet_size(char *args, int from_tty)
int(* to_stopped_by_sw_breakpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static int remote_hostio_pwrite(struct target_ops *self, int fd, const gdb_byte *write_buf, int len, ULONGEST offset, int *remote_errno)
struct remote_notif_state * notif_state
static enum target_xfer_status remote_xfer_partial(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
void(* to_set_circular_trace_buffer)(struct target_ops *, int val) TARGET_DEFAULT_IGNORE()
void(* to_open)(const char *, int)
void pop_all_targets_above(enum strata above_stratum)
void(* to_post_attach)(struct target_ops *, int) TARGET_DEFAULT_IGNORE()
static char * remote_get_noisy_reply(char **buf_p, long *sizeof_buf)
struct target_section * target_section_by_addr(struct target_ops *target, CORE_ADDR addr)
int(* to_can_async_p)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static int remote_hostio_close(struct target_ops *self, int fd, int *remote_errno)
static void trace_error(char *buf)
static int remote_hostio_set_filesystem(struct inferior *inf, int *remote_errno)
#define BUF_THREAD_ID_SIZE
static int remove_child_of_pending_fork(QUEUE(stop_reply_p)*q, QUEUE_ITER(stop_reply_p)*iter, stop_reply_p event, void *data)
void(* to_create_inferior)(struct target_ops *, char *, char *, char **, int)
static int stubhex(int ch)
int(* to_static_tracepoint_marker_at)(struct target_ops *, CORE_ADDR, struct static_tracepoint_marker *marker) TARGET_DEFAULT_RETURN(0)
char ** gdb_buildargv(const char *s)
void set_stop_requested(ptid_t ptid, int stop)
static int remote_query_attached(int pid)
static int remote_supports_cond_tracepoints(void)
struct thread_suspend_state suspend
int parse_pid_to_attach(const char *args)
static struct inferior * remote_add_inferior(int fake_pid_p, int pid, int attached, int try_open_exec)
char * pack_hex_byte(char *pkt, int byte)
static void packet_command(char *, int)
int(* to_stopped_by_watchpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
int(* to_get_trace_status)(struct target_ops *, struct trace_status *ts) TARGET_DEFAULT_RETURN(-1)
static char * append_resumption(char *p, char *endp, ptid_t ptid, int step, enum gdb_signal siggnal)
static void remote_stop_ns(ptid_t ptid)
void(* ack)(struct notif_client *self, char *buf, struct notif_event *event)
struct ui_file * gdb_stdtarg
void stdin_event_handler(int error, gdb_client_data client_data)
static void async_cleanup_sigint_signal_handler(void *dummy)
static void show_remote_cmd(char *args, int from_tty)
static struct packet_config remote_protocol_packets[PACKET_MAX]
static void remote_set_circular_trace_buffer(struct target_ops *self, int val)
struct thread_info * thread_list
void(* to_terminal_ours)(struct target_ops *) TARGET_DEFAULT_IGNORE()
int(* to_stopped_by_hw_breakpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
void parse_xml_btrace_conf(struct btrace_config *conf, const char *xml)
static void add_current_inferior_and_thread(char *wait_status)
void(* to_enable_tracepoint)(struct target_ops *, struct bp_location *location) TARGET_DEFAULT_NORETURN(tcomplain())
static int readchar(int timeout)
struct inferior * current_inferior(void)
static int remote_supports_enable_disable_tracepoint(struct target_ops *self)
void regcache_raw_supply(struct regcache *regcache, int regnum, const void *buf)
int is_exited(ptid_t ptid)
void remote_fileio_to_host_stat(struct fio_stat *fst, struct stat *st)
void(* to_terminal_inferior)(struct target_ops *) TARGET_DEFAULT_IGNORE()
int breakpoints_should_be_inserted_now(void)
const char * to_shortname
static char * remote_threads_extra_info(struct target_ops *self, struct thread_info *tp)
static void record_currthread(struct remote_state *rs, ptid_t currthread)
gdb_xml_attribute_handler gdb_xml_parse_attr_ulongest
struct program_space * current_program_space
static void extended_remote_create_inferior(struct target_ops *ops, char *exec_file, char *args, char **env, int from_tty)
char * get_exec_file(int err)
#define MAXTHREADLISTRESULTS
const struct gdb_xml_element thread_children[]
struct target_section_table * target_get_section_table(struct target_ops *target)
static enum auto_boolean remote_Z_packet_detect
static char * remote_query_supported_append(char *msg, const char *append)
unsigned long long ULONGEST
static int remote_can_use_agent(struct target_ops *self)
static void ATTRIBUTE_PRINTF(6, 0)
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static void remote_mourn(struct target_ops *ops)
void gdb_call_async_signal_handler(struct async_signal_handler *handler, int immediate_p)
int serial_setparity(struct serial *scb, int parity)
static void discard_pending_stop_replies(struct inferior *inf)
static void remote_supported_packet(const struct protocol_feature *feature, enum packet_support support, const char *argument)
static int remote_supports_install_in_trace(void)
int register_size(struct gdbarch *gdbarch, int regnum)
void clear_async_event_handler(async_event_handler *async_handler_ptr)
static int remote_thread_alive(struct target_ops *ops, ptid_t ptid)
struct observer * observer_attach_new_objfile(observer_new_objfile_ftype *f)
static void print_packet(const char *)
static struct cmd_list_element * remote_set_cmdlist
int(* to_supports_non_stop)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static struct packet_reg * packet_reg_from_regnum(struct remote_arch_state *rsa, long regnum)
static int remote_can_run_breakpoint_commands(struct target_ops *self)
long ptid_get_lwp(ptid_t ptid)
static int stub_unpack_int(char *buff, int fieldlength)
static void remote_open_1(const char *, int, struct target_ops *, int extended_p)
static struct stop_reply * remote_notif_remove_queued_reply(ptid_t ptid)
int memory_insert_breakpoint(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static ptid_t remote_wait(struct target_ops *ops, ptid_t ptid, struct target_waitstatus *status, int options)
void handle_notification(struct remote_notif_state *state, char *buf)
int(* to_has_all_memory)(struct target_ops *)
int memory_remove_breakpoint(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
struct cmd_list_element * maintenancelist
void handle_sigint(int sig)
void regcache_raw_collect(const struct regcache *regcache, int regnum, void *buf)
static void get_offsets(void)
static void async_handle_remote_sigint(int)
int(* to_fileio_unlink)(struct target_ops *, struct inferior *inf, const char *filename, int *target_errno)
void ui_out_field_string(struct ui_out *uiout, const char *fldname, const char *string)
void target_terminal_ours_for_output(void)
void(* private_dtor)(struct private_thread_info *)
static int remote_add_target_side_condition(struct gdbarch *gdbarch, struct bp_target_info *bp_tgt, char *buf, char *buf_end)
static LONGEST remote_get_raw_trace_data(struct target_ops *self, gdb_byte *buf, ULONGEST offset, LONGEST len)
int remote_register_number_and_offset(struct gdbarch *gdbarch, int regnum, int *pnum, int *poffset)
void(* dtr)(struct notif_event *self)
static void remote_open(const char *name, int from_tty)
static int remote_get_threads_with_ql(struct target_ops *ops, struct threads_listing_context *context)
static ptid_t read_ptid(char *buf, char **obuf)
int hex2bin(const char *hex, gdb_byte *bin, int count)
void do_show_command(const char *arg, int from_tty, struct cmd_list_element *c)
static char * write_ptid(char *buf, const char *endbuf, ptid_t ptid)
enum btrace_format format
static int remote_get_tib_address(struct target_ops *self, ptid_t ptid, CORE_ADDR *addr)
void free_symfile_segment_data(struct symfile_segment_data *data)
static void remote_trace_set_readonly_regions(struct target_ops *self)
#define OBSTACK_ZALLOC(OBSTACK, TYPE)
static void remote_set_trace_buffer_size(struct target_ops *self, LONGEST val)
static int remove_stop_reply_for_inferior(QUEUE(stop_reply_p)*q, QUEUE_ITER(stop_reply_p)*iter, stop_reply_p event, void *data)
#define SECT_OFF_BSS(objfile)
int(* to_insert_vfork_catchpoint)(struct target_ops *, int) TARGET_DEFAULT_RETURN(1)
int to_has_thread_control
int(* to_thread_alive)(struct target_ops *, ptid_t ptid) TARGET_DEFAULT_RETURN(0)
enum packet_support support
static void show_remotebreak(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void(* to_attach)(struct target_ops *ops, const char *, int)
void target_preopen(int from_tty)
int serial_readchar(struct serial *scb, int timeout)
int(* to_use_agent)(struct target_ops *, int use) TARGET_DEFAULT_NORETURN(tcomplain())
void gdb_flush(struct ui_file *file)
static char * escape_buffer(const char *buf, int n)
struct ui_out * current_uiout
int(* to_supports_btrace)(struct target_ops *, enum btrace_format) TARGET_DEFAULT_RETURN(0)
int(* to_stopped_data_address)(struct target_ops *, CORE_ADDR *) TARGET_DEFAULT_RETURN(0)
static struct async_signal_handler * async_sigint_remote_twice_token
unsigned char threadref[OPAQUETHREADBYTES]
static int remote_insert_breakpoint(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
enum enable_state enable_state
void(* to_update_thread_list)(struct target_ops *) TARGET_DEFAULT_IGNORE()
struct vCont_action_support supports_vCont
static int getpkt_or_notif_sane_1(char **buf, long *sizeof_buf, int forever, int expecting_notif, int *is_notif)
#define target_async(ENABLE)
void target_find_description(void)
static void remote_download_tracepoint(struct target_ops *self, struct bp_location *loc)
void(* to_prepare_to_store)(struct target_ops *, struct regcache *) TARGET_DEFAULT_NORETURN(noprocess())
void(* to_store_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_NORETURN(noprocess())
threadref echo_nextthread
struct stop_reply * output
static void remote_hostio_close_cleanup(void *opaque)
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
#define MAX_REMOTE_PACKET_SIZE
PTR xcalloc(size_t number, size_t size)
int(* to_has_registers)(struct target_ops *)
static int remote_get_threads_with_qthreadinfo(struct target_ops *ops, struct threads_listing_context *context)
static int remote_stopped_by_hw_breakpoint(struct target_ops *ops)
struct command_line ** body_list
ptid_t(* to_get_ada_task_ptid)(struct target_ops *, long lwp, long thread) TARGET_DEFAULT_FUNC(default_get_ada_task_ptid)
static void readahead_cache_invalidate_fd(int fd)
static struct target_ops remote_ops
struct breakpoint * owner
static int remote_can_async_p(struct target_ops *)
struct target_waitstatus ws
static long read_frame(char **buf_p, long *sizeof_buf)
void(* to_disable_btrace)(struct target_ops *, struct btrace_target_info *tinfo) TARGET_DEFAULT_NORETURN(tcomplain())
void set_executing(ptid_t ptid, int executing)
static void show_remote_protocol_packet_cmd(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void remote_disconnect(struct target_ops *target, const char *args, int from_tty)
static int remote_search_memory(struct target_ops *ops, CORE_ADDR start_addr, ULONGEST search_space_len, const gdb_byte *pattern, ULONGEST pattern_len, CORE_ADDR *found_addrp)
void parse_trace_status(char *line, struct trace_status *ts)
void error(const char *fmt,...)
void delete_file_handler(int fd)
int symfile_map_offsets_to_segments(bfd *abfd, const struct symfile_segment_data *data, struct section_offsets *offsets, int num_segment_bases, const CORE_ADDR *segment_bases)
char *(* to_fileio_readlink)(struct target_ops *, struct inferior *inf, const char *filename, int *target_errno)
struct gdbarch_data * gdbarch_data_register_post_init(gdbarch_data_post_init_ftype *post_init)
static void init_all_packet_configs(void)
enum target_stop_reason stop_reason
#define target_static_tracepoint_marker_at(addr, marker)
static long get_memory_write_packet_size(void)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc)
static char * pack_int(char *buf, int value)
static struct packet_reg * packet_reg_from_pnum(struct remote_arch_state *rsa, LONGEST pnum)
static int remote_fileio_errno_to_host(int errnum)
struct notif_client notif_client_stop
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int int rusage_t pid_t pid
void fputstr_filtered(const char *str, int quoter, struct ui_file *stream)
static int remote_vcont_resume(ptid_t ptid, int step, enum gdb_signal siggnal)
static void remote_load(struct target_ops *self, const char *name, int from_tty)
static void show_memory_write_packet_size(char *args, int from_tty)
static void remote_prepare_to_store(struct target_ops *self, struct regcache *regcache)
static void remote_stop(struct target_ops *self, ptid_t)
static struct btrace_target_info * remote_enable_btrace(struct target_ops *self, ptid_t ptid, const struct btrace_config *conf)
static int remote_hostio_fstat(struct target_ops *self, int fd, struct stat *st, int *remote_errno)
const struct gdb_xml_element threads_children[]
void set_current_inferior(struct inferior *inf)
int gdbarch_remote_register_number(struct gdbarch *gdbarch, int regno)
void throw_error(enum errors error, const char *fmt,...)
struct target_ops * beneath
void inferior_appeared(struct inferior *inf, int pid)
DEFINE_QUEUE_P(stop_reply_p)
static struct notif_event * remote_notif_stop_alloc_reply(void)
int(* to_can_execute_reverse)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
void(* to_load)(struct target_ops *, const char *, int) TARGET_DEFAULT_NORETURN(tcomplain())
struct stop_reply * stop_reply_p
static void remote_start_remote(int from_tty, struct target_ops *target, int extended_p)
void do_cleanups(struct cleanup *old_chain)
static void discard_pending_stop_replies_in_queue(struct remote_state *)
static void extended_remote_restart(void)
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void _initialize_remote(void)
struct cleanup * make_cleanup_restore_target_terminal(void)
int(* to_filesystem_is_local)(struct target_ops *) TARGET_DEFAULT_RETURN(1)
struct regcache * get_thread_arch_regcache(ptid_t ptid, struct gdbarch *gdbarch)
void gdbarch_remote_breakpoint_from_pc(struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *kindptr)
int(* to_supports_multi_process)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
int(* to_can_use_agent)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static int remote_supports_static_tracepoints(void)
char * last_program_signals_packet
void init_thread_list(void)
const struct target_desc * gdbarch_target_desc(struct gdbarch *gdbarch)
static ptid_t get_current_thread(char *wait_status)
static void remote_resume(struct target_ops *ops, ptid_t ptid, int step, enum gdb_signal siggnal)
#define ALL_THREADS_SAFE(T, TMP)
static int putpkt_binary(const char *buf, int cnt)
static void remote_notif_stop_parse(struct notif_client *self, char *buf, struct notif_event *event)
#define VEC_ordered_remove(T, V, I)
static int remote_supports_multi_process(struct target_ops *self)
const ULONGEST const LONGEST len
struct target_ops * find_target_at(enum strata stratum)
static char * remote_pid_to_str(struct target_ops *ops, ptid_t ptid)
static int remote_get_threads_with_qxfer(struct target_ops *ops, struct threads_listing_context *context)
void remote_fileio_request(char *buf, int ctrlc_pending_p)
static int remote_hostio_pread(struct target_ops *self, int fd, gdb_byte *read_buf, int len, ULONGEST offset, int *remote_errno)
static int remote_remove_fork_catchpoint(struct target_ops *ops, int pid)
static int remote_supports_non_stop(struct target_ops *self)
static int fetch_register_using_p(struct regcache *regcache, struct packet_reg *reg)
gdb_byte data[MAX_REGISTER_SIZE]
void int_to_threadref(threadref *id, int value)