43#include "gdbsupport/fileio.h"
44#include "gdbsupport/agent.h"
50#include "gdbsupport/byte-vector.h"
51#include "gdbsupport/search.h"
53#include <unordered_map>
63 CORE_ADDR, CORE_ADDR,
int);
71 long lwp, ULONGEST tid);
77 ULONGEST search_space_len,
78 const gdb_byte *pattern,
80 CORE_ADDR *found_addrp);
84 CORE_ADDR memaddr, ULONGEST
size);
86static void tcomplain (
void) ATTRIBUTE_NORETURN;
95 (
struct target_ops *self, bfd *ignore1,
int *ignore2);
108static std::unordered_map<const target_info *, target_open_ftype *>
122static bool trust_readonly =
false;
127static int show_memory_breakpoints = 0;
147static unsigned int targetdebug = 0;
171 if (t->has_memory ())
195 if (t->has_registers ())
209 t =
inf->find_target_beneath (t))
210 if (t->has_execution (
inf))
356 gdb::array_view<const int> syscall_counts)
450gdb::unique_xmalloc_ptr<char>
684 CORE_ADDR addr1, CORE_ADDR addr2,
int *tpp)
755 const char *stopnotes)
783std::vector<static_tracepoint_marker>
830 const gdb::byte_vector &tags,
int type)
853 func (args, from_tty);
857 ti->shortname, args, from_tty);
868 auto &func_slot = target_factories[&t];
869 if (func_slot !=
nullptr)
870 internal_error (_(
"target already added (\"%s\")."), t.
shortname);
873 if (targetlist == NULL)
875Connect to a target machine or process.\n\
876The first argument is the type or protocol of the target machine.\n\
877Remaining arguments are interpreted by the target protocol. For more\n\
878information on the arguments for a particular protocol, type\n\
879`help target ' followed by the protocol name."),
900 gdb::unique_xmalloc_ptr<char> alt
901 = xstrprintf (
"target %s", tinfo.
shortname);
1048 &&
inf->terminal_state != desired_state)
1056 gdb_assert_not_reached (
"unhandled desired state");
1057 inf->terminal_state = desired_state;
1120 return inf->top_target ()->supports_terminal_ours ();
1126 error (_(
"You can't do that when your target is `%s'"),
1133 error (_(
"You can't do that without a process to debug."));
1139 gdb_printf (_(
"No saved terminal information.\n"));
1162 gdb_assert_not_reached (
"\
1163to_execution_direction must be implemented for reverse async");
1172 if (t->refcount () == 0)
1190 auto ref = target_ops_ref::new_reference (t);
1200 m_stack[stratum] = std::move (ref);
1202 if (m_top < stratum)
1214 gdb_assert (t != NULL);
1219 internal_error (_(
"Attempt to unpush the dummy target"));
1231 if (m_top == stratum)
1243 auto ref = std::move (
m_stack[stratum]);
1259 throw_error (TLS_GENERIC_ERROR,
1260 _(
"Cannot find thread-local variables on this target"));
1268 volatile CORE_ADDR addr = 0;
1297 catch (
const gdb_exception &ex)
1303 case TLS_NO_LIBRARY_SUPPORT_ERROR:
1304 error (_(
"Cannot find thread-local variables "
1305 "in this thread library."));
1307 case TLS_LOAD_MODULE_NOT_FOUND_ERROR:
1308 if (objfile_is_library)
1309 error (_(
"Cannot find shared library `%s' in dynamic"
1312 error (_(
"Cannot find executable file `%s' in dynamic"
1315 case TLS_NOT_ALLOCATED_YET_ERROR:
1316 if (objfile_is_library)
1317 error (_(
"The inferior has not yet allocated storage for"
1318 " thread-local variables in\n"
1319 "the shared library `%s'\n"
1324 error (_(
"The inferior has not yet allocated storage for"
1325 " thread-local variables in\n"
1326 "the executable `%s'\n"
1331 case TLS_GENERIC_ERROR:
1332 if (objfile_is_library)
1333 error (_(
"Cannot find thread-local storage for %s, "
1334 "shared library %s:\n%s"),
1338 error (_(
"Cannot find thread-local storage for %s, "
1339 "executable file %s:\n%s"),
1350 error (_(
"Cannot find thread-local variables on this target"));
1358#define CASE(X) case X: return #X
1388 if (
addr >= secp.addr &&
addr < secp.endaddr)
1413 ULONGEST memaddr, ULONGEST len, ULONGEST *reg_len,
1420 if (region_p != NULL)
1426 if (writebuf != NULL)
1431 if (readbuf != NULL)
1437 if (writebuf != NULL)
1438 error (_(
"Writing to flash memory forbidden in this context"));
1446 if (memaddr + len < region->
hi || region->
hi == 0)
1449 *reg_len = region->
hi - memaddr;
1460 const gdb_byte *writebuf, ULONGEST memaddr, LONGEST len,
1461 ULONGEST *xfered_len)
1468 readbuf, writebuf, memaddr, len,
1487 while (ops != NULL);
1494 if (writebuf != NULL
1503 dcache_update (dcache, res, memaddr, writebuf, *xfered_len);
1514 gdb_byte *readbuf,
const gdb_byte *writebuf, ULONGEST memaddr,
1515 ULONGEST len, ULONGEST *xfered_len)
1537 return (strcmp (section_name, s->the_bfd_section->name) == 0);
1541 memaddr, len, xfered_len,
1547 if (readbuf != NULL && trust_readonly)
1556 memaddr, len, xfered_len,
1585 reg_len, xfered_len);
1611 gdb_byte *readbuf,
const gdb_byte *writebuf,
1612 ULONGEST memaddr, ULONGEST len, ULONGEST *xfered_len)
1625 if (readbuf != NULL)
1643 gdb::byte_vector buf (writebuf, writebuf + len);
1652scoped_restore_tmpl<int>
1655 return make_scoped_restore (&show_memory_breakpoints, show);
1663 gdb_byte *readbuf,
const gdb_byte *writebuf,
1664 ULONGEST offset, ULONGEST len,
1665 ULONGEST *xfered_len)
1674 error (_(
"Writing to memory is not allowed (addr %s, len %s)"),
1675 core_addr_to_string_nz (offset), plongest (len));
1685 writebuf, offset, len, xfered_len);
1704 writebuf, offset, len, xfered_len);
1708 const unsigned char *myaddr = NULL;
1711 "%s:target_xfer_partial "
1712 "(%d, %s, %s, %s, %s, %s) = %d, %s",
1715 (annex ? annex :
"(null)"),
1716 host_address_to_string (readbuf),
1717 host_address_to_string (writebuf),
1718 core_addr_to_string_nz (offset),
1719 pulongest (len), retval,
1720 pulongest (*xfered_len));
1731 for (i = 0; i < *xfered_len; i++)
1733 if ((((intptr_t) &(myaddr[i])) & 0xf) == 0)
1735 if (targetdebug < 2 && i > 0)
1754 gdb_assert (*xfered_len > 0);
1775 myaddr, memaddr, len) == len)
1806 myaddr, memaddr, len) == len)
1820 myaddr, memaddr, len) == len)
1834 myaddr, memaddr, len) == len)
1851 myaddr, memaddr, len) == len)
1868 myaddr, memaddr, len) == len)
1876std::vector<mem_region>
1880 std::vector<mem_region> result = target->memory_map ();
1881 if (result.empty ())
1884 std::sort (result.begin (), result.end ());
1890 for (
size_t ix = 0; ix < result.size (); ix++)
1895 if (last_one != NULL && last_one->
hi > this_one->
lo)
1897 warning (_(
"Overlapping regions in memory map: ignoring"));
1898 return std::vector<mem_region> ();
1901 last_one = this_one;
1924 _(
"Mode for reading from readonly sections is %s.\n"),
1933 const char *annex, gdb_byte *buf,
1934 ULONGEST offset, ULONGEST len,
1935 ULONGEST *xfered_len)
1944 const char *annex,
const gdb_byte *buf,
1945 ULONGEST offset, LONGEST len, ULONGEST *xfered_len)
1958 const char *annex, gdb_byte *buf,
1959 ULONGEST offset, LONGEST len)
1961 LONGEST xfered_total = 0;
1972 while (xfered_total < len)
1974 ULONGEST xfered_partial;
1978 buf + xfered_total * unit_size,
1979 offset + xfered_total, len - xfered_total,
1984 return xfered_total;
1987 xfered_total += xfered_partial;
2020 const ULONGEST begin,
const ULONGEST end,
2022 std::vector<memory_read_result> *result)
2024 ULONGEST current_begin = begin;
2025 ULONGEST current_end = end;
2027 ULONGEST xfered_len;
2030 if (end - begin <= 1)
2033 gdb::unique_xmalloc_ptr<gdb_byte> buf ((gdb_byte *)
xmalloc (end - begin));
2045 buf.get () + (end - begin) - 1, end - 1, 1,
2059 while (current_end - current_begin > 1)
2061 ULONGEST first_half_begin, first_half_end;
2062 ULONGEST second_half_begin, second_half_end;
2064 ULONGEST middle = current_begin + (current_end - current_begin) / 2;
2068 first_half_begin = current_begin;
2069 first_half_end = middle;
2070 second_half_begin = middle;
2071 second_half_end = current_end;
2075 first_half_begin = middle;
2076 first_half_end = current_end;
2077 second_half_begin = current_begin;
2078 second_half_end = middle;
2082 buf.get () + (first_half_begin - begin) * unit_size,
2084 first_half_end - first_half_begin);
2086 if (xfer == first_half_end - first_half_begin)
2090 current_begin = second_half_begin;
2091 current_end = second_half_end;
2101 current_begin = first_half_begin;
2102 current_end = first_half_end;
2109 result->emplace_back (begin, current_end, std::move (buf));
2114 LONGEST region_len = end - current_end;
2116 gdb::unique_xmalloc_ptr<gdb_byte> data
2117 ((gdb_byte *)
xmalloc (region_len * unit_size));
2118 memcpy (data.get (), buf.get () + (current_end - begin) * unit_size,
2119 region_len * unit_size);
2120 result->emplace_back (current_end, end, std::move (data));
2124std::vector<memory_read_result>
2126 const ULONGEST offset,
const LONGEST len)
2128 std::vector<memory_read_result> result;
2131 LONGEST xfered_total = 0;
2132 while (xfered_total < len)
2138 gdb_assert (region);
2140 if (region->
hi == 0)
2141 region_len = len - xfered_total;
2143 region_len = region->
hi - offset;
2150 xfered_total += region_len;
2154 LONGEST to_read = std::min (len - xfered_total, region_len);
2155 gdb::unique_xmalloc_ptr<gdb_byte> buffer
2156 ((gdb_byte *)
xmalloc (to_read * unit_size));
2158 LONGEST xfered_partial =
2160 offset + xfered_total, to_read);
2162 if (xfered_partial <= 0)
2167 offset + xfered_total + to_read,
2168 unit_size, &result);
2169 xfered_total += to_read;
2173 result.emplace_back (offset + xfered_total,
2174 offset + xfered_total + xfered_partial,
2175 std::move (buffer));
2176 xfered_total += xfered_partial;
2191 const char *annex,
const gdb_byte *buf,
2192 ULONGEST offset, LONGEST len,
2193 void (*progress) (ULONGEST,
void *),
void *baton)
2195 LONGEST xfered_total = 0;
2208 (*progress) (0, baton);
2210 while (xfered_total < len)
2212 ULONGEST xfered_partial;
2216 buf + xfered_total * unit_size,
2217 offset + xfered_total, len - xfered_total,
2224 (*progress) (xfered_partial, baton);
2226 xfered_total += xfered_partial;
2237 const char *annex,
const gdb_byte *buf,
2238 ULONGEST offset, LONGEST len)
2247template <
typename T>
2248gdb::optional<gdb::def_vector<T>>
2252 gdb::def_vector<T> buf;
2254 const int chunk = 4096;
2267 ULONGEST xfered_len;
2270 buf.resize (buf_pos + chunk);
2273 (gdb_byte *) &buf[buf_pos],
2280 buf.resize (buf_pos);
2289 buf_pos += xfered_len;
2297gdb::optional<gdb::byte_vector>
2301 return target_read_alloc_1<gdb_byte> (ops,
object, annex);
2306gdb::optional<gdb::char_vector>
2310 gdb::optional<gdb::char_vector> buf
2311 = target_read_alloc_1<char> (ops,
object, annex);
2316 if (buf->empty () || buf->back () !=
'\0')
2317 buf->push_back (
'\0');
2320 for (
auto it = std::find (buf->begin (), buf->end (),
'\0');
2321 it != buf->end (); it++)
2324 warning (_(
"target object %d, annex %s, "
2325 "contained unexpected null characters"),
2326 (
int)
object, annex ? annex :
"(none)");
2350 int len,
enum bfd_endian byte_order)
2352 gdb_byte buf[
sizeof (ULONGEST)];
2354 gdb_assert (len <=
sizeof (buf));
2367 warning (_(
"May not insert breakpoints"));
2389 warning (_(
"May not remove breakpoints"));
2401 int has_all_mem = 0;
2414 if (!t->has_memory ())
2421 "GDB does not access memory from...\n"));
2424 has_all_mem = t->has_all_memory ();
2472 agent_capability_invalidate ();
2487 ||
query (_(
"A program is being debugged already. Kill it? ")))
2497 error (_(
"Program not killed."));
2520 ptid_t save_pid_ptid = ptid_t (
inf->
pid);
2533 auto proc_target_ref = target_ops_ref::new_reference (
inf->process_target ());
2566 target_wait_flags options)
2579 ptid_t event_ptid = target->
wait (ptid,
status, options);
2595 target_wait_flags options)
2598 return minus_one_ptid;
2632 return target->thread_info_to_thread_handle (tip);
2694 internal_error (_(
"could not find a target to follow fork"));
2708 if (child_inf !=
nullptr)
2711 gdb_assert (child_inf->
pid == child_ptid.pid ());
2716 return target->
follow_fork (child_inf, child_ptid, fork_kind, follow_child,
2724 const char *execd_pathname)
2733 internal_error (_(
"could not find a target to follow mourn inferior"));
2745 bfd_cache_close_all ();
2762 CORE_ADDR start_addr, ULONGEST search_space_len,
2763 const gdb_byte *pattern, ULONGEST pattern_len,
2764 CORE_ADDR *found_addrp)
2766 auto read_memory = [=] (CORE_ADDR addr, gdb_byte *result,
size_t len)
2770 result, addr, len) == len;
2774 return simple_search_memory (
read_memory, start_addr, search_space_len,
2775 pattern, pattern_len, found_addrp);
2787 const gdb_byte *pattern, ULONGEST pattern_len,
2788 CORE_ADDR *found_addrp)
2792 return target->
search_memory (start_addr, search_space_len, pattern,
2793 pattern_len, found_addrp);
2811 if (t->can_create_inferior ())
2820 error (_(
"The \"%s\" target does not support \"run\". "
2821 "Try \"help target\" or \"continue\"."),
2828 internal_error (_(
"No targets found"));
2840 _(
"Whether GDB may automatically connect to the "
2841 "native target is %s.\n"),
2856 internal_error (_(
"native target already set (\"%s\")."),
2883 if (do_mesg != NULL)
2884 error (_(
"Don't know how to %s. Try \"help target\"."), do_mesg);
2898 if (t->can_attach ())
2916 if (t->can_create_inferior ())
2944 for (; t != NULL; t = t->
beneath ())
2950 "target_info_proc (\"%s\", %d)\n", args, what);
2986gdb::optional<gdb::char_vector>
3012 gdb_assert (aspace != NULL);
3039 gdb_assert_not_reached (
"target_ops::attach called");
3052 gdb_assert_not_reached (
"target_ops::create_inferior called");
3126 if (fh.target == targ)
3183 int flags,
int mode,
int warn_if_slow,
3184 fileio_error *target_errno)
3186 *target_errno = FILEIO_ENOSYS;
3192 ULONGEST offset, fileio_error *target_errno)
3194 *target_errno = FILEIO_ENOSYS;
3200 ULONGEST offset, fileio_error *target_errno)
3202 *target_errno = FILEIO_ENOSYS;
3209 *target_errno = FILEIO_ENOSYS;
3216 *target_errno = FILEIO_ENOSYS;
3222 fileio_error *target_errno)
3224 *target_errno = FILEIO_ENOSYS;
3228gdb::optional<std::string>
3230 fileio_error *target_errno)
3232 *target_errno = FILEIO_ENOSYS;
3240 int flags,
int mode,
bool warn_if_slow, fileio_error *target_errno)
3244 int fd = t->fileio_open (
inf, filename,
flags, mode,
3245 warn_if_slow, target_errno);
3247 if (fd == -1 && *target_errno == FILEIO_ENOSYS)
3257 "target_fileio_open (%d,%s,0x%x,0%o,%d)"
3259 inf == NULL ? 0 :
inf->num,
3260 filename,
flags, mode,
3262 fd != -1 ? 0 : *target_errno);
3266 *target_errno = FILEIO_ENOSYS;
3274 ULONGEST offset, fileio_error *target_errno)
3280 *target_errno = FILEIO_EBADF;
3281 else if (fh->
target == NULL)
3282 *target_errno = FILEIO_EIO;
3285 len, offset, target_errno);
3289 "target_fileio_pwrite (%d,...,%d,%s) "
3291 fd, len, pulongest (offset),
3292 ret, ret != -1 ? 0 : *target_errno);
3300 ULONGEST offset, fileio_error *target_errno)
3306 *target_errno = FILEIO_EBADF;
3307 else if (fh->
target == NULL)
3308 *target_errno = FILEIO_EIO;
3311 len, offset, target_errno);
3315 "target_fileio_pread (%d,...,%d,%s) "
3317 fd, len, pulongest (offset),
3318 ret, ret != -1 ? 0 : *target_errno);
3331 *target_errno = FILEIO_EBADF;
3332 else if (fh->
target == NULL)
3333 *target_errno = FILEIO_EIO;
3339 "target_fileio_fstat (%d) = %d (%d)\n",
3340 fd, ret, ret != -1 ? 0 : *target_errno);
3353 *target_errno = FILEIO_EBADF;
3366 "target_fileio_close (%d) = %d (%d)\n",
3367 fd, ret, ret != -1 ? 0 : *target_errno);
3375 fileio_error *target_errno)
3379 int ret = t->fileio_unlink (
inf, filename, target_errno);
3381 if (ret == -1 && *target_errno == FILEIO_ENOSYS)
3386 "target_fileio_unlink (%d,%s)"
3388 inf == NULL ? 0 :
inf->num, filename,
3389 ret, ret != -1 ? 0 : *target_errno);
3393 *target_errno = FILEIO_ENOSYS;
3399gdb::optional<std::string>
3401 fileio_error *target_errno)
3405 gdb::optional<std::string> ret
3406 = t->fileio_readlink (
inf, filename, target_errno);
3408 if (!ret.has_value () && *target_errno == FILEIO_ENOSYS)
3413 "target_fileio_readlink (%d,%s)"
3415 inf == NULL ? 0 :
inf->num,
3416 filename, ret ? ret->c_str () :
"(nil)",
3417 ret ? 0 : *target_errno);
3421 *target_errno = FILEIO_ENOSYS;
3439 fileio_error target_errno;
3466 gdb_byte **buf_p,
int padding)
3468 size_t buf_alloc, buf_pos;
3471 fileio_error target_errno;
3474 0700,
false, &target_errno));
3475 if (fd.
get () == -1)
3481 buf = (gdb_byte *)
xmalloc (buf_alloc);
3486 buf_alloc - buf_pos - padding, buf_pos,
3507 if (buf_alloc < buf_pos * 2)
3510 buf = (gdb_byte *)
xrealloc (buf, buf_alloc);
3528gdb::unique_xmalloc_ptr<char>
3533 LONGEST i, transferred;
3536 bufstr = (
char *) buffer;
3538 if (transferred < 0)
3539 return gdb::unique_xmalloc_ptr<char> (
nullptr);
3541 if (transferred == 0)
3542 return make_unique_xstrdup (
"");
3544 bufstr[transferred] = 0;
3547 for (i = strlen (bufstr); i < transferred; i++)
3550 warning (_(
"target file %s "
3551 "contained unexpected null characters"),
3556 return gdb::unique_xmalloc_ptr<char> (bufstr);
3562 CORE_ADDR addr,
int len)
3570 CORE_ADDR start,
int length)
3572 return addr >= start && addr < start + length;
3581 for (
int stratum = t->
stratum () - 1; stratum >= 0; --stratum)
3604 const char *exec_file;
3611 if (exec_file ==
nullptr)
3615 gdb_printf (_(
"Detaching from program: %s, %s\n"), exec_file,
3629 if (exec_file !=
nullptr)
3630 gdb_printf (
"Attaching to program: %s, %s\n", exec_file,
3674 return string_printf (
"process %d", ptid.pid ());
3688 error (_(
"Command not implemented for this target."));
3693static gdb::unique_xmalloc_ptr<char>
3695 bfd *ignore1,
int *ignore2)
3697 error (_(
"Command not implemented for this target."));
3752 gdb_assert (!
inf->target_is_pushed (targ));
3783 warning (_(
"May not interrupt or stop the target, ignoring attempt"));
3795 warning (_(
"May not interrupt or stop the target, ignoring attempt"));
3812 if (proc_target == NULL)
3881 if (!list->empty ())
3882 list->append (
", ");
3884 list->append (elem);
3892do_option (target_wait_flags *target_options, std::string *ret,
3895 if ((*target_options & opt) != 0)
3898 *target_options &= ~opt;
3909#define DO_TARG_OPTION(OPT) \
3910 do_option (&target_options, &ret, OPT, #OPT)
3914 if (target_options != 0)
3932 error (_(
"Writing to registers is not allowed (regno %d)"), regno);
3949 const gdb_byte *data, CORE_ADDR lma, ULONGEST
size)
3951 LONGEST total_xfered = 0;
3953 while (total_xfered <
size)
3955 ULONGEST xfered_len;
3958 ULONGEST howmuch = std::min<ULONGEST> (
sizeof (buf),
size - total_xfered);
3961 buf, NULL, lma + total_xfered, howmuch,
3964 && memcmp (data + total_xfered, buf, xfered_len) == 0)
3966 total_xfered += xfered_len;
3979 const gdb_byte *data, CORE_ADDR memaddr, ULONGEST
size)
3983 data, memaddr,
size);
3999 enum target_hw_bp_type rw)
4011 enum target_hw_bp_type rw)
4067 enum btrace_read_type
type)
4076const struct btrace_config *
4182 gdb_disassembly_flags
flags)
4191 gdb_disassembly_flags
flags)
4255"Names of targets and files being debugged.\nShows the entire \
4256stack of targets currently in use (including the exec-file,\n\
4257core-file, and process, if any), as well as the symbol file name.";
4263 error (_(
"\"monitor\" command not supported by this target."));
4279 bool found_flash_region =
false;
4290 found_flash_region =
true;
4295 current_uiout->message (_(
"Erasing flash memory region at address "));
4298 current_uiout->field_string (
"size", hex_string (m.hi - m.lo));
4304 if (found_flash_region)
4307 current_uiout->message (_(
"No flash memory regions found.\n"));
4315 gdb_printf (_(
"The current target stack is:\n"));
4323 gdb_printf (
" - %s (%s)\n", t->shortname (), t->longname ());
4355 error (_(
"Cannot change this setting while the inferior is running."));
4371 _(
"Controlling the inferior in "
4372 "asynchronous mode is %s.\n"),
value);
4426 error (_(
"Cannot change this setting while the inferior is running."));
4445 _(
"Whether the target is always in non-stop mode "
4446 "is %s (currently %s).\n"),
value,
4450 _(
"Whether the target is always in non-stop mode "
4451 "is %s.\n"),
value);
4486 error (_(
"Cannot change this setting while the inferior is running."));
4520Set target debugging."), _(
"\
4521Show target debugging."), _(
"\
4522When non-zero, target debugging is enabled. Higher numbers are more\n\
4529 &trust_readonly, _(
"\
4530Set mode for reading from readonly sections."), _(
"\
4531Show mode for reading from readonly sections."), _(
"\
4532When this mode is on, memory reads from readonly sections (such as .text)\n\
4533will be read from the object file instead of from the target. This will\n\
4534result in significant performance improvement for remote targets."),
4540 _(
"Send a command to the remote monitor (remote targets only)."));
4543 _(
"Print the name of each layer of the internal target stack."),
4548Set whether gdb controls the inferior in asynchronous mode."), _(
"\
4549Show whether gdb controls the inferior in asynchronous mode."), _(
"\
4550Tells gdb whether to control the inferior in asynchronous mode."),
4559Set whether gdb always controls the inferior in non-stop mode."), _(
"\
4560Show whether gdb always controls the inferior in non-stop mode."), _(
"\
4561Tells gdb whether to control the inferior in non-stop mode."),
4570Set permission to write into registers."), _(
"\
4571Show permission to write into registers."), _(
"\
4572When this permission is on, GDB may write into the target's registers.\n\
4573Otherwise, any sort of write attempt will result in an error."),
4579Set permission to write into target memory."), _(
"\
4580Show permission to write into target memory."), _(
"\
4581When this permission is on, GDB may write into the target's memory.\n\
4582Otherwise, any sort of write attempt will result in an error."),
4588Set permission to insert breakpoints in the target."), _(
"\
4589Show permission to insert breakpoints in the target."), _(
"\
4590When this permission is on, GDB may insert breakpoints in the program.\n\
4591Otherwise, any sort of insertion attempt will result in an error."),
4597Set permission to insert tracepoints in the target."), _(
"\
4598Show permission to insert tracepoints in the target."), _(
"\
4599When this permission is on, GDB may insert tracepoints in the program.\n\
4600Otherwise, any sort of insertion attempt will result in an error."),
4606Set permission to insert fast tracepoints in the target."), _(
"\
4607Show permission to insert fast tracepoints in the target."), _(
"\
4608When this permission is on, GDB may insert fast tracepoints.\n\
4609Otherwise, any sort of insertion attempt will result in an error."),
4615Set permission to interrupt or signal the target."), _(
"\
4616Show permission to interrupt or signal the target."), _(
"\
4617When this permission is on, GDB may interrupt/stop the target's execution.\n\
4618Otherwise, any attempt to interrupt or stop will be ignored."),
4623 _(
"Erase all flash memory regions."));
4627Set whether GDB may automatically connect to the native target."), _(
"\
4628Show whether GDB may automatically connect to the native target."), _(
"\
4629When on, and GDB is not connected to a target yet, GDB\n\
4630attempts \"run\" and other commands with the native target."),
constexpr string_view get()
void * xrealloc(void *ptr, size_t size)
struct gdbarch * target_gdbarch(void)
void breakpoint_init_inferior(enum inf_context context)
int remove_breakpoints(void)
void breakpoint_xfer_memory(gdb_byte *readbuf, gdb_byte *writebuf, const gdb_byte *writebuf_org, ULONGEST memaddr, LONGEST len)
void mark_breakpoints_out(void)
target_ops * top_target()
void pop_all_targets_above(enum strata stratum)
int unpush_target(struct target_ops *t)
void push_target(struct target_ops *t)
struct process_stratum_target * process_target()
target_ops * find_target_beneath(const target_ops *t)
target_ops * target_at(enum strata stratum)
bool commit_resumed_state
void debug_print_register(const char *func, int regno)
scoped_target_fd(int fd) noexcept
DISABLE_COPY_AND_ASSIGN(scoped_target_fd)
bool unpush(target_ops *t)
target_ops * find_beneath(const target_ops *t) const
std::array< target_ops_ref,(int) debug_stratum+1 > m_stack
static void restore_inferior()
static void ours_for_output()
static target_terminal_state m_terminal_state
static bool is_inferior()
static void info(const char *arg, int from_tty)
struct cmd_list_element * showlist
struct cmd_list_element * maintenanceprintlist
struct cmd_list_element * cmdlist
struct cmd_list_element * setlist
struct cmd_list_element * showdebuglist
struct cmd_list_element * setdebuglist
struct cmd_list_element * maintenance_show_cmdlist
struct cmd_list_element * maintenance_set_cmdlist
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
void set_cmd_completer(struct cmd_list_element *cmd, completer_ftype *completer)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc)
struct cmd_list_element * deprecate_cmd(struct cmd_list_element *cmd, const char *replacement)
set_show_commands add_setshow_boolean_cmd(const char *name, enum command_class theclass, bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
set_show_commands 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_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct cmd_list_element * add_basic_prefix_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **subcommands, int allow_unknown, struct cmd_list_element **list)
struct cmd_list_element * add_info(const char *name, cmd_simple_func_ftype *fun, const char *doc)
set_show_commands 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_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void completer_ftype(struct cmd_list_element *, completion_tracker &tracker, const char *text, const char *word)
void reopen_exec_file(void)
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
const char * get_exec_file(int err)
void memory_error(enum target_xfer_status err, CORE_ADDR memaddr)
void dcache_update(DCACHE *dcache, enum target_xfer_status status, CORE_ADDR memaddr, const gdb_byte *myaddr, ULONGEST len)
enum target_xfer_status dcache_read_memory_partial(struct target_ops *ops, DCACHE *dcache, CORE_ADDR memaddr, gdb_byte *myaddr, ULONGEST len, ULONGEST *xfered_len)
int check_quit_flag(void)
void(* deprecated_detach_hook)(void)
int(* find_memory_region_ftype)(CORE_ADDR addr, unsigned long size, int read, int write, int exec, int modified, bool memory_tagged, void *data)
static ULONGEST extract_unsigned_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
enum target_xfer_status section_table_xfer_memory_partial(gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len, const target_section_table §ions, gdb::function_view< bool(const struct target_section *)> match_cb)
void reinit_frame_cache(void)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
bool gdbarch_get_thread_local_address_p(struct gdbarch *gdbarch)
CORE_ADDR gdbarch_get_thread_local_address(struct gdbarch *gdbarch, ptid_t ptid, CORE_ADDR lm_addr, CORE_ADDR offset)
CORE_ADDR gdbarch_remove_non_address_bits(struct gdbarch *gdbarch, CORE_ADDR pointer)
int gdbarch_has_global_solist(struct gdbarch *gdbarch)
int gdbarch_addressable_memory_unit_size(struct gdbarch *gdbarch)
bool gdbarch_fetch_tls_load_module_address_p(struct gdbarch *gdbarch)
CORE_ADDR gdbarch_fetch_tls_load_module_address(struct gdbarch *gdbarch, struct objfile *objfile)
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
void set_executing(process_stratum_target *targ, ptid_t ptid, bool executing)
void switch_to_no_thread()
mach_port_t kern_return_t mach_port_t mach_msg_type_name_t msgportsPoly 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
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
void exit_inferior(inferior *inf)
void set_current_inferior(struct inferior *inf)
int have_live_inferiors(void)
struct inferior * current_inferior(void)
void switch_to_inferior_no_thread(inferior *inf)
all_inferiors_range all_inferiors(process_stratum_target *proc_target=nullptr)
void infrun_async(int enable)
void prepare_for_detach(void)
void update_observer_mode(void)
void clear_inline_frame_state(process_stratum_target *target, ptid_t filter_ptid)
struct ui_file * gdb_stdtarg
struct mem_region * lookup_mem_region(CORE_ADDR addr)
void invalidate_target_mem_regions(void)
observable< ptid_t > target_post_wait
observable< ptid_t > target_pre_wait
static CORE_ADDR lm_addr(struct so_list *so)
const char * objfile_name(const struct objfile *objfile)
static process_stratum_target * as_process_stratum_target(target_ops *target)
struct program_space * current_program_space
void registers_changed_ptid(process_stratum_target *target, ptid_t ptid)
void registers_changed(void)
void(* func)(remote_target *remote, char *)
void no_shared_libraries(const char *ignored, int from_tty)
struct btrace_config conf
completer_ftype * completer
void set_context(void *context)
const target_info & info() const override
strata stratum() const override
strata stratum() const override
const target_info & info() const override
enum mem_access_mode mode
struct bfd_section * the_bfd_section
struct objfile * separate_debug_objfile_backlink
target_section_table & target_sections()
struct objfile * symfile_object_file
static void decref(target_ops *t)
virtual LONGEST get_raw_trace_data(gdb_byte *buf, ULONGEST offset, LONGEST len) TARGET_DEFAULT_NORETURN(tcomplain())
virtual std::vector< mem_region > virtual memory_map() TARGET_DEFAULT_RETURN(std void flash_erase(ULONGEST address, LONGEST length) TARGET_DEFAULT_NORETURN(tcomplain())
virtual int fileio_close(int fd, fileio_error *target_errno)
virtual bool attach_no_wait() TARGET_DEFAULT_RETURN(0)
virtual int insert_mask_watchpoint(CORE_ADDR, CORE_ADDR, enum target_hw_bp_type) TARGET_DEFAULT_RETURN(1)
virtual ptid_t wait(ptid_t, struct target_waitstatus *, target_wait_flags options) TARGET_DEFAULT_FUNC(default_target_wait)
virtual gdb::optional< std::string > fileio_readlink(struct inferior *inf, const char *filename, fileio_error *target_errno)
virtual void insn_history(int size, gdb_disassembly_flags flags) TARGET_DEFAULT_NORETURN(tcomplain())
virtual bool have_steppable_watchpoint() TARGET_DEFAULT_RETURN(false)
virtual void goto_record(ULONGEST insn) TARGET_DEFAULT_NORETURN(tcomplain())
virtual void set_trace_buffer_size(LONGEST val) TARGET_DEFAULT_IGNORE()
virtual void terminal_inferior() TARGET_DEFAULT_IGNORE()
virtual int core_of_thread(ptid_t ptid) TARGET_DEFAULT_RETURN(-1)
virtual struct address_space * thread_address_space(ptid_t) TARGET_DEFAULT_RETURN(NULL)
virtual void load(const char *, int) TARGET_DEFAULT_NORETURN(tcomplain())
virtual bool can_async_p() TARGET_DEFAULT_RETURN(false)
virtual bool can_create_inferior()
virtual void goto_record_begin() TARGET_DEFAULT_NORETURN(tcomplain())
virtual int find_memory_regions(find_memory_region_ftype func, void *data) TARGET_DEFAULT_FUNC(dummy_find_memory_regions)
virtual void trace_init() TARGET_DEFAULT_NORETURN(tcomplain())
virtual void prepare_to_generate_core() TARGET_DEFAULT_IGNORE()
virtual int remove_breakpoint(struct gdbarch *, struct bp_target_info *, enum remove_bp_reason) TARGET_DEFAULT_NORETURN(noprocess())
virtual int search_memory(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)
virtual bool static_tracepoint_marker_at(CORE_ADDR, static_tracepoint_marker *marker) TARGET_DEFAULT_RETURN(false)
virtual int remove_hw_breakpoint(struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_RETURN(-1)
virtual void pass_signals(gdb::array_view< const unsigned char > TARGET_DEBUG_PRINTER(target_debug_print_signals)) TARGET_DEFAULT_IGNORE()
const char * longname() const
virtual int fileio_pread(int fd, gdb_byte *read_buf, int len, ULONGEST offset, fileio_error *target_errno)
virtual std::string pid_to_str(ptid_t) TARGET_DEFAULT_FUNC(default_pid_to_str)
virtual void terminal_init() TARGET_DEFAULT_IGNORE()
virtual void fetch_registers(struct regcache *, int) TARGET_DEFAULT_IGNORE()
virtual bool supports_evaluation_of_breakpoint_conditions() TARGET_DEFAULT_RETURN(false)
virtual bool use_agent(bool use) TARGET_DEFAULT_NORETURN(tcomplain())
virtual bool stopped_by_sw_breakpoint() TARGET_DEFAULT_RETURN(false)
virtual void create_inferior(const char *, const std::string &, char **, int)
virtual bool can_download_tracepoint() TARGET_DEFAULT_RETURN(false)
virtual thread_control_capabilities get_thread_control_capabilities() TARGET_DEFAULT_RETURN(tc_none)
virtual void goto_bookmark(const gdb_byte *, int) TARGET_DEFAULT_NORETURN(tcomplain())
virtual void detach(inferior *, int) TARGET_DEFAULT_IGNORE()
virtual void insn_history_from(ULONGEST from, int size, gdb_disassembly_flags flags) TARGET_DEFAULT_NORETURN(tcomplain())
virtual int fileio_unlink(struct inferior *inf, const char *filename, fileio_error *target_errno)
virtual void enable_tracepoint(struct bp_location *location) TARGET_DEFAULT_NORETURN(tcomplain())
virtual void set_circular_trace_buffer(int val) TARGET_DEFAULT_IGNORE()
virtual thread_info * thread_handle_to_thread_info(const gdb_byte *, int, inferior *inf) TARGET_DEFAULT_RETURN(NULL)
virtual int remove_watchpoint(CORE_ADDR, int, enum target_hw_bp_type, struct expression *) TARGET_DEFAULT_RETURN(-1)
virtual void goto_record_end() TARGET_DEFAULT_NORETURN(tcomplain())
virtual void trace_set_readonly_regions() TARGET_DEFAULT_NORETURN(tcomplain())
virtual void terminal_ours_for_output() TARGET_DEFAULT_IGNORE()
virtual void record_stop_replaying() TARGET_DEFAULT_IGNORE()
virtual bool supports_multi_process() TARGET_DEFAULT_RETURN(false)
virtual int insert_watchpoint(CORE_ADDR, int, enum target_hw_bp_type, struct expression *) TARGET_DEFAULT_RETURN(-1)
virtual bool stopped_by_watchpoint() TARGET_DEFAULT_RETURN(false)
target_ops * beneath() const
virtual int can_do_single_step() TARGET_DEFAULT_RETURN(-1)
virtual bool get_trace_state_variable_value(int tsv, LONGEST *val) TARGET_DEFAULT_RETURN(false)
virtual void download_tracepoint(struct bp_location *location) TARGET_DEFAULT_NORETURN(tcomplain())
virtual bool can_attach()
virtual void kill() TARGET_DEFAULT_NORETURN(noprocess())
virtual bool can_execute_reverse() TARGET_DEFAULT_RETURN(false)
virtual int get_trace_status(struct trace_status *ts) TARGET_DEFAULT_RETURN(-1)
virtual int insert_hw_breakpoint(struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_RETURN(-1)
virtual void set_disconnected_tracing(int val) TARGET_DEFAULT_IGNORE()
virtual void save_record(const char *filename) TARGET_DEFAULT_NORETURN(tcomplain())
virtual void program_signals(gdb::array_view< const unsigned char > TARGET_DEBUG_PRINTER(target_debug_print_signals)) TARGET_DEFAULT_IGNORE()
virtual void get_tracepoint_status(struct breakpoint *tp, struct uploaded_tp *utp) TARGET_DEFAULT_NORETURN(tcomplain())
virtual void commit_resumed() TARGET_DEFAULT_IGNORE()
virtual enum exec_direction_kind execution_direction() TARGET_DEFAULT_FUNC(default_execution_direction)
virtual traceframe_info_up traceframe_info() TARGET_DEFAULT_NORETURN(tcomplain())
virtual int insert_fork_catchpoint(int) TARGET_DEFAULT_RETURN(1)
virtual struct btrace_target_info * enable_btrace(thread_info *tp, const struct btrace_config *conf) TARGET_DEFAULT_NORETURN(tcomplain())
virtual void store_registers(struct regcache *, int) TARGET_DEFAULT_NORETURN(noprocess())
virtual bool fetch_memtags(CORE_ADDR address, size_t len, gdb::byte_vector &tags, int type) TARGET_DEFAULT_NORETURN(tcomplain())
virtual void terminal_ours() TARGET_DEFAULT_IGNORE()
virtual void trace_start() TARGET_DEFAULT_NORETURN(tcomplain())
virtual void flash_done() TARGET_DEFAULT_NORETURN(tcomplain())
virtual void done_generating_core() TARGET_DEFAULT_IGNORE()
virtual int save_trace_data(const char *filename) TARGET_DEFAULT_NORETURN(tcomplain())
virtual gdb_byte * get_bookmark(const char *, int) TARGET_DEFAULT_NORETURN(tcomplain())
virtual void follow_fork(inferior *, ptid_t, target_waitkind, bool, bool) TARGET_DEFAULT_FUNC(default_follow_fork)
virtual int can_use_hw_breakpoint(enum bptype, int, int) TARGET_DEFAULT_RETURN(0)
virtual enum target_xfer_status xfer_partial(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)
virtual gdb::byte_vector virtual thread_info_to_thread_handle(struct thread_info *) TARGET_DEFAULT_RETURN(gdb voi stop)(ptid_t) TARGET_DEFAULT_IGNORE()
virtual ULONGEST get_memory_xfer_limit() TARGET_DEFAULT_RETURN(ULONGEST_MAX)
virtual bool record_is_replaying(ptid_t ptid) TARGET_DEFAULT_RETURN(false)
virtual enum record_method record_method(ptid_t ptid) TARGET_DEFAULT_RETURN(RECORD_METHOD_NONE)
virtual bool supports_stopped_by_sw_breakpoint() TARGET_DEFAULT_RETURN(false)
virtual bool stopped_by_hw_breakpoint() TARGET_DEFAULT_RETURN(false)
virtual gdb::unique_xmalloc_ptr< char > make_corefile_notes(bfd *, int *) TARGET_DEFAULT_FUNC(dummy_make_corefile_notes)
virtual bool supports_disable_randomization() TARGET_DEFAULT_FUNC(find_default_supports_disable_randomization)
virtual const char * extra_thread_info(thread_info *) TARGET_DEFAULT_RETURN(NULL)
virtual bool filesystem_is_local() TARGET_DEFAULT_RETURN(true)
virtual bool can_run_breakpoint_commands() TARGET_DEFAULT_RETURN(false)
virtual int fileio_fstat(int fd, struct stat *sb, fileio_error *target_errno)
virtual strata stratum() const =0
virtual int ranged_break_num_registers() TARGET_DEFAULT_RETURN(-1)
virtual int get_min_fast_tracepoint_insn_len() TARGET_DEFAULT_RETURN(-1)
virtual const struct frame_unwind * get_tailcall_unwinder() TARGET_DEFAULT_RETURN(NULL)
virtual ptid_t get_ada_task_ptid(long lwp, ULONGEST thread) TARGET_DEFAULT_FUNC(default_get_ada_task_ptid)
virtual int masked_watch_num_registers(CORE_ADDR, CORE_ADDR) TARGET_DEFAULT_RETURN(-1)
virtual void async(bool) TARGET_DEFAULT_NORETURN(tcomplain())
virtual std::vector< static_tracepoint_marker > static_tracepoint_markers_by_strid(const char *id) TARGET_DEFAULT_NORETURN(tcomplain())
virtual void terminal_save_inferior() TARGET_DEFAULT_IGNORE()
const char * shortname() const
virtual bool supports_dumpcore() TARGET_DEFAULT_RETURN(false)
virtual bool supports_stopped_by_hw_breakpoint() TARGET_DEFAULT_RETURN(false)
virtual void resume(ptid_t, int TARGET_DEBUG_PRINTER(target_debug_print_step), enum gdb_signal) TARGET_DEFAULT_NORETURN(noprocess())
virtual bool is_async_p() TARGET_DEFAULT_RETURN(false)
virtual const char * pid_to_exec_file(int pid) TARGET_DEFAULT_RETURN(NULL)
virtual struct gdbarch * thread_architecture(ptid_t) TARGET_DEFAULT_RETURN(NULL)
virtual bool can_accel_watchpoint_condition(CORE_ADDR, int, int, struct expression *) TARGET_DEFAULT_RETURN(false)
virtual void thread_events(int) TARGET_DEFAULT_IGNORE()
virtual int verify_memory(const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size) TARGET_DEFAULT_FUNC(default_verify_memory)
virtual void insn_history_range(ULONGEST begin, ULONGEST end, gdb_disassembly_flags flags) TARGET_DEFAULT_NORETURN(tcomplain())
virtual void log_command(const char *) TARGET_DEFAULT_IGNORE()
virtual void update_thread_list() TARGET_DEFAULT_IGNORE()
virtual const target_info & info() const =0
virtual int trace_find(enum trace_find_type type, int num, CORE_ADDR addr1, CORE_ADDR addr2, int *tpp) TARGET_DEFAULT_RETURN(-1)
virtual bool has_all_memory()
virtual void delete_record() TARGET_DEFAULT_NORETURN(tcomplain())
virtual void teardown_btrace(struct btrace_target_info *tinfo) TARGET_DEFAULT_NORETURN(tcomplain())
virtual void stop_recording() TARGET_DEFAULT_IGNORE()
virtual bool store_memtags(CORE_ADDR address, size_t len, const gdb::byte_vector &tags, int type) TARGET_DEFAULT_NORETURN(tcomplain())
virtual void files_info() TARGET_DEFAULT_IGNORE()
virtual int upload_trace_state_variables(struct uploaded_tsv **utsvp) TARGET_DEFAULT_RETURN(0)
virtual void disable_tracepoint(struct bp_location *location) TARGET_DEFAULT_NORETURN(tcomplain())
virtual const char * thread_name(thread_info *) TARGET_DEFAULT_RETURN(NULL)
virtual void disable_btrace(struct btrace_target_info *tinfo) TARGET_DEFAULT_NORETURN(tcomplain())
virtual void pass_ctrlc() TARGET_DEFAULT_FUNC(default_target_pass_ctrlc)
virtual void prepare_to_store(struct regcache *) TARGET_DEFAULT_NORETURN(noprocess())
virtual void set_permissions() TARGET_DEFAULT_IGNORE()
virtual void interrupt() TARGET_DEFAULT_IGNORE()
virtual void trace_stop() TARGET_DEFAULT_NORETURN(tcomplain())
virtual int fileio_pwrite(int fd, const gdb_byte *write_buf, int len, ULONGEST offset, fileio_error *target_errno)
virtual void attach(const char *, int)
virtual bool can_use_agent() TARGET_DEFAULT_RETURN(false)
virtual void call_history_from(ULONGEST begin, int size, record_print_flags flags) TARGET_DEFAULT_NORETURN(tcomplain())
virtual bool augmented_libraries_svr4_read() TARGET_DEFAULT_RETURN(false)
virtual void mourn_inferior() TARGET_DEFAULT_FUNC(default_mourn_inferior)
virtual int insert_vfork_catchpoint(int) TARGET_DEFAULT_RETURN(1)
virtual bool thread_alive(ptid_t ptid) TARGET_DEFAULT_RETURN(false)
virtual void download_trace_state_variable(const trace_state_variable &tsv) TARGET_DEFAULT_NORETURN(tcomplain())
virtual void disconnect(const char *, int) TARGET_DEFAULT_NORETURN(tcomplain())
virtual bool set_trace_notes(const char *user, const char *notes, const char *stopnotes) TARGET_DEFAULT_RETURN(false)
virtual bool supports_enable_disable_tracepoint() TARGET_DEFAULT_RETURN(false)
virtual int insert_breakpoint(struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_NORETURN(noprocess())
virtual bool record_will_replay(ptid_t ptid, int dir) TARGET_DEFAULT_RETURN(false)
virtual int remove_fork_catchpoint(int) TARGET_DEFAULT_RETURN(1)
virtual void dumpcore(const char *filename) TARGET_DEFAULT_IGNORE()
virtual const struct frame_unwind * get_unwinder() TARGET_DEFAULT_RETURN(NULL)
virtual enum btrace_error read_btrace(struct btrace_data *data, struct btrace_target_info *btinfo, enum btrace_read_type type) TARGET_DEFAULT_NORETURN(tcomplain())
virtual const struct target_desc * read_description() TARGET_DEFAULT_RETURN(NULL)
virtual void call_history_range(ULONGEST begin, ULONGEST end, record_print_flags flags) TARGET_DEFAULT_NORETURN(tcomplain())
virtual bool supports_memory_tagging() TARGET_DEFAULT_RETURN(false)
virtual int region_ok_for_hw_watchpoint(CORE_ADDR, int) TARGET_DEFAULT_FUNC(default_region_ok_for_hw_watchpoint)
virtual int upload_tracepoints(struct uploaded_tp **utpp) TARGET_DEFAULT_RETURN(0)
virtual int remove_mask_watchpoint(CORE_ADDR, CORE_ADDR, enum target_hw_bp_type) TARGET_DEFAULT_RETURN(1)
virtual bool always_non_stop_p() TARGET_DEFAULT_RETURN(false)
virtual bool supports_delete_record() TARGET_DEFAULT_RETURN(false)
virtual int remove_vfork_catchpoint(int) TARGET_DEFAULT_RETURN(1)
virtual const target_section_table * get_section_table() TARGET_DEFAULT_RETURN(default_get_section_table())
virtual void follow_exec(inferior *, ptid_t, const char *) TARGET_DEFAULT_IGNORE()
virtual bool supports_string_tracing() TARGET_DEFAULT_RETURN(false)
virtual void call_history(int size, record_print_flags flags) TARGET_DEFAULT_NORETURN(tcomplain())
virtual int set_syscall_catchpoint(int, bool, int, gdb::array_view< const int >) TARGET_DEFAULT_RETURN(1)
virtual bool has_pending_events() TARGET_DEFAULT_RETURN(false)
virtual void rcmd(const char *command, struct ui_file *output) TARGET_DEFAULT_FUNC(default_rcmd)
virtual void post_attach(int) TARGET_DEFAULT_IGNORE()
virtual bool info_proc(const char *, enum info_proc_what)
virtual bool get_tib_address(ptid_t ptid, CORE_ADDR *addr) TARGET_DEFAULT_NORETURN(tcomplain())
virtual int fileio_open(struct inferior *inf, const char *filename, int flags, int mode, int warn_if_slow, fileio_error *target_errno)
virtual int insert_exec_catchpoint(int) TARGET_DEFAULT_RETURN(1)
virtual void terminal_info(const char *, int) TARGET_DEFAULT_FUNC(default_terminal_info)
virtual int remove_exec_catchpoint(int) TARGET_DEFAULT_RETURN(1)
virtual const struct btrace_config * btrace_conf(const struct btrace_target_info *) TARGET_DEFAULT_RETURN(NULL)
virtual CORE_ADDR get_thread_local_address(ptid_t ptid, CORE_ADDR load_module_addr, CORE_ADDR offset) TARGET_DEFAULT_NORETURN(generic_tls_error())
struct bfd_section * the_bfd_section
void operator()(struct target_ops *ops) const
enum prompt_state prompt_state
struct obj_section * find_pc_overlay(CORE_ADDR pc)
CORE_ADDR overlay_mapped_address(CORE_ADDR pc, struct obj_section *section)
CORE_ADDR pc_in_unmapped_range(CORE_ADDR pc, struct obj_section *section)
enum overlay_debugging_state overlay_debugging
void connection_list_remove(process_stratum_target *t)
void connection_list_add(process_stratum_target *t)
int target_dcache_init_p(void)
void target_dcache_invalidate(void)
DCACHE * target_dcache_get(void)
DCACHE * target_dcache_get_or_init(void)
int stack_cache_enabled_p(void)
int code_cache_enabled_p(void)
void target_clear_description(void)
std::vector< target_section > target_section_table
std::vector< static_tracepoint_marker > target_static_tracepoint_markers_by_strid(const char *marker_id)
void target_announce_detach(int from_tty)
struct target_ops * find_run_target(void)
LONGEST target_get_raw_trace_data(gdb_byte *buf, ULONGEST offset, LONGEST len)
int target_fileio_fstat(int fd, struct stat *sb, fileio_error *target_errno)
int target_get_min_fast_tracepoint_insn_len()
void target_require_runnable(void)
void target_goto_record(ULONGEST insn)
bool target_get_trace_state_variable_value(int tsv, LONGEST *val)
static void show_maint_target_async(ui_file *file, int from_tty, cmd_list_element *c, const char *value)
static void tcomplain(void)
void target_post_attach(int pid)
bool target_have_steppable_watchpoint()
static bool get_maint_target_async()
struct address_space * target_thread_address_space(ptid_t ptid)
gdb_byte * target_get_bookmark(const char *args, int from_tty)
void fileio_handles_invalidate_target(target_ops *targ)
void target_close(struct target_ops *targ)
ptid_t target_wait(ptid_t ptid, struct target_waitstatus *status, target_wait_flags options)
void get_target_memory(struct target_ops *ops, CORE_ADDR addr, gdb_byte *buf, LONGEST len)
static ptid_t default_get_ada_task_ptid(struct target_ops *self, long lwp, ULONGEST tid)
static std::string default_pid_to_str(struct target_ops *ops, ptid_t ptid)
bool target_filesystem_is_local()
bool target_supports_dumpcore()
void target_set_circular_trace_buffer(int val)
static int lowest_closed_fd
int target_insert_hw_breakpoint(gdbarch *gdbarch, bp_target_info *bp_tgt)
void target_goto_bookmark(const gdb_byte *arg, int from_tty)
void target_set_disconnected_tracing(int val)
static void show_trust_readonly(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void str_comma_list_concat_elem(std::string *list, const char *elem)
int target_read_code(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
struct target_ops * find_attach_target(void)
int target_region_ok_for_hw_watchpoint(CORE_ADDR addr, int len)
void default_target_pass_ctrlc(struct target_ops *ops)
enum record_method target_record_method(ptid_t ptid)
void target_call_history_from(ULONGEST begin, int size, record_print_flags flags)
static struct target_ops * default_fileio_target(void)
int target_upload_trace_state_variables(uploaded_tsv **utsvp)
static const target_info dummy_target_info
int target_supports_delete_record()
void target_pre_inferior(int from_tty)
bool target_store_memtags(CORE_ADDR address, size_t len, const gdb::byte_vector &tags, int type)
static bool may_write_registers_1
static void show_targetdebug(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static struct target_ops * find_default_run_target(const char *do_mesg)
ptid_t target_get_ada_task_ptid(long lwp, ULONGEST tid)
void target_insn_history_range(ULONGEST begin, ULONGEST end, gdb_disassembly_flags flags)
static bool auto_connect_native_target
bool target_has_pending_events()
int target_remove_exec_catchpoint(int pid)
void target_log_command(const char *p)
static void maintenance_print_target_stack(const char *cmd, int from_tty)
exec_direction_kind target_execution_direction()
int target_fileio_pwrite(int fd, const gdb_byte *write_buf, int len, ULONGEST offset, fileio_error *target_errno)
target_ops * get_native_target()
int target_can_do_single_step()
const struct target_desc * target_read_description(struct target_ops *target)
void target_insn_history(int size, gdb_disassembly_flags flags)
int target_trace_find(trace_find_type type, int num, CORE_ADDR addr1, CORE_ADDR addr2, int *tpp)
static void target_terminal_is_ours_kind(target_terminal_state desired_state)
void target_async(bool enable)
gdb::unique_xmalloc_ptr< char > target_fileio_read_stralloc(struct inferior *inf, const char *filename)
void target_stop_recording(void)
const struct frame_unwind * target_get_tailcall_unwinder(void)
int target_remove_hw_breakpoint(gdbarch *gdbarch, bp_target_info *bp_tgt)
bool target_supports_stopped_by_hw_breakpoint()
void target_goto_record_end(void)
bool target_can_run_breakpoint_commands()
int target_remove_mask_watchpoint(CORE_ADDR addr, CORE_ADDR mask, enum target_hw_bp_type rw)
bool target_supports_memory_tagging()
bool target_supports_terminal_ours(void)
void target_trace_start()
bool target_can_execute_reverse()
void target_enable_tracepoint(bp_location *loc)
void target_done_generating_core(void)
void target_call_history(int size, record_print_flags flags)
void _initialize_target()
gdb::optional< gdb::char_vector > target_get_osdata(const char *type)
gdb::optional< gdb::def_vector< T > > target_read_alloc_1(struct target_ops *ops, enum target_object object, const char *annex)
int target_record_is_replaying(ptid_t ptid)
int target_fileio_open(struct inferior *inf, const char *filename, int flags, int mode, bool warn_if_slow, fileio_error *target_errno)
int target_insert_breakpoint(struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
void target_insn_history_from(ULONGEST from, int size, gdb_disassembly_flags flags)
gdb::optional< gdb::char_vector > target_read_stralloc(struct target_ops *ops, enum target_object object, const char *annex)
int target_remove_fork_catchpoint(int pid)
scoped_restore_tmpl< int > make_scoped_restore_show_memory_breakpoints(int show)
enum auto_boolean target_non_stop_enabled
static bool may_insert_fast_tracepoints_1
static void set_target_permissions(const char *args, int from_tty, struct cmd_list_element *c)
const char * target_pid_to_exec_file(int pid)
void flash_erase_command(const char *cmd, int from_tty)
bool target_async_permitted
const struct target_section * target_section_by_addr(struct target_ops *target, CORE_ADDR addr)
void target_detach(inferior *inf, int from_tty)
bool target_can_download_tracepoint()
int target_insert_watchpoint(CORE_ADDR addr, int len, target_hw_bp_type type, expression *cond)
int simple_verify_memory(struct target_ops *ops, const gdb_byte *data, CORE_ADDR lma, ULONGEST size)
void target_get_tracepoint_status(breakpoint *tp, uploaded_tp *utp)
static dummy_target the_dummy_target
static bool may_insert_breakpoints_1
void target_fetch_registers(struct regcache *regcache, int regno)
std::vector< memory_read_result > read_memory_robust(struct target_ops *ops, const ULONGEST offset, const LONGEST len)
static void do_monitor_command(const char *cmd, int from_tty)
static void release_fileio_fd(int fd, fileio_fh_t *fh)
int target_fileio_close(int fd, fileio_error *target_errno)
void target_continue(ptid_t ptid, enum gdb_signal signal)
bool target_can_async_p()
bool target_static_tracepoint_marker_at(CORE_ADDR addr, static_tracepoint_marker *marker)
void target_disable_btrace(struct btrace_target_info *btinfo)
bool target_can_use_agent()
void target_pass_signals(gdb::array_view< const unsigned char > pass_signals)
int target_fileio_pread(int fd, gdb_byte *read_buf, int len, ULONGEST offset, fileio_error *target_errno)
static void default_follow_fork(struct target_ops *self, inferior *child_inf, ptid_t child_ptid, target_waitkind fork_kind, bool follow_child, bool detach_fork)
enum target_xfer_status raw_memory_xfer_partial(struct target_ops *ops, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST memaddr, LONGEST len, ULONGEST *xfered_len)
const char * target_xfer_status_to_string(enum target_xfer_status status)
bool target_can_lock_scheduler()
gdb::byte_vector target_thread_info_to_thread_handle(struct thread_info *tip)
gdb::unique_xmalloc_ptr< char > target_make_corefile_notes(bfd *bfd, int *size_p)
static target_ops * the_native_target
gdbarch * target_thread_architecture(ptid_t ptid)
traceframe_info_up target_traceframe_info()
LONGEST target_fileio_read_alloc(struct inferior *inf, const char *filename, gdb_byte **buf_p)
static std::vector< fileio_fh_t > fileio_fhandles
int target_read_stack(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
static int default_watchpoint_addr_within_range(struct target_ops *target, CORE_ADDR addr, CORE_ADDR start, int length)
int target_core_of_thread(ptid_t ptid)
void target_update_thread_list(void)
void target_prepare_to_store(regcache *regcache)
void target_program_signals(gdb::array_view< const unsigned char > program_signals)
void target_record_stop_replaying(void)
int target_upload_tracepoints(uploaded_tp **utpp)
void add_deprecated_target_alias(const target_info &tinfo, const char *alias)
bool target_stopped_by_hw_breakpoint()
int target_can_use_hardware_watchpoint(bptype type, int cnt, int othertype)
int target_write_memory(CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
void target_dumpcore(const char *filename)
bool target_use_agent(bool use)
void target_follow_fork(inferior *child_inf, ptid_t child_ptid, target_waitkind fork_kind, bool follow_child, bool detach_fork)
void target_call_history_range(ULONGEST begin, ULONGEST end, record_print_flags flags)
static void default_mourn_inferior(struct target_ops *self)
void target_commit_resumed()
static int dummy_find_memory_regions(struct target_ops *self, find_memory_region_ftype ignore1, void *ignore2)
static LONGEST target_fileio_read_alloc_1(struct inferior *inf, const char *filename, gdb_byte **buf_p, int padding)
bool target_has_execution(inferior *inf)
static void do_option(target_wait_flags *target_options, std::string *ret, target_wait_flag opt, const char *opt_str)
target_ops * get_dummy_target()
void target_disable_tracepoint(bp_location *loc)
void target_trace_set_readonly_regions()
void target_download_tracepoint(bp_location *location)
int target_insert_exec_catchpoint(int pid)
void target_download_trace_state_variable(const trace_state_variable &tsv)
int target_record_will_replay(ptid_t ptid, int dir)
bool target_supports_stopped_by_sw_breakpoint()
int target_get_trace_status(trace_status *ts)
int target_read_raw_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
const target_section_table * target_get_section_table(struct target_ops *target)
int target_insert_mask_watchpoint(CORE_ADDR addr, CORE_ADDR mask, enum target_hw_bp_type rw)
int target_insert_fork_catchpoint(int pid)
ptid_t default_target_wait(struct target_ops *ops, ptid_t ptid, struct target_waitstatus *status, target_wait_flags options)
void target_save_record(const char *filename)
static void read_whatever_is_readable(struct target_ops *ops, const ULONGEST begin, const ULONGEST end, int unit_size, std::vector< memory_read_result > *result)
void target_flash_erase(ULONGEST address, LONGEST length)
#define DO_TARG_OPTION(OPT)
int target_masked_watch_num_registers(CORE_ADDR addr, CORE_ADDR mask)
int target_read_uint32(CORE_ADDR memaddr, uint32_t *result)
static int find_default_supports_disable_randomization(struct target_ops *self)
struct thread_info * target_thread_handle_to_thread_info(const gdb_byte *thread_handle, int handle_len, struct inferior *inf)
static enum target_xfer_status memory_xfer_partial(struct target_ops *ops, enum target_object object, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST memaddr, ULONGEST len, ULONGEST *xfered_len)
static void show_maint_target_non_stop(ui_file *file, int from_tty, cmd_list_element *c, const char *value)
int target_supports_multi_process(void)
void target_disconnect(const char *args, int from_tty)
void generic_mourn_inferior(void)
int target_has_registers()
void add_target(const target_info &t, target_open_ftype *func, completer_ftype *completer)
gdb::optional< gdb::byte_vector > target_read_alloc(struct target_ops *ops, enum target_object object, const char *annex)
void target_prepare_to_generate_core(void)
bool target_attach_no_wait()
void set_native_target(target_ops *target)
struct btrace_target_info * target_enable_btrace(thread_info *tp, const struct btrace_config *conf)
static void set_write_memory_permission(const char *args, int from_tty, struct cmd_list_element *c)
static void generic_tls_error(void)
void target_thread_events(int enable)
static void info_target_command(const char *args, int from_tty)
void target_stop(ptid_t ptid)
const char * target_thread_name(struct thread_info *info)
void target_announce_attach(int from_tty, int pid)
void target_teardown_btrace(struct btrace_target_info *btinfo)
std::string target_options_to_string(target_wait_flags target_options)
LONGEST target_read(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *buf, ULONGEST offset, LONGEST len)
bool target_supports_string_tracing()
const struct frame_unwind * target_get_unwinder(void)
static enum target_xfer_status memory_xfer_partial_1(struct target_ops *ops, enum target_object object, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST memaddr, ULONGEST len, ULONGEST *xfered_len)
const char * target_extra_thread_info(thread_info *tp)
void target_set_permissions()
bool target_is_non_stop_p()
static void set_maint_target_non_stop(auto_boolean enabled)
bool exists_non_stop_target()
void target_flash_done(void)
static void show_auto_connect_native_target(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void target_set_trace_buffer_size(LONGEST val)
bool target_fetch_memtags(CORE_ADDR address, size_t len, gdb::byte_vector &tags, int type)
int target_remove_breakpoint(struct gdbarch *gdbarch, struct bp_target_info *bp_tgt, enum remove_bp_reason reason)
static enum target_xfer_status target_read_partial(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *buf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
static gdb::unique_xmalloc_ptr< char > dummy_make_corefile_notes(struct target_ops *self, bfd *ignore1, int *ignore2)
static int default_search_memory(struct target_ops *self, CORE_ADDR start_addr, ULONGEST search_space_len, const gdb_byte *pattern, ULONGEST pattern_len, CORE_ADDR *found_addrp)
std::string target_pid_to_str(ptid_t ptid)
int target_info_proc(const char *args, enum info_proc_what what)
bool target_can_accel_watchpoint_condition(CORE_ADDR addr, int len, int type, expression *cond)
void target_resume(ptid_t scope_ptid, int step, enum gdb_signal signal)
LONGEST target_write_with_progress(struct target_ops *ops, enum target_object object, const char *annex, const gdb_byte *buf, ULONGEST offset, LONGEST len, void(*progress)(ULONGEST, void *), void *baton)
static int acquire_fileio_fd(target_ops *target, int target_fd)
std::string normal_pid_to_str(ptid_t ptid)
struct target_ops * find_target_at(enum strata stratum)
bool target_get_tib_address(ptid_t ptid, CORE_ADDR *addr)
static void set_maint_target_async(bool permitted)
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
int target_ranged_break_num_registers(void)
int target_fileio_unlink(struct inferior *inf, const char *filename, fileio_error *target_errno)
bool target_stopped_by_watchpoint()
static void open_target(const char *args, int from_tty, struct cmd_list_element *command)
void target_continue_no_signal(ptid_t ptid)
void target_stop_and_wait(ptid_t ptid)
std::vector< mem_region > target_memory_map(void)
static auto_boolean get_maint_target_non_stop()
static fileio_fh_t * fileio_fd_to_fh(int fd)
void target_preopen(int from_tty)
static bool may_write_memory_1
const target_section_table * default_get_section_table()
int target_search_memory(CORE_ADDR start_addr, ULONGEST search_space_len, const gdb_byte *pattern, ULONGEST pattern_len, CORE_ADDR *found_addrp)
void target_goto_record_begin(void)
gdb::optional< std::string > target_fileio_readlink(struct inferior *inf, const char *filename, fileio_error *target_errno)
void target_rcmd(const char *command, struct ui_file *outbuf)
enum btrace_error target_read_btrace(struct btrace_data *btrace, struct btrace_target_info *btinfo, enum btrace_read_type type)
int target_insert_vfork_catchpoint(int pid)
int target_write_raw_memory(CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
static bool may_insert_tracepoints_1
LONGEST target_write(struct target_ops *ops, enum target_object object, const char *annex, const gdb_byte *buf, ULONGEST offset, LONGEST len)
const struct btrace_config * target_btrace_conf(const struct btrace_target_info *btinfo)
ULONGEST get_target_memory_unsigned(struct target_ops *ops, CORE_ADDR addr, int len, enum bfd_endian byte_order)
bool target_stopped_by_sw_breakpoint()
CORE_ADDR target_translate_tls_address(struct objfile *objfile, CORE_ADDR offset)
static enum target_xfer_status target_write_partial(struct target_ops *ops, enum target_object object, const char *annex, const gdb_byte *buf, ULONGEST offset, LONGEST len, ULONGEST *xfered_len)
static enum exec_direction_kind default_execution_direction(struct target_ops *self)
void target_load(const char *arg, int from_tty)
bool target_supports_evaluation_of_breakpoint_conditions()
static void default_terminal_info(struct target_ops *self, const char *args, int from_tty)
static int default_region_ok_for_hw_watchpoint(struct target_ops *self, CORE_ADDR addr, int len)
bool target_supports_enable_disable_tracepoint()
bool target_augmented_libraries_svr4_read()
void target_delete_record(void)
int target_remove_vfork_catchpoint(int pid)
void target_pass_ctrlc(void)
const char * target_shortname()
void target_follow_exec(inferior *follow_inf, ptid_t ptid, const char *execd_pathname)
bool target_set_trace_notes(const char *user, const char *notes, const char *stopnotes)
int target_find_memory_regions(find_memory_region_ftype func, void *data)
void target_mourn_inferior(ptid_t ptid)
static int default_verify_memory(struct target_ops *self, const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size)
int target_remove_watchpoint(CORE_ADDR addr, int len, target_hw_bp_type type, expression *cond)
int target_thread_alive(ptid_t ptid)
int target_supports_disable_randomization(void)
static int target_always_non_stop_p(void)
static int memory_xfer_check_region(gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST memaddr, ULONGEST len, ULONGEST *reg_len, struct mem_region **region_p)
int target_set_syscall_catchpoint(int pid, bool needed, int any_count, gdb::array_view< const int > syscall_counts)
int target_save_trace_data(const char *filename)
static void default_rcmd(struct target_ops *self, const char *command, struct ui_file *output)
void update_target_permissions(void)
int target_verify_memory(const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size)
void target_store_registers(struct regcache *regcache, int regno)
target_xfer_partial_ftype target_xfer_partial
bool may_insert_fast_tracepoints
void target_close(struct target_ops *targ)
@ TARGET_XFER_UNAVAILABLE
void target_open_ftype(const char *args, int from_tty)
@ TARGET_OBJECT_RAW_MEMORY
@ TARGET_OBJECT_STACK_MEMORY
@ TARGET_OBJECT_CODE_MEMORY
bool may_insert_tracepoints
bool may_insert_breakpoints
int get_traceframe_number(void)
std::unique_ptr< traceframe_info > traceframe_info_up
int query(const char *ctlstr,...)
void gdb_printf(struct ui_file *stream, const char *format,...)
void gdb_puts(const char *linebuffer, struct ui_file *stream)