62 #include "gdb/fileio.h" 101 static int getpkt_sane (
char **buf,
long *sizeof_buf,
int forever);
103 int forever,
int *is_notif);
150 static long read_frame (
char **buf_p,
long *sizeof_buf);
272 #define OPAQUETHREADBYTES 8 279 #define MAXTHREADLISTRESULTS 32 284 #define REMOTE_DEBUG_MAX_CHAR 512 557 error (
_(
"remote.c: error in outgoing packet."));
559 error (
_(
"remote.c: error in outgoing packet at field #%ld."),
560 strtol (buf, NULL, 16));
562 error (
_(
"Target returns error code '%s'."), buf);
587 int adjusted_size = 0;
590 p =
buf + strlen (
"qRelocInsn:");
593 error (
_(
"invalid qRelocInsn packet: %s"),
buf);
622 _(
"warning: relocating instruction: "));
630 adjusted_size = to - org_to;
636 else if (
buf[0] ==
'O' &&
buf[1] !=
'K')
675 char *remote_exec_file = (
char *) arg;
677 xfree (remote_exec_file);
685 char *remote_exec_file;
690 if (remote_exec_file == NULL)
693 return remote_exec_file;
700 char *remote_exec_file)
706 xstrdup (remote_exec_file));
736 if ((*lhs)->pnum < (*rhs)->pnum)
738 else if ((*lhs)->pnum == (*rhs)->pnum)
768 for (num_remote_regs = 0,
regnum = 0;
772 remote_regs[num_remote_regs++] = ®s[
regnum];
795 int *
pnum,
int *poffset)
804 *poffset = regs[
regnum].offset;
943 _(
"Send the ASCII ETX character (Ctrl-c) " 944 "to the remote target to interrupt the " 945 "execution of the program.\n"));
948 _(
"send a break signal to the remote target " 949 "to interrupt the execution of the program.\n"));
952 _(
"Send a break signal and 'g' a.k.a. Magic SysRq g to " 953 "the remote target to interrupt the execution " 954 "of Linux kernel.\n"));
957 _(
"Invalid value for interrupt_sequence_mode: %s."),
1021 #define DEFAULT_MAX_MEMORY_PACKET_SIZE 16384 1025 #define MIN_MEMORY_PACKET_SIZE 20 1039 if (config->
size <= 0)
1042 what_they_get = config->
size;
1048 if (config->
size > 0
1049 && what_they_get > config->
size)
1050 what_they_get = config->
size;
1064 if (rs->
buf_size < what_they_get + 1)
1070 return what_they_get;
1079 int fixed_p = config->
fixed_p;
1083 error (
_(
"Argument required (integer, `fixed' or `limited')."));
1084 else if (strcmp (args,
"hard") == 0
1085 || strcmp (args,
"fixed") == 0)
1087 else if (strcmp (args,
"soft") == 0
1088 || strcmp (args,
"limit") == 0)
1094 size = strtoul (args, &end, 0);
1096 error (
_(
"Invalid %s (bad syntax)."), config->
name);
1108 if (fixed_p && !config->
fixed_p)
1110 if (!
query (
_(
"The target may not be able to correctly handle a %s\n" 1111 "of %ld bytes. Change the packet size? "),
1113 error (
_(
"Packet size not changed."));
1134 "memory-write-packet-size",
1157 "memory-read-packet-size",
1229 const char *support =
"internal-error";
1234 support =
"enabled";
1237 support =
"disabled";
1240 support =
"unknown";
1247 "is auto-detected, currently %s.\n"),
1248 config->
name, support);
1253 config->
name, support);
1260 const char *title,
int legacy)
1267 config->
title = title;
1268 set_doc =
xstrprintf (
"Set use of remote protocol `%s' (%s) packet",
1270 show_doc =
xstrprintf (
"Show current use of remote " 1271 "protocol `%s' (%s) packet",
1276 &config->
detect, set_doc,
1305 && isxdigit (buf[1]) && isxdigit (buf[2])
1312 if (buf[0] ==
'E' && buf[1] ==
'.')
1331 _(
"packet_ok: attempt to use a disabled packet"));
1343 "Packet %s (%s) is supported\n",
1355 error (
_(
"Protocol error: %s (%s) conflicting enabled responses."),
1361 error (
_(
"Enabled packet %s (%s) not recognized by stub"),
1367 "Packet %s (%s) is NOT supported\n",
1580 internal_error (__FILE__, __LINE__,
_(
"Could not find config for %s"),
1752 if (strcmp (rs->
buf,
"1") == 0)
1809 inf->attach_flag = attached;
1944 if (thread->
priv == NULL)
1976 int numsigs,
unsigned char *pass_signals)
1980 char *pass_packet, *p;
1985 for (i = 0; i < numsigs; i++)
1987 if (pass_signals[i])
1990 pass_packet = (
char *)
xmalloc (count * 3 + strlen (
"QPassSignals:") + 1);
1991 strcpy (pass_packet,
"QPassSignals:");
1992 p = pass_packet + strlen (pass_packet);
1993 for (i = 0; i < numsigs; i++)
1995 if (pass_signals[i])
1998 *p++ =
tohex (i >> 4);
1999 *p++ =
tohex (i & 15);
2018 xfree (pass_packet);
2027 int pid,
bool needed,
int any_count,
2030 const char *catch_packet;
2040 if (needed && any_count == 0)
2043 for (
size_t i = 0; i < syscall_counts.
size (); i++)
2045 if (syscall_counts[i] != 0)
2053 "remote_set_syscall_catchpoint " 2054 "pid %d needed %d any_count %d n_sysno %d\n",
2055 pid, needed, any_count, n_sysno);
2064 const int maxpktsz = strlen (
"QCatchSyscalls:1") + n_sysno * 9 + 1;
2065 built_packet.reserve (maxpktsz);
2066 built_packet =
"QCatchSyscalls:1";
2070 for (
size_t i = 0; i < syscall_counts.
size (); i++)
2072 if (syscall_counts[i] != 0)
2080 catch_packet =
"QCatchSyscalls:1";
2083 catch_packet = built_packet.c_str ();
2086 catch_packet =
"QCatchSyscalls:0";
2104 int numsigs,
unsigned char *
signals)
2113 for (i = 0; i < numsigs; i++)
2118 packet = (
char *)
xmalloc (count * 3 + strlen (
"QProgramSignals:") + 1);
2119 strcpy (packet,
"QProgramSignals:");
2120 p = packet + strlen (packet);
2121 for (i = 0; i < numsigs; i++)
2126 *p++ =
tohex (i >> 4);
2127 *p++ =
tohex (i & 15);
2166 *
buf++ = gen ?
'g' :
'c';
2261 return (rs->
buf[0] ==
'O' && rs->
buf[1] ==
'K');
2270 if (info->
priv != NULL)
2273 return !
name.empty () ?
name.c_str () : NULL;
2314 #define TAG_THREADID 1 2315 #define TAG_EXISTS 2 2316 #define TAG_DISPLAY 4 2317 #define TAG_THREADNAME 8 2318 #define TAG_MOREDISPLAY 16 2320 #define BUF_THREAD_ID_SIZE (OPAQUETHREADBYTES * 2) 2330 static char *
unpack_string (
char *src,
char *dest,
int length);
2377 void *context,
int looplimit);
2416 const char *p =
buf;
2425 error (
_(
"invalid remote ptid: %s"), p);
2462 if (ch >=
'a' && ch <=
'f')
2463 return ch -
'a' + 10;
2464 if (ch >=
'0' && ch <=
'9')
2466 if (ch >=
'A' && ch <=
'F')
2467 return ch -
'A' + 10;
2483 retval = retval << 4;
2520 static char *pack_string (
char *pkt,
char *
string);
2523 pack_string (
char *pkt,
char *
string)
2528 len = strlen (
string);
2535 if ((ch ==
'\0') || (ch ==
'#'))
2556 unsigned char *altid;
2558 altid = (
unsigned char *)
id;
2573 altref = (
char *)
id;
2575 while (inbuf < limit)
2579 *altref++ = (x << 4) | y;
2592 unsigned char *
scan;
2594 scan = (
unsigned char *)
id;
2610 unsigned char *
scan;
2624 unsigned char *csrc, *cdest;
2626 csrc = (
unsigned char *) src;
2627 cdest = (
unsigned char *) dest;
2638 unsigned char *srcp, *destp;
2640 srcp = (
char *) src;
2641 destp = (
char *) dest;
2645 result &= (*srcp++ == *destp++) ? 1 : 0;
2676 #define TAG_THREADID 1 2677 #define TAG_EXISTS 2 2679 #define TAG_DISPLAY 4 2680 #define TAG_THREADNAME 8 2681 #define TAG_MOREDISPLAY 16 2707 warning (
_(
"Incomplete response to threadinfo request."));
2710 warning (
_(
"ERROR RMT Thread info mismatch."));
2718 while ((pkt < limit) && mask && *pkt)
2724 warning (
_(
"ERROR RMT: threadinfo tag mismatch."));
2732 warning (
_(
"ERROR RMT: length of threadid is not 16."));
2747 warning (
_(
"ERROR RMT: 'exists' length too long."));
2771 warning (
_(
"ERROR RMT: unknown thread info tag."));
2788 if (rs->
buf[0] ==
'\0')
2820 int count, resultcount, done;
2830 while ((count-- > 0) && (pkt < limit))
2833 if (resultcount++ >= result_limit)
2846 int *done,
int *result_count,
threadref *threadlist)
2859 if (*rs->
buf ==
'\0')
2879 warning (
_(
"HMM: threadlist did not echo arg thread, dropping it."));
2882 if (*result_count <= 0)
2886 warning (
_(
"RMT ERROR : failed to get remote thread list."));
2891 if (*result_count > result_limit)
2894 warning (
_(
"RMT ERROR: threadlist response longer than requested."));
2911 int done, i, result_count;
2919 if (loopcount++ > looplimit)
2922 warning (
_(
"Remote fetch threadlist -infinite loop-."));
2927 &done, &result_count,
2934 if (result_count >= 1)
2938 while (result_count--)
2992 return item.ptid == ptid;
2995 auto it = std::find_if (this->
items.begin (),
2999 return it != this->
items.end ();
3008 return item.ptid == ptid;
3011 auto it = std::remove_if (this->
items.begin (),
3015 if (it != this->
items.end ())
3016 this->
items.erase (it);
3032 context->
items.emplace_back (ptid);
3037 #define CRAZY_MAX_THREADS 1000 3046 if (rs->
buf[0] ==
'Q' && rs->
buf[1] ==
'C')
3054 "warning: garbage in qC reply\n");
3075 #if defined(HAVE_LIBEXPAT) 3089 data->
items.emplace_back (ptid);
3108 void *user_data,
const char *body_text)
3113 if (body_text != NULL && *body_text !=
'\0')
3114 data->
items.back ().extra = body_text;
3150 #if defined(HAVE_LIBEXPAT) 3156 if (xml != NULL && *xml !=
'\0')
3184 if (bufp[0] !=
'\0')
3186 while (*bufp++ ==
'm')
3191 context->
items.emplace_back (ptid);
3193 while (*bufp++ ==
',');
3230 if (context.
items.empty ()
3274 info->
name = std::move (item.
name);
3307 static char display_buf[100];
3312 _(
"remote_threads_extra_info"));
3324 if (info != NULL && info->
priv != NULL)
3327 return !extra.empty () ? extra.c_str () : NULL;
3338 xsnprintf (b, endb - b,
"qThreadExtraInfo,");
3344 if (rs->
buf[0] != 0)
3346 n = std::min (strlen (rs->
buf) / 2, sizeof (display_buf));
3348 display_buf [result] =
'\0';
3362 n +=
xsnprintf (&display_buf[0],
sizeof (display_buf) - n,
3365 n +=
xsnprintf (&display_buf[n],
sizeof (display_buf) - n,
3366 " State: %s,", threadinfo.
display);
3368 n +=
xsnprintf (&display_buf[n],
sizeof (display_buf) - n,
3374 if (
',' == display_buf[n-1])
3375 display_buf[n-1] =
' ';
3398 error (
_(
"Remote failure reply: %s"), p);
3410 remote_static_tracepoint_markers_by_strid (
struct target_ops *
self,
3425 error (
_(
"Remote failure reply: %s"), p);
3438 if (strid == NULL || strcmp (strid, marker->
str_id) == 0)
3447 memset (marker, 0,
sizeof (*marker));
3450 while (*p++ ==
',');
3529 int lose, num_segments = 0, do_sections, do_segments;
3530 CORE_ADDR text_addr, data_addr, bss_addr, segments[2];
3541 if (buf[0] ==
'\000')
3546 warning (
_(
"Remote failure reply: %s"), buf);
3554 text_addr = data_addr = bss_addr = 0;
3562 while (*ptr && *ptr !=
';')
3563 text_addr = (text_addr << 4) +
fromhex (*ptr++);
3568 while (*ptr && *ptr !=
';')
3569 data_addr = (data_addr << 4) +
fromhex (*ptr++);
3577 while (*ptr && *ptr !=
';')
3578 bss_addr = (bss_addr << 4) +
fromhex (*ptr++);
3580 if (bss_addr != data_addr)
3581 warning (
_(
"Target reported unsupported offsets: %s"), buf);
3590 while (*ptr && *ptr !=
';')
3591 text_addr = (text_addr << 4) +
fromhex (*ptr++);
3597 while (*ptr && *ptr !=
';')
3598 data_addr = (data_addr << 4) +
fromhex (*ptr++);
3606 error (
_(
"Malformed response to offset query, %s"), buf);
3607 else if (*ptr !=
'\0')
3608 warning (
_(
"Target reported unsupported offsets: %s"), buf);
3616 do_segments = (data != NULL);
3617 do_sections = num_segments == 0;
3619 if (num_segments > 0)
3621 segments[0] = text_addr;
3622 segments[1] = data_addr;
3651 offs, num_segments, segments);
3653 if (ret == 0 && !do_sections)
3654 error (
_(
"Can not handle qOffsets TextSeg " 3655 "response with this symbol file"));
3697 _(
"Invalid value for interrupt_sequence_mode: %s."),
3720 p1 = strchr (p,
':');
3724 if (strncmp (p,
"thread", p1 - p) == 0)
3727 p1 = strchr (p,
';');
3753 if (wait_status != NULL)
3847 while (pending_stop_replies-- > 0)
3852 int ignore_event = 0;
3855 memset (&ws, 0,
sizeof (ws));
3886 enum gdb_signal sig = ws.
value.
sig;
3890 if (sig == GDB_SIGNAL_TRAP)
3914 inf->needs_setup = 1;
3939 if (
inf->needs_setup)
3961 if (selected == NULL
3965 if (lowest_stopped == NULL
3968 lowest_stopped = thread;
3980 thread = lowest_stopped;
4000 char *wait_status = NULL;
4035 const char v_mustreplyempty[] =
"vMustReplyEmpty";
4037 putpkt (v_mustreplyempty);
4039 if (strcmp (rs->
buf,
"OK") == 0)
4041 else if (strcmp (rs->
buf,
"") != 0)
4042 error (
_(
"Remote replied unexpectedly to '%s': %s"), v_mustreplyempty,
4062 putpkt (
"QStartNoAckMode");
4095 error (
_(
"Non-stop mode requested, but remote " 4096 "does not support non-stop"));
4101 if (strcmp (rs->
buf,
"OK") != 0)
4102 error (
_(
"Remote refused setting non-stop mode with: %s"), rs->
buf);
4117 if (strcmp (rs->
buf,
"OK") != 0)
4118 error (
_(
"Remote refused setting all-stop mode with: %s"), rs->
buf);
4138 if (rs->
buf[0] ==
'W' || rs->
buf[0] ==
'X')
4141 error (
_(
"The target is not running (try extended-remote?)"));
4151 wait_status = (
char *) alloca (strlen (rs->
buf) + 1);
4152 strcpy (wait_status, rs->
buf);
4184 "warning: couldn't determine remote " 4185 "current thread; picking first in list.\n");
4217 strcpy (rs->
buf, wait_status);
4236 if (strcmp (rs->
buf,
"OK") != 0)
4250 error (
_(
"The target is not running (try extended-remote?)"));
4358 char *msg, *reply, *tmp;
4389 getpkt (&reply, &reply_size, 0);
4414 phex_nz (sym_addr, addr_size), &reply[8]);
4418 getpkt (&reply, &reply_size, 0);
4427 static int udp_warning = 0;
4435 warning (
_(
"The remote protocol may be unreliable over UDP.\n" 4436 "Some events may be lost, rendering further debugging " 4459 "WriteReg:%x;WriteMem:%x;" 4460 "InsertBreak:%x;InsertTrace:%x;" 4461 "InsertFastTrace:%x;Stop:%x",
4470 if (strcmp (rs->
buf,
"OK") != 0)
4471 warning (
_(
"Remote refused setting permissions with: %s"), rs->
buf);
4504 const char *argument)
4508 warning (
_(
"Remote qSupported response supplied an unexpected value for" 4509 " \"%s\"."), feature->
name);
4530 warning (
_(
"Remote target reported \"%s\" without a size."),
4536 packet_size = strtol (
value, &value_end, 16);
4537 if (errno != 0 || *value_end !=
'\0' || packet_size < 0)
4539 warning (
_(
"Remote target reported \"%s\" with a bad size: \"%s\"."),
4664 #if defined(HAVE_LIBEXPAT) 4670 char *p = strtok (copy,
",");
4674 if (strcmp (p, xml) == 0)
4681 while ((p = strtok (NULL,
",")) != NULL);
4695 return reconcat (msg, msg,
";", append, (
char *) NULL);
4697 return xstrdup (append);
4756 q = reconcat (q,
"qSupported:", q, (
char *) NULL);
4773 memset (seen, 0,
sizeof (seen));
4779 char *p, *end, *name_end, *
value;
4785 end = strchr (p,
';');
4788 end = p + strlen (p);
4798 warning (
_(
"empty item in \"qSupported\" response"));
4803 name_end = strchr (p,
'=');
4808 value = name_end + 1;
4829 warning (
_(
"unrecognized item \"%s\" " 4830 "in \"qSupported\" response"), p);
4843 feature->
func (feature, is_supported,
value);
4905 if (
query (
_(
"The target is not responding to GDB commands.\n" 4906 "Stop debugging it? ")))
4944 error (
_(
"To open a remote debug connection, you need to specify what\n" 4945 "serial device is attached to the remote system\n" 4946 "(e.g. /dev/ttyS0, /dev/ttya, COM1, etc.)."));
4958 && !
query (
_(
"Already connected to a remote target. Disconnect? ")))
4959 error (
_(
"Still connected."));
5108 strcpy (rs->
buf,
"D");
5113 if (rs->
buf[0] ==
'O' && rs->
buf[1] ==
'K')
5115 else if (rs->
buf[0] ==
'\0')
5116 error (
_(
"Remote doesn't know how to detach"));
5118 error (
_(
"Can't detach process."));
5136 error (
_(
"Argument given to \"detach\" when remotely debugging."));
5139 error (
_(
"No process to detach from."));
5152 is_fork_parent = (tp != NULL
5157 if (!is_fork_parent)
5241 error (
_(
"Argument given to \"disconnect\" when remotely debugging."));
5262 char *wait_status = NULL;
5270 error (
_(
"This target does not support attaching to a process"));
5297 wait_status = (
char *) alloca (strlen (rs->
buf) + 1);
5298 strcpy (wait_status, rs->
buf);
5300 else if (strcmp (rs->
buf,
"OK") != 0)
5301 error (
_(
"Attaching to %s failed with: %s"),
5306 error (
_(
"This target does not support attaching to a process"));
5308 error (
_(
"Attaching to %s failed"),
5362 strcpy (rs->
buf, wait_status);
5396 strcpy (rs->
buf,
"vCont?");
5405 int support_c, support_C;
5413 while (p && *p ==
';')
5416 if (*p ==
's' && (*(p + 1) ==
';' || *(p + 1) == 0))
5418 else if (*p ==
'S' && (*(p + 1) ==
';' || *(p + 1) == 0))
5420 else if (*p ==
'c' && (*(p + 1) ==
';' || *(p + 1) == 0))
5422 else if (*p ==
'C' && (*(p + 1) ==
';' || *(p + 1) == 0))
5424 else if (*p ==
't' && (*(p + 1) ==
';' || *(p + 1) == 0))
5426 else if (*p ==
'r' && (*(p + 1) ==
';' || *(p + 1) == 0))
5429 p = strchr (p,
';');
5434 if (!support_c || !support_C)
5453 ptid_t ptid,
int step,
enum gdb_signal siggnal)
5457 if (step && siggnal != GDB_SIGNAL_0)
5458 p +=
xsnprintf (p, endp - p,
";S%02x", siggnal);
5497 else if (siggnal != GDB_SIGNAL_0)
5498 p +=
xsnprintf (p, endp - p,
";C%02x", siggnal);
5526 if (thread->
priv != NULL)
5531 priv->watch_data_address = 0;
5562 ptid_t ptid,
int step,
enum gdb_signal siggnal)
5586 warning (
_(
" - Can't pass signal %d to target in reverse: ignored."),
5590 error (
_(
"Remote reverse-step not supported."));
5592 error (
_(
"Remote reverse-continue not supported."));
5594 strcpy (buf, step ?
"bs" :
"bc");
5596 else if (siggnal != GDB_SIGNAL_0)
5598 buf[0] = step ?
'S' :
'C';
5599 buf[1] =
tohex (((
int) siggnal >> 4) & 0xf);
5600 buf[2] =
tohex (((
int) siggnal) & 0xf);
5604 strcpy (buf, step ?
"s" :
"c");
5659 if (step || siggnal != GDB_SIGNAL_0)
5687 if (strcmp (rs->
buf,
"OK") != 0)
5688 error (
_(
"Unexpected vCont reply in non-stop mode: %s"), rs->
buf);
5698 ptid_t ptid,
int step,
enum gdb_signal siggnal)
5760 (
int *may_global_wildcard_vcont);
5776 if (
inf->priv == NULL)
5806 builder->
p = rs->
buf;
5826 if (strcmp (rs->
buf,
"OK") != 0)
5827 error (
_(
"Unexpected vCont reply in non-stop mode: %s"), rs->
buf);
5834 #define MAX_ACTION_SIZE 200 5843 ptid_t ptid,
int step,
enum gdb_signal siggnal)
5850 ptid, step, siggnal);
5856 if (rsize > builder->
endp - builder->
p)
5865 memcpy (builder->
p,
buf, rsize);
5866 builder->
p += rsize;
5877 int any_process_wildcard;
5878 int may_global_wildcard_vcont;
5937 may_global_wildcard_vcont = 1;
5961 may_global_wildcard_vcont = 0;
5969 may_global_wildcard_vcont = 0;
6007 any_process_wildcard = 0;
6013 any_process_wildcard = 1;
6018 if (any_process_wildcard)
6023 if (may_global_wildcard_vcont)
6062 error (
_(
"Remote server does not support stopping threads"));
6066 p +=
xsnprintf (p, endp - p,
"vCont;t");
6071 p +=
xsnprintf (p, endp - p,
"vCont;t:");
6094 if (strcmp (rs->
buf,
"OK") != 0)
6143 error (
_(
"No support for interrupting the remote target."));
6145 error (
_(
"Interrupting target failed: %s"), rs->
buf);
6211 if (
query (
_(
"The target is not responding to interrupt requests.\n" 6212 "Stop debugging it? ")))
6220 if (
query (
_(
"Interrupted while waiting for the program.\n" 6221 "Give up waiting? ")))
6249 for (p = msg; p[0] && p[1]; p += 2)
6332 putpkt (self->ack_command);
6336 error (
_(
"Unknown stop reply"));
6411 if (event_pid == -1 || event_pid ==
ptid_get_pid (thread_ptid))
6490 param.
input = context;
6507 int *may_global_wildcard_vcont = (
int *) data;
6515 *may_global_wildcard_vcont = 0;
6522 *may_global_wildcard_vcont = 0;
6543 may_global_wildcard);
6611 if (event->
rs == rs)
6664 param.
input = &ptid;
6671 "notif: discard queued event: 'Stop' in %s\n",
6705 "notif: push 'Stop' %s to queue %d\n",
6738 strprefix (
const char *p,
const char *pend,
const char *prefix)
6740 for ( ; p < pend; p++, prefix++)
6743 return *prefix ==
'\0';
6760 event->ws.value.integer = 0;
6762 event->regcache = NULL;
6781 p1 = strchr (p,
':');
6783 error (
_(
"Malformed packet(a) (missing colon): %s\n\ 6787 error (
_(
"Malformed packet(a) (missing register number): %s\n\ 6800 else if (
strprefix (p, p1,
"syscall_entry"))
6806 event->ws.value.syscall_number = (int) sysno;
6808 else if (
strprefix (p, p1,
"syscall_return"))
6814 event->ws.value.syscall_number = (int) sysno;
6822 event->watch_data_address = (
CORE_ADDR) addr;
6831 error (
_(
"Unexpected swbreak stop reason"));
6836 p = strchrnul (p1 + 1,
';');
6845 error (
_(
"Unexpected hwbreak stop reason"));
6848 p = strchrnul (p1 + 1,
';');
6853 p = strchrnul (p1 + 1,
';');
6855 else if (
strprefix (p, p1,
"replaylog"))
6860 p = strchrnul (p1 + 1,
';');
6871 event->ws.value.related_pid =
read_ptid (++p1, &p);
6876 event->ws.value.related_pid =
read_ptid (++p1, &p);
6879 else if (
strprefix (p, p1,
"vforkdone"))
6882 p = strchrnul (p1 + 1,
';');
6887 char pathname[PATH_MAX];
6892 pathlen = (p - p1) / 2;
6897 pathname[pathlen] =
'\0';
6900 event->ws.value.execd_pathname = xstrdup (pathname);
6911 p = strchrnul (p1 + 1,
';');
6920 p = strchrnul (p1 + 1,
';');
6937 const char *thr = strstr (p1 + 1,
";thread:");
6939 event->ptid =
read_ptid (thr + strlen (
";thread:"),
6947 event->ptid =
event->rs->general_thread;
6967 p = strchrnul (p1 + 1,
';');
6972 event->arch =
inf->gdbarch;
6981 error (
_(
"Remote sent bad register number %s: %s\n\ 6994 warning (
_(
"Remote reply is too short: %s"), buf);
7002 p = strchrnul (p1 + 1,
';');
7007 error (
_(
"Remote register badly formatted: %s\nhere: %s"),
7023 event->ws.value.sig = (
enum gdb_signal) sig;
7025 event->ws.value.sig = GDB_SIGNAL_UNKNOWN;
7035 event->ws.value.integer =
value;
7037 error (
_(
"stop reply packet badly formatted: %s"), buf);
7057 event->ws.value.integer =
value;
7064 event->ws.value.sig = (
enum gdb_signal)
value;
7066 event->ws.value.sig = GDB_SIGNAL_UNKNOWN;
7083 p +=
sizeof (
"process:") - 1;
7088 error (
_(
"unknown stop reply packet: %s"), buf);
7091 error (
_(
"unknown stop reply packet: %s"), buf);
7102 error (
_(
"No process or thread specified in stop reply: %s"), buf);
7156 "notif: process: '%s' ack pending event\n",
7166 if (strcmp (rs->
buf,
"OK") == 0)
7176 "notif: process: '%s' no pending reply\n",
7251 if (ret != -1 && !is_notif)
7306 status->value.integer = 0;
7333 forever, &is_notif);
7337 if (ret != -1 && is_notif)
7348 if (buf[0] !=
'F' && buf[0] !=
'O')
7358 warning (
_(
"Remote failure reply: %s"), buf);
7360 status->value.sig = GDB_SIGNAL_0;
7374 case 'N':
case 'T':
case 'S':
case 'X':
case 'W':
7398 (
"Can't send signals to this remote system. %s not sent.\n",
7409 warning (
_(
"Invalid remote reply: %s"), buf);
7478 if (
reg->pnum == -1)
7497 error (
_(
"Could not fetch register \"%s\"; remote failure reply '%s'"),
7516 error (
_(
"fetch_register_using_p: early buf termination"));
7539 while ((rs->
buf[0] <
'0' || rs->
buf[0] >
'9')
7540 && (rs->
buf[0] <
'A' || rs->
buf[0] >
'F')
7541 && (rs->
buf[0] <
'a' || rs->
buf[0] >
'f')
7542 && rs->
buf[0] !=
'x')
7546 "Bad register packet; fetching a new packet\n");
7550 buf_len = strlen (rs->
buf);
7553 if (buf_len % 2 != 0)
7554 error (
_(
"Remote 'g' packet reply is of odd length: %s"), rs->
buf);
7569 buf_len = strlen (rs->
buf);
7573 error (
_(
"Remote 'g' packet reply is too long (expected %ld bytes, got %d " 7586 if (buf_len < 2 * rsa->sizeof_g_packet)
7588 long sizeof_g_packet = buf_len / 2;
7598 if (
offset >= sizeof_g_packet)
7600 else if (
offset + reg_size > sizeof_g_packet)
7601 error (
_(
"Truncated register %d in remote 'g' packet"), i);
7627 if (p[0] == 0 || p[1] == 0)
7630 _(
"unexpected end of 'g' packet reply"));
7632 if (p[0] ==
'x' && p[1] ==
'x')
7646 if ((r->
offset + reg_size) * 2 > strlen (rs->
buf))
7649 _(
"unexpected end of 'g' packet reply"));
7691 warning (
_(
"could not set remote traceframe"));
7715 if (
reg->in_g_packet)
7718 if (
reg->in_g_packet)
7784 if (
reg->pnum == -1)
7799 error (
_(
"Could not write register \"%s\"; remote failure reply '%s'"),
7843 error (
_(
"Could not write registers; remote failure reply '%s'"),
7878 if (!
reg->in_g_packet)
7902 for (i = 0; num != 0; i++)
7905 return std::max (i, 1);
7928 for (i = width - 1; i >= 0; i--)
7930 buf[i] =
"0123456789abcdef"[(num & 0xf)];
7948 if (address_size > 0
7949 && address_size < (
sizeof (
ULONGEST) * 8))
7955 mask = (mask << address_size) - 1;
7998 if (rs->
buf[0] ==
'\0')
8002 "binary downloading NOT " 8003 "supported by target\n");
8010 "binary downloading supported by target\n");
8066 int unit_size,
ULONGEST *xfered_len_units,
8067 char packet_format,
int use_length)
8075 int payload_capacity_bytes;
8076 int payload_length_bytes;
8078 if (packet_format !=
'X' && packet_format !=
'M')
8080 _(
"remote_write_bytes_aux: bad packet format"));
8094 payload_capacity_bytes -= strlen (
"$,:#NN");
8097 payload_capacity_bytes += 1;
8098 payload_capacity_bytes -= strlen (header);
8099 payload_capacity_bytes -=
hexnumlen (memaddr);
8103 strcat (rs->
buf, header);
8104 p = rs->
buf + strlen (header);
8107 if (packet_format ==
'X')
8110 todo_units = std::min (len_units,
8111 (
ULONGEST) payload_capacity_bytes / unit_size);
8113 payload_capacity_bytes -=
hexnumlen (todo_units);
8114 todo_units = std::min (todo_units, payload_capacity_bytes / unit_size);
8120 = std::min (len_units,
8121 (
ULONGEST) (payload_capacity_bytes / unit_size) / 2);
8123 payload_capacity_bytes -=
hexnumlen (todo_units);
8124 todo_units = std::min (todo_units,
8125 (payload_capacity_bytes / unit_size) / 2);
8128 if (todo_units <= 0)
8130 _(
"minimum packet size too small to write data"));
8158 if (packet_format ==
'X')
8163 payload_length_bytes =
8165 &units_written, payload_capacity_bytes);
8176 if (new_todo_units != units_written)
8177 payload_length_bytes =
8180 payload_capacity_bytes);
8183 p += payload_length_bytes;
8184 if (use_length && units_written < todo_units)
8200 p += 2 *
bin2hex (myaddr, p, todo_units * unit_size);
8201 units_written = todo_units;
8207 if (rs->
buf[0] ==
'E')
8212 *xfered_len_units = (
ULONGEST) units_written;
8228 int unit_size,
ULONGEST *xfered_len)
8230 const char *packet_format = NULL;
8238 packet_format =
"X";
8241 packet_format =
"M";
8245 _(
"remote_write_bytes: bad internal state"));
8251 memaddr, myaddr, len, unit_size, xfered_len,
8252 packet_format[0], 1);
8271 int unit_size,
ULONGEST *xfered_len_units)
8284 todo_units = std::min (len_units,
8285 (
ULONGEST) (buf_size_bytes / unit_size) / 2);
8297 if (rs->
buf[0] ==
'E' 8298 && isxdigit (rs->
buf[1]) && isxdigit (rs->
buf[2])
8299 && rs->
buf[3] ==
'\0')
8304 decoded_bytes =
hex2bin (p, myaddr, todo_units * unit_size);
8306 *xfered_len_units = (
ULONGEST) (decoded_bytes / unit_size);
8319 int unit_size,
ULONGEST *xfered_len)
8335 for (p = table->
sections; p < table->sections_end; p++)
8337 if (memaddr >= p->
addr)
8345 else if (memaddr >= p->
endaddr)
8402 len, unit_size, xfered_len);
8410 return (*xfered_len != 0) ?
8442 va_start (ap, format);
8445 if (vsnprintf (rs->
buf, max_size, format, ap) >= max_size)
8449 error (
_(
"Communication problem with target."));
8472 phex (address, addr_size),
8477 error (
_(
"Remote target does not support flash erase"));
8479 error (
_(
"Error erasing flash with vFlashErase packet"));
8509 error (
_(
"Remote target does not support vFlashDone"));
8511 error (
_(
"Error finishing flash operation"));
8535 int saved_errno = errno;
8576 "Target disconnected."));
8603 "Target disconnected."));
8622 if ((*
buf)[0] ==
'E')
8623 error (
_(
"Remote failure reply: %s"), *
buf);
8635 return std::move (stb.
string ());
8666 unsigned char csum = 0;
8668 char *buf2 = data.data ();
8685 error (
_(
"Cannot execute this command while the target is running.\n" 8686 "Use the \"interrupt\" command to stop the target\n" 8687 "and then try again."));
8700 for (i = 0; i < cnt; i++)
8706 *p++ =
tohex ((csum >> 4) & 0xf);
8707 *p++ =
tohex (csum & 0xf);
8713 int started_error_output = 0;
8719 int len = (int) (p - buf2);
8758 if (started_error_output)
8761 started_error_output = 0;
8785 "Packet instead of Ack, ignoring it\n");
8811 " Notification received: %s\n",
8822 if (!started_error_output)
8824 started_error_output = 1;
8837 if (!started_error_output)
8839 started_error_output = 1;
8940 unsigned char pktcsum;
8957 else if (check_0 < 0 || check_1 < 0)
8972 if (csum == pktcsum)
8980 "Bad checksum, sentsum=0x%x, " 8981 "csum=0x%x, buf=%s\n",
8982 pktcsum, csum, str.c_str ());
8995 repeat = c -
' ' + 3;
8999 if (repeat > 0 && repeat <= 255 && bc > 0)
9001 if (bc + repeat - 1 >= *sizeof_buf - 1)
9004 *sizeof_buf += repeat;
9005 *buf_p = (
char *)
xrealloc (*buf_p, *sizeof_buf);
9019 if (bc >= *sizeof_buf - 1)
9023 *buf_p = (
char *)
xrealloc (*buf_p, *sizeof_buf);
9066 int expecting_notif,
int *is_notif)
9078 strcpy (*
buf,
"timeout");
9082 else if (expecting_notif)
9096 for (tries = 1; tries <=
MAX_TRIES; tries++)
9113 if (expecting_notif)
9121 _(
"Watchdog timeout has expired. " 9122 "Target detached."));
9175 if (is_notif != NULL)
9191 " Notification received: %s\n",
9194 if (is_notif != NULL)
9201 if (expecting_notif)
9231 int parent_pid = *(
int *) param->
input;
9241 error (
_(
"Can't kill fork child process %d"), child_pid);
9271 error (
_(
"Can't kill fork child process %d"), child_pid);
9327 error (
_(
"Can't kill process"));
9445 if (rs->
buf[0] ==
'S' || rs->
buf[0] ==
'T')
9474 error (
_(
"Target does not support QDisableRandomization."));
9475 if (strcmp (reply,
"OK") != 0)
9476 error (
_(
"Bogus QDisableRandomization reply from target: %s"), reply);
9491 strcpy (rs->
buf,
"vRun;");
9492 len = strlen (rs->
buf);
9495 error (
_(
"Remote file name too long for run packet"));
9497 strlen (remote_exec_file));
9504 for (i = 0;
argv[i] != NULL; i++)
9507 error (
_(
"Argument list too long for run packet"));
9508 rs->
buf[len++] =
';';
9514 rs->
buf[len++] =
'\0';
9527 if (remote_exec_file[0] ==
'\0')
9528 error (
_(
"Running the default executable on the remote target failed; " 9529 "try \"set remote exec-file\"?"));
9531 error (
_(
"Running \"%s\" on the remote target failed"),
9555 "%s:%s", packet, encoded_value.c_str ());
9559 if (strcmp (rs->
buf,
"OK") != 0)
9560 warning (
_(
"Unable to %s environment variable '%s' on remote."),
9571 putpkt (
"QEnvironmentReset");
9573 if (strcmp (rs->
buf,
"OK") != 0)
9574 warning (
_(
"Unable to reset environment on remote."));
9599 if (inferior_cwd != NULL)
9602 strlen (inferior_cwd));
9605 "QSetWorkingDir:%s", hexpath.c_str ());
9621 Remote replied unexpectedly while setting the inferior's working\n\ 9636 const char *exec_file,
9638 char **env,
int from_tty)
9662 if (strcmp (rs->
buf,
"OK") != 0)
9664 Remote replied unexpectedly while setting startup-with-shell: %s"),
9678 if (remote_exec_file[0])
9679 error (
_(
"Remote target does not support \"set remote exec-file\""));
9681 error (
_(
"Remote target does not support \"set args\" or run <ARGS>"));
9727 for (
int i = 0; i < aexpr->
len; ++i)
9750 sprintf (
buf,
"X%x,", aexpr->
len);
9752 for (
int i = 0; i < aexpr->
len; ++i)
9818 Target doesn't support breakpoints that have target side commands."));
9853 return (rs->
buf[0] ==
'E');
9875 _(
"hw_bp_to_z: bad watchpoint type %d"),
type);
9897 p = strchr (rs->
buf,
'\0');
9915 _(
"remote_insert_watchpoint: reached end of function"));
9924 return diff < length;
9946 p = strchr (rs->
buf,
'\0');
9962 _(
"remote_remove_watchpoint: reached end of function"));
10018 return (thread->
priv != NULL
10039 return (thread->
priv != NULL
10058 return (thread->
priv != NULL
10068 if (thread->
priv != NULL
10121 if (rs->
buf[1] ==
'.')
10123 message = strchr (rs->
buf + 2,
'.');
10125 error (
_(
"Remote failure reply: %s"), message + 1);
10134 _(
"remote_insert_hw_breakpoint: reached end of function"));
10175 _(
"remote_remove_hw_breakpoint: reached end of function"));
10185 unsigned long host_crc, target_crc;
10199 (
long) lma, (
long)
size);
10204 host_crc = xcrc32 (data,
size, 0xffffffff);
10214 for (target_crc = 0, tmp = &rs->
buf[1]; *tmp; tmp++)
10215 target_crc = target_crc * 16 +
fromhex (*tmp);
10217 return (host_crc == target_crc);
10234 const char *sectname;
10235 bfd_size_type
size;
10238 int mismatched = 0;
10243 error (
_(
"command cannot be used without an exec file"));
10248 if (args != NULL && strcmp (args,
"-r") == 0)
10254 for (s =
exec_bfd->sections; s; s = s->next)
10256 if (!(s->flags & SEC_LOAD))
10259 if (read_only && (s->flags & SEC_READONLY) == 0)
10262 size = bfd_get_section_size (s);
10266 sectname = bfd_get_section_name (
exec_bfd, s);
10267 if (args && strcmp (args, sectname) != 0)
10274 bfd_get_section_contents (
exec_bfd, s, sectdata.data (), 0,
size);
10279 error (
_(
"target memory fault, section %s, range %s -- %s"), sectname,
10294 if (mismatched > 0)
10295 warning (
_(
"One or more sections of the target image does not match\n\ 10296 the loaded file\n"));
10297 if (args && !matched)
10307 const char *annex,
const gdb_byte *writebuf,
10320 i = snprintf (rs->
buf, max_size,
10321 "qXfer:%s:write:%s:%s:",
10322 object_name, annex ? annex :
"",
10324 max_size -= (i + 1);
10328 (writebuf, len, 1, (
gdb_byte *) rs->
buf + i, &max_size, max_size);
10385 object_name, annex ? annex :
"",
10397 if (rs->
buf[0] !=
'l' && rs->
buf[0] !=
'm')
10398 error (
_(
"Unknown remote qXfer reply: %s"), rs->
buf);
10403 if (rs->
buf[0] ==
'm' && packet_len == 1)
10404 error (
_(
"Remote qXfer reply contained no data."));
10408 packet_len - 1, readbuf, n);
10413 if (rs->
buf[0] ==
'l' &&
offset + i > 0)
10431 const char *annex,
gdb_byte *readbuf,
10455 if (writebuf != NULL)
10485 writebuf,
offset, len, xfered_len,
10494 readbuf,
offset, len, xfered_len,
10502 if (writebuf != NULL)
10531 (ops,
"features", annex, readbuf,
offset, len, xfered_len,
10536 (ops,
"libraries", annex, readbuf,
offset, len, xfered_len,
10541 (ops,
"libraries-svr4", annex, readbuf,
offset, len, xfered_len,
10554 (ops,
"osdata", annex, readbuf,
offset, len, xfered_len,
10566 (ops,
"traceframe-info", annex, readbuf,
offset, len, xfered_len,
10606 error (
_(
"remote query is only available after target open"));
10613 *p2++ = query_type;
10624 gdb_assert (isprint (annex[i]) && annex[i] !=
'$' && annex[i] !=
'#');
10636 strcpy ((
char *) readbuf, rs->
buf);
10638 *xfered_len = strlen ((
char *) readbuf);
10663 int escaped_pattern_len;
10665 int used_pattern_len;
10674 if (pattern_len > search_space_len)
10676 if (pattern_len == 0)
10678 *found_addrp = start_addr;
10690 pattern, pattern_len, found_addrp);
10697 i = snprintf (rs->
buf, max_size,
10698 "qSearch:memory:%s;%s;",
10699 phex_nz (start_addr, addr_size),
10700 phex_nz (search_space_len,
sizeof (search_space_len)));
10701 max_size -= (i + 1);
10704 escaped_pattern_len =
10706 &used_pattern_len, max_size);
10709 if (used_pattern_len != pattern_len)
10710 error (
_(
"Pattern is too large to transmit to remote target."));
10721 pattern, pattern_len, found_addrp);
10726 if (rs->
buf[0] ==
'0')
10728 else if (rs->
buf[0] ==
'1')
10731 if (rs->
buf[1] !=
',')
10732 error (
_(
"Unknown qSearch:memory reply: %s"), rs->
buf);
10734 *found_addrp = found_addr;
10737 error (
_(
"Unknown qSearch:memory reply: %s"), rs->
buf);
10750 error (
_(
"remote rcmd is only available after target open"));
10753 if (command == NULL)
10757 strcpy (rs->
buf,
"qRcmd,");
10758 p = strchr (rs->
buf,
'\0');
10760 if ((strlen (rs->
buf) + strlen (command) * 2 + 8)
10762 error (
_(
"\"monitor\" command ``%s'' is too long."), command);
10768 error (
_(
"Communication problem with target."));
10788 if (
buf[0] ==
'\0')
10789 error (
_(
"Target does not support this command."));
10790 if (
buf[0] ==
'O' &&
buf[1] !=
'K')
10795 if (strcmp (
buf,
"OK") == 0)
10797 if (strlen (
buf) == 3 &&
buf[0] ==
'E' 10798 && isdigit (
buf[1]) && isdigit (
buf[2]))
10800 error (
_(
"Protocol error with Rcmd"));
10802 for (p =
buf; p[0] !=
'\0' && p[1] !=
'\0'; p += 2)
10812 static std::vector<mem_region>
10815 std::vector<mem_region> result;
10831 error (
_(
"command can only be used with remote target"));
10834 error (
_(
"remote-packet command requires packet text as argument"));
10852 static void threadset_test_cmd (
char *cmd,
int tty);
10854 static void threadalive_test (
char *cmd,
int tty);
10856 static void threadlist_test_cmd (
char *cmd,
int tty);
10858 int get_and_display_threadinfo (
threadref *ref);
10860 static void threadinfo_test_cmd (
char *cmd,
int tty);
10862 static int thread_display_step (
threadref *ref,
void *context);
10864 static void threadlist_update_test_cmd (
char *cmd,
int tty);
10866 static void init_remote_threadtests (
void);
10868 #define SAMPLE_THREAD 0x05060708 10871 threadset_test_cmd (
const char *cmd,
int tty)
10873 int sample_thread = SAMPLE_THREAD;
10881 threadalive_test (
const char *cmd,
int tty)
10883 int sample_thread = SAMPLE_THREAD;
10893 void output_threadid (
char *title,
threadref *ref);
10896 output_threadid (
char *title,
threadref *ref)
10906 threadlist_test_cmd (
const char *cmd,
int tty)
10910 int done, result_count;
10915 &result_count, &threadlist[0]))
10922 while (
scan < limit)
10923 output_threadid (
" thread ",
scan++);
10930 output_threadid (
"Threadid: ", &info->
threadid);
10937 get_and_display_threadinfo (
threadref *ref)
10946 display_thread_info (&threadinfo);
10951 threadinfo_test_cmd (
const char *cmd,
int tty)
10953 int athread = SAMPLE_THREAD;
10959 if (!get_and_display_threadinfo (&thread))
10964 thread_display_step (
threadref *ref,
void *context)
10967 return get_and_display_threadinfo (ref);
10971 threadlist_update_test_cmd (
const char *cmd,
int tty)
10978 init_remote_threadtests (
void)
10981 _(
"Fetch and print the remote list of " 10982 "thread identifiers, one pkt only"));
10984 _(
"Fetch and display info about one thread"));
10986 _(
"Test setting to a different thread"));
10988 _(
"Iterate through updating all remote thread info"));
10990 _(
" Remote thread alive test "));
10998 static const char *
11001 static char buf[64];
11058 strcpy (p,
"qGetTLSAddr:");
11080 _(
"Remote target doesn't support qGetTLSAddr packet"));
11083 _(
"Remote target failed to process qGetTLSAddr request"));
11087 _(
"TLS not supported or disabled on this target"));
11105 strcpy (p,
"qGetTIBAddr:");
11124 error (
_(
"Remote target doesn't support qGetTIBAddr packet"));
11126 error (
_(
"Remote target failed to process qGetTIBAddr request"));
11129 error (
_(
"qGetTIBAddr not supported or disabled on this target"));
11178 _(
"Duplicate g packet description added for size %d"),
11224 return guess->
tdesc;
11244 int len = strlen (
string);
11247 error (
_(
"Packet too long for target."));
11249 memcpy (*
buffer,
string, len);
11267 if (2 * len > *left)
11268 error (
_(
"Packet too long for target."));
11290 error (
_(
"Packet too long for target."));
11313 int *remote_errno,
char **attachment)
11318 *attachment = NULL;
11324 *retcode = strtol (&
buffer[1], &p, 16);
11325 if (errno != 0 || p == &
buffer[1])
11332 *remote_errno = strtol (p + 1, &p2, 16);
11333 if (errno != 0 || p + 1 == p2)
11342 *attachment = p + 1;
11345 else if (*p ==
'\0')
11369 int *remote_errno,
char **attachment,
11370 int *attachment_len)
11373 int ret, bytes_read;
11374 char *attachment_tmp;
11379 *remote_errno = FILEIO_ENOSYS;
11388 if (bytes_read < 0)
11390 *remote_errno = FILEIO_EINVAL;
11397 *remote_errno = FILEIO_EINVAL;
11400 *remote_errno = FILEIO_ENOSYS;
11409 *remote_errno = FILEIO_EINVAL;
11414 if ((attachment_tmp == NULL && attachment != NULL)
11415 || (attachment_tmp != NULL && attachment == NULL))
11417 *remote_errno = FILEIO_EINVAL;
11423 if (attachment_tmp != NULL)
11425 *attachment = attachment_tmp;
11426 *attachment_len = bytes_read - (*attachment - rs->
buf);
11461 int required_pid = (
inf == NULL ||
inf->fake_pid_p) ? 0 :
inf->
pid;
11475 xsnprintf (arg,
sizeof (arg),
"%x", required_pid);
11479 remote_errno, NULL, NULL);
11485 rs->
fs_pid = required_pid;
11495 int flags,
int mode,
int warn_if_slow,
11504 static int warning_issued = 0;
11509 if (!warning_issued)
11511 warning (
_(
"File transfers from remote targets can be slow." 11512 " Use \"set sysroot\" to access files locally" 11514 warning_issued = 1;
11524 strlen (filename));
11533 remote_errno, NULL, NULL);
11540 int fd,
const gdb_byte *write_buf,
int len,
11562 remote_errno, NULL, NULL);
11570 int fd,
gdb_byte *read_buf,
int len,
11577 int ret, attachment_len;
11591 remote_errno, &attachment,
11599 if (read_len != ret)
11600 error (
_(
"Read returned %d, but %d bytes."), ret, (
int) read_len);
11610 int fd,
gdb_byte *read_buf,
size_t len,
11615 if (cache->
fd ==
fd 11664 cache->
offset, remote_errno);
11691 remote_errno, NULL, NULL);
11711 strlen (filename));
11714 remote_errno, NULL, NULL);
11728 int len, attachment_len;
11738 strlen (filename));
11741 remote_errno, &attachment,
11747 ret = (
char *)
xmalloc (len + 1);
11751 if (read_len != len)
11752 error (
_(
"Readlink returned %d, but %d bytes."), len, read_len);
11762 int fd,
struct stat *st,
11768 int attachment_len, ret;
11770 struct fio_stat fst;
11778 remote_errno, &attachment,
11782 if (*remote_errno != FILEIO_ENOSYS)
11798 memset (st, 0,
sizeof (
struct stat));
11806 if (read_len != ret)
11807 error (
_(
"vFile:fstat returned %d, but %d bytes."), ret, read_len);
11809 if (read_len !=
sizeof (fst))
11810 error (
_(
"vFile:fstat returned %d bytes, but expecting %d."),
11811 read_len, (
int)
sizeof (fst));
11835 int fd, remote_errno;
11841 FILEIO_O_RDONLY, 0700, 0,
11852 static int warning_issued = 0;
11854 if (!warning_issued)
11856 warning (
_(
"remote target does not support file" 11857 " transfer, attempting to access files" 11858 " from local filesystem."));
11859 warning_issued = 1;
11876 case FILEIO_ENOENT:
11884 case FILEIO_EACCES:
11886 case FILEIO_EFAULT:
11890 case FILEIO_EEXIST:
11892 case FILEIO_ENODEV:
11894 case FILEIO_ENOTDIR:
11896 case FILEIO_EISDIR:
11898 case FILEIO_EINVAL:
11900 case FILEIO_ENFILE:
11902 case FILEIO_EMFILE:
11906 case FILEIO_ENOSPC:
11908 case FILEIO_ESPIPE:
11912 case FILEIO_ENOSYS:
11914 case FILEIO_ENAMETOOLONG:
11915 return ENAMETOOLONG;
11925 if (host_error == -1)
11926 error (
_(
"Unknown remote I/O error %d"), errnum);
11934 int fd = *(
int *) opaque;
11943 struct cleanup *back_to, *close_cleanup;
11944 int retcode, fd, remote_errno, bytes, io_size;
11946 int bytes_in_buffer;
11952 error (
_(
"command can only be used with remote target"));
11959 remote_file, (FILEIO_O_WRONLY | FILEIO_O_CREAT
11961 0700, 0, &remote_errno);
11973 bytes_in_buffer = 0;
11976 while (bytes_in_buffer || !saw_eof)
11980 bytes = fread (
buffer + bytes_in_buffer, 1,
11981 io_size - bytes_in_buffer,
11985 if (ferror (file.get ()))
11986 error (
_(
"Error reading %s."), local_file);
11992 if (bytes_in_buffer == 0)
12000 bytes += bytes_in_buffer;
12001 bytes_in_buffer = 0;
12009 else if (retcode == 0)
12010 error (
_(
"Remote write of %d bytes returned 0!"), bytes);
12011 else if (retcode < bytes)
12015 bytes_in_buffer = bytes - retcode;
12034 struct cleanup *back_to, *close_cleanup;
12035 int fd, remote_errno, bytes, io_size;
12041 error (
_(
"command can only be used with remote target"));
12044 remote_file, FILEIO_O_RDONLY, 0, 0,
12074 bytes = fwrite (
buffer, 1, bytes, file.get ());
12091 int retcode, remote_errno;
12095 error (
_(
"command can only be used with remote target"));
12098 NULL, remote_file, &remote_errno);
12113 if (
argv[0] == NULL ||
argv[1] == NULL ||
argv[2] != NULL)
12114 error (
_(
"Invalid parameters to remote put"));
12126 if (
argv[0] == NULL ||
argv[1] == NULL ||
argv[2] != NULL)
12127 error (
_(
"Invalid parameters to remote get"));
12139 if (
argv[0] == NULL ||
argv[1] != NULL)
12140 error (
_(
"Invalid parameters to remote delete"));
12238 if (strcmp (rs->
buf,
"OK") != 0)
12239 error (
_(
"Target does not support this command."));
12252 for (cmd = cmds; cmd; cmd = cmd->
next)
12255 strcpy (rs->
buf,
"QTDPsrc:");
12257 rs->
buf + strlen (rs->
buf),
12261 if (strcmp (rs->
buf,
"OK"))
12262 warning (
_(
"Target does not support source download."));
12270 strcpy (rs->
buf,
"QTDPsrc:");
12272 rs->
buf + strlen (rs->
buf),
12276 if (strcmp (rs->
buf,
"OK"))
12277 warning (
_(
"Target does not support source download."));
12285 #define BUF_SIZE 2048 12290 std::vector<std::string> tdp_actions;
12291 std::vector<std::string> stepping_actions;
12299 tpaddr =
loc->address;
12300 sprintf_vma (addrbuf, tpaddr);
12322 _(
"Fast tracepoint not " 12323 "valid during download"));
12329 warning (
_(
"Target does not support fast tracepoints, " 12330 "downloading %d as regular tracepoint"), b->
number);
12341 strcat (buf,
":S");
12343 error (
_(
"Static tracepoint not valid during download"));
12349 error (
_(
"Target does not support static tracepoints"));
12362 pkt = buf + strlen (buf);
12363 for (
int ndx = 0; ndx < aexpr->len; ++ndx)
12368 warning (
_(
"Target does not support conditional tracepoints, " 12369 "ignoring tp %d cond"), b->
number);
12376 if (strcmp (rs->
buf,
"OK"))
12377 error (
_(
"Target does not support tracepoints."));
12380 for (
auto action_it = tdp_actions.begin ();
12381 action_it != tdp_actions.end (); action_it++)
12385 bool has_more = (action_it != tdp_actions.end ()
12386 || !stepping_actions.empty ());
12390 action_it->c_str (),
12391 has_more ?
'-' : 0);
12394 if (strcmp (rs->
buf,
"OK"))
12395 error (
_(
"Error on target while setting tracepoints."));
12398 for (
auto action_it = stepping_actions.begin ();
12399 action_it != stepping_actions.end (); action_it++)
12403 bool is_first = action_it == stepping_actions.begin ();
12404 bool has_more = action_it != stepping_actions.end ();
12408 is_first ?
"S" :
"",
12409 action_it->c_str (),
12410 has_more ?
"-" :
"");
12413 if (strcmp (rs->
buf,
"OK"))
12414 error (
_(
"Error on target while setting tracepoints."));
12421 strcpy (buf,
"QTDPsrc:");
12424 buf + strlen (buf), 2048 - strlen (buf));
12427 if (strcmp (rs->
buf,
"OK"))
12428 warning (
_(
"Target does not support source download."));
12432 strcpy (buf,
"QTDPsrc:");
12435 2048 - strlen (buf));
12438 if (strcmp (rs->
buf,
"OK"))
12439 warning (
_(
"Target does not support source download."));
12484 p = rs->
buf + strlen (rs->
buf);
12486 error (
_(
"Trace state variable name too long for tsv definition packet"));
12491 if (*rs->
buf ==
'\0')
12492 error (
_(
"Target does not support this command."));
12493 if (strcmp (rs->
buf,
"OK") != 0)
12494 error (
_(
"Error on target while downloading trace state variable."));
12504 sprintf_vma (addr_buf, location->
address);
12509 if (*rs->
buf ==
'\0')
12510 error (
_(
"Target does not support enabling tracepoints while a trace run is ongoing."));
12511 if (strcmp (rs->
buf,
"OK") != 0)
12512 error (
_(
"Error on target while enabling tracepoint."));
12522 sprintf_vma (addr_buf, location->
address);
12527 if (*rs->
buf ==
'\0')
12528 error (
_(
"Target does not support disabling tracepoints while a trace run is ongoing."));
12529 if (strcmp (rs->
buf,
"OK") != 0)
12530 error (
_(
"Error on target while disabling tracepoint."));
12538 bfd_size_type
size;
12548 strcpy (rs->
buf,
"QTro");
12550 for (s =
exec_bfd->sections; s; s = s->next)
12552 char tmp1[40], tmp2[40];
12555 if ((s->flags & SEC_LOAD) == 0 ||
12557 (s->flags & SEC_READONLY) == 0)
12561 vma = bfd_get_section_vma (abfd, s);
12562 size = bfd_get_section_size (s);
12563 sprintf_vma (tmp1, vma);
12564 sprintf_vma (tmp2, vma +
size);
12565 sec_length = 1 + strlen (tmp1) + 1 + strlen (tmp2);
12570 Too many sections for read-only sections definition packet."));
12591 if (*rs->
buf ==
'\0')
12592 error (
_(
"Target does not support this command."));
12593 if (strcmp (rs->
buf,
"OK") != 0)
12594 error (
_(
"Bogus reply from target: %s"), rs->
buf);
12640 error (
_(
"Bogus trace status reply from target: %s"), rs->
buf);
12673 if (reply && *reply)
12688 if (reply && *reply)
12703 if (*rs->
buf ==
'\0')
12704 error (
_(
"Target does not support this command."));
12705 if (strcmp (rs->
buf,
"OK") != 0)
12706 error (
_(
"Bogus reply from target: %s"), rs->
buf);
12718 int target_frameno = -1, target_tracept = -1;
12727 strcpy (p,
"QTFrame:");
12728 p = strchr (p,
'\0');
12738 xsnprintf (p, endbuf - p,
"tdp:%x", num);
12749 error (
_(
"Unknown trace find type %d"),
type);
12754 if (*reply ==
'\0')
12755 error (
_(
"Target does not support this command."));
12757 while (reply && *reply)
12762 target_frameno = (int) strtol (p, &reply, 16);
12764 error (
_(
"Unable to parse trace frame number"));
12767 if (target_frameno == -1)
12772 target_tracept = (int) strtol (p, &reply, 16);
12774 error (
_(
"Unable to parse tracepoint number"));
12777 if (reply[1] ==
'K' && reply[2] ==
'\0')
12780 error (
_(
"Bogus reply from target: %s"), reply);
12783 error (
_(
"Bogus reply from target: %s"), reply);
12786 *tpp = target_tracept;
12789 return target_frameno;
12805 if (reply && *reply)
12824 strcpy (p,
"QTSave:");
12827 error (
_(
"Remote file name too long for trace save packet"));
12832 if (*reply ==
'\0')
12833 error (
_(
"Target does not support this command."));
12834 if (strcmp (reply,
"OK") != 0)
12835 error (
_(
"Bogus reply from target: %s"), reply);
12854 strcpy (p,
"qTBuffer:");
12863 if (reply && *reply)
12895 if (*reply ==
'\0')
12896 error (
_(
"Target does not support this command."));
12897 if (strcmp (reply,
"OK") != 0)
12898 error (
_(
"Bogus reply from target: %s"), reply);
12901 warning (
_(
"Target does not support disconnected tracing."));
12909 if (info != NULL && info->
priv != NULL)
12924 if (*reply ==
'\0')
12925 error (
_(
"Target does not support this command."));
12926 if (strcmp (reply,
"OK") != 0)
12927 error (
_(
"Bogus reply from target: %s"), reply);
12964 if (*reply ==
'\0')
12972 return (
int) min_insn_len;
13003 warning (
_(
"Bogus reply from target: %s"), rs->
buf);
13009 const char *user,
const char *notes,
13010 const char *stop_notes)
13045 if (*reply ==
'\0')
13048 if (strcmp (reply,
"OK") != 0)
13049 error (
_(
"Bogus reply from target: %s"), reply);
13066 if (strcmp (rs->
buf,
"OK") == 0)
13122 #if defined (HAVE_LIBIPT) 13129 internal_error (__FILE__, __LINE__,
_(
"Unknown branch trace format"));
13139 char *
buf, *pos, *endbuf;
13150 pos +=
xsnprintf (pos, endbuf - pos,
"%s=0x%x", packet->
name,
13158 if (
buf[0] ==
'E' &&
buf[1] ==
'.')
13159 error (
_(
"Failed to configure the BTS buffer size: %s"),
buf + 2);
13161 error (
_(
"Failed to configure the BTS buffer size."));
13172 pos +=
xsnprintf (pos, endbuf - pos,
"%s=0x%x", packet->
name,
13180 if (
buf[0] ==
'E' &&
buf[1] ==
'.')
13181 error (
_(
"Failed to configure the trace buffer size: %s"),
buf + 2);
13183 error (
_(
"Failed to configure the trace buffer size."));
13209 int btrace_target_pushed = 0;
13224 #if !defined (HAVE_LIBIPT) 13230 warning (
_(
"GDB does not support Intel Processor Trace. " 13231 "\"record\" will not work in this session."));
13241 if (!btrace_target_pushed)
13243 btrace_target_pushed = 1;
13279 error (
_(
"Target does not support branch tracing."));
13291 if (rs->
buf[0] ==
'E' && rs->
buf[1] ==
'.')
13292 error (
_(
"Could not enable branch tracing for %s: %s"),
13295 error (
_(
"Could not enable branch tracing for %s."),
13300 tinfo->
ptid = ptid;
13310 if (
err.message != NULL)
13330 error (
_(
"Target does not support branch tracing."));
13340 if (rs->
buf[0] ==
'E' && rs->
buf[1] ==
'.')
13341 error (
_(
"Could not disable branch tracing for %s: %s"),
13344 error (
_(
"Could not disable branch tracing for %s."),
13373 error (
_(
"Target does not support branch tracing."));
13375 #if !defined(HAVE_LIBEXPAT) 13376 error (
_(
"Cannot process branch tracing result. XML parsing not supported."));
13392 _(
"Bad branch tracing read type: %u."),
13393 (
unsigned int)
type);
13410 return &tinfo->
conf;
13437 char *annex = NULL;
13445 _(
"not currently attached to process %d"),
pid);
13447 if (!
inf->fake_pid_p)
13449 const int annex_size = 9;
13451 annex = (
char *) alloca (annex_size);
13458 return filename.get ();
13512 if (handle_len !=
priv->thread_handle.size ())
13513 error (
_(
"Thread handle size mismatch: %d vs %zu (from remote)"),
13514 handle_len,
priv->thread_handle.size ());
13515 if (memcmp (thread_handle,
priv->thread_handle.data (),
13530 "Use a remote computer via a serial line, using a gdb-specific protocol.\n\ 13531 Specify the serial device it is connected to\n\ 13532 (e.g. /dev/ttyS0, /dev/ttya, COM1, etc.).";
13650 remote_ops.to_static_tracepoint_markers_by_strid
13651 = remote_static_tracepoint_markers_by_strid;
13686 "Extended remote serial target in gdb-specific protocol";
13688 "Use a remote computer via a serial line, using a gdb-specific protocol.\n\ 13689 Specify the serial device it is connected to (e.g. /dev/ttya).";
13798 if (strcmp (rs->
buf,
"OK") != 0)
13799 error (
_(
"Remote refused setting thread events: %s"), rs->
buf);
13802 warning (
_(
"Remote failure reply: %s"), rs->
buf);
13824 for (; list != NULL; list = list->
next)
13825 if (strcmp (list->
name,
"Z-packet") == 0)
13836 uiout->
text (
": ");
13870 while (*p && *p !=
'l')
13892 while (*p && *p !=
'l')
13911 _(
"Debugger's willingness to use range stepping " 13912 "is %s.\n"),
value);
13937 warning (
_(
"Range stepping is not supported by the current target"));
13945 const char *cmd_name;
13954 = register_program_space_data_with_cleanup (NULL,
13975 init_remote_threadtests ();
13982 Remote protocol specific variables\n\ 13983 Configure various remote-protocol specific variables such as\n\ 13984 the packets being used"),
13988 Remote protocol specific variables\n\ 13989 Configure various remote-protocol specific variables such as\n\ 13990 the packets being used"),
13995 Compare section data on target to the exec file.\n\ 13996 Argument is a single section name (default: all loaded sections).\n\ 13997 To compare only read-only loaded sections, specify the -r option."),
14001 Send an arbitrary packet to a remote target.\n\ 14002 maintenance packet TEXT\n\ 14003 If GDB is talking to an inferior via the GDB serial protocol, then\n\ 14004 this command sends the string TEXT to the inferior, and displays the\n\ 14005 response packet. GDB supplies the initial `$' character, and the\n\ 14006 terminating `#' character and checksum."),
14010 Set whether to send break if interrupted."),
_(
"\ 14011 Show whether to send break if interrupted."),
_(
"\ 14012 If set, a break, instead of a cntrl-c, is sent to the remote target."),
14015 cmd_name =
"remotebreak";
14018 cmd_name =
"remotebreak";
14025 Set interrupt sequence to remote target."),
_(
"\ 14026 Show interrupt sequence to remote target."),
_(
"\ 14027 Valid value is \"Ctrl-C\", \"BREAK\" or \"BREAK-g\". The default is \"Ctrl-C\"."),
14034 Set whether interrupt-sequence is sent to remote target when gdb connects to."),
_(
" \ 14035 Show whether interrupt-sequence is sent to remote target when gdb connects to."),
_(
" \ 14036 If set, interrupt sequence is sent to remote target."),
14043 Set the maximum number of bytes per memory write packet (deprecated)."),
14046 Show the maximum number of bytes per memory write packet (deprecated)."),
14050 Set the maximum number of bytes per memory-write packet.\n\ 14051 Specify the number of bytes in a packet or 0 (zero) for the\n\ 14052 default packet size. The actual limit is further reduced\n\ 14053 dependent on the target. Specify ``fixed'' to disable the\n\ 14054 further restriction and ``limit'' to enable that restriction."),
14058 Set the maximum number of bytes per memory-read packet.\n\ 14059 Specify the number of bytes in a packet or 0 (zero) for the\n\ 14060 default packet size. The actual limit is further reduced\n\ 14061 dependent on the target. Specify ``fixed'' to disable the\n\ 14062 further restriction and ``limit'' to enable that restriction."),
14066 _(
"Show the maximum number of bytes per memory-write packet."),
14070 _(
"Show the maximum number of bytes per memory-read packet."),
14075 Set the maximum number of target hardware watchpoints."),
_(
"\ 14076 Show the maximum number of target hardware watchpoints."),
_(
"\ 14077 Specify a negative limit for unlimited."),
14084 Set the maximum length (in bytes) of a target hardware watchpoint."),
_(
"\ 14085 Show the maximum length (in bytes) of a target hardware watchpoint."),
_(
"\ 14086 Specify a negative limit for unlimited."),
14093 Set the maximum number of target hardware breakpoints."),
_(
"\ 14094 Show the maximum number of target hardware breakpoints."),
_(
"\ 14095 Specify a negative limit for unlimited."),
14103 Set the maximum size of the address (in bits) in a memory packet."),
_(
"\ 14104 Show the maximum size of the address (in bits) in a memory packet."), NULL,
14112 "X",
"binary-download", 1);
14115 "vCont",
"verbose-resume", 0);
14118 "QPassSignals",
"pass-signals", 0);
14121 "QCatchSyscalls",
"catch-syscalls", 0);
14124 "QProgramSignals",
"program-signals", 0);
14127 "QSetWorkingDir",
"set-working-dir", 0);
14130 "QStartupWithShell",
"startup-with-shell", 0);
14134 "QEnvironmentHexEncoded",
"environment-hex-encoded",
14138 "QEnvironmentReset",
"environment-reset",
14142 "QEnvironmentUnset",
"environment-unset",
14146 "qSymbol",
"symbol-lookup", 0);
14149 "P",
"set-register", 1);
14152 "p",
"fetch-register", 1);
14155 "Z0",
"software-breakpoint", 0);
14158 "Z1",
"hardware-breakpoint", 0);
14161 "Z2",
"write-watchpoint", 0);
14164 "Z3",
"read-watchpoint", 0);
14167 "Z4",
"access-watchpoint", 0);
14170 "qXfer:auxv:read",
"read-aux-vector", 0);
14173 "qXfer:exec-file:read",
"pid-to-exec-file", 0);
14176 "qXfer:features:read",
"target-features", 0);
14179 "qXfer:libraries:read",
"library-info", 0);
14182 "qXfer:libraries-svr4:read",
"library-info-svr4", 0);
14185 "qXfer:memory-map:read",
"memory-map", 0);
14188 "qXfer:spu:read",
"read-spu-object", 0);
14191 "qXfer:spu:write",
"write-spu-object", 0);
14194 "qXfer:osdata:read",
"osdata", 0);
14197 "qXfer:threads:read",
"threads", 0);
14200 "qXfer:siginfo:read",
"read-siginfo-object", 0);
14203 "qXfer:siginfo:write",
"write-siginfo-object", 0);
14207 "qXfer:traceframe-info:read",
"traceframe-info", 0);
14210 "qXfer:uib:read",
"unwind-info-block", 0);
14213 "qGetTLSAddr",
"get-thread-local-storage-address",
14217 "qGetTIBAddr",
"get-thread-information-block-address",
14221 "bc",
"reverse-continue", 0);
14224 "bs",
"reverse-step", 0);
14227 "qSupported",
"supported-packets", 0);
14230 "qSearch:memory",
"search-memory", 0);
14233 "qTStatus",
"trace-status", 0);
14236 "vFile:setfs",
"hostio-setfs", 0);
14239 "vFile:open",
"hostio-open", 0);
14242 "vFile:pread",
"hostio-pread", 0);
14245 "vFile:pwrite",
"hostio-pwrite", 0);
14248 "vFile:close",
"hostio-close", 0);
14251 "vFile:unlink",
"hostio-unlink", 0);
14254 "vFile:readlink",
"hostio-readlink", 0);
14257 "vFile:fstat",
"hostio-fstat", 0);
14260 "vAttach",
"attach", 0);
14266 "QStartNoAckMode",
"noack", 0);
14269 "vKill",
"kill", 0);
14272 "qAttached",
"query-attached", 0);
14275 "ConditionalTracepoints",
14276 "conditional-tracepoints", 0);
14279 "ConditionalBreakpoints",
14280 "conditional-breakpoints", 0);
14283 "BreakpointCommands",
14284 "breakpoint-commands", 0);
14287 "FastTracepoints",
"fast-tracepoints", 0);
14290 "TracepointSource",
"TracepointSource", 0);
14293 "QAllow",
"allow", 0);
14296 "StaticTracepoints",
"static-tracepoints", 0);
14299 "InstallInTrace",
"install-in-trace", 0);
14302 "qXfer:statictrace:read",
"read-sdata-object", 0);
14305 "qXfer:fdpic:read",
"read-fdpic-loadmap", 0);
14308 "QDisableRandomization",
"disable-randomization", 0);
14311 "QAgent",
"agent", 0);
14314 "QTBuffer:size",
"trace-buffer-size", 0);
14317 "Qbtrace:off",
"disable-btrace", 0);
14320 "Qbtrace:bts",
"enable-btrace-bts", 0);
14323 "Qbtrace:pt",
"enable-btrace-pt", 0);
14326 "qXfer:btrace",
"read-btrace", 0);
14329 "qXfer:btrace-conf",
"read-btrace-conf", 0);
14332 "Qbtrace-conf:bts:size",
"btrace-conf-bts-size", 0);
14335 "multiprocess-feature",
"multiprocess-feature", 0);
14338 "swbreak-feature",
"swbreak-feature", 0);
14341 "hwbreak-feature",
"hwbreak-feature", 0);
14344 "fork-event-feature",
"fork-event-feature", 0);
14347 "vfork-event-feature",
"vfork-event-feature", 0);
14350 "Qbtrace-conf:pt:size",
"btrace-conf-pt-size", 0);
14353 "vContSupported",
"verbose-resume-supported", 0);
14356 "exec-event-feature",
"exec-event-feature", 0);
14359 "vCtrlC",
"ctrl-c", 0);
14362 "QThreadEvents",
"thread-events", 0);
14365 "N stop reply",
"no-resumed-stop-reply", 0);
14407 Set use of remote protocol `Z' packets"),
_(
"\ 14408 Show use of remote protocol `Z' packets "),
_(
"\ 14409 When set, GDB will attempt to use the remote breakpoint and watchpoint\n\ 14418 Manipulate files on the remote system\n\ 14419 Transfer files to and from the remote target system."),
14424 _(
"Copy a local file to the remote system."),
14428 _(
"Copy a remote file to the local system."),
14432 _(
"Delete a remote file."),
14437 Set the remote pathname for \"run\""),
_(
"\ 14438 Show the remote pathname for \"run\""), NULL,
14446 Enable or disable range stepping."),
_(
"\ 14447 Show whether target-assisted range stepping is enabled."),
_(
"\ 14448 If on, and the target supports it, when stepping a source line, GDB\n\ 14449 tells the target to step the corresponding range of addresses itself instead\n\ 14450 of issuing multiple single-steps. This speeds up source level\n\ 14451 stepping. If off, GDB always issues single-steps, even if range\n\ 14452 stepping is supported by the target. The default is on."),
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)
enum exec_direction_kind last_resume_exec_dir
struct gdbarch * target_gdbarch(void)
long actual_register_packet_size
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t err
static const struct btrace_config * remote_btrace_conf(struct target_ops *self, const struct btrace_target_info *tinfo)
static void show_remote_cmd(const char *args, int from_tty)
#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)
static int remote_insert_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
int default_child_has_stack(struct target_ops *ops)
int serial_is_async_p(struct serial *scb)
static void init_remote_ops(void)
struct btrace_config_bts bts
void no_shared_libraries(const char *ignored, int from_tty)
char * hex_string(LONGEST num)
static void interrupt_query(void)
static void show_memory_write_packet_size(const char *args, int from_tty)
static struct remote_state * new_remote_state(void)
static void remote_set_permissions(struct target_ops *self)
static const char * remote_pid_to_str(struct target_ops *ops, ptid_t ptid)
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)
void reopen_exec_file(void)
constexpr int pid() const
#define MIN_MEMORY_PACKET_SIZE
static constexpr ptid_t tid
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)
static ULONGEST remote_get_memory_xfer_limit(struct target_ops *ops)
int ptid_is_pid(const ptid_t &ptid)
#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()
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)
#define REMOTE_DEBUG_MAX_CHAR
static struct memory_packet_config memory_read_packet_config
static int remote_resume_with_vcont(ptid_t ptid, int step, enum gdb_signal siggnal)
CORE_ADDR step_range_start
static int remote_upload_trace_state_variables(struct target_ops *self, struct uploaded_tsv **utsvp)
CORE_ADDR get_frame_pc(struct frame_info *frame)
std::unique_ptr< agent_expr > agent_expr_up
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[]
static void process_initial_stop_replies(int from_tty)
const char interrupt_sequence_break_g[]
int remote_traceframe_number
static void kill_new_fork_children(int pid, struct remote_state *rs)
static void set_memory_read_packet_size(const char *args, int from_tty)
void target_announce_detach(int from_tty)
struct frame_info * get_current_frame(void)
void field_string(const char *fldname, const char *string)
void remote_notif_process(struct remote_notif_state *state, struct notif_client *except)
constexpr size_type size() const noexcept
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)
ptid_t target_wait(ptid_t ptid, struct target_waitstatus *status, int options)
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)
int ptid_get_pid(const ptid_t &ptid)
void fputs_unfiltered(const char *buf, struct ui_file *file)
static struct serial * remote_serial_open(const char *name)
void delete_thread(ptid_t)
static int peek_stop_reply(ptid_t ptid)
static char * remote_support_xml
static const char * interrupt_sequence_mode
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
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)
static void remote_add_thread(ptid_t ptid, int running, int executing)
static char * unpack_string(char *src, char *dest, int length)
__extension__ enum cmd_types type
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_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static char * unpack_threadid(char *inbuf, threadref *id)
static void remote_btrace_maybe_reopen(void)
int gdbarch_has_global_solist(struct gdbarch *gdbarch)
#define GDBARCH_OBSTACK_CALLOC(GDBARCH, NR, TYPE)
static enum Z_packet_type watchpoint_to_Z_packet(int type)
static int remote_supports_disable_randomization(struct target_ops *self)
static ptid_t remote_get_ada_task_ptid(struct target_ops *self, long lwp, long thread)
static void set_memory_packet_size(const char *args, struct memory_packet_config *config)
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 *)
static const struct program_space_data * remote_pspace_data
static char * unpack_byte(char *buf, int *value)
#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())
enum target_stop_reason stop_reason
static int remote_get_min_fast_tracepoint_insn_len(struct target_ops *self)
CORE_ADDR * segment_bases
static char * remote_get_noisy_reply()
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())
int query(const char *ctlstr,...)
enum gdb_signal last_sent_signal
void init_wait_for_inferior(void)
int disable_randomization
int(* to_has_stack)(struct target_ops *)
counted_command_line commands
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)
char * get_exec_file(int err)
static void set_remote_traceframe(void)
static void remote_new_objfile(struct objfile *objfile)
void register_remote_support_xml(const char *xml)
int gdb_insn_length(struct gdbarch *gdbarch, CORE_ADDR addr)
#define QUEUE_length(TYPE, Q)
void(* to_rcmd)(struct target_ops *, const char *command, struct ui_file *output) TARGET_DEFAULT_FUNC(default_rcmd)
std::vector< T, gdb::default_init_allocator< T > > def_vector
static int check_pending_event_prevents_wildcard_vcont_callback(QUEUE(stop_reply_p) *q, QUEUE_ITER(stop_reply_p) *iter, stop_reply_p event, void *data)
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 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)
#define QUEUE_is_empty(TYPE, Q)
static void remote_resume_with_hc(struct target_ops *ops, ptid_t ptid, int step, enum gdb_signal siggnal)
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)
ptid_t regcache_get_ptid(const struct regcache *regcache)
int unpush_target(struct target_ops *t)
int(* to_follow_fork)(struct target_ops *, int, int) TARGET_DEFAULT_FUNC(default_follow_fork)
static struct remote_arch_state * get_remote_arch_state(struct gdbarch *gdbarch)
static void show_memory_read_packet_size(const char *args, int from_tty)
static const char * remote_threads_extra_info(struct target_ops *self, struct thread_info *tp)
void * memset(T *s, int c, size_t n)=delete
void internal_error(const char *file, int line, const char *fmt,...)
struct thread_info * inferior_thread(void)
int(* to_set_syscall_catchpoint)(struct target_ops *, int, bool, int, gdb::array_view< const int >) TARGET_DEFAULT_RETURN(1)
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 int wait_forever_enabled_p
struct cmd_list_element * lookup_cmd(const char **line, struct cmd_list_element *list, const char *cmdtype, int allow_unknown, int ignore_help_classes)
static enum target_xfer_status remote_flash_write(struct target_ops *ops, ULONGEST address, ULONGEST length, ULONGEST *xfered_len, const gdb_byte *data)
void generic_mourn_inferior(void)
CORE_ADDR watch_data_address
static void remote_rcmd(struct target_ops *self, const char *command, struct ui_file *outbuf)
void observer_notify_normal_stop(struct bpstats *bs, int print_frame)
void(* to_close)(struct target_ops *)
void objfile_relocate(struct objfile *objfile, const struct section_offsets *new_offsets)
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_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
const char *(* to_pid_to_str)(struct target_ops *, ptid_t) TARGET_DEFAULT_FUNC(default_pid_to_str)
union target_waitstatus::@174 value
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)
static void remote_trace_start(struct target_ops *self)
void remote_file_delete(const char *remote_file, int from_tty)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
static int remote_stopped_by_watchpoint(struct target_ops *ops)
struct thread_info *(* to_thread_handle_to_thread_info)(struct target_ops *, const gdb_byte *, int, struct inferior *inf) TARGET_DEFAULT_RETURN(NULL)
static int remote_supports_stopped_by_hw_breakpoint(struct target_ops *ops)
static int remove_child_of_pending_fork(QUEUE(stop_reply_p) *q, QUEUE_ITER(stop_reply_p) *iter, stop_reply_p event, void *data)
static int remote_remove_vfork_catchpoint(struct target_ops *ops, int pid)
static struct cmd_list_element * remote_cmdlist
void reread_symbols(void)
void target_async(int enable)
static void remote_follow_exec(struct target_ops *ops, struct inferior *inf, char *execd_pathname)
struct notif_event * pending_event[REMOTE_NOTIF_LAST]
static int extended_remote_run(const std::string &args)
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()
struct inferior * find_inferior_ptid(ptid_t ptid)
static void remote_set_disconnected_tracing(struct target_ops *self, int val)
struct readahead_cache readahead_cache
struct cmd_list_element * cmdlist
std::vector< thread_item > items
static int remote_unpack_thread_info_response(char *pkt, threadref *expectedref, struct gdb_ext_thread_info *info)
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)
int(* to_remove_watchpoint)(struct target_ops *, CORE_ADDR, int, enum target_hw_bp_type, struct expression *) TARGET_DEFAULT_RETURN(-1)
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)
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)
static void remote_async(struct target_ops *ops, int enable)
static void set_memory_write_packet_size(const char *args, int from_tty)
int(* to_can_use_hw_breakpoint)(struct target_ops *, enum bptype, int, int) TARGET_DEFAULT_RETURN(0)
static int remote_supports_stopped_by_sw_breakpoint(struct target_ops *ops)
enum gdb_signal stop_signal
void set_current_sal_from_frame(struct frame_info *)
int putpkt(const char *buf)
static int is_pending_fork_parent(struct target_waitstatus *ws, int event_pid, ptid_t thread_ptid)
const struct gdb_xml_element threads_elements[]
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 void remote_buffer_add_string(char **buffer, int *left, const char *string)
static void remote_serial_quit_handler(void)
static int stop_reply_queue_length(void)
static char * pack_threadinfo_request(char *pkt, int mode, threadref *id)
std::vector< mem_region >(*) to_memory_map(struct target_ops *) TARGET_DEFAULT_RETURN(std void(* to_flash_erase)(struct target_ops *, ULONGEST address, LONGEST length) TARGET_DEFAULT_NORETURN(tcomplain())
int signal_print_state(int signo)
ULONGEST(* to_get_memory_xfer_limit)(struct target_ops *) TARGET_DEFAULT_RETURN(ULONGEST_MAX)
static std::vector< mem_region > remote_memory_map(struct target_ops *ops)
int default_child_has_execution(struct target_ops *ops, ptid_t the_ptid)
static const struct target_desc * remote_read_description(struct target_ops *target)
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)
static int remove_stop_reply_for_inferior(QUEUE(stop_reply_p) *q, QUEUE_ITER(stop_reply_p) *iter, stop_reply_p event, void *data)
void(* to_set_trace_buffer_size)(struct target_ops *, LONGEST val) TARGET_DEFAULT_IGNORE()
static int remote_remove_breakpoint(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt, enum remove_bp_reason reason)
const std::set< std::string > & user_unset_env() const
void serial_async(struct serial *scb, serial_event_ftype *handler, void *context)
static int remote_vkill(int pid, struct remote_state *rs)
gdb::byte_vector thread_handle
static unsigned int remote_address_size
void text(const char *string)
struct serial * remote_desc
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)
static void start_thread(struct gdb_xml_parser *parser, const struct gdb_xml_element *element, void *user_data, VEC(gdb_xml_value_s) *attributes)
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)
static void set_pspace_remote_exec_file(struct program_space *pspace, char *remote_exec_file)
gdb::unique_xmalloc_ptr< char > target_read_stralloc(struct target_ops *ops, enum target_object object, const char *annex)
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)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
gdb::byte_vector thread_handle
static void skip_frame(void)
void string_appendf(std::string &str, const char *fmt,...)
int(* to_remove_exec_catchpoint)(struct target_ops *, int) TARGET_DEFAULT_RETURN(1)
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)
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
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_const_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
#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)
int gdbarch_addressable_memory_unit_size(struct gdbarch *gdbarch)
scoped_restore_tmpl< T > make_scoped_restore(T *var)
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_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
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
void(* to_thread_events)(struct target_ops *, int) TARGET_DEFAULT_IGNORE()
const char * normal_pid_to_str(ptid_t ptid)
static void remote_trace_stop(struct target_ops *self)
int default_child_has_memory(struct target_ops *ops)
std::vector< agent_expr * > tcommands
int in_thread_list(ptid_t ptid)
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)
static void remote_put_command(const char *args, int from_tty)
static int remote_supports_btrace(struct target_ops *self, enum btrace_format format)
static void * init_remote_state(struct gdbarch *gdbarch)
static void remote_fetch_registers(struct target_ops *ops, struct regcache *regcache, int regnum)
#define SIZEOF_N_SECTION_OFFSETS(n)
void switch_to_thread(ptid_t ptid)
static ptid_t any_thread_ptid
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(* 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)
int(* to_can_do_single_step)(struct target_ops *) TARGET_DEFAULT_RETURN(-1)
static void remote_thread_events(struct target_ops *ops, int enable)
#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)
int remote_hw_breakpoint_limit
static void remove_new_fork_children(struct threads_listing_context *)
static int remote_save_trace_data(struct target_ops *self, const char *filename)
enum exec_direction_kind execution_direction
struct notif_event * remote_notif_parse(struct notif_client *nc, char *buf)
#define CATCH(EXCEPTION, MASK)
std::unique_ptr< FILE, gdb_file_deleter > gdb_file_up
static int is_pending_fork_parent_thread(struct thread_info *thread)
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 *)
thread_suspend_state suspend
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 *)
std::unique_ptr< T, xfree_deleter< T > > unique_xmalloc_ptr
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)
struct gdb_xml_value * xml_find_attribute(VEC(gdb_xml_value_s) *attributes, const char *name)
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)
void target_clear_description(void)
static int interrupt_on_connect
const char * btrace_format_string(enum btrace_format format)
int thread_is_in_step_over_chain(struct thread_info *tp)
int target_is_non_stop_p(void)
void solib_add(const char *pattern, int from_tty, int readsyms)
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)
void stop_all_threads(void)
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 cmd_func(struct cmd_list_element *cmd, const char *args, int from_tty)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
static void check_pending_events_prevent_wildcard_vcont(int *may_global_wildcard_vcont)
void free_current_marker(void *arg)
static void set_thread(ptid_t ptid, int gen)
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)
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)
struct thread_info * any_live_thread_of_process(int pid)
static char * remote_pid_to_exec_file(struct target_ops *self, int pid)
std::vector< mem_region > parse_memory_map(const char *memory_map)
static struct remote_state * get_remote_state(void)
void trace_reset_local_state(void)
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_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
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)
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 fprintf_unfiltered(struct ui_file *stream, const char *format,...)
static enum exec_direction_kind remote_execution_direction(struct target_ops *self)
static struct stop_reply * queued_stop_reply(ptid_t ptid)
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
void print_target_wait_results(ptid_t waiton_ptid, ptid_t result_ptid, const struct target_waitstatus *ws)
static void readahead_cache_invalidate(void)
int traceframe_available_memory(std::vector< mem_range > *result, CORE_ADDR memaddr, ULONGEST len)
struct cmd_list_element * showlist
void regcache_raw_update(struct regcache *regcache, int regnum)
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)
#define gdb_assert_not_reached(message)
static void set_remote_cmd(const char *args, int from_tty)
#define OPAQUETHREADBYTES
void discard_all_inferiors(void)
static int remote_exec_event_p(struct remote_state *rs)
int serial_flush_input(struct serial *scb)
void generic_load(const char *name, int from_tty)
#define SECT_OFF_DATA(objfile)
void free_current_contents(void *ptr)
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_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void parse_tracepoint_status(const char *p, struct breakpoint *bp, struct uploaded_tp *utp)
static char * remote_exec_file_var
static enum packet_result packet_check_result(const char *buf)
static void show_remote_exec_file(struct ui_file *file, int from_tty, struct cmd_list_element *cmd, const char *value)
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)
int(* to_insert_exec_catchpoint)(struct target_ops *, int) TARGET_DEFAULT_RETURN(1)
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 parse_trace_status(const char *line, struct trace_status *ts)
static void remote_kill_k(void)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
static ptid_t read_ptid(const char *buf, const char **obuf)
threadref resultthreadlist[MAXTHREADLISTRESULTS]
traceframe_info_up parse_traceframe_info(const char *tframe_info)
struct target_section * sections
void(* to_set_permissions)(struct target_ops *) TARGET_DEFAULT_IGNORE()
struct btrace_target_info *(* to_enable_btrace)(struct target_ops *, ptid_t ptid, const struct btrace_config *conf) TARGET_DEFAULT_NORETURN(tcomplain())
void target_interrupt(ptid_t ptid)
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)
static int store_register_using_P(const struct regcache *regcache, struct packet_reg *reg)
static int remote_remove_watchpoint(struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
struct inferior * find_inferior_pid(int pid)
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())
static int remote_get_threadinfo(threadref *threadid, int fieldset, struct gdb_ext_thread_info *info)
static void remote_download_command_source(int num, ULONGEST addr, struct command_line *cmds)
int serial_send_break(struct serial *scb)
static void show_memory_packet_size(struct memory_packet_config *config)
static remote_inferior * get_remote_inferior(inferior *inf)
static int remote_set_syscall_catchpoint(struct target_ops *self, int pid, bool needed, int any_count, gdb::array_view< const int > syscall_counts)
static ptid_t magic_null_ptid
static const char * remote_thread_name(struct target_ops *ops, struct thread_info *info)
static void remote_enable_tracepoint(struct target_ops *self, struct bp_location *location)
static std::string escape_buffer(const char *buf, int n)
static struct remote_state * remote_state
static void vcont_builder_flush(struct vcont_builder *builder)
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)
bool contains_thread(ptid_t ptid) const
struct target_waitstatus pending_follow
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())
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)
void target_mourn_inferior(ptid_t ptid)
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)
gdb_file_up gdb_fopen_cloexec(const char *filename, const char *opentype)
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)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
#define target_is_async_p()
static struct packet_reg * packet_reg_from_pnum(struct gdbarch *gdbarch, struct remote_arch_state *rsa, LONGEST pnum)
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)
int(* to_insert_watchpoint)(struct target_ops *, CORE_ADDR, int, enum target_hw_bp_type, struct expression *) TARGET_DEFAULT_RETURN(-1)
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)
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
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)
std::vector< agent_expr * > conditions
struct btrace_config conf
const char * event_location_to_string(struct event_location *location)
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,...)
static ptid_t remote_current_thread(ptid_t oldptid)
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 *)
#define ALL_NON_EXITED_INFERIORS(I)
long explicit_packet_size
void printf_unfiltered(const char *format,...)
static void compare_sections_command(const char *args, int from_tty)
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_exec_catchpoint(struct target_ops *ops, int pid)
static traceframe_info_up remote_traceframe_info(struct target_ops *self)
static int remote_insert_vfork_catchpoint(struct target_ops *ops, int pid)
traceframe_info_up(* to_traceframe_info)(struct target_ops *) TARGET_DEFAULT_NORETURN(tcomplain())
static int remote_can_do_single_step(struct target_ops *ops)
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())
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_commit_resume(struct target_ops *ops)
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)
void remote_fileio_reset(void)
long ptid_get_lwp(const ptid_t &ptid)
enum packet_support default_support
static int getpkt_or_notif_sane(char **buf, long *sizeof_buf, int forever, int *is_notif)
int remote_hw_watchpoint_limit
static ptid_t not_sent_ptid
int(* to_insert_hw_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_RETURN(-1)
static void remote_notice_new_inferior(ptid_t currthread, int executing)
char *(* to_pid_to_exec_file)(struct target_ops *, int pid) TARGET_DEFAULT_RETURN(NULL)
static void ours_for_output()
#define DEFAULT_MAX_MEMORY_PACKET_SIZE
int number_of_live_inferiors(void)
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)
struct cmd_list_element * add_alias_cmd(const char *name, cmd_list_element *old, enum command_class theclass, int abbrev_flag, struct cmd_list_element **list)
static void remote_detach_pid(int pid)
void set_last_target_status(ptid_t ptid, struct target_waitstatus status)
static void process_g_packet(struct regcache *regcache)
void(* to_commit_resume)(struct target_ops *) TARGET_DEFAULT_IGNORE()
const char * get_inferior_cwd()
struct serial * serial_open(const char *name)
void(* to_disconnect)(struct target_ops *, const char *, int) TARGET_DEFAULT_NORETURN(tcomplain())
static int hexnumlen(ULONGEST num)
static const struct protocol_feature remote_protocol_features[]
static const struct @28 signals[]
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 resume_clear_thread_private_info(struct thread_info *thread)
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)
static void set_remotebreak(const char *args, int from_tty, struct cmd_list_element *c)
static void set_general_thread(ptid_t ptid)
#define QUEUE_alloc(TYPE, FREE_FUNC)
static struct thread_info * remote_thread_handle_to_thread_info(struct target_ops *ops, const gdb_byte *thread_handle, int handle_len, struct inferior *inf)
static void remote_terminal_inferior(struct target_ops *self)
static void send_environment_packet(struct remote_state *rs, const char *action, const char *packet, const char *value)
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
static void remote_interrupt_as(void)
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 vcont_builder_restart(struct vcont_builder *builder)
void remote_notif_ack(struct notif_client *nc, char *buf)
int gdbarch_fast_tracepoint_valid_at(struct gdbarch *gdbarch, CORE_ADDR addr, char **msg)
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)
void(* to_download_tracepoint)(struct target_ops *, struct bp_location *location) TARGET_DEFAULT_NORETURN(tcomplain())
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)
static struct packet_reg * packet_reg_from_regnum(struct gdbarch *gdbarch, struct remote_arch_state *rsa, long regnum)
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)
static void extended_remote_set_inferior_cwd(struct remote_state *rs)
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 exec_direction_kind(* to_execution_direction)(struct target_ops *) TARGET_DEFAULT_FUNC(default_execution_direction)
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)
std::unique_ptr< traceframe_info > traceframe_info_up
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)
void discard_cleanups(struct cleanup *old_chain)
void remove_thread(ptid_t ptid)
static int threadref_to_int(threadref *ref)
quit_handler_ftype * quit_handler
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)
static int remote_remove_exec_catchpoint(struct target_ops *ops, int pid)
void(* to_mourn_inferior)(struct target_ops *) TARGET_DEFAULT_FUNC(default_mourn_inferior)
static const int remote_flash_timeout
static void remote_interrupt(struct target_ops *self, ptid_t ptid)
const char *(* to_extra_thread_info)(struct target_ops *, struct thread_info *) TARGET_DEFAULT_RETURN(NULL)
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)
int encode_source_string(int tpnum, ULONGEST addr, const char *srctype, const char *src, char *buf, int buf_size)
static int remote_hostio_pread_from_cache(struct remote_state *rs, int fd, gdb_byte *read_buf, size_t len, ULONGEST offset)
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 int remote_verify_memory(struct target_ops *ops, const gdb_byte *data, CORE_ADDR lma, ULONGEST size)
static void set_range_stepping(const char *ignore_args, int from_tty, struct cmd_list_element *c)
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)
#define ALL_NON_EXITED_THREADS(T)
int serial_can_async_p(struct serial *scb)
static remote_thread_info * get_remote_thread_info(thread_info *thread)
std::unique_ptr< private_thread_info > priv
int default_child_has_registers(struct target_ops *ops)
static int remote_stopped_by_sw_breakpoint(struct target_ops *ops)
int may_insert_breakpoints
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)
event_location_up location
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)
void record_btrace_push_target(void)
int(* to_fileio_pwrite)(struct target_ops *, int fd, const gdb_byte *write_buf, int len, ULONGEST offset, int *target_errno)
thread_control_state control
int check_quit_flag(void)
enum target_waitkind kind
static void init_extended_remote_ops(void)
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())
thread_item & operator=(thread_item &&other)=default
static void remote_check_symbols(void)
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 detach_inferior(int pid)
struct minimal_symbol * minsym
void exec_file_locate_attach(int pid, int defer_bp_reset, int from_tty)
char * safe_strerror(int)
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)
void observer_notify_signal_received(enum gdb_signal siggnal)
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()
const char * target_pid_to_str(ptid_t ptid)
void(* to_open)(const char *, int)
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_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void(* to_post_attach)(struct target_ops *, int) TARGET_DEFAULT_IGNORE()
static void remote_delete_command(const char *args, int from_tty)
struct target_section * target_section_by_addr(struct target_ops *target, CORE_ADDR addr)
static void extended_remote_create_inferior(struct target_ops *ops, const char *exec_file, const std::string &args, char **env, int from_tty)
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 constexpr ptid_t lwp
const std::set< std::string > & user_set_env() const
static int remote_hostio_set_filesystem(struct inferior *inf, int *remote_errno)
#define BUF_THREAD_ID_SIZE
void parse_tsv_definition(const char *line, struct uploaded_tsv **utsvp)
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)
static void extended_remote_environment_support(struct remote_state *rs)
static int remote_query_attached(int pid)
static int remote_supports_cond_tracepoints(void)
int parse_pid_to_attach(const char *args)
void switch_to_thread_no_regs(struct thread_info *thread)
int(* to_remove_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *, enum remove_bp_reason) TARGET_DEFAULT_FUNC(memory_remove_breakpoint)
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)
int(* to_stopped_by_watchpoint)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
void() serial_event_ftype(struct serial *scb, void *context)
int(* to_get_trace_status)(struct target_ops *, struct trace_status *ts) TARGET_DEFAULT_RETURN(-1)
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 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)
static const char * get_remote_exec_file(void)
struct ui_file * gdb_stdtarg
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)
int ptid_equal(const ptid_t &ptid1, const ptid_t &ptid2)
void parse_xml_btrace_conf(struct btrace_config *conf, const char *xml)
static void add_current_inferior_and_thread(char *wait_status)
gdb::def_vector< gdb_byte > byte_vector
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 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
int ptid_match(const ptid_t &ptid, const ptid_t &filter)
#define MAXTHREADLISTRESULTS
const struct gdb_xml_element thread_children[]
static void remote_unpush_and_throw(void)
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 int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static void remote_mourn(struct target_ops *ops)
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 void remote_interrupt_ns(void)
static int remote_thread_alive(struct target_ops *ops, ptid_t ptid)
thread_item(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
static struct memory_packet_config memory_write_packet_config
int(* to_supports_non_stop)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static int remote_can_run_breakpoint_commands(struct target_ops *self)
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 *)
struct cmd_list_element * maintenancelist
void regcache_raw_collect(const struct regcache *regcache, int regnum, void *buf)
void(* to_interrupt)(struct target_ops *, ptid_t) TARGET_DEFAULT_IGNORE()
static void get_offsets(void)
static void set_continue_thread(ptid_t ptid)
int(* to_fileio_unlink)(struct target_ops *, struct inferior *inf, const char *filename, int *target_errno)
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)
static void remote_pass_ctrlc(struct target_ops *self)
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)
agent_expr_up gen_eval_for_expr(CORE_ADDR scope, struct expression *expr)
static void vcont_builder_push_action(struct vcont_builder *builder, ptid_t ptid, int step, enum gdb_signal siggnal)
static int remote_get_threads_with_ql(struct target_ops *ops, struct threads_listing_context *context)
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)
struct target_waitstatus waitstatus
enum btrace_format format
static void print_one_stopped_thread(struct thread_info *thread)
void(* to_create_inferior)(struct target_ops *, const char *, const std::string &, char **, int)
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 int remote_check_watch_resources(struct target_ops *self, enum bptype type, int cnt, int ot)
static void remote_set_trace_buffer_size(struct target_ops *self, LONGEST val)
const char * unpack_varlen_hex(const char *buff, ULONGEST *result)
#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)
static void remote_command(const char *args, int from_tty)
enum packet_support support
static void show_remotebreak(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
int remote_hw_watchpoint_length_limit
void(* to_attach)(struct target_ops *ops, const char *, int)
void target_preopen(int from_tty)
void(* to_follow_exec)(struct target_ops *, struct inferior *, char *) TARGET_DEFAULT_IGNORE()
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)
struct async_event_handler * get_pending_events_token
void(* to_pass_ctrlc)(struct target_ops *) TARGET_DEFAULT_FUNC(default_target_pass_ctrlc)
DISABLE_COPY_AND_ASSIGN(thread_item)
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)
unsigned char threadref[OPAQUETHREADBYTES]
static int remote_insert_breakpoint(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_const_cfunc_ftype *fun, const char *doc)
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)
void target_find_description(void)
static void remote_download_tracepoint(struct target_ops *self, struct bp_location *loc)
static void packet_command(const char *args, int from_tty)
void(* to_prepare_to_store)(struct target_ops *, struct regcache *) TARGET_DEFAULT_NORETURN(noprocess())
static void set_remote_protocol_Z_packet_cmd(const char *args, int from_tty, struct cmd_list_element *c)
static void remote_get_command(const char *args, int from_tty)
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)
gdb_signal last_resume_sig
int memory_remove_breakpoint(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt, enum remove_bp_reason reason)
int(* to_has_registers)(struct target_ops *)
static void set_remote_exec_file(const char *ignored, int from_tty, struct cmd_list_element *c)
static int remote_get_threads_with_qthreadinfo(struct target_ops *ops, struct threads_listing_context *context)
ptid_t(* to_wait)(struct target_ops *, ptid_t, struct target_waitstatus *, int TARGET_DEBUG_PRINTER(target_debug_print_options)) TARGET_DEFAULT_FUNC(default_target_wait)
void putstrn(const char *str, int n, int quoter)
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)
int is_target_filename(const char *name)
static struct target_ops remote_ops
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 pop_all_targets_at_and_above(enum strata stratum)
void parse_static_tracepoint_marker_definition(const char *line, const char **pp, struct static_tracepoint_marker *marker)
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 error(const char *fmt,...)
const char *(* to_thread_name)(struct target_ops *, struct thread_info *) TARGET_DEFAULT_RETURN(NULL)
static struct target_waitstatus * thread_pending_fork_status(struct thread_info *thread)
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)
#define target_static_tracepoint_marker_at(addr, marker)
static long get_memory_write_packet_size(void)
static char * pack_int(char *buf, int value)
static int remote_fileio_errno_to_host(int errnum)
struct notif_client notif_client_stop
void fputstr_filtered(const char *str, int quoter, struct ui_file *stream)
static void remote_load(struct target_ops *self, const char *name, int from_tty)
static void remote_prepare_to_store(struct target_ops *self, struct regcache *regcache)
void parse_tracepoint_definition(const char *line, struct uploaded_tp **utpp)
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 _initialize_remote(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)
int(* to_supports_multi_process)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
void setup_inferior(int from_tty)
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)
void encode_actions_rsp(struct bp_location *tloc, std::vector< std::string > *tdp_actions, std::vector< std::string > *stepping_actions)
const struct target_desc * gdbarch_target_desc(struct gdbarch *gdbarch)
static ptid_t get_current_thread(char *wait_status)
static int kill_child_of_pending_fork(QUEUE(stop_reply_p) *q, QUEUE_ITER(stop_reply_p) *iter, stop_reply_p event, void *data)
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)
static void remote_pspace_data_cleanup(struct program_space *pspace, void *arg)
static int remote_supports_multi_process(struct target_ops *self)
struct target_ops * find_target_at(enum strata stratum)
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)
void int_to_threadref(threadref *id, int value)