37#include "gdbsupport/event-loop.h"
48#include "gdbsupport/gdb_splay_tree.h"
55#include "gdbsupport/gdb_optional.h"
56#include "gdbsupport/byte-vector.h"
59#include "gdbsupport/run-time-clock.h"
62#include "gdbsupport/rsp-low.h"
93 int skip_unavailable);
109 error (_(
"Cannot change this setting while the inferior is running."));
121 _(
"Whether MI is in asynchronous mode is %s.\n"),
169 if (argc > 0 && strcmp(argv[0],
"--reverse") == 0)
180 if (argc > 0 && strcmp(argv[0],
"--reverse") == 0)
190 if (argc > 0 && strcmp(argv[0],
"--reverse") == 0)
201 if (argc > 0 && strcmp(argv[0],
"--reverse") == 0)
211 if (argc > 0 && strcmp(argv[0],
"--reverse") == 0)
254 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
260 int pid = *(
int *)arg;
284 (
"MI continue all threads in non-stop");
305 scoped_restore save_multi = make_scoped_restore (&
sched_multi);
329 error (_(
"Already in reverse mode."));
342 if (argc > 0 && strcmp (argv[0],
"--reverse") == 0)
351 int pid = *(
int *)arg;
356 if (thread->
ptid.pid () !=
pid)
390 (
"interrupting all threads of thread group");
411 const char *run_cmd = start_p ?
"start" :
"run";
419 error (_(
"Inferior has no threads."));
426 async_p ?
"&" : NULL);
439 static const struct mi_opt opts[] =
441 {
"-start", START_OPT, 0},
450 int opt =
mi_getopt (
"-exec-run", argc, argv, opts, &oind, &oarg);
454 switch ((
enum opt) opt)
465 error (_(
"Invalid argument: %s"), argv[oind]);
476 const char *run_cmd = start_p ?
"start" :
"run";
481 async_p ?
"&" : NULL);
500 if (argc != 0 && argc != 1)
501 error (_(
"Usage: -target-detach [pid | thread-group]"));
513 int id = strtoul (argv[0] + 1, &end, 0);
516 error (_(
"Invalid syntax of thread-group id '%s'"), argv[0]);
520 error (_(
"Non-existent thread-group id '%d'"),
id);
527 pid = strtol (argv[0], &end, 10);
530 error (_(
"Invalid identifier '%s'"), argv[0]);
537 error (_(
"Thread group is empty"));
556 error (_(
"-thread-select: USAGE: threadnum."));
561 error (_(
"Thread ID %d not known."),
num);
573 error (_(
"-thread-list-ids: No arguments required."));
576 int current_thread = -1;
586 current_thread = tp->global_num;
593 if (current_thread != -1)
594 current_uiout->field_signed (
"current-thread-id", current_thread);
601 if (argc != 0 && argc != 1)
602 error (_(
"Invalid MI command"));
618 if (ti->
ptid.pid () == data->pid)
623 data->cores.insert (core);
637 const std::set<int> &ids)
641 if (ids.empty () || (ids.find (
inferior->
pid) != ids.end ()))
666 if (!data.cores.empty ())
670 for (
int b : data.cores)
687 auto cores = make_unique_xstrdup (xcores);
688 char *p =
cores.get ();
691 for (p = strtok_r (p,
",", &saveptr); p; p = strtok_r (NULL,
",", &saveptr))
702 std::map<int, std::vector<osdata_item>> tree;
705 std::unique_ptr<osdata> data =
get_osdata (
"processes");
709 std::unique_ptr<osdata> threads =
get_osdata (
"threads");
714 int pid_i = strtoul (
pid->c_str (), NULL, 0);
716 tree[pid_i].push_back (item);
729 int pid_i = strtoul (
pid->c_str (), NULL, 0);
734 if (!ids.empty () && ids.find (pid_i) == ids.end ())
750 auto n = tree.find (pid_i);
751 if (n != tree.end ())
753 std::vector<osdata_item> &children = n->second;
783 AVAILABLE_OPT, RECURSE_OPT
785 static const struct mi_opt opts[] =
787 {
"-available", AVAILABLE_OPT, 0},
788 {
"-recurse", RECURSE_OPT, 1},
797 int opt =
mi_getopt (
"-list-thread-groups", argc, argv, opts,
802 switch ((
enum opt) opt)
808 if (strcmp (oarg,
"0") == 0)
810 else if (strcmp (oarg,
"1") == 0)
813 error (_(
"only '0' and '1' are valid values "
814 "for the '--recurse' option"));
819 for (; oind < argc; ++oind)
824 if (*(argv[oind]) !=
'i')
825 error (_(
"invalid syntax of group id '%s'"), argv[oind]);
827 inf = strtoul (argv[oind] + 1, &end, 0);
830 error (_(
"invalid syntax of group id '%s'"), argv[oind]);
838 else if (ids.size () == 1)
841 int id = *(ids.begin ());
845 error (_(
"Non-existent thread group id '%d'"),
id);
897 for (i = 0; i < argc; i++)
900 if (regnum < 0 || regnum >= numregs)
901 error (_(
"bad register number"));
912 const char *
const *argv,
int argc)
914 static std::unique_ptr<readonly_detached_regcache> this_regs;
916 std::unique_ptr<readonly_detached_regcache> prev_regs;
926 prev_regs = std::move (this_regs);
958 for (i = 0; i < argc; i++)
971 error (_(
"bad register number"));
980 struct value *prev_value, *this_value;
990 gdb_assert (prev_value != NULL);
991 gdb_assert (this_value != NULL);
993 auto ret = !prev_value->
contents_eq (0, this_value, 0,
1017 int regnum, numregs, format;
1019 int skip_unavailable = 0;
1025 static const struct mi_opt opts[] =
1027 {
"-skip-unavailable", SKIP_UNAVAILABLE, 0},
1041 int opt =
mi_getopt (
"-data-list-register-values", argc, argv,
1042 opts, &oind, &oarg);
1046 switch ((
enum opt) opt)
1048 case SKIP_UNAVAILABLE:
1049 skip_unavailable = 1;
1054 if (argc - oind < 1)
1055 error (_(
"-data-list-register-values: Usage: "
1056 "-data-list-register-values [--skip-unavailable] <format>"
1057 " [<regnum1>...<regnumN>]"));
1059 format = (int) argv[oind][0];
1067 if (argc - oind == 1)
1082 for (i = 1 + oind; i < argc; i++)
1091 error (_(
"bad register number"));
1101 int skip_unavailable)
1122 opts.deref_ref =
true;
1133 const char *
const *argv,
int argc)
1151 error (_(
"-data-write-register-values: Usage: -data-write-register-"
1152 "values <format> [<regnum1> <value1>...<regnumN> <valueN>]"));
1155 error (_(
"-data-write-register-values: No registers."));
1158 error (_(
"-data-write-register-values: No regs and values specified."));
1161 error (_(
"-data-write-register-values: "
1162 "Regs and vals are not in pairs."));
1164 for (i = 1; i < argc; i = i + 2)
1166 int regnum = atoi (argv[i]);
1180 error (_(
"bad register number"));
1197 error (_(
"-data-evaluate-expression: "
1198 "Usage: -data-evaluate-expression expression"));
1202 val =
expr->evaluate ();
1208 opts.deref_ref =
false;
1240 long total_bytes, nr_cols, nr_rows;
1242 struct type *word_type;
1254 static const struct mi_opt opts[] =
1256 {
"o", OFFSET_OPT, 1},
1262 int opt =
mi_getopt (
"-data-read-memory", argc, argv, opts,
1267 switch ((
enum opt) opt)
1270 offset = atol (oarg);
1277 if (argc < 5 || argc > 6)
1278 error (_(
"-data-read-memory: Usage: "
1279 "ADDR WORD-FORMAT WORD-SIZE NR-ROWS NR-COLS [ASCHAR]."));
1287 word_format = argv[1][0];
1289 word_size = atol (argv[2]);
1313 nr_rows = atol (argv[3]);
1315 error (_(
"-data-read-memory: invalid number of rows."));
1318 nr_cols = atol (argv[4]);
1320 error (_(
"-data-read-memory: invalid number of columns."));
1329 total_bytes = word_size * nr_rows * nr_cols;
1331 gdb::byte_vector mbuf (total_bytes);
1335 mbuf.data (), addr, total_bytes);
1337 error (_(
"Unable to read memory."));
1356 for (row = 0, row_byte = 0;
1358 row++, row_byte += nr_cols * word_size)
1371 for (col = 0, col_byte = row_byte;
1373 col++, col_byte += word_size)
1375 if (col_byte + word_size > nr_bytes)
1383 &print_opts, word_asize, &stream);
1394 for (
byte = row_byte;
1395 byte < row_byte + word_size * nr_cols;
byte++)
1397 if (
byte >= nr_bytes)
1399 else if (mbuf[
byte] < 32 || mbuf[
byte] > 126)
1400 stream.
putc (aschar);
1402 stream.
putc (mbuf[
byte]);
1426 static const struct mi_opt opts[] =
1428 {
"o", OFFSET_OPT, 1},
1434 int opt =
mi_getopt (
"-data-read-memory-bytes", argc, argv, opts,
1438 switch ((
enum opt) opt)
1441 offset = atol (oarg);
1449 error (_(
"Usage: [ -o OFFSET ] ADDR LENGTH."));
1452 length = atol (argv[1]);
1454 std::vector<memory_read_result> result
1457 if (result.size () == 0)
1458 error (_(
"Unable to read memory."));
1469 std::string data = bin2hex (read_result.data.get (),
1470 (read_result.end - read_result.begin)
1511 static const struct mi_opt opts[] =
1513 {
"o", OFFSET_OPT, 1},
1519 int opt =
mi_getopt (
"-data-write-memory", argc, argv, opts,
1524 switch ((
enum opt) opt)
1527 offset = atol (oarg);
1535 error (_(
"-data-write-memory: Usage: "
1536 "[-o COLUMN_OFFSET] ADDR FORMAT WORD-SIZE VALUE."));
1542 word_size = atol (argv[2]);
1545 addr += (offset * word_size);
1550 gdb::byte_vector buffer (word_size);
1568 size_t len_hex, len_bytes, len_units, i, steps, remaining_units;
1569 long int count_units;
1572 if (argc != 2 && argc != 3)
1573 error (_(
"Usage: ADDR DATA [COUNT]."));
1577 len_hex = strlen (cdata);
1580 if (len_hex % (unit_size * 2) != 0)
1581 error (_(
"Hex-encoded '%s' must represent an integral number of "
1582 "addressable memory units."),
1585 len_bytes = len_hex / 2;
1586 len_units = len_bytes / unit_size;
1589 count_units = strtoul (argv[2], NULL, 10);
1591 count_units = len_units;
1593 gdb::byte_vector databuf (len_bytes);
1595 for (i = 0; i < len_bytes; ++i)
1598 if (sscanf (cdata + i * 2,
"%02x", &x) != 1)
1599 error (_(
"Invalid argument"));
1600 databuf[i] = (gdb_byte) x;
1603 gdb::byte_vector data;
1604 if (len_units < count_units)
1608 data = gdb::byte_vector (count_units * unit_size);
1611 steps = count_units / len_units;
1613 remaining_units = count_units % len_units;
1614 for (i = 0; i < steps; i++)
1615 memcpy (&data[i * len_bytes], &databuf[0], len_bytes);
1617 if (remaining_units > 0)
1618 memcpy (&data[steps * len_bytes], &databuf[0],
1619 remaining_units * unit_size);
1625 data = std::move (databuf);
1638 if (strcmp (argv[0],
"yes") == 0)
1640 else if (strcmp (argv[0],
"no") == 0)
1651 error (_(
"-enable-timings: Usage: %s {yes|no}"), command);
1666 uiout->
field_string (NULL,
"breakpoint-notifications");
1670 uiout->
field_string (NULL,
"undefined-command-error-code");
1672 uiout->
field_string (NULL,
"data-disassemble-a-option");
1681 error (_(
"-list-features should be passed no arguments"));
1700 error (_(
"-list-target-features should be passed no arguments"));
1706 bool no_connection =
false;
1713 static const struct mi_opt opts[] =
1715 {
"-no-connection", NO_CONNECTION_OPT, 0},
1724 int opt =
mi_getopt (
"-add-inferior", argc, argv, opts, &oind, &oarg);
1728 switch ((
enum opt) opt)
1730 case NO_CONNECTION_OPT:
1731 no_connection =
true;
1747 if (proc_target !=
nullptr)
1762 error (_(
"-remove-inferior should be passed a single argument"));
1767 if (inf_to_remove == NULL)
1768 error (_(
"the specified thread group does not exist"));
1770 if (inf_to_remove->
pid != 0)
1771 error (_(
"cannot remove an active inferior"));
1776 struct inferior *new_inferior = NULL;
1780 if (
inf != inf_to_remove)
1784 if (new_inferior == NULL)
1785 error (_(
"Cannot remove last inferior"));
1788 if (new_inferior->
pid != 0)
1816 scoped_restore save_token
1821 switch (context->
op)
1827 " token=`%s' command=`%s' args=`%s'\n",
1860 const char *argv[2];
1869 argv[1] = context->
command.get ();
1899 const struct gdb_exception &exception)
1903 if (exception.message == NULL)
1909 switch (exception.error)
1911 case UNDEFINED_COMMAND_ERROR:
1923 std::unique_ptr<struct mi_parse> command;
1936 command = gdb::make_unique<mi_parse> (cmd, &
token);
1938 catch (
const gdb_exception &exception)
1943 if (command != NULL)
1945 command->token = std::move (
token);
1957 catch (
const gdb_exception &result)
1972 if (result.reason == RETURN_FORCED_QUIT)
1987 error (_(
"Command is not an MI command"));
1994 scoped_restore save_token = make_scoped_restore (&mi->
current_token,
1995 context->
token.c_str ());
1997 scoped_restore save_debug = make_scoped_restore (&
mi_debug_p, 0);
2026 int current_frame_level;
2038 if (current_frame_level != -1
2063 error (_(
"Cannot specify --thread-group together with --all"));
2066 error (_(
"Cannot specify --thread together with --all"));
2069 error (_(
"Cannot specify --thread together with --thread-group"));
2072 error (_(
"Cannot specify --frame without --thread"));
2080 error (_(
"Invalid thread group for the --thread-group option"));
2099 gdb::optional<scoped_restore_current_thread> thread_saver;
2105 error (_(
"Invalid thread id: %d"), parse->
thread);
2108 error (_(
"Thread id: %d has terminated"), parse->
thread);
2111 thread_saver.emplace ();
2116 gdb::optional<scoped_restore_selected_frame> frame_saver;
2117 if (parse->
frame != -1)
2120 int frame = parse->
frame;
2126 frame_saver.emplace ();
2131 error (_(
"Invalid frame id: %d"), frame);
2134 gdb::optional<scoped_restore_current_language> lang_saver;
2137 lang_saver.emplace ();
2143 gdb_assert (parse->
cmd !=
nullptr);
2145 gdb::optional<scoped_restore_tmpl<int>> restore_suppress_notification
2163 std::string
run (cmd);
2168 gdb_assert (args ==
nullptr);
2182 std::string
run = cli_command;
2194 unsigned long sent_so_far,
2195 unsigned long total_section,
2196 unsigned long total_sent,
2197 unsigned long grand_total)
2199 using namespace std::chrono;
2200 static steady_clock::time_point last_update;
2201 static char *previous_sect_name = NULL;
2215 if (uiout ==
nullptr)
2218 scoped_restore save_uiout
2221 new_section = (previous_sect_name ?
2222 strcmp (previous_sect_name, section_name) : 1);
2225 xfree (previous_sect_name);
2226 previous_sect_name = xstrdup (section_name);
2233 uiout->field_string (
"section", section_name);
2234 uiout->field_signed (
"section-size", total_section);
2235 uiout->field_signed (
"total-size", grand_total);
2242 steady_clock::time_point time_now = steady_clock::now ();
2243 if (time_now - last_update > milliseconds (500))
2245 last_update = time_now;
2251 uiout->field_string (
"section", section_name);
2252 uiout->field_signed (
"section-sent", sent_so_far);
2253 uiout->field_signed (
"section-size", total_section);
2254 uiout->field_signed (
"total-sent", total_sent);
2255 uiout->field_signed (
"total-size", grand_total);
2266 using namespace std::chrono;
2294 using namespace std::chrono;
2302 ",time={wallclock=\"%0.5f\",user=\"%0.5f\",system=\"%0.5f\"}",
2310 LONGEST initval = 0;
2314 if (argc != 1 && argc != 2)
2315 error (_(
"Usage: -trace-define-variable VARIABLE [VALUE]"));
2319 error (_(
"Name of trace variable should start with '$'"));
2338 error (_(
"-trace-list-variables: no arguments allowed"));
2349 error (_(
"trace selection mode is required"));
2353 if (strcmp (mode,
"none") == 0)
2361 if (strcmp (mode,
"frame-number") == 0)
2364 error (_(
"frame number is required"));
2367 else if (strcmp (mode,
"tracepoint-number") == 0)
2370 error (_(
"tracepoint number is required"));
2373 else if (strcmp (mode,
"pc") == 0)
2376 error (_(
"PC is required"));
2379 else if (strcmp (mode,
"pc-inside-range") == 0)
2382 error (_(
"Start and end PC are required"));
2386 else if (strcmp (mode,
"pc-outside-range") == 0)
2389 error (_(
"Start and end PC are required"));
2393 else if (strcmp (mode,
"line") == 0)
2396 error (_(
"Line is required"));
2398 std::vector<symtab_and_line> sals
2404 error (_(
"Could not find the specified line"));
2406 CORE_ADDR start_pc, end_pc;
2410 error (_(
"Could not find the specified line"));
2413 error (_(
"Invalid mode '%s'"), mode);
2422 int target_saves = 0;
2423 int generate_ctf = 0;
2424 const char *filename;
2430 TARGET_SAVE_OPT, CTF_OPT
2432 static const struct mi_opt opts[] =
2434 {
"r", TARGET_SAVE_OPT, 0},
2435 {
"ctf", CTF_OPT, 0},
2441 int opt =
mi_getopt (
"-trace-save", argc, argv, opts,
2446 switch ((
enum opt) opt)
2448 case TARGET_SAVE_OPT:
2457 if (argc - oind != 1)
2458 error (_(
"Exactly one argument required "
2459 "(file in which to save trace data)"));
2461 filename = argv[oind];
2493 if (argc != 0 && argc != 1)
2494 error (_(
"Invalid MI command"));
2512 val =
expr->evaluate_type ();
2514 val =
expr->evaluate ();
2516 gdb::optional<ui_out_emit_tuple> tuple_emitter;
2518 tuple_emitter.emplace (uiout,
nullptr);
2531 opts.deref_ref =
true;
2541 opts.deref_ref =
true;
2563 int registers_format =
'x';
2564 int memory_contents = 0;
2573 static const struct mi_opt opts[] =
2575 {
"-var-print-values", VAR_PRINT_VALUES, 1},
2576 {
"-comp-print-values", COMP_PRINT_VALUES, 1},
2577 {
"-registers-format", REGISTERS_FORMAT, 1},
2578 {
"-memory-contents", MEMORY_CONTENTS, 0},
2585 int opt =
mi_getopt (
"-trace-frame-collected", argc, argv, opts,
2589 switch ((
enum opt) opt)
2591 case VAR_PRINT_VALUES:
2594 case COMP_PRINT_VALUES:
2597 case REGISTERS_FORMAT:
2598 registers_format = oarg[0];
2600 case MEMORY_CONTENTS:
2601 memory_contents = 1;
2607 error (_(
"Usage: -trace-frame-collected "
2608 "[--var-print-values PRINT_VALUES] "
2609 "[--comp-print-values PRINT_VALUES] "
2610 "[--registers-format FORMAT]"
2611 "[--memory-contents]"));
2624 clist = &stepping_list;
2626 clist = &tracepoint_list;
2633 const std::vector<std::string> &wholly_collected
2635 for (
size_t i = 0; i < wholly_collected.size (); i++)
2637 const std::string &str = wholly_collected[i];
2646 const std::vector<std::string> &computed = clist->
computed ();
2647 for (
size_t i = 0; i < computed.size (); i++)
2649 const std::string &str = computed[i];
2683 for (
int tvar : tinfo->
tvars)
2709 std::vector<mem_range> available_memory;
2715 for (
const mem_range &r : available_memory)
2724 gdb::byte_vector data (r.length);
2726 if (memory_contents)
2730 std::string data_str = bin2hex (data.data (), r.length);
2744 const char *
const *argv,
2754 const char *
const *argv,
int argc)
2765 error (_(
"Usage: -complete COMMAND"));
2768 error (_(
"max-completions is zero, completion is disabled."));
2770 int quote_char =
'\0';
2775 std::string arg_prefix (argv[0], word - argv[0]);
2795 arg_prefix.c_str (), result.
match_list[i + 1]);
2808 error (_(
"thread group id should start with an 'i'"));
2811 long num = strtol (
id + 1, &
end, 10);
2813 if (*
end !=
'\0' || num > INT_MAX)
2814 error (_(
"invalid thread group id '%s'"),
id);
2826Set whether MI asynchronous mode is enabled."), _(
"\
2827Show whether MI asynchronous mode is enabled."), _(
"\
2828Tells 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
const char * current_token
int running_result_record_printed
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())
void end(ui_out_type type)
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 * parse_and_eval(const char *exp, parser_flags flags)
CORE_ADDR parse_and_eval_address(const char *exp)
void async_enable_stdin(void)
std::unique_ptr< expression > expression_up
expression_up parse_expression(const char *, innermost_block_tracker *=nullptr, parser_flags flags=0)
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)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
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)
void interps_notify_user_selected_context_changed(user_selected_what selection)
static void set_language(const char *language)
const struct language_defn * current_language
std::vector< symtab_and_line > decode_line_with_current_source(const char *string, int flags)
@ DECODE_LINE_FUNFIRSTLINE
bool mi_simple_type_p(struct type *type)
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, const char *const *argv, const struct mi_opt *opts, int *oind, const char **oarg)
static struct mi_interp * as_mi_interp(struct interp *interp)
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()
void mi_cmd_fix_breakpoint_script_output(const char *command, const char *const *argv, int argc)
static void timestamp(struct mi_timestamp *tv)
static void exec_continue(const char *const *argv, int argc)
static void exec_reverse_continue(const char *const *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_cmd_execute(struct mi_parse *parse)
static int interrupt_thread_callback(struct thread_info *thread, void *arg)
static void captured_mi_execute_command(struct mi_interp *mi, struct ui_out *uiout, struct mi_parse *context)
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)
int mi_parse_thread_group_id(const char *id)
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)
void mi_cmd_fix_multi_location_breakpoint_output(const char *command, const char *const *argv, int argc)
static void print_diff(struct ui_file *file, struct mi_timestamp *start, struct mi_timestamp *end)
void mi_execute_cli_command(const char *cmd, bool args_p, const char *args)
static struct mi_timestamp * current_command_ts
static void mi_print_exception(struct mi_interp *mi, const char *token, const struct gdb_exception &exception)
static void mi_execute_async_cli_command(const char *cli_command, const char *const *argv, int argc)
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 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)
void mi_out_put(ui_out *uiout, struct ui_file *stream)
std::unique_ptr< mi_ui_out > mi_out_new(const char *mi_version)
enum print_values mi_parse_print_values(const char *name)
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
gdb::unique_xmalloc_ptr< char > command
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 entirely_available()
struct type * type() const
bool contents_eq(LONGEST offset1, const struct value *val2, LONGEST offset2, LONGEST length) const
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)
LONGEST value_as_long(struct value *val)
value_ref_ptr release_value(struct value *val)