27#include "gdbsupport/environ.h"
55#include "gdbsupport/gdb_optional.h"
64static void step_1 (
int,
int,
const char *);
66#define ERROR_NO_INFERIOR \
67 if (!target_has_execution ()) error (_("The program is not being run."));
102static const std::string &
119 _(
"Terminal for future runs of program being debugged "
120 "is \"%s\".\n"), inferior_tty.c_str ());
133static const std::string &
148Argument list to give program being debugged when it is started is \"%s\".\n"),
179You have not set the inferior's current working directory.\n\
180The inferior will inherit GDB's cwd if native debugging, or the remote\n\
181server's cwd if remote debugging.\n"));
184 _(
"Current working directory that will be used "
185 "when starting the inferior is \"%s\".\n"),
197static gdb::unique_xmalloc_ptr<char>
202 if (args ==
nullptr || *args ==
'\0')
208 p = args + strlen (args);
212 while (p > args && isspace (p[-1]))
217 return gdb::unique_xmalloc_ptr<char>
218 (savestring (args, p - args));
220 return gdb::unique_xmalloc_ptr<char> (
nullptr);
224 return make_unique_xstrdup (args);
258 catch (
const gdb_exception_error &ex)
260 if (ex.error != NOT_AVAILABLE_ERROR)
266 const unsigned solib_add_generation
269 scoped_restore restore_in_initial_library_scan
285 warning (_(
"platform-specific solib_create_inferior_hook did "
286 "not load initial shared libraries."));
325 && !
query (_(
"The program being debugged has been started already.\n\
326Start it from the beginning? ")))
327 error (_(
"Program not restarted."));
340 error (_(
"Asynchronous execution not supported on this target."));
372 const char *exec_file;
400 gdb::unique_xmalloc_ptr<char> stripped =
strip_bg_char (args, &async_exec);
401 args = stripped.get ();
411 error (_(
"The target does not support running in non-stop mode."));
420 std::string arg = string_printf (
"-qualified %s inferior %d",
459 run_target =
nullptr;
479 finish_target =
nullptr;
480 finish_ptid = minus_one_ptid;
503 finish_state.release ();
524 error (_(
"No symbol table loaded. Use the \"file\" command."));
559 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
568 error (_(
"Cannot execute this command without a live selected thread."));
579 error (_(
"Cannot execute this command while looking at trace frames."));
587 error (_(
"Cannot execute this command while "
588 "the selected thread is running."));
615 (
"continue all threads in non-stop");
644 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
654 bool all_threads_p =
false;
659 gdb::unique_xmalloc_ptr<char> stripped =
strip_bg_char (args, &async_exec);
660 args = stripped.get ();
664 if (startswith (args,
"-a"))
666 all_threads_p =
true;
667 args +=
sizeof (
"-a") - 1;
674 error (_(
"`-a' is meaningless in all-stop mode."));
676 if (args !=
nullptr && all_threads_p)
677 error (_(
"Can't resume all threads and specify "
678 "proceed count simultaneously."));
715 if (!stopped && from_tty)
718 (
"Not stopped at any breakpoint; argument ignored.\n");
761 step_1 (0, 0, count_string);
769 step_1 (1, 0, count_string);
777 step_1 (0, 1, count_string);
783 step_1 (1, 1, count_string);
815 int skip_subroutines,
int single_inst,
832step_1 (
int skip_subroutines,
int single_inst,
const char *count_string)
844 gdb::unique_xmalloc_ptr<char> stripped
846 count_string = stripped.get ();
868 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
948 const char *fn =
nullptr;
1007 error (_(
"Cannot find bounds of current function"));
1010 gdb_printf (_(
"Single stepping until exit from function %s,"
1011 "\nwhich has no line number information.\n"),
1055 gdb::unique_xmalloc_ptr<char> stripped =
strip_bg_char (arg, &async_exec);
1056 arg = stripped.get ();
1063 std::vector<symtab_and_line> sals
1065 if (sals.size () != 1)
1070 sals.erase (std::remove_if (sals.begin (), sals.end (),
1073 return sal.symtab != cursal.symtab;
1075 if (sals.size () != 1)
1076 error (_(
"Jump request is ambiguous: "
1077 "does not resolve to a single address"));
1082 if (sal.
symtab == 0 && sal.
pc == 0)
1083 error (_(
"No source file has been specified."));
1091 if (fn !=
nullptr && sfn != fn)
1093 if (!
query (_(
"Line %d is not in `%s'. Jump anyway? "), sal.
line,
1096 error (_(
"Not confirmed."));
1109 if (!
query (_(
"WARNING!!! Destination is in "
1110 "unmapped overlay! Jump anyway? ")))
1112 error (_(
"Not confirmed."));
1136 enum gdb_signal oursig;
1146 gdb::unique_xmalloc_ptr<char> stripped
1148 signum_exp = stripped.get ();
1158 oursig = gdb_signal_from_name (signum_exp);
1160 if (oursig == GDB_SIGNAL_UNKNOWN)
1166 oursig = GDB_SIGNAL_0;
1179 int must_confirm = 0;
1194 if (tp->stop_signal () != GDB_SIGNAL_0
1199 gdb_printf (_(
" Thread %s previously stopped with signal %s, %s.\n"),
1201 gdb_signal_to_name (tp->stop_signal ()),
1202 gdb_signal_to_string (tp->stop_signal ()));
1208 && !
query (_(
"Continuing thread %s (the current thread) with specified signal will\n"
1209 "still deliver the signals noted above to their respective threads.\n"
1210 "Continue anyway? "),
1212 error (_(
"Not confirmed."));
1217 if (oursig == GDB_SIGNAL_0)
1218 gdb_printf (_(
"Continuing with no signal.\n"));
1220 gdb_printf (_(
"Continuing with signal %s.\n"),
1221 gdb_signal_to_name (oursig));
1225 proceed ((CORE_ADDR) -1, oursig);
1233 enum gdb_signal oursig;
1241 if (signum_exp ==
nullptr)
1247 oursig = gdb_signal_from_name (signum_exp);
1249 if (oursig == GDB_SIGNAL_UNKNOWN)
1255 oursig = GDB_SIGNAL_0;
1260 if (oursig != GDB_SIGNAL_0
1262 error (_(
"Signal handling set to not pass this signal to the program."));
1352 if (msymbol.
minsym ==
nullptr)
1353 error (_(
"Execution is not within a known function."));
1415 lj_deleter.release ();
1417 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
1431 gdb::unique_xmalloc_ptr<char> stripped =
strip_bg_char (arg, &async_exec);
1432 arg = stripped.get ();
1456 gdb::unique_xmalloc_ptr<char> stripped =
strip_bg_char (arg, &async_exec);
1457 arg = stripped.get ();
1473 struct type *value_type
1475 gdb_assert (value_type->
code () != TYPE_CODE_VOID);
1479 warning (_(
"Function '%s' does not follow the target calling "
1480 "convention, cannot determine its returned value."),
1494 nullptr,
nullptr,
nullptr))
1506 internal_error (_(
"bad switch"));
1534 if (rv->
value !=
nullptr)
1537 uiout->
text (
"Value returned is ");
1538 uiout->
field_fmt (
"gdb-result-var",
"$%d",
1540 uiout->
text (
" = ");
1552 uiout->
field_string (
"return-value", _(
"<not displayed>"),
1559 uiout->
text (
"Value returned has type: ");
1562 uiout->
text (
" Cannot determine contents\n");
1573 if (rv->
type ==
nullptr
1584 catch (
const gdb_exception_error &ex)
1640 if (rv->type ==
nullptr)
1641 internal_error (_(
"finish_command: function has no target type"));
1655 if (rv->value !=
nullptr)
1656 rv->value_history_index = rv->value->record_latest ();
1708 CORE_ADDR func_addr;
1709 CORE_ADDR alt_entry_point;
1710 CORE_ADDR entry_point;
1717 error (_(
"Cannot find bounds of current function"));
1720 alt_entry_point = sal.
pc;
1721 entry_point = alt_entry_point;
1742 if ((pc < alt_entry_point) || (pc > entry_point))
1747 sr_sal.
pc = entry_point;
1752 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
1763 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
1793 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
1808 if (frame ==
nullptr)
1812 if (frame ==
nullptr)
1815 while (start != frame);
1837 gdb::unique_xmalloc_ptr<char> stripped =
strip_bg_char (arg, &async_exec);
1838 arg = stripped.get ();
1843 error (_(
"The \"finish\" command does not take any arguments."));
1847 error (_(
"\"finish\" not meaningful in the outermost frame."));
1880 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
1896 struct type * val_type
1903 val_type,
nullptr,
nullptr,
nullptr);
1906 && val_type->
code () != TYPE_CODE_VOID)
1920 && !
query (_(
"warning: Function %s does not return normally.\n"
1921 "Try to finish anyway? "),
1923 error (_(
"Not confirmed."));
1936 if (frame ==
nullptr)
1937 error (_(
"Cannot find the caller frame."));
1959 gdb_printf (_(
"The program being debugged is not being run.\n"));
1964 error (_(
"No selected thread."));
1974 gdb_printf (_(
"Selected thread has exited.\n"));
1979 gdb_printf (_(
"Selected thread is running.\n"));
1989 gdb_printf (_(
"The program being debugged is not being run.\n"));
1995 gdb_printf (_(
"Last stopped for thread %s (%s).\n"),
2001 gdb_printf (_(
"Thread has since exited.\n"));
2020 gdb_printf (_(
"It stopped after being stepped.\n"));
2030 "that has since been deleted.\n"));
2033 gdb_printf (_(
"It stopped at breakpoint %d.\n"), num);
2039 gdb_printf (_(
"It stopped with signal %s, %s.\n"),
2046 gdb_printf (_(
"Type \"info stack\" or \"info "
2047 "registers\" for more information.\n"));
2067 gdb_puts (
"Environment variable \"");
2076 for (
int idx = 0; envp[idx] !=
nullptr; ++idx)
2087 const char *p, *val;
2094 p = (
char *) strchr (arg,
'=');
2095 val = (
char *) strchr (arg,
' ');
2097 if (p != 0 && val != 0)
2111 else if (val != 0 && p == 0)
2117 if (p == 0 || p[1] == 0)
2121 p = arg + strlen (arg);
2127 while (*val ==
' ' || *val ==
'\t')
2131 while (p != arg && (p[-1] ==
' ' || p[-1] ==
'\t'))
2134 std::string var (arg, p - arg);
2137 gdb_printf (_(
"Setting environment variable "
2138 "\"%s\" to null value.\n"),
2153 if (!from_tty ||
query (_(
"Delete all environment variables? ")))
2167 gdb_puts (
"Executable and object file path: ");
2184 std::string exec_path = env;
2210 struct type *regtype = val->
type ();
2211 int print_raw_format;
2215 value_column_1 = 15,
2218 value_column_2 = value_column_1 + 2 + 16 + 2,
2229 if (regtype->
code () == TYPE_CODE_FLT
2230 || regtype->
code () == TYPE_CODE_DECFLOAT)
2237 opts.deref_ref =
true;
2241 if (print_raw_format)
2244 format_stream.
puts (
"(raw ");
2247 format_stream.
putc (
')');
2256 opts.deref_ref =
true;
2260 if (print_raw_format && regtype->
is_vector () == 0)
2264 opts.deref_ref =
true;
2288 int regnum,
int print_all)
2293 for (i = 0; i < numregs; i++)
2334 error (_(
"The program has no registers now."));
2345 while (*addr_exp !=
'\0')
2351 addr_exp = skip_spaces (addr_exp);
2355 if (addr_exp[0] ==
'$')
2357 if (isspace ((*addr_exp)) || (*addr_exp) ==
'\0')
2358 error (_(
"Missing register name"));
2362 while ((*addr_exp) !=
'\0' && !isspace ((*addr_exp)))
2399 const struct reggroup *group =
nullptr;
2405 if (strncmp (start, g->name (), end - start) == 0)
2411 if (group !=
nullptr)
2429 error (_(
"Invalid register `%.*s'"), (
int) (end - start), start);
2456 int printed_something = 0;
2462 printed_something = 1;
2466 if (!printed_something)
2467 gdb_printf (file,
"No vector information\n");
2475 error (_(
"The program has no registers now."));
2490 error (_(
"The program is not being run."));
2491 if (!
query (_(
"Kill the program being debugged? ")))
2492 error (_(
"Not confirmed."));
2501 bfd_cache_close_all ();
2506 gdb_printf (_(
"[Inferior %d (%s) killed]\n"),
2507 infnum, pid_str.c_str ());
2525 if (!thread->executing ()
2526 && !thread->stop_requested
2527 && thread->stop_signal () == GDB_SIGNAL_0)
2531 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
2605 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
2634 if (thread->inf->num < lowest->
inf->
num
2670 if (
query (_(
"A program is being debugged already. Kill it? ")))
2673 error (_(
"Not killed."));
2681 args = stripped.get ();
2688 error (_(
"Cannot attach to this target in non-stop mode"));
2693 attach_target =
nullptr;
2793 gdb::optional<scoped_restore_current_thread> restore_thread;
2796 restore_thread.emplace ();
2845 error (_(
"The program is not being run."));
2882 if (!was_non_stop_p)
2974 && startswith (
args,
"-a"))
2988 int printed_something = 0;
2994 printed_something = 1;
2998 if (!printed_something)
3000 "available for this processor.\n");
3009 error (_(
"The program has no registers now."));
3027 error (_(
"Not supported on this target."));
3111Printing of return value after `finish' is %s.\n"),
3119#define RUN_ARGS_HELP \
3120"You may specify arguments to give it.\n\
3121Args may include \"*\", or \"[...]\"; they are expanded using the\n\
3122shell that will start the program (specified by the \"$SHELL\" environment\n\
3123variable). Input and output redirection with \">\", \"<\", or \">>\"\n\
3126With no arguments, uses arguments last specified (with \"run\" or \n\
3127\"set args\"). To cancel previous arguments and run with no arguments,\n\
3128use \"set args\" without arguments.\n\
3130To start the inferior without using a shell, use \"set startup-with-shell off\"."
3142Set terminal for future runs of program being debugged."), _(
" \
3143Show terminal for future runs of program being debugged."), _(
" \
3144Usage: set inferior-tty [TTY]\n\n \
3145If TTY is omitted, the default behavior of using the same terminal as GDB\n \
3155Set argument list to give program being debugged when it is started."), _(
"\
3156Show argument list to give program being debugged when it is started."), _(
"\
3157Follow this command with any number of args, to be passed to the program."),
3166Set the current working directory to be used when the inferior is started.\n \
3167Changing this setting does not have any effect on inferiors that are\n \
3170Show the current working directory that is used when the inferior is started."),
3172Use this command to change the current working directory that will be used\n\
3173when the inferior is started. This setting does not affect GDB's current\n\
3174working directory."),
3181The environment to give the program, or one variable's value.\n\
3182With an argument VAR, prints the value of environment variable VAR to\n\
3183give the program being debugged. With no arguments, prints the entire\n\
3184environment to be given to the program."), &
showlist);
3188 _(
"Complement to certain \"set\" commands."),
3192Cancel environment variable VAR for the program.\n\
3193This does not affect the program until the next \"run\" command."),
3198Set environment variable value to give the program.\n\
3199Arguments are VAR VALUE where VAR is variable name and VALUE is value.\n\
3200VALUES of environment variables are uninterpreted strings.\n\
3201This does not affect the program until the next \"run\" command."),
3206Add directory DIR(s) to beginning of search path for object files.\n\
3207$cwd in the path means the current working directory.\n\
3208This path is equivalent to the $PATH shell variable. It is a list of\n\
3209directories, separated by colons. These directories are searched to find\n\
3210fully linked executable files and separately compiled object files as \
3215Current search path for finding object files.\n\
3216$cwd in the path means the current working directory.\n\
3217This path is equivalent to the $PATH shell variable. It is a list of\n\
3218directories, separated by colons. These directories are searched to find\n\
3219fully linked executable files and separately compiled object files as \
3225 _(
"Kill execution of program being debugged."),
3229Attach to a process or file outside of GDB.\n\
3230This command attaches to another target, of the same type as your last\n\
3231\"target\" command (\"info files\" will show your target stack).\n\
3232The command may take as argument a process id or a device file.\n\
3233For a process id, you must have permission to send the process a signal,\n\
3234and it must have the same effective uid as the debugger.\n\
3235When using \"attach\" with a process id, the debugger finds the\n\
3236program running in the process, looking first in the current working\n\
3237directory, or (if not found there) using the source file search path\n\
3238(see the \"directory\" command). You can also use the \"file\" command\n\
3239to specify the program, and to load its symbol table."));
3242Detach a process or file previously attached.\n\
3243If a process, it is no longer traced, and it continues its execution. If\n\
3244you were debugging a file, the file is closed and gdb no longer accesses it."),
3248Disconnect from a target.\n\
3249The target will wait for another debugger to connect. Not available for\n\
3253Continue program with the specified signal.\n\
3254Usage: signal SIGNAL\n\
3255The SIGNAL argument is processed the same as the handle command.\n\
3257An argument of \"0\" means continue the program without sending it a signal.\n\
3258This is useful in cases where the program stopped because of a signal,\n\
3259and you want to resume the program while discarding the signal.\n\
3261In a multi-threaded program the signal is delivered to, or discarded from,\n\
3262the current thread only."));
3266Queue a signal to be delivered to the current thread when it is resumed.\n\
3267Usage: queue-signal SIGNAL\n\
3268The SIGNAL argument is processed the same as the handle command.\n\
3269It is an error if the handling state of SIGNAL is \"nopass\".\n\
3271An argument of \"0\" means remove any currently queued signal from\n\
3272the current thread. This is useful in cases where the program stopped\n\
3273because of a signal, and you want to resume it while discarding the signal.\n\
3275In a multi-threaded program the signal is queued with, or discarded from,\n\
3276the current thread only."));
3281Step one instruction exactly.\n\
3283Argument N means step N times (or till program stops for another \
3289Step one instruction, but proceed through subroutine calls.\n\
3291Argument N means step N times (or till program stops for another \
3297Execute until selected stack frame returns.\n\
3299Upon return, the value returned is printed and put in the value history."));
3304Step program, proceeding through subroutine calls.\n\
3306Unlike \"step\", if the current source line calls a subroutine,\n\
3307this command does not enter the subroutine, but instead steps over\n\
3308the call, in effect treating it as a single source line."));
3313Step program until it reaches a different source line.\n\
3315Argument N means step N times (or till program stops for another \
3321Execute until past the current line or past a LOCATION.\n\
3322Execute until the program reaches a source line greater than the current\n\
3323or a specified location (same args as break command) within the current \
3329Continue the program up to the given location (same form as args for break \
3331Execution will also stop upon exit from the current stack frame."));
3336Continue program being debugged at specified line or address.\n\
3337Usage: jump LOCATION\n\
3338Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\
3339for an address to start at."));
3345Continue program being debugged, after signal or breakpoint.\n\
3346Usage: continue [N]\n\
3347If proceeding from breakpoint, a number N may be used as an argument,\n\
3348which means to set the ignore count of that breakpoint to N - 1 (so that\n\
3349the breakpoint won't break until the Nth time it is reached).\n\
3351If non-stop mode is enabled, continue only the current thread,\n\
3352otherwise all the threads in the program are continued. To \n\
3353continue all stopped threads in non-stop mode, use the -a option.\n\
3354Specifying -a and an ignore count simultaneously is an error."));
3360Start debugged program.\n"
3366Start the debugged program stopping at the beginning of the main procedure.\n"
3371Start the debugged program stopping at the first instruction.\n"
3376 _(
"Interrupt the execution of the debugged program.\n\
3377If non-stop mode is enabled, interrupt only the current thread,\n\
3378otherwise all the threads in the program are stopped. To \n\
3379interrupt all running threads in non-stop mode, use the -a option."));
3383List of integer registers and their contents, for selected stack frame.\n\
3384One or more register names as argument means describe the given registers.\n\
3385One or more register group names as argument means describe the registers\n\
3386in the named register groups."));
3391List of all registers and their contents, for selected stack frame.\n\
3392One or more register names as argument means describe the given registers.\n\
3393One or more register group names as argument means describe the registers\n\
3394in the named register groups."));
3398 _(
"Execution status of the program."));
3401 _(
"Print the status of the floating point unit."));
3404 _(
"Print the status of the vector unit."));
3408Show additional information about a process.\n\
3409Specify any process id, or use the program being debugged by default."),
3414List memory regions mapped by the specified process."),
3415 &info_proc_cmdlist);
3418List process info from /proc/PID/stat."),
3419 &info_proc_cmdlist);
3422List process info from /proc/PID/status."),
3423 &info_proc_cmdlist);
3426List current working directory of the specified process."),
3427 &info_proc_cmdlist);
3430List command line arguments of the specified process."),
3431 &info_proc_cmdlist);
3434List absolute filename for executable of the specified process."),
3435 &info_proc_cmdlist);
3438List files opened by the specified process."),
3439 &info_proc_cmdlist);
3442List all available info about the specified process."),
3443 &info_proc_cmdlist);
3447Set whether `finish' prints the return value."), _(
"\
3448Show whether `finish' prints the return value."),
nullptr,
struct gdbarch * get_current_arch(void)
struct gdbarch * target_gdbarch(void)
struct symbol * find_pc_function(CORE_ADDR pc)
bool find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr, const struct block **block)
struct symbol * get_frame_function(frame_info_ptr frame)
struct symbol * find_pc_sect_containing_function(CORE_ADDR pc, struct obj_section *section)
void breakpoint_re_set(void)
void breakpoint_init_inferior(enum inf_context context)
void until_break_command(const char *arg, int from_tty, int anywhere)
int bpstat_num(bpstat **bsp, int *num)
void resolve_sal_pc(struct symtab_and_line *sal)
bpstat * bpstat_find_breakpoint(bpstat *bsp, struct breakpoint *breakpoint)
void set_ignore_count(int bptnum, int count, int from_tty)
void tbreak_command(const char *arg, int from_tty)
void clear_breakpoint_hit_counts(void)
breakpoint_up set_momentary_breakpoint(struct gdbarch *gdbarch, struct symtab_and_line sal, struct frame_id frame_id, enum bptype type)
void delete_longjmp_breakpoint(int thread)
void set_longjmp_breakpoint(struct thread_info *tp, struct frame_id frame)
std::unique_ptr< struct breakpoint, breakpoint_deleter > breakpoint_up
ui_file_style style() const
inferior_control_state control
void set_args(std::string args)
const std::string & cwd() const
struct process_stratum_target * process_target()
const std::string & args() const
void add_continuation(std::function< void()> &&cont)
const std::string & tty()
inf_non_exited_threads_range non_exited_threads()
void set_tty(std::string terminal_name)
void set_cwd(std::string cwd)
thread_info * find_thread(ptid_t ptid)
const char * c_str() const
static void ours_for_output()
void set_pending_waitstatus(const target_waitstatus &ws)
CORE_ADDR stop_pc() const
void set_thread_fsm(std::unique_ptr< struct thread_fsm > fsm)
gdb_signal stop_signal() const
struct thread_fsm * thread_fsm() const
void set_stop_pc(CORE_ADDR stop_pc)
void set_stop_signal(gdb_signal sig)
thread_control_state control
virtual void puts(const char *str)
void void void spaces(int numspaces)
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 text(const char *string)
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 * showprintlist
struct cmd_list_element * infolist
void error_no_arg(const char *why)
struct cmd_list_element * cmdlist
struct cmd_list_element * setprintlist
struct cmd_list_element * setlist
struct cmd_list_element * detachlist
struct cmd_list_element * killlist
struct cmd_list_element * unsetlist
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 * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
cmd_list_element * add_com_alias(const char *name, cmd_list_element *target, command_class theclass, int abbrev_flag)
set_show_commands add_setshow_optional_filename_cmd(const char *name, enum command_class theclass, std::string *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void set_cmd_completer(struct cmd_list_element *cmd, completer_ftype *completer)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc, struct cmd_list_element **subcommands, int allow_unknown, struct cmd_list_element **list)
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)
cmd_list_element * add_info_alias(const char *name, cmd_list_element *target, int abbrev_flag)
set_show_commands add_setshow_string_noescape_cmd(const char *name, enum command_class theclass, std::string *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct cmd_list_element * add_basic_prefix_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **subcommands, int allow_unknown, struct cmd_list_element **list)
struct cmd_list_element * add_info(const char *name, cmd_simple_func_ftype *fun, const char *doc)
cli_style_option file_name_style
cli_style_option metadata_style
void signal_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
void noop_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *prefix)
void location_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *)
void reg_or_group_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
void filename_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
void reopen_exec_file(void)
const char * get_exec_file(int err)
void(* deprecated_detach_hook)(void)
void(* deprecated_attach_hook)(void)
@ RETURN_VALUE_ABI_RETURNS_ADDRESS
@ RETURN_VALUE_REGISTER_CONVENTION
@ RETURN_VALUE_STRUCT_CONVENTION
@ RETURN_VALUE_ABI_PRESERVES_ADDRESS
LONGEST parse_and_eval_long(const char *exp)
void exception_print(struct ui_file *file, const struct gdb_exception &e)
void exec_file_locate_attach(int pid, int defer_bp_reset, int from_tty)
void validate_exec_file(int from_tty)
struct value * value_of_register(int regnum, frame_info_ptr frame)
struct value * read_var_value(struct symbol *var, const struct block *var_block, frame_info_ptr frame)
const struct frame_id null_frame_id
struct program_space * get_frame_program_space(frame_info_ptr frame)
frame_info_ptr skip_unwritable_frames(frame_info_ptr frame)
CORE_ADDR get_frame_pc(frame_info_ptr frame)
struct frame_id get_stack_frame_id(frame_info_ptr next_frame)
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
enum frame_type get_frame_type(frame_info_ptr frame)
frame_info_ptr get_selected_frame(const char *message)
frame_info_ptr get_current_frame(void)
frame_info_ptr skip_tailcall_frames(frame_info_ptr frame)
struct frame_id get_frame_id(frame_info_ptr fi)
frame_info_ptr get_prev_frame(frame_info_ptr this_frame)
symtab_and_line find_frame_sal(frame_info_ptr frame)
void print_stack_frame(frame_info_ptr, int print_level, enum print_what print_what, int set_current_sal)
enum return_value_convention gdbarch_return_value_as_value(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, struct value **read_value, const gdb_byte *writebuf)
const char * gdbarch_register_name(struct gdbarch *gdbarch, int regnr)
void gdbarch_print_registers_info(struct gdbarch *gdbarch, struct ui_file *file, frame_info_ptr frame, int regnum, int all)
bool gdbarch_skip_entrypoint_p(struct gdbarch *gdbarch)
bool gdbarch_print_vector_info_p(struct gdbarch *gdbarch)
CORE_ADDR gdbarch_skip_entrypoint(struct gdbarch *gdbarch, CORE_ADDR ip)
void gdbarch_print_float_info(struct gdbarch *gdbarch, struct ui_file *file, frame_info_ptr frame, const char *args)
bool gdbarch_info_proc_p(struct gdbarch *gdbarch)
int gdbarch_has_global_solist(struct gdbarch *gdbarch)
int gdbarch_register_reggroup_p(struct gdbarch *gdbarch, int regnum, const struct reggroup *reggroup)
void gdbarch_print_vector_info(struct gdbarch *gdbarch, struct ui_file *file, frame_info_ptr frame, const char *args)
CORE_ADDR gdbarch_get_return_buf_addr(struct gdbarch *gdbarch, struct type *val_type, frame_info_ptr cur_frame)
void gdbarch_info_proc(struct gdbarch *gdbarch, const char *args, enum info_proc_what what)
static int gdbarch_num_cooked_regs(gdbarch *arch)
all_matching_threads_range all_threads(process_stratum_target *proc_target=nullptr, ptid_t filter_ptid=minus_one_ptid)
void switch_to_thread_no_regs(struct thread_info *thread)
all_non_exited_threads_range all_non_exited_threads(process_stratum_target *proc_target=nullptr, ptid_t filter_ptid=minus_one_ptid)
void set_stop_requested(process_stratum_target *targ, ptid_t ptid, bool stop)
struct thread_info * inferior_thread(void)
void switch_to_thread(struct thread_info *thr)
void set_running(process_stratum_target *targ, ptid_t ptid, bool running)
struct thread_info * iterate_over_threads(thread_callback_func, void *)
FORWARD_SCOPE_EXIT(finish_thread_state) scoped_finish_thread_state
const char * print_thread_id(struct thread_info *thr)
void init_thread_list(void)
enum bfd_endian type_byte_order(const struct type *type)
bool is_nocall_function(const struct type *type)
struct type * check_typedef(struct type *type)
#define TYPE_NO_RETURN(thistype)
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 inferior_event_handler(enum inferior_event_type event_type)
static void set_tty_value(const std::string &tty)
static void signal_command(const char *signum_exp, int from_tty)
void attach_command(const char *args, int from_tty)
static void path_command(const char *dirname, int from_tty)
static void info_vector_command(const char *args, int from_tty)
static void show_inferior_tty_command(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void finish_command(const char *arg, int from_tty)
static void kill_if_already_running(int from_tty)
static void pad_to_column(string_file &stream, int col)
void continue_1(int all_threads)
static void finish_backward(struct finish_command_fsm *sm)
static void interrupt_command(const char *args, int from_tty)
static void set_step_frame(thread_info *tp)
static void set_args_value(const std::string &args)
static void info_proc_cmd_status(const char *args, int from_tty)
static void info_proc_cmd_1(const char *args, enum info_proc_what what, int from_tty)
static void set_environment_command(const char *arg, int from_tty)
static const std::string & get_args_value()
static void stop_current_target_threads_ns(ptid_t ptid)
static void show_print_finish(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void prepare_execution_command(struct target_ops *target, int background)
static void environment_info(const char *var, int from_tty)
static void step_command(const char *count_string, int from_tty)
static void ensure_not_tfind_mode(void)
static void info_float_command(const char *args, int from_tty)
static void print_return_value_1(struct ui_out *uiout, struct return_value_info *rv)
static void disconnect_command(const char *args, int from_tty)
static void stepi_command(const char *count_string, int from_tty)
static void run_command_1(const char *args, int from_tty, enum run_how run_how)
static void set_cwd_value(const std::string &args)
static void info_proc_cmd_cwd(const char *args, int from_tty)
static void nexti_command(const char *count_string, int from_tty)
static const std::string & get_tty_value()
static frame_info_ptr skip_finish_frames(frame_info_ptr frame)
void default_print_registers_info(struct gdbarch *gdbarch, struct ui_file *file, frame_info_ptr frame, int regnum, int print_all)
static void unset_environment_command(const char *var, int from_tty)
static void attach_post_wait(int from_tty, enum attach_post_wait_mode mode)
@ ATTACH_POST_WAIT_RESUME
@ ATTACH_POST_WAIT_NOTHING
static void step_command_fsm_prepare(struct step_command_fsm *sm, int skip_subroutines, int single_inst, int count, struct thread_info *thread)
static void info_proc_cmd_stat(const char *args, int from_tty)
void detach_command(const char *args, int from_tty)
static void until_next_command(int)
static void info_proc_cmd_mappings(const char *args, int from_tty)
static void ensure_valid_thread(void)
static void queue_signal_command(const char *signum_exp, int from_tty)
static void info_proc_cmd_exe(const char *args, int from_tty)
#define ERROR_NO_INFERIOR
static void info_proc_cmd(const char *args, int from_tty)
static void starti_command(const char *args, int from_tty)
static void info_all_registers_command(const char *addr_exp, int from_tty)
void _initialize_infcmd()
static void continue_command(const char *args, int from_tty)
static gdb::unique_xmalloc_ptr< char > strip_bg_char(const char *args, int *bg_char_p)
static void advance_command(const char *arg, int from_tty)
static void info_registers_command(const char *addr_exp, int from_tty)
void interrupt_target_1(bool all_threads)
void registers_info(const char *addr_exp, int fpregs)
struct value * get_return_value(struct symbol *func_symbol, struct value *function)
static void error_is_running(void)
int stopped_by_random_signal
static void show_args_command(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void start_command(const char *args, int from_tty)
static void run_command(const char *args, int from_tty)
static void default_print_one_register_info(struct ui_file *file, const char *name, struct value *val)
static void finish_forward(struct finish_command_fsm *sm, frame_info_ptr frame)
const std::string & get_inferior_cwd()
static void info_program_command(const char *args, int from_tty)
static void info_proc_cmd_files(const char *args, int from_tty)
static void info_proc_cmd_all(const char *args, int from_tty)
static int prepare_one_step(thread_info *, struct step_command_fsm *sm)
static int proceed_thread_callback(struct thread_info *thread, void *arg)
static void next_command(const char *count_string, int from_tty)
static void jump_command(const char *arg, int from_tty)
void setup_inferior(int from_tty)
void notice_new_inferior(thread_info *thr, bool leave_running, int from_tty)
enum stop_stack_kind stop_stack_dummy
static void path_info(const char *args, int from_tty)
void default_print_float_info(struct gdbarch *gdbarch, struct ui_file *file, frame_info_ptr frame, const char *args)
void post_create_inferior(int from_tty)
static void step_1(int, int, const char *)
static void info_proc_cmd_cmdline(const char *args, int from_tty)
static void until_command(const char *arg, int from_tty)
void print_return_value(struct ui_out *uiout, struct return_value_info *rv)
static void proceed_after_attach(inferior *inf)
static void print_vector_info(struct ui_file *file, frame_info_ptr frame, const char *args)
static void ensure_not_running(void)
static const char path_var_name[]
static void show_cwd_command(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static void kill_command(const char *arg, int from_tty)
bool print_inferior_events
struct inferior * current_inferior(void)
void switch_to_inferior_no_thread(inferior *inf)
all_inferiors_range all_inferiors(process_stratum_target *proc_target=nullptr)
@ STOP_QUIETLY_NO_SIGSTOP
FORWARD_SCOPE_EXIT(delete_longjmp_breakpoint) delete_longjmp_breakpoint_cleanup
void set_step_info(thread_info *tp, frame_info_ptr frame, struct symtab_and_line sal)
void insert_step_resume_breakpoint_at_sal(struct gdbarch *gdbarch, struct symtab_and_line sr_sal, struct frame_id sr_id)
void mark_infrun_async_event_handler(void)
bool step_stop_if_no_debug
thread_info * get_previous_thread()
process_stratum_target * user_visible_resume_target(ptid_t resume_ptid)
void restart_after_all_stop_detach(process_stratum_target *proc_target)
void clear_proceed_status(int step)
enum exec_direction_kind execution_direction
void update_previous_thread()
int signal_pass_state(int signo)
void all_uis_on_sync_execution_starting(void)
enum gdb_signal gdb_signal_from_command(int num)
void all_uis_check_sync_execution_done(void)
void stop_all_threads(const char *reason, inferior *inf)
void init_wait_for_inferior(void)
void get_last_target_status(process_stratum_target **target, ptid_t *ptid, target_waitstatus *status)
void proceed(CORE_ADDR addr, enum gdb_signal siggnal)
ptid_t user_visible_resume_ptid(int step)
static void infrun_debug_show_threads(const char *title, ThreadRange threads)
int inline_skipped_frames(thread_info *thread)
void step_into_inline_frame(thread_info *thread)
struct symbol * inline_skipped_symbol(thread_info *thread)
struct interp * command_interp(void)
const struct language_defn * current_language
std::vector< symtab_and_line > decode_line_with_current_source(const char *string, int flags)
@ DECODE_LINE_FUNFIRSTLINE
@ EXEC_ASYNC_FUNCTION_FINISHED
@ EXEC_ASYNC_END_STEPPING_RANGE
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
observable< inferior * > inferior_created
int have_minimal_symbols(void)
static process_stratum_target * as_process_stratum_target(target_ops *target)
struct program_space * current_program_space
CORE_ADDR regcache_read_pc(struct regcache *regcache)
struct regcache * get_current_regcache(void)
struct regcache * get_thread_regcache(process_stratum_target *target, ptid_t ptid)
const reggroup *const general_reggroup
const reggroup *const float_reggroup
const reggroup *const all_reggroup
const std::vector< const reggroup * > & gdbarch_reggroups(struct gdbarch *gdbarch)
const reggroup *const vector_reggroup
void(* func)(remote_target *remote, char *)
bool function_name_is_marked_for_skip(const char *function_name, const symtab_and_line &function_sal)
void solib_create_inferior_hook(int from_tty)
void solib_add(const char *pattern, int from_tty, int readsyms)
void no_shared_libraries(const char *ignored, int from_tty)
struct symtab_and_line get_current_source_symtab_and_line(void)
void mod_path(const char *dirname, std::string &which_path)
CORE_ADDR value_address() const
struct minimal_symbol * minsym
enum async_reply_reason do_async_reply_reason() override
void clean_up(struct thread_info *thread) override
struct return_value_info * return_value() override
bool should_stop(struct thread_info *thread) override
finish_command_fsm(struct interp *cmd_interp)
const char * print_name() const
struct obj_section * obj_section(const struct objfile *objfile) const
unsigned int solib_add_generation
step_command_fsm(struct interp *cmd_interp)
void clean_up(struct thread_info *thread) override
bool should_stop(struct thread_info *thread) override
enum async_reply_reason do_async_reply_reason() override
const block * value_block() const
address_class aclass() const
struct type * type() const
struct objfile * objfile() const
struct program_space * pspace
virtual void create_inferior(const char *, const std::string &, char **, int)
virtual bool supports_non_stop() TARGET_DEFAULT_RETURN(false)
virtual void attach(const char *, int)
target_waitstatus & set_stopped(gdb_signal sig)
CORE_ADDR step_range_start
enum step_over_calls_kind step_over_calls
struct symbol * step_start_function
virtual void clean_up(struct thread_info *thread)
struct type * target_type() const
enum prompt_state prompt_state
enum async_reply_reason do_async_reply_reason() override
until_next_fsm(struct interp *cmd_interp, int thread)
bool should_stop(struct thread_info *thread) override
void clean_up(struct thread_info *thread) override
bool entirely_available()
struct type * type() const
gdb::array_view< const gdb_byte > contents_for_printing()
int section_is_mapped(struct obj_section *osect)
void reread_symbols(int from_tty)
struct obj_section * find_pc_mapped_section(CORE_ADDR pc)
int section_is_overlay(struct obj_section *section)
bool find_pc_line_pc_range(CORE_ADDR pc, CORE_ADDR *startptr, CORE_ADDR *endptr)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
void target_find_description(void)
struct target_ops * find_run_target(void)
void target_require_runnable(void)
void target_post_attach(int pid)
struct target_ops * find_attach_target(void)
void target_pre_inferior(int from_tty)
void target_async(bool enable)
void target_detach(inferior *inf, int from_tty)
bool target_can_async_p()
bool target_has_execution(inferior *inf)
void target_disconnect(const char *args, int from_tty)
int target_has_registers()
bool target_attach_no_wait()
void target_stop(ptid_t ptid)
bool target_is_non_stop_p()
std::string target_pid_to_str(ptid_t ptid)
int target_info_proc(const char *args, enum info_proc_what what)
void disconnect_tracing(void)
int get_traceframe_number(void)
void query_if_trace_running(int from_tty)
std::string type_to_string(struct type *type)
const char * user_reg_map_regnum_to_name(struct gdbarch *gdbarch, int regnum)
int user_reg_map_name_to_regnum(struct gdbarch *gdbarch, const char *name, int len)
struct value * value_of_user_reg(int regnum, frame_info_ptr frame)
int query(const char *ctlstr,...)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
const char * n_spaces(int n)
void gdb_printf(struct ui_file *stream, const char *format,...)
void gdb_puts(const char *linebuffer, struct ui_file *stream)
struct value * value_at(struct type *type, CORE_ADDR addr)
void get_formatted_print_options(struct value_print_options *opts, char format)
void value_print(struct value *val, struct ui_file *stream, const struct value_print_options *options)
void get_user_print_options(struct value_print_options *opts)
void print_hex_chars(struct ui_file *stream, const gdb_byte *valaddr, unsigned len, enum bfd_endian byte_order, bool zero_pad)
void common_val_print(struct value *value, struct ui_file *stream, int recurse, const struct value_print_options *options, const struct language_defn *language)