36#include "gdbsupport/event-loop.h"
47#include "gdbsupport/gdb_splay_tree.h"
54#include "gdbsupport/gdb_optional.h"
55#include "gdbsupport/byte-vector.h"
58#include "gdbsupport/run-time-clock.h"
61#include "gdbsupport/rsp-low.h"
99 int skip_unavailable);
115 error (_(
"Cannot change this setting while the inferior is running."));
127 _(
"Whether MI is in asynchronous mode is %s.\n"),
168 if (argc > 0 && strcmp(argv[0],
"--reverse") == 0)
178 if (argc > 0 && strcmp(argv[0],
"--reverse") == 0)
188 if (argc > 0 && strcmp(argv[0],
"--reverse") == 0)
198 if (argc > 0 && strcmp(argv[0],
"--reverse") == 0)
208 if (argc > 0 && strcmp(argv[0],
"--reverse") == 0)
251 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
257 int pid = *(
int *)arg;
281 (
"MI continue all threads in non-stop");
302 scoped_restore save_multi = make_scoped_restore (&
sched_multi);
326 error (_(
"Already in reverse mode."));
339 if (argc > 0 && strcmp (argv[0],
"--reverse") == 0)
348 int pid = *(
int *)arg;
353 if (thread->
ptid.pid () !=
pid)
387 (
"interrupting all threads of thread group");
408 const char *run_cmd = start_p ?
"start" :
"run";
416 error (_(
"Inferior has no threads."));
423 async_p ?
"&" : NULL);
436 static const struct mi_opt opts[] =
438 {
"-start", START_OPT, 0},
447 int opt =
mi_getopt (
"-exec-run", argc, argv, opts, &oind, &oarg);
451 switch ((
enum opt) opt)
462 error (_(
"Invalid argument: %s"), argv[oind]);
473 const char *run_cmd = start_p ?
"start" :
"run";
478 async_p ?
"&" : NULL);
497 if (argc != 0 && argc != 1)
498 error (_(
"Usage: -target-detach [pid | thread-group]"));
510 int id = strtoul (argv[0] + 1, &end, 0);
513 error (_(
"Invalid syntax of thread-group id '%s'"), argv[0]);
517 error (_(
"Non-existent thread-group id '%d'"),
id);
524 pid = strtol (argv[0], &end, 10);
527 error (_(
"Invalid identifier '%s'"), argv[0]);
534 error (_(
"Thread group is empty"));
552 error (_(
"-thread-select: USAGE: threadnum."));
557 error (_(
"Thread ID %d not known."),
num);
569 error (_(
"-thread-list-ids: No arguments required."));
572 int current_thread = -1;
582 current_thread = tp->global_num;
589 if (current_thread != -1)
590 current_uiout->field_signed (
"current-thread-id", current_thread);
597 if (argc != 0 && argc != 1)
598 error (_(
"Invalid MI command"));
614 if (ti->
ptid.pid () == data->pid)
619 data->cores.insert (core);
633 const std::set<int> &ids)
637 if (ids.empty () || (ids.find (
inferior->
pid) != ids.end ()))
662 if (!data.cores.empty ())
666 for (
int b : data.cores)
683 auto cores = make_unique_xstrdup (xcores);
684 char *p =
cores.get ();
687 for (p = strtok_r (p,
",", &saveptr); p; p = strtok_r (NULL,
",", &saveptr))
698 std::map<int, std::vector<osdata_item>> tree;
701 std::unique_ptr<osdata> data =
get_osdata (
"processes");
705 std::unique_ptr<osdata> threads =
get_osdata (
"threads");
710 int pid_i = strtoul (
pid->c_str (), NULL, 0);
712 tree[pid_i].push_back (item);
725 int pid_i = strtoul (
pid->c_str (), NULL, 0);
730 if (!ids.empty () && ids.find (pid_i) == ids.end ())
746 auto n = tree.find (pid_i);
747 if (n != tree.end ())
749 std::vector<osdata_item> &children = n->second;
778 AVAILABLE_OPT, RECURSE_OPT
780 static const struct mi_opt opts[] =
782 {
"-available", AVAILABLE_OPT, 0},
783 {
"-recurse", RECURSE_OPT, 1},
792 int opt =
mi_getopt (
"-list-thread-groups", argc, argv, opts,
797 switch ((
enum opt) opt)
803 if (strcmp (oarg,
"0") == 0)
805 else if (strcmp (oarg,
"1") == 0)
808 error (_(
"only '0' and '1' are valid values "
809 "for the '--recurse' option"));
814 for (; oind < argc; ++oind)
819 if (*(argv[oind]) !=
'i')
820 error (_(
"invalid syntax of group id '%s'"), argv[oind]);
822 inf = strtoul (argv[oind] + 1, &end, 0);
825 error (_(
"invalid syntax of group id '%s'"), argv[oind]);
833 else if (ids.size () == 1)
836 int id = *(ids.begin ());
840 error (_(
"Non-existent thread group id '%d'"),
id);
891 for (i = 0; i < argc; i++)
894 if (regnum < 0 || regnum >= numregs)
895 error (_(
"bad register number"));
907 static std::unique_ptr<readonly_detached_regcache> this_regs;
909 std::unique_ptr<readonly_detached_regcache> prev_regs;
919 prev_regs = std::move (this_regs);
951 for (i = 0; i < argc; i++)
964 error (_(
"bad register number"));
973 struct value *prev_value, *this_value;
983 gdb_assert (prev_value != NULL);
984 gdb_assert (this_value != NULL);
1009 int regnum, numregs, format;
1011 int skip_unavailable = 0;
1017 static const struct mi_opt opts[] =
1019 {
"-skip-unavailable", SKIP_UNAVAILABLE, 0},
1033 int opt =
mi_getopt (
"-data-list-register-values", argc, argv,
1034 opts, &oind, &oarg);
1038 switch ((
enum opt) opt)
1040 case SKIP_UNAVAILABLE:
1041 skip_unavailable = 1;
1046 if (argc - oind < 1)
1047 error (_(
"-data-list-register-values: Usage: "
1048 "-data-list-register-values [--skip-unavailable] <format>"
1049 " [<regnum1>...<regnumN>]"));
1051 format = (int) argv[oind][0];
1059 if (argc - oind == 1)
1074 for (i = 1 + oind; i < argc; i++)
1083 error (_(
"bad register number"));
1093 int skip_unavailable)
1142 error (_(
"-data-write-register-values: Usage: -data-write-register-"
1143 "values <format> [<regnum1> <value1>...<regnumN> <valueN>]"));
1146 error (_(
"-data-write-register-values: No registers."));
1149 error (_(
"-data-write-register-values: No regs and values specified."));
1152 error (_(
"-data-write-register-values: "
1153 "Regs and vals are not in pairs."));
1155 for (i = 1; i < argc; i = i + 2)
1157 int regnum = atoi (argv[i]);
1171 error (_(
"bad register number"));
1187 error (_(
"-data-evaluate-expression: "
1188 "Usage: -data-evaluate-expression expression"));
1229 long total_bytes, nr_cols, nr_rows;
1231 struct type *word_type;
1243 static const struct mi_opt opts[] =
1245 {
"o", OFFSET_OPT, 1},
1251 int opt =
mi_getopt (
"-data-read-memory", argc, argv, opts,
1256 switch ((
enum opt) opt)
1259 offset = atol (oarg);
1266 if (argc < 5 || argc > 6)
1267 error (_(
"-data-read-memory: Usage: "
1268 "ADDR WORD-FORMAT WORD-SIZE NR-ROWS NR-COLS [ASCHAR]."));
1276 word_format = argv[1][0];
1278 word_size = atol (argv[2]);
1302 nr_rows = atol (argv[3]);
1304 error (_(
"-data-read-memory: invalid number of rows."));
1307 nr_cols = atol (argv[4]);
1309 error (_(
"-data-read-memory: invalid number of columns."));
1318 total_bytes = word_size * nr_rows * nr_cols;
1320 gdb::byte_vector mbuf (total_bytes);
1324 mbuf.data (), addr, total_bytes);
1326 error (_(
"Unable to read memory."));
1345 for (row = 0, row_byte = 0;
1347 row++, row_byte += nr_cols * word_size)
1360 for (col = 0, col_byte = row_byte;
1362 col++, col_byte += word_size)
1364 if (col_byte + word_size > nr_bytes)
1372 &print_opts, word_asize, &stream);
1383 for (
byte = row_byte;
1384 byte < row_byte + word_size * nr_cols;
byte++)
1386 if (
byte >= nr_bytes)
1388 else if (mbuf[
byte] < 32 || mbuf[
byte] > 126)
1389 stream.
putc (aschar);
1391 stream.
putc (mbuf[
byte]);
1414 static const struct mi_opt opts[] =
1416 {
"o", OFFSET_OPT, 1},
1422 int opt =
mi_getopt (
"-data-read-memory-bytes", argc, argv, opts,
1426 switch ((
enum opt) opt)
1429 offset = atol (oarg);
1437 error (_(
"Usage: [ -o OFFSET ] ADDR LENGTH."));
1440 length = atol (argv[1]);
1442 std::vector<memory_read_result> result
1445 if (result.size () == 0)
1446 error (_(
"Unable to read memory."));
1457 std::string data = bin2hex (read_result.data.get (),
1458 (read_result.end - read_result.begin)
1498 static const struct mi_opt opts[] =
1500 {
"o", OFFSET_OPT, 1},
1506 int opt =
mi_getopt (
"-data-write-memory", argc, argv, opts,
1511 switch ((
enum opt) opt)
1514 offset = atol (oarg);
1522 error (_(
"-data-write-memory: Usage: "
1523 "[-o COLUMN_OFFSET] ADDR FORMAT WORD-SIZE VALUE."));
1529 word_size = atol (argv[2]);
1532 addr += (offset * word_size);
1537 gdb::byte_vector buffer (word_size);
1554 size_t len_hex, len_bytes, len_units, i, steps, remaining_units;
1555 long int count_units;
1558 if (argc != 2 && argc != 3)
1559 error (_(
"Usage: ADDR DATA [COUNT]."));
1563 len_hex = strlen (cdata);
1566 if (len_hex % (unit_size * 2) != 0)
1567 error (_(
"Hex-encoded '%s' must represent an integral number of "
1568 "addressable memory units."),
1571 len_bytes = len_hex / 2;
1572 len_units = len_bytes / unit_size;
1575 count_units = strtoul (argv[2], NULL, 10);
1577 count_units = len_units;
1579 gdb::byte_vector databuf (len_bytes);
1581 for (i = 0; i < len_bytes; ++i)
1584 if (sscanf (cdata + i * 2,
"%02x", &x) != 1)
1585 error (_(
"Invalid argument"));
1586 databuf[i] = (gdb_byte) x;
1589 gdb::byte_vector data;
1590 if (len_units < count_units)
1594 data = gdb::byte_vector (count_units * unit_size);
1597 steps = count_units / len_units;
1599 remaining_units = count_units % len_units;
1600 for (i = 0; i < steps; i++)
1601 memcpy (&data[i * len_bytes], &databuf[0], len_bytes);
1603 if (remaining_units > 0)
1604 memcpy (&data[steps * len_bytes], &databuf[0],
1605 remaining_units * unit_size);
1611 data = std::move (databuf);
1624 if (strcmp (argv[0],
"yes") == 0)
1626 else if (strcmp (argv[0],
"no") == 0)
1637 error (_(
"-enable-timings: Usage: %s {yes|no}"), command);
1652 uiout->
field_string (NULL,
"breakpoint-notifications");
1656 uiout->
field_string (NULL,
"undefined-command-error-code");
1658 uiout->
field_string (NULL,
"data-disassemble-a-option");
1666 error (_(
"-list-features should be passed no arguments"));
1684 error (_(
"-list-target-features should be passed no arguments"));
1690 bool no_connection =
false;
1697 static const struct mi_opt opts[] =
1699 {
"-no-connection", NO_CONNECTION_OPT, 0},
1708 int opt =
mi_getopt (
"-add-inferior", argc, argv, opts, &oind, &oarg);
1712 switch ((
enum opt) opt)
1714 case NO_CONNECTION_OPT:
1715 no_connection =
true;
1731 if (proc_target !=
nullptr)
1746 error (_(
"-remove-inferior should be passed a single argument"));
1748 if (sscanf (argv[0],
"i%d", &
id) != 1)
1749 error (_(
"the thread group id is syntactically invalid"));
1752 if (inf_to_remove == NULL)
1753 error (_(
"the specified thread group does not exist"));
1755 if (inf_to_remove->
pid != 0)
1756 error (_(
"cannot remove an active inferior"));
1761 struct inferior *new_inferior = NULL;
1765 if (
inf != inf_to_remove)
1769 if (new_inferior == NULL)
1770 error (_(
"Cannot remove last inferior"));
1773 if (new_inferior->
pid != 0)
1802 scoped_restore save_token = make_scoped_restore (&
current_token,
1807 switch (context->
op)
1813 " token=`%s' command=`%s' args=`%s'\n",
1890 if (exception.message == NULL)
1896 switch (exception.error)
1898 case UNDEFINED_COMMAND_ERROR:
1910 std::unique_ptr<struct mi_parse> command;
1923 catch (
const gdb_exception &exception)
1929 if (command != NULL)
1931 command->token =
token;
1943 catch (
const gdb_exception &result)
1987 int current_frame_level;
1999 if (current_frame_level != -1
2024 error (_(
"Cannot specify --thread-group together with --all"));
2027 error (_(
"Cannot specify --thread together with --all"));
2030 error (_(
"Cannot specify --thread together with --thread-group"));
2033 error (_(
"Cannot specify --frame without --thread"));
2041 error (_(
"Invalid thread group for the --thread-group option"));
2060 gdb::optional<scoped_restore_current_thread> thread_saver;
2066 error (_(
"Invalid thread id: %d"), parse->
thread);
2069 error (_(
"Thread id: %d has terminated"), parse->
thread);
2072 thread_saver.emplace ();
2077 gdb::optional<scoped_restore_selected_frame> frame_saver;
2078 if (parse->
frame != -1)
2081 int frame = parse->
frame;
2087 frame_saver.emplace ();
2092 error (_(
"Invalid frame id: %d"), frame);
2095 gdb::optional<scoped_restore_current_language> lang_saver;
2098 lang_saver.emplace ();
2104 gdb_assert (parse->
cmd !=
nullptr);
2106 gdb::optional<scoped_restore_tmpl<int>> restore_suppress_notification
2124 std::string
run (cmd);
2129 gdb_assert (args ==
nullptr);
2142 std::string
run = cli_command;
2154 unsigned long sent_so_far,
2155 unsigned long total_section,
2156 unsigned long total_sent,
2157 unsigned long grand_total)
2159 using namespace std::chrono;
2160 static steady_clock::time_point last_update;
2161 static char *previous_sect_name = NULL;
2170 if (uiout ==
nullptr)
2173 scoped_restore save_uiout
2176 new_section = (previous_sect_name ?
2177 strcmp (previous_sect_name, section_name) : 1);
2180 xfree (previous_sect_name);
2181 previous_sect_name = xstrdup (section_name);
2188 uiout->field_string (
"section", section_name);
2189 uiout->field_signed (
"section-size", total_section);
2190 uiout->field_signed (
"total-size", grand_total);
2197 steady_clock::time_point time_now = steady_clock::now ();
2198 if (time_now - last_update > milliseconds (500))
2200 last_update = time_now;
2206 uiout->field_string (
"section", section_name);
2207 uiout->field_signed (
"section-sent", sent_so_far);
2208 uiout->field_signed (
"section-size", total_section);
2209 uiout->field_signed (
"total-sent", total_sent);
2210 uiout->field_signed (
"total-size", grand_total);
2221 using namespace std::chrono;
2249 using namespace std::chrono;
2257 ",time={wallclock=\"%0.5f\",user=\"%0.5f\",system=\"%0.5f\"}",
2264 LONGEST initval = 0;
2268 if (argc != 1 && argc != 2)
2269 error (_(
"Usage: -trace-define-variable VARIABLE [VALUE]"));
2273 error (_(
"Name of trace variable should start with '$'"));
2291 error (_(
"-trace-list-variables: no arguments allowed"));
2302 error (_(
"trace selection mode is required"));
2306 if (strcmp (mode,
"none") == 0)
2314 if (strcmp (mode,
"frame-number") == 0)
2317 error (_(
"frame number is required"));
2320 else if (strcmp (mode,
"tracepoint-number") == 0)
2323 error (_(
"tracepoint number is required"));
2326 else if (strcmp (mode,
"pc") == 0)
2329 error (_(
"PC is required"));
2332 else if (strcmp (mode,
"pc-inside-range") == 0)
2335 error (_(
"Start and end PC are required"));
2339 else if (strcmp (mode,
"pc-outside-range") == 0)
2342 error (_(
"Start and end PC are required"));
2346 else if (strcmp (mode,
"line") == 0)
2349 error (_(
"Line is required"));
2351 std::vector<symtab_and_line> sals
2357 error (_(
"Could not find the specified line"));
2359 CORE_ADDR start_pc, end_pc;
2363 error (_(
"Could not find the specified line"));
2366 error (_(
"Invalid mode '%s'"), mode);
2375 int target_saves = 0;
2376 int generate_ctf = 0;
2383 TARGET_SAVE_OPT, CTF_OPT
2385 static const struct mi_opt opts[] =
2387 {
"r", TARGET_SAVE_OPT, 0},
2388 {
"ctf", CTF_OPT, 0},
2394 int opt =
mi_getopt (
"-trace-save", argc, argv, opts,
2399 switch ((
enum opt) opt)
2401 case TARGET_SAVE_OPT:
2410 if (argc - oind != 1)
2411 error (_(
"Exactly one argument required "
2412 "(file in which to save trace data)"));
2414 filename = argv[oind];
2446 if (argc != 0 && argc != 1)
2447 error (_(
"Invalid MI command"));
2470 gdb::optional<ui_out_emit_tuple> tuple_emitter;
2472 tuple_emitter.emplace (uiout,
nullptr);
2481 if (
type->
code () != TYPE_CODE_ARRAY
2482 &&
type->
code () != TYPE_CODE_STRUCT
2483 &&
type->
code () != TYPE_CODE_UNION)
2519 int registers_format =
'x';
2520 int memory_contents = 0;
2529 static const struct mi_opt opts[] =
2531 {
"-var-print-values", VAR_PRINT_VALUES, 1},
2532 {
"-comp-print-values", COMP_PRINT_VALUES, 1},
2533 {
"-registers-format", REGISTERS_FORMAT, 1},
2534 {
"-memory-contents", MEMORY_CONTENTS, 0},
2541 int opt =
mi_getopt (
"-trace-frame-collected", argc, argv, opts,
2545 switch ((
enum opt) opt)
2547 case VAR_PRINT_VALUES:
2550 case COMP_PRINT_VALUES:
2553 case REGISTERS_FORMAT:
2554 registers_format = oarg[0];
2556 case MEMORY_CONTENTS:
2557 memory_contents = 1;
2563 error (_(
"Usage: -trace-frame-collected "
2564 "[--var-print-values PRINT_VALUES] "
2565 "[--comp-print-values PRINT_VALUES] "
2566 "[--registers-format FORMAT]"
2567 "[--memory-contents]"));
2580 clist = &stepping_list;
2582 clist = &tracepoint_list;
2589 const std::vector<std::string> &wholly_collected
2591 for (
size_t i = 0; i < wholly_collected.size (); i++)
2593 const std::string &str = wholly_collected[i];
2602 const std::vector<std::string> &computed = clist->
computed ();
2603 for (
size_t i = 0; i < computed.size (); i++)
2605 const std::string &str = computed[i];
2639 for (
int tvar : tinfo->
tvars)
2665 std::vector<mem_range> available_memory;
2671 for (
const mem_range &r : available_memory)
2680 gdb::byte_vector data (r.length);
2682 if (memory_contents)
2686 std::string data_str = bin2hex (data.data (), r.length);
2719 error (_(
"Usage: -complete COMMAND"));
2722 error (_(
"max-completions is zero, completion is disabled."));
2724 int quote_char =
'\0';
2729 std::string arg_prefix (argv[0], word - argv[0]);
2749 arg_prefix.c_str (), result.
match_list[i + 1]);
2765Set whether MI asynchronous mode is enabled."), _(
"\
2766Show whether MI asynchronous mode is enabled."), _(
"\
2767Tells GDB whether MI should be in asynchronous mode."),
void print_ada_task_info(struct ui_out *uiout, const char *taskno_str, struct inferior *inf)
struct gdbarch * get_current_arch(void)
struct gdbarch * target_gdbarch(void)
bool fix_breakpoint_script_output_globally
bool fix_multi_location_breakpoint_output_globally
void bpstat_do_actions(void)
const std::vector< std::string > & wholly_collected()
const std::vector< std::string > & computed()
struct program_space * pspace
struct ui_file * raw_stdout
struct value * cooked_read_value(int regnum)
void void putstr(const char *str, int quoter)
void field_core_addr(const char *fldname, struct gdbarch *gdbarch, CORE_ADDR address)
void field_string(const char *fldname, const char *string, const ui_file_style &style=ui_file_style())
void field_fmt(const char *fldname, const char *format,...) ATTRIBUTE_PRINTF(3
void field_signed(const char *fldname, LONGEST value)
void field_skip(const char *fldname)
void field_stream(const char *fldname, string_file &stream, const ui_file_style &style=ui_file_style())
struct cmd_list_element * showlist
struct cmd_list_element * setlist
struct cmd_list_element * add_alias_cmd(const char *name, cmd_list_element *target, enum command_class theclass, int abbrev_flag, struct cmd_list_element **list)
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)
completion_result complete(const char *line, char const **word, int *quote_char)
void write_memory_with_notification(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
static void store_signed_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, LONGEST val)
struct value * evaluate_expression(struct expression *exp, struct type *expect_type)
struct value * evaluate_type(struct expression *exp)
CORE_ADDR parse_and_eval_address(const char *exp)
struct value * parse_and_eval(const char *exp)
void async_enable_stdin(void)
std::unique_ptr< expression > expression_up
expression_up parse_expression(const char *, innermost_block_tracker *=nullptr, bool void_context_p=false)
int ext_lang_initialized_p(const struct extension_language_defn *extlang)
const struct extension_language_defn * get_ext_lang_defn(enum extension_language lang)
struct value * value_of_register(int regnum, frame_info_ptr frame)
void select_frame(frame_info_ptr fi)
std::unique_ptr< readonly_detached_regcache > frame_save_as_regcache(frame_info_ptr this_frame)
void save_selected_frame(frame_id *frame_id, int *frame_level) noexcept
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
frame_info_ptr get_selected_frame(const char *message)
frame_info_ptr get_current_frame(void)
void print_stack_frame(frame_info_ptr, int print_level, enum print_what print_what, int set_current_sal)
void return_command(const char *, int)
frame_info_ptr find_relative_frame(frame_info_ptr, int *)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
const char * gdbarch_register_name(struct gdbarch *gdbarch, int regnr)
int gdbarch_addressable_memory_unit_size(struct gdbarch *gdbarch)
static int gdbarch_num_cooked_regs(gdbarch *arch)
void execute_command(const char *, int)
struct thread_info * any_live_thread_of_inferior(inferior *inf)
void thread_select(const char *tidstr, class thread_info *thr)
void print_selected_thread_frame(struct ui_out *uiout, user_selected_what selection)
all_non_exited_threads_range all_non_exited_threads(process_stratum_target *proc_target=nullptr, ptid_t filter_ptid=minus_one_ptid)
struct thread_info * find_thread_global_id(int global_id)
void update_thread_list(void)
void switch_to_thread(struct thread_info *thr)
struct thread_info * iterate_over_threads(thread_callback_func, void *)
struct thread_info * any_thread_of_inferior(inferior *inf)
void switch_to_no_thread()
void print_thread_info(struct ui_out *uiout, const char *requested_threads, int pid)
struct type * check_typedef(struct type *type)
void print_scalar_formatted(const gdb_byte *, struct type *, const struct value_print_options *, int, struct ui_file *)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
void continue_1(int all_threads)
void prepare_execution_command(struct target_ops *target, int background)
void detach_command(const char *args, int from_tty)
void interrupt_target_1(bool all_threads)
struct inferior * add_inferior_with_spaces(void)
void set_current_inferior(struct inferior *inf)
void delete_inferior(struct inferior *inf)
int have_live_inferiors(void)
void switch_to_inferior_and_push_target(inferior *new_inf, bool no_connection, inferior *org_inf)
struct inferior * current_inferior(void)
void switch_to_inferior_no_thread(inferior *inf)
struct inferior * find_inferior_id(int num)
all_inferiors_range all_inferiors(process_stratum_target *proc_target=nullptr)
void clear_proceed_status(int step)
enum exec_direction_kind execution_direction
void proceed(CORE_ADDR addr, enum gdb_signal siggnal)
int current_interp_named_p(const char *interp_name)
struct interp * current_interpreter(void)
struct interp * command_interp(void)
const struct language_defn * current_language
enum language set_language(enum language lang)
std::vector< symtab_and_line > decode_line_with_current_source(const char *string, int flags)
@ DECODE_LINE_FUNFIRSTLINE
mi_cmd_argv_ftype mi_cmd_exec_jump
mi_cmd_argv_ftype mi_cmd_data_list_register_names
mi_cmd_argv_ftype mi_cmd_exec_next_instruction
mi_cmd_argv_ftype mi_cmd_data_read_memory_bytes
mi_cmd_argv_ftype mi_cmd_trace_stop
mi_cmd_argv_ftype mi_cmd_exec_finish
mi_cmd_argv_ftype mi_cmd_ada_task_info
mi_cmd_argv_ftype mi_cmd_data_list_changed_registers
mi_cmd_argv_ftype mi_cmd_exec_return
mi_cmd_argv_ftype mi_cmd_exec_next
mi_cmd_argv_ftype mi_cmd_exec_step
mi_cmd_argv_ftype mi_cmd_add_inferior
mi_cmd_argv_ftype mi_cmd_enable_timings
mi_cmd_argv_ftype mi_cmd_data_evaluate_expression
mi_cmd_argv_ftype mi_cmd_data_read_memory
mi_cmd_argv_ftype mi_cmd_target_detach
mi_cmd_argv_ftype mi_cmd_thread_info
mi_cmd_argv_ftype mi_cmd_exec_interrupt
mi_cmd_argv_ftype mi_cmd_trace_find
mi_cmd_argv_ftype mi_cmd_exec_step_instruction
mi_cmd_argv_ftype mi_cmd_trace_frame_collected
mi_cmd_argv_ftype mi_cmd_trace_start
mi_cmd_argv_ftype mi_cmd_interpreter_exec
mi_cmd_argv_ftype mi_cmd_trace_save
mi_cmd_argv_ftype mi_cmd_remove_inferior
mi_cmd_argv_ftype mi_cmd_data_write_register_values
mi_cmd_argv_ftype mi_cmd_list_features
mi_cmd_argv_ftype mi_cmd_data_write_memory
mi_cmd_argv_ftype mi_cmd_data_write_memory_bytes
mi_cmd_argv_ftype mi_cmd_exec_continue
mi_cmd_argv_ftype mi_cmd_target_flash_erase
mi_cmd_argv_ftype mi_cmd_thread_select
mi_cmd_argv_ftype mi_cmd_list_thread_groups
mi_cmd_argv_ftype mi_cmd_trace_define_variable
mi_cmd_argv_ftype mi_cmd_thread_list_ids
mi_cmd_argv_ftype mi_cmd_gdb_exit
mi_cmd_argv_ftype mi_cmd_list_target_features
mi_cmd_argv_ftype mi_cmd_trace_status
mi_cmd_argv_ftype mi_cmd_trace_list_variables
mi_cmd_argv_ftype mi_cmd_exec_run
mi_cmd_argv_ftype mi_cmd_data_list_register_values
mi_cmd_argv_ftype mi_cmd_complete
int mi_getopt(const char *prefix, int argc, char **argv, const struct mi_opt *opts, int *oind, char **oarg)
void mi_load_progress(const char *section_name, unsigned long sent_so_far, unsigned long total_section, unsigned long total_sent, unsigned long grand_total)
void _initialize_mi_main()
static void timestamp(struct mi_timestamp *tv)
void mi_cmd_fix_breakpoint_script_output(const char *command, char **argv, int argc)
void mi_cmd_fix_multi_location_breakpoint_output(const char *command, char **argv, int argc)
static void mi_execute_async_cli_command(const char *cli_command, char **argv, int argc)
static void exec_continue(char **argv, int argc)
static void exec_reverse_continue(char **argv, int argc)
static void proceed_thread(struct thread_info *thread, int pid)
void mi_print_timing_maybe(struct ui_file *file)
static void mi_print_exception(const char *token, const struct gdb_exception &exception)
static void mi_cmd_execute(struct mi_parse *parse)
static int interrupt_thread_callback(struct thread_info *thread, void *arg)
static struct mi_parse * current_context
static bool register_changed_p(int regnum, readonly_detached_regcache *, readonly_detached_regcache *)
static void print_one_inferior(struct inferior *inferior, bool recurse, const std::set< int > &ids)
static void output_register(frame_info_ptr, int regnum, int format, int skip_unavailable)
static void show_mi_async_command(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void list_available_thread_groups(const std::set< int > &ids, int recurse)
static void set_mi_async_command(const char *args, int from_tty, struct cmd_list_element *c)
static void print_diff_now(struct ui_file *file, struct mi_timestamp *start)
static void print_diff(struct ui_file *file, struct mi_timestamp *start, struct mi_timestamp *end)
int running_result_record_printed
void mi_execute_cli_command(const char *cmd, bool args_p, const char *args)
static struct mi_timestamp * current_command_ts
static int collect_cores(struct thread_info *ti, void *xdata)
static void run_one_inferior(inferior *inf, bool start_p)
void mi_execute_command(const char *cmd, int from_tty)
static int proceed_thread_callback(struct thread_info *thread, void *arg)
static void captured_mi_execute_command(struct ui_out *uiout, struct mi_parse *context)
static void print_variable_or_computed(const char *expression, enum print_values values)
static int find_thread_of_process(struct thread_info *ti, void *p)
static void output_cores(struct ui_out *uiout, const char *field_name, const char *xcores)
void mi_out_rewind(ui_out *uiout)
mi_ui_out * mi_out_new(const char *mi_version)
void mi_out_put(ui_out *uiout, struct ui_file *stream)
enum print_values mi_parse_print_values(const char *name)
observable< user_selected_what > user_selected_context_changed
std::unique_ptr< osdata > get_osdata(const char *type)
const std::string * get_osdata_column(const osdata_item &item, const char *name)
void set_current_program_space(struct program_space *pspace)
static gdbpy_ref field_name(struct type *type, int field)
int register_size(struct gdbarch *gdbarch, int regnum)
void regcache_cooked_write_signed(struct regcache *regcache, int regnum, LONGEST val)
struct regcache * get_current_regcache(void)
struct type * builtin_int8
struct type * builtin_int64
struct type * builtin_int32
struct type * builtin_int16
gdb::optional< scoped_restore_tmpl< int > > do_suppress_notification() const
virtual void invoke(struct mi_parse *parse) const =0
bool preserve_user_selected_context() const
struct mi_timestamp * cmd_start
const struct mi_command * cmd
user_cpu_time_clock::time_point utime
std::chrono::steady_clock::time_point wallclock
system_cpu_time_clock::time_point stime
const std::set< int > * inferiors
gdb::unique_xmalloc_ptr< char > exec_filename
const char * shortname() const
enum prompt_state prompt_state
int m_previous_frame_level
frame_id m_previous_frame_id
bool find_line_pc_range(struct symtab_and_line sal, CORE_ADDR *startptr, CORE_ADDR *endptr)
struct target_ops * find_run_target(void)
bool target_get_trace_state_variable_value(int tsv, LONGEST *val)
void target_log_command(const char *p)
bool target_can_execute_reverse()
void flash_erase_command(const char *cmd, int from_tty)
std::vector< memory_read_result > read_memory_robust(struct target_ops *ops, const ULONGEST offset, const LONGEST len)
bool target_can_async_p()
int target_core_of_thread(ptid_t ptid)
int target_has_registers()
void target_stop(ptid_t ptid)
LONGEST target_read(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *buf, ULONGEST offset, LONGEST len)
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
const char * target_shortname()
void quit_force(int *exit_arg, int from_tty)
scoped_value_mark prepare_execute_command()
void trace_save_tfile(const char *filename, int target_does_save)
void trace_save_ctf(const char *dirname, int target_does_save)
struct trace_state_variable * find_trace_state_variable(const char *name)
struct traceframe_info * get_traceframe_info(void)
struct trace_status * current_trace_status(void)
int get_traceframe_number(void)
struct trace_state_variable * find_trace_state_variable_by_number(int number)
void check_trace_running(struct trace_status *status)
void validate_trace_state_variable_name(const char *name)
void stop_tracing(const char *note)
void start_tracing(const char *notes)
void tfind_1(enum trace_find_type type, int num, CORE_ADDR addr1, CORE_ADDR addr2, int from_tty)
struct trace_state_variable * create_trace_state_variable(const char *name)
int traceframe_available_memory(std::vector< mem_range > *result, CORE_ADDR memaddr, ULONGEST len)
struct bp_location * get_traceframe_location(int *stepping_frame_p)
void tvariables_info_1(void)
void trace_status_mi(int on_stop)
void encode_actions(struct bp_location *tloc, struct collection_list *tracepoint_list, struct collection_list *stepping_list)
void type_print(struct type *type, const char *varstring, struct ui_file *stream, int show)
void gdb_printf(struct ui_file *stream, const char *format,...)
void gdb_flush(struct ui_file *stream)
void gdb_puts(const char *linebuffer, struct ui_file *stream)
void get_formatted_print_options(struct value_print_options *opts, char format)
void get_no_prettyformat_print_options(struct value_print_options *opts)
void get_user_print_options(struct value_print_options *opts)
void common_val_print(struct value *value, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language)
struct type * value_type(const struct value *value)
int value_entirely_available(struct value *value)
LONGEST value_as_long(struct value *val)
bool value_contents_eq(const struct value *val1, LONGEST offset1, const struct value *val2, LONGEST offset2, LONGEST length)
value_ref_ptr release_value(struct value *val)