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."));
127 _(
"Terminal for future runs of program being debugged "
128 "is \"%s\".\n"), inferior_tty.c_str ());
134 gdb::array_view<char * const> args (argv, argc);
135 std::string n = construct_inferior_arguments (args);
188You have not set the inferior's current working directory.\n\
189The inferior will inherit GDB's cwd if native debugging, or the remote\n\
190server's cwd if remote debugging.\n"));
193 _(
"Current working directory that will be used "
194 "when starting the inferior is \"%s\".\n"),
206static gdb::unique_xmalloc_ptr<char>
211 if (args ==
nullptr || *args ==
'\0')
217 p = args + strlen (args);
221 while (p > args && isspace (p[-1]))
226 return gdb::unique_xmalloc_ptr<char>
227 (savestring (args, p - args));
229 return gdb::unique_xmalloc_ptr<char> (
nullptr);
233 return make_unique_xstrdup (args);
267 catch (
const gdb_exception_error &ex)
269 if (ex.error != NOT_AVAILABLE_ERROR)
275 const unsigned solib_add_generation
278 scoped_restore restore_in_initial_library_scan
294 warning (_(
"platform-specific solib_create_inferior_hook did "
295 "not load initial shared libraries."));
334 && !
query (_(
"The program being debugged has been started already.\n\
335Start it from the beginning? ")))
336 error (_(
"Program not restarted."));
349 error (_(
"Asynchronous execution not supported on this target."));
381 const char *exec_file;
409 gdb::unique_xmalloc_ptr<char> stripped =
strip_bg_char (args, &async_exec);
410 args = stripped.get ();
420 error (_(
"The target does not support running in non-stop mode."));
436 std::string arg = string_printf
437 (
"-qualified %s if $_inferior %s %d",
main_name (), op,
475 run_target =
nullptr;
495 finish_target =
nullptr;
496 finish_ptid = minus_one_ptid;
519 finish_state.release ();
540 error (_(
"No symbol table loaded. Use the \"file\" command."));
575 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
584 error (_(
"Cannot execute this command without a live selected thread."));
595 error (_(
"Cannot execute this command while looking at trace frames."));
603 error (_(
"Cannot execute this command while "
604 "the selected thread is running."));
631 (
"continue all threads in non-stop");
660 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
670 bool all_threads_p =
false;
675 gdb::unique_xmalloc_ptr<char> stripped =
strip_bg_char (args, &async_exec);
676 args = stripped.get ();
680 if (startswith (args,
"-a"))
682 all_threads_p =
true;
683 args +=
sizeof (
"-a") - 1;
690 error (_(
"`-a' is meaningless in all-stop mode."));
692 if (args !=
nullptr && all_threads_p)
693 error (_(
"Can't resume all threads and specify "
694 "proceed count simultaneously."));
731 if (!stopped && from_tty)
734 (
"Not stopped at any breakpoint; argument ignored.\n");
778 step_1 (0, 0, count_string);
786 step_1 (1, 0, count_string);
794 step_1 (0, 1, count_string);
800 step_1 (1, 1, count_string);
832 int skip_subroutines,
int single_inst,
849step_1 (
int skip_subroutines,
int single_inst,
const char *count_string)
861 gdb::unique_xmalloc_ptr<char> stripped
863 count_string = stripped.get ();
885 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
967 const char *fn =
nullptr;
1026 error (_(
"Cannot find bounds of current function"));
1029 gdb_printf (_(
"Single stepping until exit from function %s,"
1030 "\nwhich has no line number information.\n"),
1074 gdb::unique_xmalloc_ptr<char> stripped =
strip_bg_char (arg, &async_exec);
1075 arg = stripped.get ();
1082 std::vector<symtab_and_line> sals
1084 if (sals.size () != 1)
1085 error (_(
"Unreasonable jump request"));
1089 if (sal.
symtab == 0 && sal.
pc == 0)
1090 error (_(
"No source file has been specified."));
1097 if (fn !=
nullptr && sfn != fn)
1099 if (!
query (_(
"Line %d is not in `%s'. Jump anyway? "), sal.
line,
1102 error (_(
"Not confirmed."));
1116 if (!
query (_(
"WARNING!!! Destination is in "
1117 "unmapped overlay! Jump anyway? ")))
1119 error (_(
"Not confirmed."));
1143 enum gdb_signal oursig;
1153 gdb::unique_xmalloc_ptr<char> stripped
1155 signum_exp = stripped.get ();
1165 oursig = gdb_signal_from_name (signum_exp);
1167 if (oursig == GDB_SIGNAL_UNKNOWN)
1173 oursig = GDB_SIGNAL_0;
1186 int must_confirm = 0;
1201 if (tp->stop_signal () != GDB_SIGNAL_0
1206 gdb_printf (_(
" Thread %s previously stopped with signal %s, %s.\n"),
1208 gdb_signal_to_name (tp->stop_signal ()),
1209 gdb_signal_to_string (tp->stop_signal ()));
1215 && !
query (_(
"Continuing thread %s (the current thread) with specified signal will\n"
1216 "still deliver the signals noted above to their respective threads.\n"
1217 "Continue anyway? "),
1219 error (_(
"Not confirmed."));
1224 if (oursig == GDB_SIGNAL_0)
1225 gdb_printf (_(
"Continuing with no signal.\n"));
1227 gdb_printf (_(
"Continuing with signal %s.\n"),
1228 gdb_signal_to_name (oursig));
1232 proceed ((CORE_ADDR) -1, oursig);
1240 enum gdb_signal oursig;
1248 if (signum_exp ==
nullptr)
1254 oursig = gdb_signal_from_name (signum_exp);
1256 if (oursig == GDB_SIGNAL_UNKNOWN)
1262 oursig = GDB_SIGNAL_0;
1267 if (oursig != GDB_SIGNAL_0
1269 error (_(
"Signal handling set to not pass this signal to the program."));
1359 if (msymbol.
minsym ==
nullptr)
1360 error (_(
"Execution is not within a known function."));
1422 lj_deleter.release ();
1424 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
1438 gdb::unique_xmalloc_ptr<char> stripped =
strip_bg_char (arg, &async_exec);
1439 arg = stripped.get ();
1463 gdb::unique_xmalloc_ptr<char> stripped =
strip_bg_char (arg, &async_exec);
1464 arg = stripped.get ();
1486 warning (_(
"Function '%s' does not follow the target calling "
1487 "convention, cannot determine its returned value."),
1501 nullptr,
nullptr,
nullptr))
1514 internal_error (_(
"bad switch"));
1542 if (rv->
value !=
nullptr)
1545 uiout->
text (
"Value returned is ");
1546 uiout->
field_fmt (
"gdb-result-var",
"$%d",
1548 uiout->
text (
" = ");
1560 uiout->
field_string (
"return-value", _(
"<not displayed>"),
1567 uiout->
text (
"Value returned has type: ");
1570 uiout->
text (
" Cannot determine contents\n");
1581 if (rv->
type ==
nullptr
1592 catch (
const gdb_exception &ex)
1648 if (rv->type ==
nullptr)
1649 internal_error (_(
"finish_command: function has no target type"));
1663 if (rv->value !=
nullptr)
1716 CORE_ADDR func_addr;
1721 error (_(
"Cannot find bounds of current function"));
1748 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
1755 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
1785 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
1800 if (frame ==
nullptr)
1804 if (frame ==
nullptr)
1807 while (start != frame);
1829 gdb::unique_xmalloc_ptr<char> stripped =
strip_bg_char (arg, &async_exec);
1830 arg = stripped.get ();
1835 error (_(
"The \"finish\" command does not take any arguments."));
1839 error (_(
"\"finish\" not meaningful in the outermost frame."));
1873 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
1889 struct type * val_type
1895 val_type,
nullptr,
nullptr,
nullptr);
1898 && val_type->
code () != TYPE_CODE_VOID)
1912 && !
query (_(
"warning: Function %s does not return normally.\n"
1913 "Try to finish anyway? "),
1915 error (_(
"Not confirmed."));
1929 if (frame ==
nullptr)
1930 error (_(
"Cannot find the caller frame."));
1947 gdb_printf (_(
"The program being debugged is not being run.\n"));
1959 if (ptid == null_ptid || ptid == minus_one_ptid)
1960 error (_(
"No selected thread."));
1965 error (_(
"Invalid selected thread."));
1967 error (_(
"Selected thread is running."));
1976 gdb_printf (_(
"It stopped after being stepped.\n"));
1986 "that has since been deleted.\n"));
1989 gdb_printf (_(
"It stopped at breakpoint %d.\n"), num);
1995 gdb_printf (_(
"It stopped with signal %s, %s.\n"),
2002 gdb_printf (_(
"Type \"info stack\" or \"info "
2003 "registers\" for more information.\n"));
2023 gdb_puts (
"Environment variable \"");
2032 for (
int idx = 0; envp[idx] !=
nullptr; ++idx)
2043 const char *p, *val;
2050 p = (
char *) strchr (arg,
'=');
2051 val = (
char *) strchr (arg,
' ');
2053 if (p != 0 && val != 0)
2067 else if (val != 0 && p == 0)
2073 if (p == 0 || p[1] == 0)
2077 p = arg + strlen (arg);
2083 while (*val ==
' ' || *val ==
'\t')
2087 while (p != arg && (p[-1] ==
' ' || p[-1] ==
'\t'))
2090 std::string var (arg, p - arg);
2093 gdb_printf (_(
"Setting environment variable "
2094 "\"%s\" to null value.\n"),
2109 if (!from_tty ||
query (_(
"Delete all environment variables? ")))
2123 gdb_puts (
"Executable and object file path: ");
2140 std::string exec_path = env;
2167 int print_raw_format;
2171 value_column_1 = 15,
2174 value_column_2 = value_column_1 + 2 + 16 + 2,
2185 if (regtype->
code () == TYPE_CODE_FLT
2186 || regtype->
code () == TYPE_CODE_DECFLOAT)
2197 if (print_raw_format)
2200 format_stream.
puts (
"(raw ");
2203 format_stream.
putc (
')');
2216 if (print_raw_format && regtype->
is_vector () == 0)
2244 int regnum,
int print_all)
2249 for (i = 0; i < numregs; i++)
2290 error (_(
"The program has no registers now."));
2301 while (*addr_exp !=
'\0')
2307 addr_exp = skip_spaces (addr_exp);
2311 if (addr_exp[0] ==
'$')
2313 if (isspace ((*addr_exp)) || (*addr_exp) ==
'\0')
2314 error (_(
"Missing register name"));
2318 while ((*addr_exp) !=
'\0' && !isspace ((*addr_exp)))
2355 const struct reggroup *group =
nullptr;
2361 if (strncmp (start, g->name (), end - start) == 0)
2367 if (group !=
nullptr)
2385 error (_(
"Invalid register `%.*s'"), (
int) (end - start), start);
2412 int printed_something = 0;
2418 printed_something = 1;
2422 if (!printed_something)
2423 gdb_printf (file,
"No vector information\n");
2431 error (_(
"The program has no registers now."));
2446 error (_(
"The program is not being run."));
2447 if (!
query (_(
"Kill the program being debugged? ")))
2448 error (_(
"Not confirmed."));
2457 bfd_cache_close_all ();
2460 gdb_printf (_(
"[Inferior %d (%s) killed]\n"),
2461 infnum, pid_str.c_str ());
2479 if (!thread->executing ()
2480 && !thread->stop_requested
2481 && thread->stop_signal () == GDB_SIGNAL_0)
2485 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
2559 proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
2588 if (thread->inf->num < lowest->
inf->
num
2624 if (
query (_(
"A program is being debugged already. Kill it? ")))
2627 error (_(
"Not killed."));
2635 args = stripped.get ();
2642 error (_(
"Cannot attach to this target in non-stop mode"));
2647 attach_target =
nullptr;
2747 gdb::optional<scoped_restore_current_thread> restore_thread;
2750 restore_thread.emplace ();
2799 error (_(
"The program is not being run."));
2834 if (!was_non_stop_p)
2925 && startswith (
args,
"-a"))
2939 int printed_something = 0;
2945 printed_something = 1;
2949 if (!printed_something)
2951 "available for this processor.\n");
2960 error (_(
"The program has no registers now."));
2978 error (_(
"Not supported on this target."));
3062Printing of return value after `finish' is %s.\n"),
3070#define RUN_ARGS_HELP \
3071"You may specify arguments to give it.\n\
3072Args may include \"*\", or \"[...]\"; they are expanded using the\n\
3073shell that will start the program (specified by the \"$SHELL\" environment\n\
3074variable). Input and output redirection with \">\", \"<\", or \">>\"\n\
3077With no arguments, uses arguments last specified (with \"run\" or \n\
3078\"set args\"). To cancel previous arguments and run with no arguments,\n\
3079use \"set args\" without arguments.\n\
3081To start the inferior without using a shell, use \"set startup-with-shell off\"."
3089 const char *cmd_name;
3094Set terminal for future runs of program being debugged."), _(
"\
3095Show terminal for future runs of program being debugged."), _(
"\
3096Usage: set inferior-tty [TTY]\n\n\
3097If TTY is omitted, the default behavior of using the same terminal as GDB\n\
3102 cmd_name =
"inferior-tty";
3104 gdb_assert (c !=
nullptr);
3110Set argument list to give program being debugged when it is started."), _(
"\
3111Show argument list to give program being debugged when it is started."), _(
"\
3112Follow this command with any number of args, to be passed to the program."),
3117 gdb_assert (c !=
nullptr);
3123Set the current working directory to be used when the inferior is started.\n\
3124Changing this setting does not have any effect on inferiors that are\n\
3127Show the current working directory that is used when the inferior is started."),
3129Use this command to change the current working directory that will be used\n\
3130when the inferior is started. This setting does not affect GDB's current\n\
3131working directory."),
3136 gdb_assert (c !=
nullptr);
3140The environment to give the program, or one variable's value.\n\
3141With an argument VAR, prints the value of environment variable VAR to\n\
3142give the program being debugged. With no arguments, prints the entire\n\
3143environment to be given to the program."), &
showlist);
3147 _(
"Complement to certain \"set\" commands."),
3151Cancel environment variable VAR for the program.\n\
3152This does not affect the program until the next \"run\" command."),
3157Set environment variable value to give the program.\n\
3158Arguments are VAR VALUE where VAR is variable name and VALUE is value.\n\
3159VALUES of environment variables are uninterpreted strings.\n\
3160This does not affect the program until the next \"run\" command."),
3165Add directory DIR(s) to beginning of search path for object files.\n\
3166$cwd in the path means the current working directory.\n\
3167This path is equivalent to the $PATH shell variable. It is a list of\n\
3168directories, separated by colons. These directories are searched to find\n\
3169fully linked executable files and separately compiled object files as \
3174Current search path for finding object files.\n\
3175$cwd in the path means the current working directory.\n\
3176This path is equivalent to the $PATH shell variable. It is a list of\n\
3177directories, separated by colons. These directories are searched to find\n\
3178fully linked executable files and separately compiled object files as \
3184 _(
"Kill execution of program being debugged."),
3188Attach to a process or file outside of GDB.\n\
3189This command attaches to another target, of the same type as your last\n\
3190\"target\" command (\"info files\" will show your target stack).\n\
3191The command may take as argument a process id or a device file.\n\
3192For a process id, you must have permission to send the process a signal,\n\
3193and it must have the same effective uid as the debugger.\n\
3194When using \"attach\" with a process id, the debugger finds the\n\
3195program running in the process, looking first in the current working\n\
3196directory, or (if not found there) using the source file search path\n\
3197(see the \"directory\" command). You can also use the \"file\" command\n\
3198to specify the program, and to load its symbol table."));
3201Detach a process or file previously attached.\n\
3202If a process, it is no longer traced, and it continues its execution. If\n\
3203you were debugging a file, the file is closed and gdb no longer accesses it."),
3207Disconnect from a target.\n\
3208The target will wait for another debugger to connect. Not available for\n\
3212Continue program with the specified signal.\n\
3213Usage: signal SIGNAL\n\
3214The SIGNAL argument is processed the same as the handle command.\n\
3216An argument of \"0\" means continue the program without sending it a signal.\n\
3217This is useful in cases where the program stopped because of a signal,\n\
3218and you want to resume the program while discarding the signal.\n\
3220In a multi-threaded program the signal is delivered to, or discarded from,\n\
3221the current thread only."));
3225Queue a signal to be delivered to the current thread when it is resumed.\n\
3226Usage: queue-signal SIGNAL\n\
3227The SIGNAL argument is processed the same as the handle command.\n\
3228It is an error if the handling state of SIGNAL is \"nopass\".\n\
3230An argument of \"0\" means remove any currently queued signal from\n\
3231the current thread. This is useful in cases where the program stopped\n\
3232because of a signal, and you want to resume it while discarding the signal.\n\
3234In a multi-threaded program the signal is queued with, or discarded from,\n\
3235the current thread only."));
3240Step one instruction exactly.\n\
3242Argument N means step N times (or till program stops for another \
3248Step one instruction, but proceed through subroutine calls.\n\
3250Argument N means step N times (or till program stops for another \
3256Execute until selected stack frame returns.\n\
3258Upon return, the value returned is printed and put in the value history."));
3263Step program, proceeding through subroutine calls.\n\
3265Unlike \"step\", if the current source line calls a subroutine,\n\
3266this command does not enter the subroutine, but instead steps over\n\
3267the call, in effect treating it as a single source line."));
3272Step program until it reaches a different source line.\n\
3274Argument N means step N times (or till program stops for another \
3280Execute until past the current line or past a LOCATION.\n\
3281Execute until the program reaches a source line greater than the current\n\
3282or a specified location (same args as break command) within the current \
3288Continue the program up to the given location (same form as args for break \
3290Execution will also stop upon exit from the current stack frame."));
3295Continue program being debugged at specified line or address.\n\
3296Usage: jump LOCATION\n\
3297Give as argument either LINENUM or *ADDR, where ADDR is an expression\n\
3298for an address to start at."));
3304Continue program being debugged, after signal or breakpoint.\n\
3305Usage: continue [N]\n\
3306If proceeding from breakpoint, a number N may be used as an argument,\n\
3307which means to set the ignore count of that breakpoint to N - 1 (so that\n\
3308the breakpoint won't break until the Nth time it is reached).\n\
3310If non-stop mode is enabled, continue only the current thread,\n\
3311otherwise all the threads in the program are continued. To \n\
3312continue all stopped threads in non-stop mode, use the -a option.\n\
3313Specifying -a and an ignore count simultaneously is an error."));
3319Start debugged program.\n"
3325Start the debugged program stopping at the beginning of the main procedure.\n"
3330Start the debugged program stopping at the first instruction.\n"
3335 _(
"Interrupt the execution of the debugged program.\n\
3336If non-stop mode is enabled, interrupt only the current thread,\n\
3337otherwise all the threads in the program are stopped. To \n\
3338interrupt all running threads in non-stop mode, use the -a option."));
3342List of integer registers and their contents, for selected stack frame.\n\
3343One or more register names as argument means describe the given registers.\n\
3344One or more register group names as argument means describe the registers\n\
3345in the named register groups."));
3350List of all registers and their contents, for selected stack frame.\n\
3351One or more register names as argument means describe the given registers.\n\
3352One or more register group names as argument means describe the registers\n\
3353in the named register groups."));
3357 _(
"Execution status of the program."));
3360 _(
"Print the status of the floating point unit."));
3363 _(
"Print the status of the vector unit."));
3367Show additional information about a process.\n\
3368Specify any process id, or use the program being debugged by default."),
3373List memory regions mapped by the specified process."),
3374 &info_proc_cmdlist);
3377List process info from /proc/PID/stat."),
3378 &info_proc_cmdlist);
3381List process info from /proc/PID/status."),
3382 &info_proc_cmdlist);
3385List current working directory of the specified process."),
3386 &info_proc_cmdlist);
3389List command line arguments of the specified process."),
3390 &info_proc_cmdlist);
3393List absolute filename for executable of the specified process."),
3394 &info_proc_cmdlist);
3397List files opened by the specified process."),
3398 &info_proc_cmdlist);
3401List all available info about the specified process."),
3402 &info_proc_cmdlist);
3406Set whether `finish' prints the return value."), _(
"\
3407Show 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)
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)
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 * lookup_cmd(const char **line, struct cmd_list_element *list, const char *cmdtype, std::string *default_args, int allow_unknown, int ignore_help_classes)
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
show_value_ftype deprecated_show_value_hack
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(struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, gdb_byte *readbuf, 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_print_vector_info_p(struct gdbarch *gdbarch)
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)
thread_info * find_thread_ptid(inferior *inf, ptid_t 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 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 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 void stop_current_target_threads_ns(ptid_t ptid)
static std::string inferior_args_scratch
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 info_proc_cmd_cwd(const char *args, int from_tty)
static void nexti_command(const char *count_string, int from_tty)
static void set_cwd_command(const char *args, int from_tty, struct cmd_list_element *c)
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)
void set_inferior_args_vector(int argc, char **argv)
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)
static std::string inferior_cwd_scratch
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 set_args_command(const char *args, int from_tty, struct cmd_list_element *c)
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 set_inferior_tty_command(const char *args, int from_tty, struct cmd_list_element *c)
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)
static std::string inferior_io_terminal_scratch
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
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
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_last_displayed(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)
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
enum language la_language
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
int section_is_mapped(struct obj_section *osect)
void reread_symbols(int from_tty)
int section_is_overlay(struct obj_section *section)
bool find_pc_line_pc_range(CORE_ADDR pc, CORE_ADDR *startptr, CORE_ADDR *endptr)
struct symbol * fixup_symbol_section(struct symbol *sym, struct objfile *objfile)
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)
struct type * value_type(const struct value *value)
int value_entirely_available(struct value *value)
struct value * allocate_value(struct type *type)
int record_latest_value(struct value *val)
gdb::array_view< gdb_byte > value_contents_raw(struct value *value)
int value_optimized_out(struct value *value)
gdb::array_view< const gdb_byte > value_contents_for_printing(struct value *value)