42 #include "gdb/fileio.h" 85 static void tcomplain (
void) ATTRIBUTE_NORETURN;
101 bfd *ignore1,
int *ignore2);
119 static VEC (target_ops_p) *target_structs;
142 static int trust_readonly = 0;
147 static int show_memory_breakpoints = 0;
167 static unsigned int targetdebug = 0;
170 set_targetdebug (
const char *args,
int from_tty,
struct cmd_list_element *c)
189 fputs_filtered (
"Argument required (target name). Try `help target'\n",
377 if (targetlist == NULL)
379 Connect to a target machine or process.\n\ 380 The first argument is the type or protocol of the target machine.\n\ 381 Remaining arguments are interpreted by the target protocol. For more\n\ 382 information on the arguments for a particular protocol, type\n\ 383 `help target ' followed by the protocol name."),
384 &targetlist,
"target ", 0, &
cmdlist);
543 error (
_(
"You can't do that when your target is `%s'"),
550 error (
_(
"You can't do that without a process to debug."));
580 to_execution_direction must be implemented for reverse async");
608 #define INHERIT(FIELD, TARGET) \ 609 if (!current_target.FIELD) \ 610 current_target.FIELD = (TARGET)->FIELD 614 for (t = target_stack; t; t = t->
beneath)
651 "Magic number of %s target struct wrong\n",
654 _(
"failed internal consistency check"));
658 for (cur = &target_stack; (*cur) != NULL; cur = &(*cur)->
beneath)
660 if ((
int) (t->
to_stratum) >= (
int) (*cur)->to_stratum)
667 while ((*cur) != NULL && t->
to_stratum == (*cur)->to_stratum)
696 _(
"Attempt to unpush the dummy target"));
701 for (cur = &target_stack; (*cur) != NULL; cur = &(*cur)->
beneath)
735 "pop_all_targets couldn't find target %s\n",
738 _(
"failed internal consistency check"));
776 "Magic number of %s target struct wrong\n",
779 _(
"failed internal consistency check"));
782 for (cur = target_stack; cur != NULL; cur = cur->
beneath)
795 _(
"Cannot find thread-local variables on this target"));
830 error (
_(
"Cannot find thread-local variables " 831 "in this thread library."));
834 if (objfile_is_library)
835 error (
_(
"Cannot find shared library `%s' in dynamic" 838 error (
_(
"Cannot find executable file `%s' in dynamic" 842 if (objfile_is_library)
843 error (
_(
"The inferior has not yet allocated storage for" 844 " thread-local variables in\n" 845 "the shared library `%s'\n" 849 error (
_(
"The inferior has not yet allocated storage for" 850 " thread-local variables in\n" 851 "the executable `%s'\n" 856 if (objfile_is_library)
857 error (
_(
"Cannot find thread-local storage for %s, " 858 "shared library %s:\n%s"),
862 error (
_(
"Cannot find thread-local storage for %s, " 863 "executable file %s:\n%s"),
877 error (
_(
"Cannot find thread-local variables on this target"));
885 #define CASE(X) case X: return #X 898 #define MIN(A, B) (((A) <= (B)) ? (A) : (B)) 913 int buffer_allocated;
915 unsigned int nbytes_read = 0;
920 buffer_allocated = 4;
926 tlen =
MIN (len, 4 - (memaddr & 3));
942 if (bufptr -
buffer + tlen > buffer_allocated)
947 buffer_allocated *= 2;
952 for (i = 0; i < tlen; i++)
954 *bufptr++ = buf[i +
offset];
955 if (buf[i +
offset] ==
'\000')
957 nbytes_read += i + 1;
990 for (secp = table->
sections; secp < table->sections_end; secp++)
1017 if (region_p != NULL)
1023 if (writebuf != NULL)
1028 if (readbuf != NULL)
1034 if (writebuf != NULL)
1035 error (
_(
"Writing to flash memory forbidden in this context"));
1043 if (memaddr + len < region->
hi || region->
hi == 0)
1046 *reg_len = region->
hi - memaddr;
1065 readbuf, writebuf, memaddr, len,
1081 while (ops != NULL);
1088 if (writebuf != NULL
1097 dcache_update (dcache, res, memaddr, writebuf, *xfered_len);
1130 memaddr, len, xfered_len,
1138 if (readbuf != NULL && trust_readonly)
1151 memaddr, len, xfered_len,
1182 reg_len, xfered_len);
1222 if (readbuf != NULL)
1273 error (
_(
"Writing to memory is not allowed (addr %s, len %s)"),
1284 writebuf,
offset, len, xfered_len);
1303 writebuf,
offset, len, xfered_len);
1307 const unsigned char *myaddr = NULL;
1310 "%s:target_xfer_partial " 1311 "(%d, %s, %s, %s, %s, %s) = %d, %s",
1314 (annex ? annex :
"(null)"),
1330 for (i = 0; i < *xfered_len; i++)
1332 if ((((intptr_t) &(myaddr[i])) & 0xf) == 0)
1334 if (targetdebug < 2 && i > 0)
1376 myaddr, memaddr, len) == len)
1408 myaddr, memaddr, len) == len)
1423 myaddr, memaddr, len) == len)
1438 myaddr, memaddr, len) == len)
1456 myaddr, memaddr, len) == len)
1474 myaddr, memaddr, len) == len)
1482 std::vector<mem_region>
1485 std::vector<mem_region> result
1487 if (result.empty ())
1490 std::sort (result.begin (), result.end ());
1496 for (
size_t ix = 0; ix < result.size (); ix++)
1501 if (last_one != NULL && last_one->hi > this_one->
lo)
1503 warning (
_(
"Overlapping regions in memory map: ignoring"));
1504 return std::vector<mem_region> ();
1507 last_one = this_one;
1530 _(
"Mode for reading from readonly sections is %s.\n"),
1550 const char *annex,
const gdb_byte *buf,
1578 while (xfered_total < len)
1584 buf + xfered_total * unit_size,
1585 offset + xfered_total, len - xfered_total,
1590 return xfered_total;
1593 xfered_total += xfered_partial;
1628 std::vector<memory_read_result> *result)
1636 if (end - begin <= 1)
1651 buf.get () + (end - begin) - 1, end - 1, 1,
1665 while (current_end - current_begin > 1)
1667 ULONGEST first_half_begin, first_half_end;
1668 ULONGEST second_half_begin, second_half_end;
1670 ULONGEST middle = current_begin + (current_end - current_begin) / 2;
1674 first_half_begin = current_begin;
1675 first_half_end = middle;
1676 second_half_begin = middle;
1677 second_half_end = current_end;
1681 first_half_begin = middle;
1682 first_half_end = current_end;
1683 second_half_begin = current_begin;
1684 second_half_end = middle;
1688 buf.get () + (first_half_begin - begin) * unit_size,
1690 first_half_end - first_half_begin);
1692 if (xfer == first_half_end - first_half_begin)
1696 current_begin = second_half_begin;
1697 current_end = second_half_end;
1707 current_begin = first_half_begin;
1708 current_end = first_half_end;
1715 result->emplace_back (begin, current_end, std::move (buf));
1720 LONGEST region_len = end - current_end;
1724 memcpy (data.get (), buf.get () + (current_end - begin) * unit_size,
1725 region_len * unit_size);
1726 result->emplace_back (current_end, end, std::move (data));
1730 std::vector<memory_read_result>
1734 std::vector<memory_read_result> result;
1738 while (xfered_total < len)
1746 if (region->
hi == 0)
1747 region_len = len - xfered_total;
1756 xfered_total += region_len;
1760 LONGEST to_read = std::min (len - xfered_total, region_len);
1766 offset + xfered_total, to_read);
1768 if (xfered_partial <= 0)
1773 offset + xfered_total + to_read,
1774 unit_size, &result);
1775 xfered_total += to_read;
1779 result.emplace_back (
offset + xfered_total,
1780 offset + xfered_total + xfered_partial,
1782 xfered_total += xfered_partial;
1797 const char *annex,
const gdb_byte *buf,
1799 void (*progress) (
ULONGEST,
void *),
void *baton)
1814 (*progress) (0, baton);
1816 while (xfered_total < len)
1822 buf + xfered_total * unit_size,
1823 offset + xfered_total, len - xfered_total,
1830 (*progress) (xfered_partial, baton);
1832 xfered_total += xfered_partial;
1843 const char *annex,
const gdb_byte *buf,
1858 const char *annex,
gdb_byte **buf_p,
int padding)
1860 size_t buf_alloc, buf_pos;
1881 buf_pos, buf_alloc - buf_pos - padding,
1900 buf_pos += xfered_len;
1903 if (buf_alloc < buf_pos * 2)
1919 const char *annex,
gdb_byte **buf_p)
1935 bufstr = (
char *)
buffer;
1937 if (transferred < 0)
1940 if (transferred == 0)
1943 bufstr[transferred] = 0;
1946 for (i = strlen (bufstr); i < transferred; i++)
1949 warning (
_(
"target object %d, annex %s, " 1950 "contained unexpected null characters"),
1951 (
int)
object, annex ? annex :
"(none)");
1975 int len,
enum bfd_endian byte_order)
1992 warning (
_(
"May not insert breakpoints"));
2013 warning (
_(
"May not remove breakpoints"));
2025 int has_all_mem = 0;
2031 for (t = target_stack; t != NULL; t = t->
beneath)
2040 "GDB does not access memory from...\n"));
2129 ||
query (
_(
"A program is being debugged already. Kill it? ")))
2132 error (
_(
"Program not killed."));
2260 numsigs, program_signals);
2269 _(
"could not find a target to follow fork"));
2294 _(
"could not find a target to follow mourn inferior"));
2306 bfd_cache_close_all ();
2329 #define SEARCH_CHUNK_SIZE 16000 2332 unsigned search_buf_size;
2334 search_buf_size = chunk_size + pattern_len - 1;
2337 if (search_space_len < search_buf_size)
2338 search_buf_size = search_space_len;
2345 search_buf.data (), start_addr, search_buf_size)
2348 warning (
_(
"Unable to access %s bytes of target " 2349 "memory at %s, halting search."),
2360 while (search_space_len >= pattern_len)
2363 unsigned nr_search_bytes
2364 = std::min (search_space_len, (
ULONGEST) search_buf_size);
2366 found_ptr = (
gdb_byte *) memmem (search_buf.data (), nr_search_bytes,
2367 pattern, pattern_len);
2369 if (found_ptr != NULL)
2371 CORE_ADDR found_addr = start_addr + (found_ptr - search_buf.data ());
2373 *found_addrp = found_addr;
2380 if (search_space_len >= chunk_size)
2381 search_space_len -= chunk_size;
2383 search_space_len = 0;
2385 if (search_space_len >= pattern_len)
2387 unsigned keep_len = search_buf_size - chunk_size;
2388 CORE_ADDR read_addr = start_addr + chunk_size + keep_len;
2394 memcpy (&search_buf[0], &search_buf[chunk_size], keep_len);
2396 nr_to_read = std::min (search_space_len - keep_len,
2400 &search_buf[keep_len], read_addr,
2401 nr_to_read) != nr_to_read)
2403 warning (
_(
"Unable to access %s bytes of target " 2404 "memory at %s, halting search."),
2410 start_addr += chunk_size;
2429 start_addr, search_space_len,
2430 pattern, pattern_len, found_addrp);
2447 pattern, pattern_len, found_addrp);
2459 for (t = target_stack; t != NULL; t = t->
beneath)
2476 error (
_(
"The \"%s\" target does not support \"run\". " 2477 "Try \"help target\" or \"continue\"."),
2496 _(
"Whether GDB may automatically connect to the " 2497 "native target is %s.\n"),
2519 for (i = 0;
VEC_iterate (target_ops_p, target_structs, i, t); ++i)
2532 if (runable == NULL)
2535 error (
_(
"Don't know how to %s. Try \"help target\"."), do_mesg);
2600 for (; t != NULL; t = t->
beneath)
2608 "target_info_proc (\"%s\", %d)\n", args, what);
2677 if (
inf == NULL ||
inf->aspace == NULL)
2679 _(
"Can't determine the current " 2680 "address space of thread %s\n"),
2734 #define is_closed_fileio_fh(fd) ((fd) < 0) 2739 static int lowest_closed_fd;
2744 acquire_fileio_fd (
struct target_ops *t,
int fd)
2753 lowest_closed_fd, fh);
2768 return lowest_closed_fd++;
2777 lowest_closed_fd = std::min (lowest_closed_fd, fd);
2782 #define fileio_fd_to_fh(fd) \ 2783 VEC_index (fileio_fh_t, fileio_fhandles, (fd)) 2790 int flags,
int mode,
int warn_if_slow,
2800 warn_if_slow, target_errno);
2805 fd = acquire_fileio_fd (t, fd);
2809 "target_fileio_open (%d,%s,0x%x,0%o,%d)" 2811 inf == NULL ? 0 :
inf->num,
2812 filename,
flags, mode,
2814 fd != -1 ? 0 : *target_errno);
2819 *target_errno = FILEIO_ENOSYS;
2827 int flags,
int mode,
int *target_errno)
2837 const char *filename,
2838 int flags,
int mode,
int *target_errno)
2854 *target_errno = EBADF;
2857 len,
offset, target_errno);
2861 "target_fileio_pwrite (%d,...,%d,%s) " 2864 ret, ret != -1 ? 0 : *target_errno);
2878 *target_errno = EBADF;
2881 len,
offset, target_errno);
2885 "target_fileio_pread (%d,...,%d,%s) " 2888 ret, ret != -1 ? 0 : *target_errno);
2901 *target_errno = EBADF;
2907 "target_fileio_fstat (%d) = %d (%d)\n",
2908 fd, ret, ret != -1 ? 0 : *target_errno);
2921 *target_errno = EBADF;
2930 "target_fileio_close (%d) = %d (%d)\n",
2931 fd, ret, ret != -1 ? 0 : *target_errno);
2952 "target_fileio_unlink (%d,%s)" 2954 inf == NULL ? 0 :
inf->num, filename,
2955 ret, ret != -1 ? 0 : *target_errno);
2960 *target_errno = FILEIO_ENOSYS;
2981 "target_fileio_readlink (%d,%s)" 2983 inf == NULL ? 0 :
inf->num,
2984 filename, ret? ret :
"(nil)",
2985 ret? 0 : *target_errno);
2990 *target_errno = FILEIO_ENOSYS;
2997 int fd = *(
int *) opaque;
3015 struct cleanup *close_cleanup;
3016 size_t buf_alloc, buf_pos;
3037 buf_alloc - buf_pos - padding, buf_pos,
3060 if (buf_alloc < buf_pos * 2)
3089 bufstr = (
char *)
buffer;
3091 if (transferred < 0)
3094 if (transferred == 0)
3097 bufstr[transferred] = 0;
3100 for (i = strlen (bufstr); i < transferred; i++)
3104 "contained unexpected null characters"),
3125 return addr >= start && addr < start + length;
3133 return inf->gdbarch;
3180 const char *exec_file;
3186 if (exec_file == NULL)
3236 static char buf[32];
3253 error (
_(
"Command not implemented for this target."));
3260 bfd *ignore1,
int *ignore2)
3262 error (
_(
"Command not implemented for this target."));
3272 dummy_target.to_shortname =
"None";
3273 dummy_target.to_longname =
"None";
3274 dummy_target.to_doc =
"";
3275 dummy_target.to_supports_disable_randomization
3320 warning (
_(
"May not interrupt or stop the target, ignoring attempt"));
3332 warning (
_(
"May not interrupt or stop the target, ignoring attempt"));
3395 return xstrdup (elem);
3397 return reconcat (list, list,
", ", elem, (
char *) NULL);
3407 int opt,
const char *opt_str)
3409 if ((*target_options & opt) != 0)
3412 *target_options &= ~opt;
3423 #define DO_TARG_OPTION(OPT) \ 3424 ret = do_option (&target_options, ret, OPT, #OPT) 3428 if (target_options != 0)
3448 error (
_(
"Writing to registers is not allowed (regno %d)"), regno);
3469 while (total_xfered <
size)
3474 ULONGEST howmuch = std::min<ULONGEST> (
sizeof (buf),
size - total_xfered);
3477 buf, NULL, lma + total_xfered, howmuch,
3480 && memcmp (data + total_xfered, buf, xfered_len) == 0)
3482 total_xfered += xfered_len;
3499 data, memaddr,
size);
3506 data, memaddr,
size);
3707 gdb_disassembly_flags
flags)
3716 gdb_disassembly_flags
flags)
3787 "Names of targets and files being debugged.\nShows the entire \ 3788 stack of targets currently in use (including the exec-file,\n\ 3789 core-file, and process, if any), as well as the symbol file name.";
3795 error (
_(
"\"monitor\" command not supported by this target."));
3811 bool found_flash_region =
false;
3822 found_flash_region =
true;
3827 current_uiout->message (
_(
"Erasing flash memory region at address "));
3836 if (found_flash_region)
3851 for (t = target_stack; t != NULL; t = t->
beneath)
3889 error (
_(
"Cannot change this setting while the inferior is running."));
3901 _(
"Controlling the inferior in " 3902 "asynchronous mode is %s.\n"),
value);
3942 error (
_(
"Cannot change this setting while the inferior is running."));
3957 _(
"Whether the target is always in non-stop mode " 3958 "is %s (currently %s).\n"),
value,
3962 _(
"Whether the target is always in non-stop mode " 3963 "is %s.\n"),
value);
3998 error (
_(
"Cannot change this setting while the inferior is running."));
4052 test_target_ops::test_target_ops ()
4057 to_has_memory = test_target_has_memory;
4058 to_has_stack = test_target_has_stack;
4059 to_has_registers = test_target_has_registers;
4060 to_prepare_to_store = test_target_prepare_to_store;
4061 to_store_registers = test_target_store_registers;
4079 Set target debugging."),
_(
"\ 4080 Show target debugging."),
_(
"\ 4081 When non-zero, target debugging is enabled. Higher numbers are more\n\ 4088 &trust_readonly,
_(
"\ 4089 Set mode for reading from readonly sections."),
_(
"\ 4090 Show mode for reading from readonly sections."),
_(
"\ 4091 When this mode is on, memory reads from readonly sections (such as .text)\n\ 4092 will be read from the object file instead of from the target. This will\n\ 4093 result in significant performance improvement for remote targets."),
4099 _(
"Send a command to the remote monitor (remote targets only)."));
4102 _(
"Print the name of each layer of the internal target stack."),
4107 Set whether gdb controls the inferior in asynchronous mode."),
_(
"\ 4108 Show whether gdb controls the inferior in asynchronous mode."),
_(
"\ 4109 Tells gdb whether to control the inferior in asynchronous mode."),
4117 Set whether gdb always controls the inferior in non-stop mode."),
_(
"\ 4118 Show whether gdb always controls the inferior in non-stop mode."),
_(
"\ 4119 Tells gdb whether to control the inferior in non-stop mode."),
4127 Set permission to write into registers."),
_(
"\ 4128 Show permission to write into registers."),
_(
"\ 4129 When this permission is on, GDB may write into the target's registers.\n\ 4130 Otherwise, any sort of write attempt will result in an error."),
4136 Set permission to write into target memory."),
_(
"\ 4137 Show permission to write into target memory."),
_(
"\ 4138 When this permission is on, GDB may write into the target's memory.\n\ 4139 Otherwise, any sort of write attempt will result in an error."),
4145 Set permission to insert breakpoints in the target."),
_(
"\ 4146 Show permission to insert breakpoints in the target."),
_(
"\ 4147 When this permission is on, GDB may insert breakpoints in the program.\n\ 4148 Otherwise, any sort of insertion attempt will result in an error."),
4154 Set permission to insert tracepoints in the target."),
_(
"\ 4155 Show permission to insert tracepoints in the target."),
_(
"\ 4156 When this permission is on, GDB may insert tracepoints in the program.\n\ 4157 Otherwise, any sort of insertion attempt will result in an error."),
4163 Set permission to insert fast tracepoints in the target."),
_(
"\ 4164 Show permission to insert fast tracepoints in the target."),
_(
"\ 4165 When this permission is on, GDB may insert fast tracepoints.\n\ 4166 Otherwise, any sort of insertion attempt will result in an error."),
4172 Set permission to interrupt or signal the target."),
_(
"\ 4173 Show permission to interrupt or signal the target."),
_(
"\ 4174 When this permission is on, GDB may interrupt/stop the target's execution.\n\ 4175 Otherwise, any attempt to interrupt or stop will be ignored."),
4180 _(
"Erase all flash memory regions."));
4184 Set whether GDB may automatically connect to the native target."),
_(
"\ 4185 Show whether GDB may automatically connect to the native target."),
_(
"\ 4186 When on, and GDB is not connected to a target yet, GDB\n\ 4187 attempts \"run\" and other commands with the native target."),
int target_supports_disable_randomization(void)
int(* to_fileio_pread)(struct target_ops *, int fd, gdb_byte *read_buf, int len, ULONGEST offset, int *target_errno)
struct gdbarch * target_gdbarch(void)
#define target_can_async_p()
struct address_space *(* to_thread_address_space)(struct target_ops *, ptid_t) TARGET_DEFAULT_FUNC(default_thread_address_space)
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)
void(* deprecated_detach_hook)(void)
void target_goto_record_begin(void)
void set_cmd_context(struct cmd_list_element *cmd, void *context)
void add_target(struct target_ops *t)
int have_live_inferiors(void)
int default_child_has_stack(struct target_ops *ops)
int target_thread_alive(ptid_t ptid)
void target_record_stop_replaying(void)
void flash_erase_command(const char *cmd, int from_tty)
void no_shared_libraries(const char *ignored, int from_tty)
char * hex_string(LONGEST num)
void get_target_memory(struct target_ops *ops, CORE_ADDR addr, gdb_byte *buf, LONGEST len)
void target_mourn_inferior(ptid_t ptid)
void target_disable_btrace(struct btrace_target_info *btinfo)
ptid_t default_target_wait(struct target_ops *ops, ptid_t ptid, struct target_waitstatus *status, int options)
enum auto_boolean target_non_stop_enabled
void reopen_exec_file(void)
int target_supports_terminal_ours(void)
static constexpr ptid_t tid
#define target_can_execute_reverse
void(* to_delete_record)(struct target_ops *) TARGET_DEFAULT_NORETURN(tcomplain())
int target_supports_multi_process(void)
int(* to_supports_disable_randomization)(struct target_ops *)
const struct target_desc *(* to_read_description)(struct target_ops *ops) TARGET_DEFAULT_RETURN(NULL)
int target_insert_mask_watchpoint(CORE_ADDR addr, CORE_ADDR mask, enum target_hw_bp_type rw)
void default_target_pass_ctrlc(struct target_ops *ops)
void(* to_program_signals)(struct target_ops *, int, unsigned char *TARGET_DEBUG_PRINTER(target_debug_print_signals)) TARGET_DEFAULT_IGNORE()
void target_stop(ptid_t ptid)
static void install_dummy_methods(struct target_ops *ops)
void * get_cmd_context(struct cmd_list_element *cmd)
void(* to_goto_record_begin)(struct target_ops *) TARGET_DEFAULT_NORETURN(tcomplain())
void target_teardown_btrace(struct btrace_target_info *btinfo)
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)
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)
void(* to_save_record)(struct target_ops *, const char *filename) TARGET_DEFAULT_NORETURN(tcomplain())
void target_announce_detach(int from_tty)
void clear_inline_frame_state(ptid_t ptid)
int(* to_insert_mask_watchpoint)(struct target_ops *, CORE_ADDR, CORE_ADDR, enum target_hw_bp_type) TARGET_DEFAULT_RETURN(1)
const struct frame_unwind * target_get_tailcall_unwinder(void)
static int return_zero_has_execution(struct target_ops *ignore, ptid_t ignore2)
void target_insn_history_from(ULONGEST from, int size, gdb_disassembly_flags flags)
int(* to_fileio_close)(struct target_ops *, int fd, int *target_errno)
int ptid_get_pid(const ptid_t &ptid)
void fputs_unfiltered(const char *buf, struct ui_file *file)
void target_require_runnable(void)
static void do_monitor_command(const char *cmd, int from_tty)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
static void set_write_memory_permission(const char *args, int from_tty, struct cmd_list_element *c)
int target_verify_memory(const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size)
int may_insert_fast_tracepoints
struct btrace_target_info * target_enable_btrace(ptid_t ptid, const struct btrace_config *conf)
struct target_section * sections_end
char * target_fileio_readlink(struct inferior *inf, const char *filename, int *target_errno)
void add_setshow_auto_boolean_cmd(const char *name, enum command_class theclass, enum auto_boolean *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
int gdbarch_has_global_solist(struct gdbarch *gdbarch)
const struct frame_unwind * target_get_unwinder(void)
void(* to_xclose)(struct target_ops *targ)
struct bfd_section * the_bfd_section
static enum auto_boolean target_non_stop_enabled_1
int(* to_has_memory)(struct target_ops *)
void warning(const char *fmt,...)
struct cmd_list_element * deprecate_cmd(struct cmd_list_element *cmd, const char *replacement)
int target_supports_btrace(enum btrace_format format)
void(* to_flash_done)(struct target_ops *) TARGET_DEFAULT_NORETURN(tcomplain())
int query(const char *ctlstr,...)
void(* to_stop_recording)(struct target_ops *) TARGET_DEFAULT_IGNORE()
static void maint_set_target_non_stop_command(const char *args, int from_tty, struct cmd_list_element *c)
static int target_fileio_open_1(struct inferior *inf, const char *filename, int flags, int mode, int warn_if_slow, int *target_errno)
LONGEST target_write(struct target_ops *ops, enum target_object object, const char *annex, const gdb_byte *buf, ULONGEST offset, LONGEST len)
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
int(* to_has_stack)(struct target_ops *)
static ptid_t default_get_ada_task_ptid(struct target_ops *self, long lwp, long tid)
void(* to_terminal_init)(struct target_ops *) TARGET_DEFAULT_IGNORE()
void push_target(struct target_ops *t)
void(* to_record_stop_replaying)(struct target_ops *) TARGET_DEFAULT_IGNORE()
int(* to_insert_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *) TARGET_DEFAULT_FUNC(memory_insert_breakpoint)
static void maint_set_target_async_command(const char *args, int from_tty, struct cmd_list_element *c)
char * plongest(LONGEST l)
LONGEST target_read_alloc(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte **buf_p)
char * get_exec_file(int err)
void generic_mourn_inferior(void)
void target_detach(const char *args, int from_tty)
struct cmd_list_element * add_info(const char *name, cmd_const_cfunc_ftype *fun, const char *doc)
int(* to_core_of_thread)(struct target_ops *, ptid_t ptid) TARGET_DEFAULT_RETURN(-1)
int unpush_target(struct target_ops *t)
int(* to_follow_fork)(struct target_ops *, int, int) TARGET_DEFAULT_FUNC(default_follow_fork)
void * memset(T *s, int c, size_t n)=delete
int target_supports_delete_record(void)
void internal_error(const char *file, int line, const char *fmt,...)
void(* to_terminal_ours_for_output)(struct target_ops *) TARGET_DEFAULT_IGNORE()
void(* to_call_history)(struct target_ops *, int size, int flags) TARGET_DEFAULT_NORETURN(tcomplain())
void target_pass_signals(int numsigs, unsigned char *pass_signals)
#define target_can_run(t)
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)
struct address_space * target_thread_address_space(ptid_t ptid)
void(* to_close)(struct target_ops *)
void initialize_targets(void)
const char *(* to_pid_to_str)(struct target_ops *, ptid_t) TARGET_DEFAULT_FUNC(default_pid_to_str)
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
struct thread_info *(* to_thread_handle_to_thread_info)(struct target_ops *, const gdb_byte *, int, struct inferior *inf) TARGET_DEFAULT_RETURN(NULL)
static int memory_xfer_check_region(gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST memaddr, ULONGEST len, ULONGEST *reg_len, struct mem_region **region_p)
void target_async(int enable)
scoped_restore_tmpl< int > make_scoped_restore_show_memory_breakpoints(int show)
DCACHE * target_dcache_get_or_init(void)
const struct frame_unwind *(* to_get_tailcall_unwinder)(struct target_ops *self) TARGET_DEFAULT_RETURN(NULL)
void(* to_insn_history)(struct target_ops *, int size, gdb_disassembly_flags flags) TARGET_DEFAULT_NORETURN(tcomplain())
#define VEC_safe_push(T, V, O)
struct inferior * find_inferior_ptid(ptid_t ptid)
struct cmd_list_element * cmdlist
struct inferior * iterate_over_inferiors(int(*callback)(struct inferior *, void *), void *data)
void target_prepare_to_generate_core(void)
void(* to_insn_history_range)(struct target_ops *, ULONGEST begin, ULONGEST end, gdb_disassembly_flags flags) TARGET_DEFAULT_NORETURN(tcomplain())
void target_fetch_registers(struct regcache *regcache, int regno)
void target_call_history_from(ULONGEST begin, int size, int flags)
static CORE_ADDR lm_addr(struct so_list *so)
int target_fileio_pwrite(int fd, const gdb_byte *write_buf, int len, ULONGEST offset, int *target_errno)
static struct target_ops * default_fileio_target(void)
#define fileio_fd_to_fh(fd)
std::vector< mem_region >(*) to_memory_map(struct target_ops *) TARGET_DEFAULT_RETURN(std void(* to_flash_erase)(struct target_ops *, ULONGEST address, LONGEST length) TARGET_DEFAULT_NORETURN(tcomplain())
ULONGEST(* to_get_memory_xfer_limit)(struct target_ops *) TARGET_DEFAULT_RETURN(ULONGEST_MAX)
int target_remove_mask_watchpoint(CORE_ADDR addr, CORE_ADDR mask, enum target_hw_bp_type rw)
int default_child_has_execution(struct target_ops *ops, ptid_t the_ptid)
scoped_restore_tmpl< int > make_scoped_defer_target_commit_resume()
void set_cmd_sfunc(struct cmd_list_element *cmd, cmd_const_sfunc_ftype *sfunc)
static int default_follow_fork(struct target_ops *self, int follow_child, int detach_fork)
enum target_xfer_status section_table_xfer_memory_partial(gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len, struct target_section *sections, struct target_section *sections_end, const char *section_name)
const char * target_xfer_status_to_string(enum target_xfer_status status)
int target_has_execution_1(ptid_t the_ptid)
void target_program_signals(int numsigs, unsigned char *program_signals)
void target_insn_history_range(ULONGEST begin, ULONGEST end, gdb_disassembly_flags flags)
struct cmd_list_element * maintenance_set_cmdlist
int target_fileio_close(int fd, int *target_errno)
int may_insert_tracepoints
void target_insn_history(int size, gdb_disassembly_flags flags)
gdb::unique_xmalloc_ptr< char > target_read_stralloc(struct target_ops *ops, enum target_object object, const char *annex)
void printf_filtered(const char *format,...)
enum target_xfer_status target_xfer_partial(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
#define host_address_to_string(ADDR)
struct obj_section * find_pc_overlay(CORE_ADDR pc)
static void release_fileio_fd(int fd, fileio_fh_t *fh)
ptid_t ptid_build(int pid, long lwp, long tid)
void(* to_files_info)(struct target_ops *) TARGET_DEFAULT_IGNORE()
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_const_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
int target_read_code(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
int gdbarch_addressable_memory_unit_size(struct gdbarch *gdbarch)
scoped_restore_tmpl< T > make_scoped_restore(T *var)
void infrun_async(int enable)
void add_setshow_zuinteger_cmd(const char *name, enum command_class theclass, unsigned int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
void(* to_thread_events)(struct target_ops *, int) TARGET_DEFAULT_IGNORE()
const char * normal_pid_to_str(ptid_t ptid)
int default_child_has_memory(struct target_ops *ops)
void memory_error(enum target_xfer_status err, CORE_ADDR memaddr)
void switch_to_thread(ptid_t ptid)
static void target_command(const char *arg, int from_tty)
struct cmd_list_element * setlist
static struct target_ops * find_default_run_target(const char *do_mesg)
static int may_write_registers_1
std::vector< mem_region > target_memory_map(void)
int(* to_record_is_replaying)(struct target_ops *, ptid_t ptid) TARGET_DEFAULT_RETURN(0)
#define VEC_iterate(T, V, I, P)
int target_has_all_memory_1(void)
static void default_terminal_info(struct target_ops *self, const char *args, int from_tty)
static int delegate_can_run(struct target_ops *self)
int target_remove_breakpoint(struct gdbarch *gdbarch, struct bp_target_info *bp_tgt, enum remove_bp_reason reason)
void(* to_insn_history_from)(struct target_ops *, ULONGEST from, int size, gdb_disassembly_flags flags) TARGET_DEFAULT_NORETURN(tcomplain())
void target_flash_erase(ULONGEST address, LONGEST length)
void target_dcache_invalidate(void)
#define CATCH(EXCEPTION, MASK)
void(* to_prepare_to_generate_core)(struct target_ops *) TARGET_DEFAULT_IGNORE()
char * target_options_to_string(int target_options)
#define DO_TARG_OPTION(OPT)
const struct target_desc * target_read_description(struct target_ops *target)
static void open_target(const char *args, int from_tty, struct cmd_list_element *command)
ULONGEST get_target_memory_unsigned(struct target_ops *ops, CORE_ADDR addr, int len, enum bfd_endian byte_order)
void(* to_call_history_range)(struct target_ops *, ULONGEST begin, ULONGEST end, int flags) TARGET_DEFAULT_NORETURN(tcomplain())
void target_load(const char *arg, int from_tty)
std::unique_ptr< T, xfree_deleter< T > > unique_xmalloc_ptr
int fputc_unfiltered(int c, struct ui_file *stream)
struct target_ops current_target
static int default_region_ok_for_hw_watchpoint(struct target_ops *self, CORE_ADDR addr, int len)
static int find_default_supports_disable_randomization(struct target_ops *self)
void target_clear_description(void)
CORE_ADDR address_significant(gdbarch *gdbarch, CORE_ADDR addr)
void complete_target_initialization(struct target_ops *t)
int target_is_non_stop_p(void)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
int(* to_record_will_replay)(struct target_ops *, ptid_t ptid, int dir) TARGET_DEFAULT_RETURN(0)
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)
void set_cmd_completer(struct cmd_list_element *cmd, completer_ftype *completer)
static ULONGEST extract_unsigned_integer(const gdb_byte *addr, int len, enum bfd_endian byte_order)
void update_target_permissions(void)
int target_dcache_init_p(void)
enum prompt_state prompt_state
struct mem_region * lookup_mem_region(CORE_ADDR addr)
static void generic_tls_error(void)
int simple_verify_memory(struct target_ops *ops, const gdb_byte *data, CORE_ADDR lma, ULONGEST size)
void target_resume(ptid_t ptid, int step, enum gdb_signal signal)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
static int may_insert_fast_tracepoints_1
void(* to_resume)(struct target_ops *, ptid_t, int TARGET_DEBUG_PRINTER(target_debug_print_step), enum gdb_signal) TARGET_DEFAULT_NORETURN(noprocess())
struct cmd_list_element * showlist
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
struct target_section_table *(* to_get_section_table)(struct target_ops *) TARGET_DEFAULT_RETURN(NULL)
static int target_always_non_stop_p(void)
static struct gdbarch * default_thread_architecture(struct target_ops *ops, ptid_t ptid)
#define gdb_assert_not_reached(message)
int target_has_stack_1(void)
int(* to_can_run)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
void update_observer_mode(void)
ptid_t pid_to_ptid(int pid)
static int default_watchpoint_addr_within_range(struct target_ops *target, CORE_ADDR addr, CORE_ADDR start, int length)
void target_thread_events(int enable)
CORE_ADDR(* to_get_thread_local_address)(struct target_ops *ops, ptid_t ptid, CORE_ADDR load_module_addr, CORE_ADDR offset) TARGET_DEFAULT_NORETURN(generic_tls_error())
int default_child_has_all_memory(struct target_ops *ops)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
static void setup_target_debug(void)
int get_traceframe_number(void)
int target_write_raw_memory(CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
struct target_section * sections
struct btrace_target_info *(* to_enable_btrace)(struct target_ops *, ptid_t ptid, const struct btrace_config *conf) TARGET_DEFAULT_NORETURN(tcomplain())
void target_interrupt(ptid_t ptid)
char * pulongest(ULONGEST u)
int(* to_masked_watch_num_registers)(struct target_ops *, CORE_ADDR, CORE_ADDR) TARGET_DEFAULT_RETURN(-1)
void add_target_with_completer(struct target_ops *t, completer_ftype *completer)
int(* to_remove_mask_watchpoint)(struct target_ops *, CORE_ADDR, CORE_ADDR, enum target_hw_bp_type) TARGET_DEFAULT_RETURN(1)
int(* to_has_execution)(struct target_ops *, ptid_t)
int gdbarch_has_global_breakpoints(struct gdbarch *gdbarch)
static void delegate_terminal_ours(struct target_ops *self)
static struct address_space * default_thread_address_space(struct target_ops *self, ptid_t ptid)
int target_record_will_replay(ptid_t ptid, int dir)
int(* to_fileio_fstat)(struct target_ops *, int fd, struct stat *sb, int *target_errno)
void target_continue(ptid_t ptid, enum gdb_signal signal)
void pop_all_targets(void)
static int may_insert_tracepoints_1
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
void target_goto_record_end(void)
int target_read_uint32(CORE_ADDR memaddr, uint32_t *result)
void target_close(struct target_ops *targ)
static void show_targetdebug(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void target_continue_no_signal(ptid_t ptid)
const struct btrace_config *(* to_btrace_conf)(struct target_ops *self, const struct btrace_target_info *) TARGET_DEFAULT_RETURN(NULL)
#define target_has_execution
enum target_xfer_status(* to_xfer_partial)(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) TARGET_DEFAULT_RETURN(TARGET_XFER_E_IO)
struct btrace_config conf
void target_goto_record(ULONGEST insn)
void exit_inferior(int pid)
struct target_ops * find_target_beneath(struct target_ops *t)
int(* to_search_memory)(struct target_ops *ops, CORE_ADDR start_addr, ULONGEST search_space_len, const gdb_byte *pattern, ULONGEST pattern_len, CORE_ADDR *found_addrp) TARGET_DEFAULT_FUNC(default_search_memory)
char * xstrprintf(const char *format,...)
int target_has_execution_current(void)
static char * str_comma_list_concat_elem(char *list, const char *elem)
void printf_unfiltered(const char *format,...)
int target_record_is_replaying(ptid_t ptid)
struct cmd_list_element * setdebuglist
ptid_t target_wait(ptid_t ptid, struct target_waitstatus *status, int options)
void completer_ftype(struct cmd_list_element *, completion_tracker &tracker, const char *text, const char *word)
LONGEST target_fileio_read_alloc(struct inferior *inf, const char *filename, gdb_byte **buf_p)
void(* to_detach)(struct target_ops *ops, const char *, int) TARGET_DEFAULT_IGNORE()
void(* to_async)(struct target_ops *, int) TARGET_DEFAULT_NORETURN(tcomplain())
struct bfd_section * the_bfd_section
static void info_target_command(const char *args, int from_tty)
const char * objfile_name(const struct objfile *objfile)
static char * do_option(int *target_options, char *ret, int opt, const char *opt_str)
int target_fileio_unlink(struct inferior *inf, const char *filename, int *target_errno)
void target_save_record(const char *filename)
int target_has_memory_1(void)
static enum exec_direction_kind default_execution_direction(struct target_ops *self)
struct cmd_list_element * maintenanceprintlist
enum btrace_error target_read_btrace(struct btrace_data *btrace, struct btrace_target_info *btinfo, enum btrace_read_type type)
static void ours_for_output()
static void delegate_delete_record(struct target_ops *self)
void agent_capability_invalidate(void)
static void install_delegators(struct target_ops *ops)
void target_stop_recording(void)
int target_is_pushed(struct target_ops *t)
static int dummy_find_memory_regions(struct target_ops *self, find_memory_region_ftype ignore1, void *ignore2)
void(* to_commit_resume)(struct target_ops *) TARGET_DEFAULT_IGNORE()
static void maint_show_target_non_stop_command(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void(* to_disconnect)(struct target_ops *, const char *, int) TARGET_DEFAULT_NORETURN(tcomplain())
void breakpoint_xfer_memory(gdb_byte *readbuf, gdb_byte *writebuf, const gdb_byte *writebuf_org, ULONGEST memaddr, LONGEST len)
void target_call_history_range(ULONGEST begin, ULONGEST end, int flags)
int target_read_raw_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
const char * target_thread_name(struct thread_info *info)
int(* to_always_non_stop_p)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
enum btrace_error(* to_read_btrace)(struct target_ops *self, struct btrace_data *data, struct btrace_target_info *btinfo, enum btrace_read_type type) TARGET_DEFAULT_NORETURN(tcomplain())
PTR xrealloc(PTR ptr, size_t size)
int(* to_verify_memory)(struct target_ops *, const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size) TARGET_DEFAULT_FUNC(default_verify_memory)
void add_deprecated_target_alias(struct target_ops *t, const char *alias)
int(* to_fileio_open)(struct target_ops *, struct inferior *inf, const char *filename, int flags, int mode, int warn_if_slow, int *target_errno)
#define is_closed_fileio_fh(fd)
std::vector< memory_read_result > read_memory_robust(struct target_ops *ops, const ULONGEST offset, const LONGEST len)
void throw_exception(struct gdb_exception exception)
static void default_mourn_inferior(struct target_ops *self)
void target_update_thread_list(void)
enum record_method target_record_method(ptid_t ptid)
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)
int simple_search_memory(struct target_ops *ops, CORE_ADDR start_addr, ULONGEST search_space_len, const gdb_byte *pattern, ULONGEST pattern_len, CORE_ADDR *found_addrp)
int target_insert_breakpoint(struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
void(* to_fetch_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_IGNORE()
static void unpush_target_and_assert(struct target_ops *target)
void target_commit_resume(void)
void(* to_mourn_inferior)(struct target_ops *) TARGET_DEFAULT_FUNC(default_mourn_inferior)
const struct frame_unwind *(* to_get_unwinder)(struct target_ops *self) TARGET_DEFAULT_RETURN(NULL)
int target_info_proc(const char *args, enum info_proc_what what)
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)
int default_child_has_registers(struct target_ops *ops)
CORE_ADDR target_translate_tls_address(struct objfile *objfile, CORE_ADDR offset)
int may_insert_breakpoints
void target_pre_inferior(int from_tty)
int gdbarch_fetch_tls_load_module_address_p(struct gdbarch *gdbarch)
void(* to_pass_signals)(struct target_ops *, int, unsigned char *TARGET_DEBUG_PRINTER(target_debug_print_signals)) TARGET_DEFAULT_IGNORE()
void(* to_stop)(struct target_ops *, ptid_t) TARGET_DEFAULT_IGNORE()
static LONGEST target_fileio_read_alloc_1(struct inferior *inf, const char *filename, gdb_byte **buf_p, int padding)
void(* to_teardown_btrace)(struct target_ops *, struct btrace_target_info *tinfo) TARGET_DEFAULT_NORETURN(tcomplain())
enum record_method(* to_record_method)(struct target_ops *, ptid_t ptid) TARGET_DEFAULT_RETURN(RECORD_METHOD_NONE)
void prepare_for_detach(void)
gdb::unique_xmalloc_ptr< char > target_fileio_read_stralloc(struct inferior *inf, const char *filename)
void registers_changed_ptid(ptid_t ptid)
int xsnprintf(char *str, size_t size, const char *format,...)
int target_async_permitted
int(* to_fileio_pwrite)(struct target_ops *, int fd, const gdb_byte *write_buf, int len, ULONGEST offset, int *target_errno)
#define INHERIT(FIELD, TARGET)
int check_quit_flag(void)
void debug_print_register(const char *func, int regno)
void(* to_kill)(struct target_ops *) TARGET_DEFAULT_NORETURN(noprocess())
static int dispose_inferior(struct inferior *inf, void *args)
static int defer_target_commit_resume
void breakpoint_init_inferior(enum inf_context context)
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_stop_and_wait(ptid_t ptid)
int remove_breakpoints(void)
void(* to_goto_record_end)(struct target_ops *) TARGET_DEFAULT_NORETURN(tcomplain())
static char * dummy_make_corefile_notes(struct target_ops *self, bfd *ignore1, int *ignore2)
const char * target_pid_to_str(ptid_t ptid)
void(* to_open)(const char *, int)
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void pop_all_targets_above(enum strata above_stratum)
int(* to_ranged_break_num_registers)(struct target_ops *) TARGET_DEFAULT_RETURN(-1)
void(* to_call_history_from)(struct target_ops *, ULONGEST begin, int size, int flags) TARGET_DEFAULT_NORETURN(tcomplain())
void registers_changed(void)
int target_has_registers_1(void)
struct target_section * target_section_by_addr(struct target_ops *target, CORE_ADDR addr)
static void update_current_target(void)
int(* to_can_async_p)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
#define target_rcmd(command, outbuf)
static constexpr ptid_t lwp
void target_call_history(int size, int flags)
int(* to_remove_breakpoint)(struct target_ops *, struct gdbarch *, struct bp_target_info *, enum remove_bp_reason) TARGET_DEFAULT_FUNC(memory_remove_breakpoint)
int to_have_steppable_watchpoint
void target_done_generating_core(void)
gdb::unique_xmalloc_ptr< char > target_get_osdata(const char *type)
struct target_ops * find_run_target(void)
static void tdefault_terminal_ours(struct target_ops *self)
struct ui_file * gdb_stdtarg
#define SEARCH_CHUNK_SIZE
int target_core_of_thread(ptid_t ptid)
int target_fileio_pread(int fd, gdb_byte *read_buf, int len, ULONGEST offset, int *target_errno)
void(* to_terminal_ours)(struct target_ops *) TARGET_DEFAULT_IGNORE()
int ptid_equal(const ptid_t &ptid1, const ptid_t &ptid2)
int target_ranged_break_num_registers(void)
gdb::def_vector< gdb_byte > byte_vector
static void show_auto_connect_native_target(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
struct inferior * current_inferior(void)
static int default_verify_memory(struct target_ops *self, const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size)
void(* to_terminal_inferior)(struct target_ops *) TARGET_DEFAULT_IGNORE()
static void default_rcmd(struct target_ops *self, const char *command, struct ui_file *output)
const char * to_shortname
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)
enum overlay_debugging_state overlay_debugging
void target_delete_record(void)
int to_have_continuable_watchpoint
struct target_section_table * target_get_section_table(struct target_ops *target)
unsigned long long ULONGEST
void target_store_registers(struct regcache *regcache, int regno)
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
static void init_dummy_target(void)
int target_write_memory(CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
int(* to_supports_non_stop)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static const char * default_pid_to_str(struct target_ops *ops, ptid_t ptid)
void target_disconnect(const char *args, int from_tty)
int(* to_has_all_memory)(struct target_ops *)
LONGEST target_read(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *buf, ULONGEST offset, LONGEST len)
struct target_ops * find_attach_target(void)
static void maintenance_print_target_stack(const char *cmd, int from_tty)
void(* to_interrupt)(struct target_ops *, ptid_t) TARGET_DEFAULT_IGNORE()
struct cmd_list_element * showdebuglist
int target_follow_fork(int follow_child, int detach_fork)
void(* to_done_generating_core)(struct target_ops *) TARGET_DEFAULT_IGNORE()
struct thread_info * target_thread_handle_to_thread_info(const gdb_byte *thread_handle, int handle_len, struct inferior *inf)
int(* to_fileio_unlink)(struct target_ops *, struct inferior *inf, const char *filename, int *target_errno)
int target_fileio_fstat(int fd, struct stat *sb, int *target_errno)
CORE_ADDR overlay_mapped_address(CORE_ADDR pc, struct obj_section *section)
static int auto_connect_native_target
void(* to_create_inferior)(struct target_ops *, const char *, const std::string &, char **, int)
int to_has_thread_control
int(* to_thread_alive)(struct target_ops *, ptid_t ptid) TARGET_DEFAULT_RETURN(0)
void(* to_info_proc)(struct target_ops *, const char *, enum info_proc_what)
int target_fileio_open(struct inferior *inf, const char *filename, int flags, int mode, int *target_errno)
void(* to_attach)(struct target_ops *ops, const char *, int)
void target_preopen(int from_tty)
void reinit_frame_cache(void)
int code_cache_enabled_p(void)
void(* to_follow_exec)(struct target_ops *, struct inferior *, char *) TARGET_DEFAULT_IGNORE()
int remove_breakpoints_pid(int pid)
static void init_debug_target(struct target_ops *ops)
CORE_ADDR gdbarch_fetch_tls_load_module_address(struct gdbarch *gdbarch, struct objfile *objfile)
void gdb_flush(struct ui_file *file)
void(* to_pass_ctrlc)(struct target_ops *) TARGET_DEFAULT_FUNC(default_target_pass_ctrlc)
int(* to_supports_btrace)(struct target_ops *, enum btrace_format) TARGET_DEFAULT_RETURN(0)
static int return_zero(struct target_ops *ignore)
static int target_async_permitted_1
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_const_cfunc_ftype *fun, const char *doc)
void(* to_update_thread_list)(struct target_ops *) TARGET_DEFAULT_IGNORE()
completer_ftype * completer
static void info(const char *arg, int from_tty)
static void maint_show_target_async_command(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void(* to_store_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_NORETURN(noprocess())
int(* find_memory_region_ftype)(CORE_ADDR addr, unsigned long size, int read, int write, int exec, int modified, void *data)
int(* to_has_registers)(struct target_ops *)
void target_follow_exec(struct inferior *inf, char *execd_pathname)
ptid_t(* to_wait)(struct target_ops *, ptid_t, struct target_waitstatus *, int TARGET_DEBUG_PRINTER(target_debug_print_options)) TARGET_DEFAULT_FUNC(default_target_wait)
CORE_ADDR pc_in_unmapped_range(CORE_ADDR pc, struct obj_section *section)
const char * core_addr_to_string_nz(const CORE_ADDR addr)
struct cmd_list_element * maintenance_show_cmdlist
int stack_cache_enabled_p(void)
int target_read_string(CORE_ADDR memaddr, char **string, int len, int *errnop)
static void tdefault_delete_record(struct target_ops *self)
void invalidate_target_mem_regions(void)
void dcache_update(DCACHE *dcache, enum target_xfer_status status, CORE_ADDR memaddr, const gdb_byte *myaddr, ULONGEST len)
static void tcomplain(void)
const struct btrace_config * target_btrace_conf(const struct btrace_target_info *btinfo)
static void show_trust_readonly(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
DCACHE * target_dcache_get(void)
void(* to_disable_btrace)(struct target_ops *, struct btrace_target_info *tinfo) TARGET_DEFAULT_NORETURN(tcomplain())
void pop_all_targets_at_and_above(enum strata stratum)
void set_executing(ptid_t ptid, int executing)
struct thread_info * any_thread_of_process(int pid)
int target_read_stack(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
void error(const char *fmt,...)
const char *(* to_thread_name)(struct target_ops *, struct thread_info *) TARGET_DEFAULT_RETURN(NULL)
char *(* to_fileio_readlink)(struct target_ops *, struct inferior *inf, const char *filename, int *target_errno)
static void set_target_permissions(const char *args, int from_tty, struct cmd_list_element *c)
int target_fileio_open_warn_if_slow(struct inferior *inf, const char *filename, int flags, int mode, int *target_errno)
void throw_error(enum errors error, const char *fmt,...)
int target_masked_watch_num_registers(CORE_ADDR addr, CORE_ADDR mask)
struct target_ops * beneath
void(* to_load)(struct target_ops *, const char *, int) TARGET_DEFAULT_NORETURN(tcomplain())
void do_cleanups(struct cleanup *old_chain)
void(* to_terminal_info)(struct target_ops *, const char *, int) TARGET_DEFAULT_FUNC(default_terminal_info)
void target_flash_done(void)
int(* to_supports_multi_process)(struct target_ops *) TARGET_DEFAULT_RETURN(0)
static int may_write_memory_1
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)
static int may_insert_breakpoints_1
static void target_fileio_close_cleanup(void *opaque)
static LONGEST target_read_alloc_1(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte **buf_p, int padding)
void(* to_goto_record)(struct target_ops *, ULONGEST insn) TARGET_DEFAULT_NORETURN(tcomplain())
enum mem_access_mode mode
void mark_breakpoints_out(void)
struct target_ops * find_target_at(enum strata stratum)
void target_pass_ctrlc(void)