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 *>
126static int show_memory_breakpoints = 0;
146static unsigned int targetdebug = 0;
170 if (t->has_memory ())
194 if (t->has_registers ())
208 t =
inf->find_target_beneath (t))
209 if (t->has_execution (
inf))
355 gdb::array_view<const int> syscall_counts)
449gdb::unique_xmalloc_ptr<char>
683 CORE_ADDR addr1, CORE_ADDR addr2,
int *tpp)
754 const char *stopnotes)
782std::vector<static_tracepoint_marker>
829 const gdb::byte_vector &tags,
int type)
858 func (args, from_tty);
862 ti->shortname, args, from_tty);
873 auto &func_slot = target_factories[&t];
874 if (func_slot !=
nullptr)
875 internal_error (_(
"target already added (\"%s\")."), t.
shortname);
878 if (targetlist == NULL)
880Connect to a target machine or process.\n\
881The first argument is the type or protocol of the target machine.\n\
882Remaining arguments are interpreted by the target protocol. For more\n\
883information on the arguments for a particular protocol, type\n\
884`help target ' followed by the protocol name."),
905 gdb::unique_xmalloc_ptr<char> alt
906 = xstrprintf (
"target %s", tinfo.
shortname);
1053 &&
inf->terminal_state != desired_state)
1061 gdb_assert_not_reached (
"unhandled desired state");
1062 inf->terminal_state = desired_state;
1125 return inf->top_target ()->supports_terminal_ours ();
1131 error (_(
"You can't do that when your target is `%s'"),
1138 error (_(
"You can't do that without a process to debug."));
1144 gdb_printf (_(
"No saved terminal information.\n"));
1167 gdb_assert_not_reached (
"\
1168to_execution_direction must be implemented for reverse async");
1177 if (t->refcount () == 0)
1183 gdb_assert (!
inf->target_is_pushed (t));
1204 auto ref = target_ops_ref::new_reference (t);
1214 m_stack[stratum] = std::move (ref);
1216 if (m_top < stratum)
1228 gdb_assert (t != NULL);
1233 internal_error (_(
"Attempt to unpush the dummy target"));
1245 if (m_top == stratum)
1257 auto ref = std::move (
m_stack[stratum]);
1273 throw_error (TLS_GENERIC_ERROR,
1274 _(
"Cannot find thread-local variables on this target"));
1282 volatile CORE_ADDR addr = 0;
1311 catch (
const gdb_exception &ex)
1317 case TLS_NO_LIBRARY_SUPPORT_ERROR:
1318 error (_(
"Cannot find thread-local variables "
1319 "in this thread library."));
1321 case TLS_LOAD_MODULE_NOT_FOUND_ERROR:
1322 if (objfile_is_library)
1323 error (_(
"Cannot find shared library `%s' in dynamic"
1326 error (_(
"Cannot find executable file `%s' in dynamic"
1329 case TLS_NOT_ALLOCATED_YET_ERROR:
1330 if (objfile_is_library)
1331 error (_(
"The inferior has not yet allocated storage for"
1332 " thread-local variables in\n"
1333 "the shared library `%s'\n"
1338 error (_(
"The inferior has not yet allocated storage for"
1339 " thread-local variables in\n"
1340 "the executable `%s'\n"
1345 case TLS_GENERIC_ERROR:
1346 if (objfile_is_library)
1347 error (_(
"Cannot find thread-local storage for %s, "
1348 "shared library %s:\n%s"),
1352 error (_(
"Cannot find thread-local storage for %s, "
1353 "executable file %s:\n%s"),
1364 error (_(
"Cannot find thread-local variables on this target"));
1372#define CASE(X) case X: return #X
1402 if (
addr >= secp.addr &&
addr < secp.endaddr)
1427 ULONGEST memaddr, ULONGEST len, ULONGEST *reg_len,
1434 if (region_p != NULL)
1440 if (writebuf != NULL)
1445 if (readbuf != NULL)
1451 if (writebuf != NULL)
1452 error (_(
"Writing to flash memory forbidden in this context"));
1460 if (memaddr + len < region->
hi || region->
hi == 0)
1463 *reg_len = region->
hi - memaddr;
1474 const gdb_byte *writebuf, ULONGEST memaddr, LONGEST len,
1475 ULONGEST *xfered_len)
1482 readbuf, writebuf, memaddr, len,
1501 while (ops != NULL);
1508 if (writebuf != NULL
1517 dcache_update (dcache, res, memaddr, writebuf, *xfered_len);
1528 gdb_byte *readbuf,
const gdb_byte *writebuf, ULONGEST memaddr,
1529 ULONGEST len, ULONGEST *xfered_len)
1551 return (strcmp (section_name, s->the_bfd_section->name) == 0);
1555 memaddr, len, xfered_len,
1570 memaddr, len, xfered_len,
1599 reg_len, xfered_len);
1625 gdb_byte *readbuf,
const gdb_byte *writebuf,
1626 ULONGEST memaddr, ULONGEST len, ULONGEST *xfered_len)
1639 if (readbuf != NULL)
1657 gdb::byte_vector buf (writebuf, writebuf + len);
1666scoped_restore_tmpl<int>
1669 return make_scoped_restore (&show_memory_breakpoints, show);
1677 gdb_byte *readbuf,
const gdb_byte *writebuf,
1678 ULONGEST offset, ULONGEST len,
1679 ULONGEST *xfered_len)
1688 error (_(
"Writing to memory is not allowed (addr %s, len %s)"),
1689 core_addr_to_string_nz (offset), plongest (len));
1699 writebuf, offset, len, xfered_len);
1718 writebuf, offset, len, xfered_len);
1722 const unsigned char *myaddr = NULL;
1725 "%s:target_xfer_partial "
1726 "(%d, %s, %s, %s, %s, %s) = %d, %s",
1729 (annex ? annex :
"(null)"),
1730 host_address_to_string (readbuf),
1731 host_address_to_string (writebuf),
1732 core_addr_to_string_nz (offset),
1733 pulongest (len), retval,
1734 pulongest (*xfered_len));
1745 for (i = 0; i < *xfered_len; i++)
1747 if ((((intptr_t) &(myaddr[i])) & 0xf) == 0)
1749 if (targetdebug < 2 && i > 0)
1768 gdb_assert (*xfered_len > 0);
1789 myaddr, memaddr, len) == len)
1820 myaddr, memaddr, len) == len)
1834 myaddr, memaddr, len) == len)
1848 myaddr, memaddr, len) == len)
1865 myaddr, memaddr, len) == len)
1882 myaddr, memaddr, len) == len)
1890std::vector<mem_region>
1894 std::vector<mem_region> result = target->memory_map ();
1895 if (result.empty ())
1898 std::sort (result.begin (), result.end ());
1904 for (
size_t ix = 0; ix < result.size (); ix++)
1909 if (last_one != NULL && last_one->
hi > this_one->
lo)
1911 warning (_(
"Overlapping regions in memory map: ignoring"));
1912 return std::vector<mem_region> ();
1915 last_one = this_one;
1938 _(
"Mode for reading from readonly sections is %s.\n"),
1947 const char *annex, gdb_byte *buf,
1948 ULONGEST offset, ULONGEST len,
1949 ULONGEST *xfered_len)
1958 const char *annex,
const gdb_byte *buf,
1959 ULONGEST offset, LONGEST len, ULONGEST *xfered_len)
1972 const char *annex, gdb_byte *buf,
1973 ULONGEST offset, LONGEST len)
1975 LONGEST xfered_total = 0;
1986 while (xfered_total < len)
1988 ULONGEST xfered_partial;
1992 buf + xfered_total * unit_size,
1993 offset + xfered_total, len - xfered_total,
1998 return xfered_total;
2001 xfered_total += xfered_partial;
2034 const ULONGEST begin,
const ULONGEST end,
2036 std::vector<memory_read_result> *result)
2038 ULONGEST current_begin = begin;
2039 ULONGEST current_end = end;
2041 ULONGEST xfered_len;
2044 if (end - begin <= 1)
2047 gdb::unique_xmalloc_ptr<gdb_byte> buf ((gdb_byte *)
xmalloc (end - begin));
2059 buf.get () + (end - begin) - 1, end - 1, 1,
2073 while (current_end - current_begin > 1)
2075 ULONGEST first_half_begin, first_half_end;
2076 ULONGEST second_half_begin, second_half_end;
2078 ULONGEST middle = current_begin + (current_end - current_begin) / 2;
2082 first_half_begin = current_begin;
2083 first_half_end = middle;
2084 second_half_begin = middle;
2085 second_half_end = current_end;
2089 first_half_begin = middle;
2090 first_half_end = current_end;
2091 second_half_begin = current_begin;
2092 second_half_end = middle;
2096 buf.get () + (first_half_begin - begin) * unit_size,
2098 first_half_end - first_half_begin);
2100 if (xfer == first_half_end - first_half_begin)
2104 current_begin = second_half_begin;
2105 current_end = second_half_end;
2115 current_begin = first_half_begin;
2116 current_end = first_half_end;
2123 result->emplace_back (begin, current_end, std::move (buf));
2128 LONGEST region_len = end - current_end;
2130 gdb::unique_xmalloc_ptr<gdb_byte> data
2131 ((gdb_byte *)
xmalloc (region_len * unit_size));
2132 memcpy (data.get (), buf.get () + (current_end - begin) * unit_size,
2133 region_len * unit_size);
2134 result->emplace_back (current_end, end, std::move (data));
2138std::vector<memory_read_result>
2140 const ULONGEST offset,
const LONGEST len)
2142 std::vector<memory_read_result> result;
2145 LONGEST xfered_total = 0;
2146 while (xfered_total < len)
2152 gdb_assert (region);
2154 if (region->
hi == 0)
2155 region_len = len - xfered_total;
2157 region_len = region->
hi - offset;
2164 xfered_total += region_len;
2168 LONGEST to_read = std::min (len - xfered_total, region_len);
2169 gdb::unique_xmalloc_ptr<gdb_byte> buffer
2170 ((gdb_byte *)
xmalloc (to_read * unit_size));
2172 LONGEST xfered_partial =
2174 offset + xfered_total, to_read);
2176 if (xfered_partial <= 0)
2181 offset + xfered_total + to_read,
2182 unit_size, &result);
2183 xfered_total += to_read;
2187 result.emplace_back (offset + xfered_total,
2188 offset + xfered_total + xfered_partial,
2189 std::move (buffer));
2190 xfered_total += xfered_partial;
2205 const char *annex,
const gdb_byte *buf,
2206 ULONGEST offset, LONGEST len,
2207 void (*progress) (ULONGEST,
void *),
void *baton)
2209 LONGEST xfered_total = 0;
2222 (*progress) (0, baton);
2224 while (xfered_total < len)
2226 ULONGEST xfered_partial;
2230 buf + xfered_total * unit_size,
2231 offset + xfered_total, len - xfered_total,
2238 (*progress) (xfered_partial, baton);
2240 xfered_total += xfered_partial;
2251 const char *annex,
const gdb_byte *buf,
2252 ULONGEST offset, LONGEST len)
2261template <
typename T>
2262gdb::optional<gdb::def_vector<T>>
2266 gdb::def_vector<T> buf;
2268 const int chunk = 4096;
2281 ULONGEST xfered_len;
2284 buf.resize (buf_pos + chunk);
2287 (gdb_byte *) &buf[buf_pos],
2294 buf.resize (buf_pos);
2303 buf_pos += xfered_len;
2311gdb::optional<gdb::byte_vector>
2315 return target_read_alloc_1<gdb_byte> (ops,
object, annex);
2320gdb::optional<gdb::char_vector>
2324 gdb::optional<gdb::char_vector> buf
2325 = target_read_alloc_1<char> (ops,
object, annex);
2330 if (buf->empty () || buf->back () !=
'\0')
2331 buf->push_back (
'\0');
2334 for (
auto it = std::find (buf->begin (), buf->end (),
'\0');
2335 it != buf->end (); it++)
2338 warning (_(
"target object %d, annex %s, "
2339 "contained unexpected null characters"),
2340 (
int)
object, annex ? annex :
"(none)");
2364 int len,
enum bfd_endian byte_order)
2366 gdb_byte buf[
sizeof (ULONGEST)];
2368 gdb_assert (len <=
sizeof (buf));
2381 warning (_(
"May not insert breakpoints"));
2403 warning (_(
"May not remove breakpoints"));
2415 int has_all_mem = 0;
2428 if (!t->has_memory ())
2435 "GDB does not access memory from...\n"));
2438 has_all_mem = t->has_all_memory ();
2488 agent_capability_invalidate ();
2503 ||
query (_(
"A program is being debugged already. Kill it? ")))
2513 error (_(
"Program not killed."));
2539 ptid_t save_pid_ptid = ptid_t (
inf->
pid);
2554 auto proc_target_ref = target_ops_ref::new_reference (
inf->process_target ());
2587 target_wait_flags options)
2600 ptid_t event_ptid = target->
wait (ptid,
status, options);
2616 target_wait_flags options)
2619 return minus_one_ptid;
2648gdb::array_view<const gdb_byte>
2653 return target->thread_info_to_thread_handle (tip);
2715 internal_error (_(
"could not find a target to follow fork"));
2729 if (child_inf !=
nullptr)
2732 gdb_assert (child_inf->
pid == child_ptid.pid ());
2737 return target->
follow_fork (child_inf, child_ptid, fork_kind, follow_child,
2745 const char *execd_pathname)
2754 internal_error (_(
"could not find a target to follow mourn inferior"));
2766 bfd_cache_close_all ();
2783 CORE_ADDR start_addr, ULONGEST search_space_len,
2784 const gdb_byte *pattern, ULONGEST pattern_len,
2785 CORE_ADDR *found_addrp)
2787 auto read_memory = [=] (CORE_ADDR addr, gdb_byte *result,
size_t len)
2791 result, addr, len) == len;
2795 return simple_search_memory (
read_memory, start_addr, search_space_len,
2796 pattern, pattern_len, found_addrp);
2808 const gdb_byte *pattern, ULONGEST pattern_len,
2809 CORE_ADDR *found_addrp)
2813 return target->
search_memory (start_addr, search_space_len, pattern,
2814 pattern_len, found_addrp);
2832 if (t->can_create_inferior ())
2841 error (_(
"The \"%s\" target does not support \"run\". "
2842 "Try \"help target\" or \"continue\"."),
2849 internal_error (_(
"No targets found"));
2861 _(
"Whether GDB may automatically connect to the "
2862 "native target is %s.\n"),
2877 internal_error (_(
"native target already set (\"%s\")."),
2904 if (do_mesg != NULL)
2905 error (_(
"Don't know how to %s. Try \"help target\"."), do_mesg);
2919 if (t->can_attach ())
2937 if (t->can_create_inferior ())
2965 for (; t != NULL; t = t->
beneath ())
2971 "target_info_proc (\"%s\", %d)\n", args, what);
3007gdb::optional<gdb::char_vector>
3033 gdb_assert (aspace != NULL);
3060 gdb_assert_not_reached (
"target_ops::attach called");
3073 gdb_assert_not_reached (
"target_ops::create_inferior called");
3147 if (fh.target == targ)
3204 int flags,
int mode,
int warn_if_slow,
3205 fileio_error *target_errno)
3207 *target_errno = FILEIO_ENOSYS;
3213 ULONGEST offset, fileio_error *target_errno)
3215 *target_errno = FILEIO_ENOSYS;
3221 ULONGEST offset, fileio_error *target_errno)
3223 *target_errno = FILEIO_ENOSYS;
3230 *target_errno = FILEIO_ENOSYS;
3237 *target_errno = FILEIO_ENOSYS;
3243 fileio_error *target_errno)
3245 *target_errno = FILEIO_ENOSYS;
3249gdb::optional<std::string>
3251 fileio_error *target_errno)
3253 *target_errno = FILEIO_ENOSYS;
3261 int flags,
int mode,
bool warn_if_slow, fileio_error *target_errno)
3265 int fd = t->fileio_open (
inf, filename,
flags, mode,
3266 warn_if_slow, target_errno);
3268 if (fd == -1 && *target_errno == FILEIO_ENOSYS)
3278 "target_fileio_open (%d,%s,0x%x,0%o,%d)"
3280 inf == NULL ? 0 :
inf->num,
3281 filename,
flags, mode,
3283 fd != -1 ? 0 : *target_errno);
3287 *target_errno = FILEIO_ENOSYS;
3295 ULONGEST offset, fileio_error *target_errno)
3301 *target_errno = FILEIO_EBADF;
3302 else if (fh->
target == NULL)
3303 *target_errno = FILEIO_EIO;
3306 len, offset, target_errno);
3310 "target_fileio_pwrite (%d,...,%d,%s) "
3312 fd, len, pulongest (offset),
3313 ret, ret != -1 ? 0 : *target_errno);
3321 ULONGEST offset, fileio_error *target_errno)
3327 *target_errno = FILEIO_EBADF;
3328 else if (fh->
target == NULL)
3329 *target_errno = FILEIO_EIO;
3332 len, offset, target_errno);
3336 "target_fileio_pread (%d,...,%d,%s) "
3338 fd, len, pulongest (offset),
3339 ret, ret != -1 ? 0 : *target_errno);
3352 *target_errno = FILEIO_EBADF;
3353 else if (fh->
target == NULL)
3354 *target_errno = FILEIO_EIO;
3360 "target_fileio_fstat (%d) = %d (%d)\n",
3361 fd, ret, ret != -1 ? 0 : *target_errno);
3374 *target_errno = FILEIO_EBADF;
3387 "target_fileio_close (%d) = %d (%d)\n",
3388 fd, ret, ret != -1 ? 0 : *target_errno);
3396 fileio_error *target_errno)
3400 int ret = t->fileio_unlink (
inf, filename, target_errno);
3402 if (ret == -1 && *target_errno == FILEIO_ENOSYS)
3407 "target_fileio_unlink (%d,%s)"
3409 inf == NULL ? 0 :
inf->num, filename,
3410 ret, ret != -1 ? 0 : *target_errno);
3414 *target_errno = FILEIO_ENOSYS;
3420gdb::optional<std::string>
3422 fileio_error *target_errno)
3426 gdb::optional<std::string> ret
3427 = t->fileio_readlink (
inf, filename, target_errno);
3429 if (!ret.has_value () && *target_errno == FILEIO_ENOSYS)
3434 "target_fileio_readlink (%d,%s)"
3436 inf == NULL ? 0 :
inf->num,
3437 filename, ret ? ret->c_str () :
"(nil)",
3438 ret ? 0 : *target_errno);
3442 *target_errno = FILEIO_ENOSYS;
3460 fileio_error target_errno;
3487 gdb_byte **buf_p,
int padding)
3489 size_t buf_alloc, buf_pos;
3492 fileio_error target_errno;
3495 0700,
false, &target_errno));
3496 if (fd.
get () == -1)
3502 buf = (gdb_byte *)
xmalloc (buf_alloc);
3507 buf_alloc - buf_pos - padding, buf_pos,
3528 if (buf_alloc < buf_pos * 2)
3531 buf = (gdb_byte *)
xrealloc (buf, buf_alloc);
3549gdb::unique_xmalloc_ptr<char>
3554 LONGEST i, transferred;
3557 bufstr = (
char *) buffer;
3559 if (transferred < 0)
3560 return gdb::unique_xmalloc_ptr<char> (
nullptr);
3562 if (transferred == 0)
3563 return make_unique_xstrdup (
"");
3565 bufstr[transferred] = 0;
3568 for (i = strlen (bufstr); i < transferred; i++)
3571 warning (_(
"target file %s "
3572 "contained unexpected null characters"),
3577 return gdb::unique_xmalloc_ptr<char> (bufstr);
3583 CORE_ADDR addr,
int len)
3591 CORE_ADDR start,
int length)
3593 return addr >= start && addr < start + length;
3602 for (
int stratum = t->
stratum () - 1; stratum >= 0; --stratum)
3625 const char *exec_file;
3632 if (exec_file ==
nullptr)
3636 gdb_printf (_(
"Detaching from program: %s, %s\n"), exec_file,
3650 if (exec_file !=
nullptr)
3651 gdb_printf (
"Attaching to program: %s, %s\n", exec_file,
3695 return string_printf (
"process %d", ptid.pid ());
3709 error (_(
"Command not implemented for this target."));
3714static gdb::unique_xmalloc_ptr<char>
3716 bfd *ignore1,
int *ignore2)
3718 error (_(
"Command not implemented for this target."));
3790 warning (_(
"May not interrupt or stop the target, ignoring attempt"));
3802 warning (_(
"May not interrupt or stop the target, ignoring attempt"));
3819 if (proc_target == NULL)
3888 if (!list->empty ())
3889 list->append (
", ");
3891 list->append (elem);
3899do_option (target_wait_flags *target_options, std::string *ret,
3902 if ((*target_options & opt) != 0)
3905 *target_options &= ~opt;
3916#define DO_TARG_OPTION(OPT) \
3917 do_option (&target_options, &ret, OPT, #OPT)
3921 if (target_options != 0)
3939 error (_(
"Writing to registers is not allowed (regno %d)"), regno);
3956 const gdb_byte *data, CORE_ADDR lma, ULONGEST
size)
3958 LONGEST total_xfered = 0;
3960 while (total_xfered <
size)
3962 ULONGEST xfered_len;
3965 ULONGEST howmuch = std::min<ULONGEST> (
sizeof (buf),
size - total_xfered);
3968 buf, NULL, lma + total_xfered, howmuch,
3971 && memcmp (data + total_xfered, buf, xfered_len) == 0)
3973 total_xfered += xfered_len;
3986 const gdb_byte *data, CORE_ADDR memaddr, ULONGEST
size)
3990 data, memaddr,
size);
4006 enum target_hw_bp_type rw)
4018 enum target_hw_bp_type rw)
4047struct btrace_target_info *
4073 struct btrace_target_info *btinfo,
4074 enum btrace_read_type
type)
4083const struct btrace_config *
4189 gdb_disassembly_flags
flags)
4198 gdb_disassembly_flags
flags)
4262"Names of targets and files being debugged.\nShows the entire \
4263stack of targets currently in use (including the exec-file,\n\
4264core-file, and process, if any), as well as the symbol file name.";
4270 error (_(
"\"monitor\" command not supported by this target."));
4286 bool found_flash_region =
false;
4297 found_flash_region =
true;
4302 current_uiout->message (_(
"Erasing flash memory region at address "));
4305 current_uiout->field_string (
"size", hex_string (m.hi - m.lo));
4311 if (found_flash_region)
4314 current_uiout->message (_(
"No flash memory regions found.\n"));
4322 gdb_printf (_(
"The current target stack is:\n"));
4330 gdb_printf (
" - %s (%s)\n", t->shortname (), t->longname ());
4362 error (_(
"Cannot change this setting while the inferior is running."));
4378 _(
"Controlling the inferior in "
4379 "asynchronous mode is %s.\n"),
value);
4433 error (_(
"Cannot change this setting while the inferior is running."));
4452 _(
"Whether the target is always in non-stop mode "
4453 "is %s (currently %s).\n"),
value,
4457 _(
"Whether the target is always in non-stop mode "
4458 "is %s.\n"),
value);
4493 error (_(
"Cannot change this setting while the inferior is running."));
4527Set target debugging."), _(
"\
4528Show target debugging."), _(
"\
4529When non-zero, target debugging is enabled. Higher numbers are more\n\
4537Set mode for reading from readonly sections."), _(
"\
4538Show mode for reading from readonly sections."), _(
"\
4539When this mode is on, memory reads from readonly sections (such as .text)\n\
4540will be read from the object file instead of from the target. This will\n\
4541result in significant performance improvement for remote targets."),
4547 _(
"Send a command to the remote monitor (remote targets only)."));
4550 _(
"Print the name of each layer of the internal target stack."),
4555Set whether gdb controls the inferior in asynchronous mode."), _(
"\
4556Show whether gdb controls the inferior in asynchronous mode."), _(
"\
4557Tells gdb whether to control the inferior in asynchronous mode."),
4566Set whether gdb always controls the inferior in non-stop mode."), _(
"\
4567Show whether gdb always controls the inferior in non-stop mode."), _(
"\
4568Tells gdb whether to control the inferior in non-stop mode."),
4577Set permission to write into registers."), _(
"\
4578Show permission to write into registers."), _(
"\
4579When this permission is on, GDB may write into the target's registers.\n\
4580Otherwise, any sort of write attempt will result in an error."),
4586Set permission to write into target memory."), _(
"\
4587Show permission to write into target memory."), _(
"\
4588When this permission is on, GDB may write into the target's memory.\n\
4589Otherwise, any sort of write attempt will result in an error."),
4595Set permission to insert breakpoints in the target."), _(
"\
4596Show permission to insert breakpoints in the target."), _(
"\
4597When this permission is on, GDB may insert breakpoints in the program.\n\
4598Otherwise, any sort of insertion attempt will result in an error."),
4604Set permission to insert tracepoints in the target."), _(
"\
4605Show permission to insert tracepoints in the target."), _(
"\
4606When this permission is on, GDB may insert tracepoints in the program.\n\
4607Otherwise, any sort of insertion attempt will result in an error."),
4613Set permission to insert fast tracepoints in the target."), _(
"\
4614Show permission to insert fast tracepoints in the target."), _(
"\
4615When this permission is on, GDB may insert fast tracepoints.\n\
4616Otherwise, any sort of insertion attempt will result in an error."),
4622Set permission to interrupt or signal the target."), _(
"\
4623Show permission to interrupt or signal the target."), _(
"\
4624When this permission is on, GDB may interrupt/stop the target's execution.\n\
4625Otherwise, any attempt to interrupt or stop will be ignored."),
4630 _(
"Erase all flash memory regions."));
4634Set whether GDB may automatically connect to the native target."), _(
"\
4635Show whether GDB may automatically connect to the native target."), _(
"\
4636When on, and GDB is not connected to a target yet, GDB\n\
4637attempts \"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 set_current_inferior(struct inferior *inf)
int have_live_inferiors(void)
struct inferior * current_inferior(void)
void switch_to_inferior_no_thread(inferior *inf)
void exit_inferior(struct inferior *inf)
all_inferiors_range all_inferiors(process_stratum_target *proc_target=nullptr)
void infrun_async(int enable)
void update_previous_thread()
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
observable< struct inferior * > inferior_pre_detach
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)
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 get_tracepoint_status(tracepoint *tp, struct uploaded_tp *utp) TARGET_DEFAULT_NORETURN(tcomplain())
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 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::array_view< const_gdb_byte > 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 x86_xsave_layout fetch_x86_xsave_layout() TARGET_DEFAULT_RETURN(x86_xsave_layout())
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)
bool pc_in_unmapped_range(CORE_ADDR pc, struct obj_section *section)
CORE_ADDR overlay_mapped_address(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)
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)
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::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()
x86_xsave_layout target_fetch_x86_xsave_layout()
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 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)
gdb::array_view< const gdb_byte > target_thread_info_to_thread_handle(struct thread_info *tip)
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
void target_get_tracepoint_status(tracepoint *tp, uploaded_tp *utp)
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)
static void set_write_memory_registers_permission(const char *args, int from_tty, struct cmd_list_element *c)
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 fileio_handles_invalidate_target(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)