27 #ifdef HAVE_SYS_RESOURCE_H 28 #include <sys/resource.h> 49 #include "filenames.h" 61 #include "readline/readline.h" 77 #if !HAVE_DECL_REALLOC 78 extern PTR realloc ();
104 static std::chrono::steady_clock::duration prompt_for_continue_wait_time;
108 static int debug_timestamp = 0;
116 show_sevenbit_strings (
struct ui_file *file,
int from_tty,
120 "in strings as \\nnn is %s.\n"),
201 void **location = (
void **) ptr;
203 if (location == NULL)
205 _(
"free_current_contents: NULL pointer"));
206 if (*location != NULL)
225 (*deprecated_warning_hook) (
string, args);
249 verror (
const char *
string, va_list args)
262 static void ATTRIBUTE_NORETURN
278 #ifdef HAVE_SETRLIMIT 279 struct rlimit rlim = { RLIM_INFINITY, RLIM_INFINITY };
281 setrlimit (RLIMIT_CORE, &rlim);
295 #ifdef HAVE_GETRLIMIT 299 if (getrlimit (RLIMIT_CORE, &rlim) != 0)
305 if (rlim.rlim_cur == 0)
309 if (rlim.rlim_max == 0)
323 _(
"%s\nUnable to dump core, use `ulimit -c" 324 " unlimited' before executing GDB next time.\n"),
337 if (!core_dump_allowed)
340 return core_dump_allowed;
376 const
char *file,
int line, const
char *fmt, va_list ap)
385 static char msg[] =
"Recursive internal problem.\n";
402 if (write (STDERR_FILENO, msg,
sizeof (msg)) !=
sizeof (msg))
416 "A problem internal to GDB has been detected,\n" 417 "further debugging may prove unreliable.",
418 file, line, problem->name, msg.c_str ());
424 fputs (reason.c_str (), stderr);
452 quit_p =
query (
_(
"%s\nQuit this debugging session? "),
479 dump_core_p =
query (
_(
"%s\nCreate a core file of GDB? "),
501 #ifdef HAVE_WORKING_FORK 547 va_start (ap,
string);
589 *set_cmd_list = NULL;
590 *show_cmd_list = NULL;
592 set_doc =
xstrprintf (
_(
"Configure what GDB does when %s is detected."),
595 show_doc =
xstrprintf (
_(
"Show what GDB does when %s is detected."),
601 concat (
"maintenance set ", problem->
name,
" ",
608 concat (
"maintenance show ", problem->
name,
" ",
614 set_doc =
xstrprintf (
_(
"Set whether GDB should quit " 615 "when an %s is detected"),
617 show_doc =
xstrprintf (
_(
"Show whether GDB will quit " 618 "when an %s is detected"),
637 set_doc =
xstrprintf (
_(
"Set whether GDB should create a core " 638 "file of GDB when %s is detected"),
640 show_doc =
xstrprintf (
_(
"Show whether GDB will create a core " 641 "file of GDB when %s is detected"),
683 bfd_set_error (bfd_error_no_error);
704 warning (
_(
"%s"), combined.c_str ());
717 combined = (
char *) alloca (strlen (
err) + strlen (
string) + 3);
718 strcpy (combined,
string);
719 strcat (combined,
": ");
720 strcat (combined,
err);
750 throw_quit (
"Quit (expect signal SIGINT when the program is resumed)");
778 _(
"virtual memory exhausted: can't allocate %ld bytes."),
798 val =
read (desc, addr, len);
828 char *result = (
char *)
xmalloc (length * 2 + 1);
833 for (i = 0; i < length; ++i)
891 defaulted_query (const
char *ctlstr, const
char defchar, va_list args)
895 char def_answer, not_def_answer;
896 const char *y_string, *n_string;
903 not_def_answer =
'N';
907 else if (defchar ==
'y')
911 not_def_answer =
'N';
919 not_def_answer =
'Y';
944 "input not from terminal]\n"),
945 y_string, n_string, def_answer);
962 question.c_str (), y_string, n_string,
968 steady_clock::time_point prompt_started = steady_clock::now ();
974 char *response, answer;
979 if (response == NULL)
986 answer = response[0];
993 if (answer == not_def_answer)
1001 if (answer == def_answer
1002 || (defchar !=
'\0' && answer ==
'\0'))
1009 y_string, n_string);
1013 prompt_for_continue_wait_time += steady_clock::now () - prompt_started;
1033 va_start (args, ctlstr);
1034 ret = defaulted_query (ctlstr,
'n', args);
1051 va_start (args, ctlstr);
1052 ret = defaulted_query (ctlstr,
'y', args);
1068 va_start (args, ctlstr);
1069 ret = defaulted_query (ctlstr,
'\0', args);
1091 if (obstack_object_size (&host_data) == 1)
1094 *target_c = *(
char *) obstack_base (&host_data);
1118 int target_char = -2;
1119 int c = *(*string_ptr)++;
1143 if (isdigit (c) && c !=
'8' && c !=
'9')
1184 error (
_(
"The escape sequence `\\%c' is equivalent to plain `%c'," 1185 " which has no equivalent\nin the `%s' character set."),
1203 void (*do_fprintf) (
struct ui_file *,
const char *, ...)
1204 ATTRIBUTE_FPTR_PRINTF_2,
struct ui_file *stream,
int quoter)
1209 (c >= 0x7F && c < 0xA0) ||
1215 do_fputs (
"\\n", stream);
1218 do_fputs (
"\\b", stream);
1221 do_fputs (
"\\t", stream);
1224 do_fputs (
"\\f", stream);
1227 do_fputs (
"\\r", stream);
1230 do_fputs (
"\\e", stream);
1233 do_fputs (
"\\a", stream);
1236 do_fprintf (stream,
"\\%.3o", (
unsigned int) c);
1242 if (quoter != 0 && (c ==
'\\' || c == quoter))
1243 do_fputs (
"\\", stream);
1244 do_fprintf (stream,
"%c", c);
1273 for (i = 0; i < n; i++)
1283 for (i = 0; i < n; i++)
1295 _(
"Number of lines gdb thinks are in a page is %s.\n"),
1306 _(
"Number of characters gdb thinks " 1307 "are in a line is %s.\n"),
1356 #if defined(__GO32__) 1357 rows = ScreenRows ();
1358 cols = ScreenCols ();
1363 rl_reset_terminal (NULL);
1366 rl_get_screen_size (&rows, &cols);
1373 if (((rows <= 0) && (
tgetnum ((
char *)
"li") < 0))
1376 || getenv (
"EMACS") || getenv (
"INSIDE_EMACS"))
1391 rl_catch_sigwinch = 0;
1438 rl_set_screen_size (rows, cols);
1494 char cont_prompt[120];
1499 steady_clock::time_point prompt_started = steady_clock::now ();
1504 strcpy (cont_prompt,
1505 "---Type <return> to continue, or q <return> to quit---");
1507 strcat (cont_prompt,
"\n\032\032prompt-for-continue\n");
1522 prompt_for_continue_wait_time += steady_clock::now () - prompt_started;
1531 while (*p ==
' ' || *p ==
'\t')
1554 prompt_for_continue_wait_time = steady_clock::duration::zero ();
1559 std::chrono::steady_clock::duration
1562 return prompt_for_continue_wait_time;
1601 _(
"failed internal consistency check"));
1659 stringlen = strlen (
string);
1664 spaces += width - stringlen;
1666 spacebuf = (
char *) alloca (spaces + 1);
1667 spacebuf[spaces] =
'\0';
1669 spacebuf[spaces] =
' ';
1708 const char *lineptr;
1710 if (linebuffer == 0)
1729 lineptr = linebuffer;
1736 while (*lineptr && *lineptr !=
'\n')
1739 if (*lineptr ==
'\t')
1798 if (*lineptr ==
'\n')
1863 static int new_line = 1;
1864 static int return_p = 0;
1865 static const char *prev_prefix =
"";
1866 static const char *prev_suffix =
"";
1868 if (*
string ==
'\n')
1873 if ((return_p || (strcmp (prev_prefix, prefix) != 0)) && !new_line)
1887 prev_prefix = prefix;
1888 prev_suffix = suffix;
1891 while ((ch = *
string++) !=
'\0')
1927 return_p = ch ==
'\r';
1955 va_list args,
int filter)
1977 steady_clock::time_point now = steady_clock::now ();
1978 seconds s = duration_cast<seconds> (now.time_since_epoch ());
1979 microseconds us = duration_cast<microseconds> (now.time_since_epoch () - s);
1981 len = linebuffer.size ();
1982 need_nl = (len > 0 && linebuffer[len - 1] !=
'\n');
1987 linebuffer.c_str (),
1988 need_nl ?
"\n":
"");
2012 va_start (args, format);
2022 va_start (args, format);
2036 va_start (args, format);
2049 va_start (args, format);
2060 va_start (args, format);
2073 va_start (args, format);
2102 static char *spaces = 0;
2103 static int max_spaces = -1;
2109 spaces = (
char *)
xmalloc (n + 1);
2110 for (t = spaces + n; t != spaces;)
2116 return spaces + max_spaces - n;
2150 if (demangled != NULL)
2164 return (isalnum (ch) || ch ==
'_');
2173 const char *p =
token;
2174 while (p != end && !isspace (*p) && *p !=
'(')
2187 static const char *ops[] =
2193 "-=",
"--",
"->",
"-",
2202 "<<=",
"<=",
"<<",
"<",
2203 ">>=",
">=",
">>",
">",
2207 for (
const char *op : ops)
2209 size_t oplen = strlen (op);
2210 size_t lencmp = std::min<size_t> (oplen, end - p);
2212 if (strncmp (p, op, lencmp) == 0)
2226 skip_ws (
const char *&string1,
const char *&string2,
const char *end_str2)
2228 while (isspace (*string1))
2230 while (string2 < end_str2 && isspace (*string2))
2241 return ((
string == start
2255 const char *p = *
name;
2282 const char *string1_start = string1;
2283 const char *end_str2 = string2 + string2_len;
2295 skip_ws (string1, string2, end_str2);
2314 if (string2 == end_str2
2317 const char *abi_start = string1;
2323 if (match_for_lcd != NULL && abi_start != string1)
2326 while (isspace (*string1))
2330 if (*string1 ==
'\0' || string2 == end_str2)
2334 if (have_colon_op && string1[0] ==
':' && string1[1] ==
':')
2336 if (*string2 !=
':')
2342 if (string2 == end_str2)
2345 if (*string2 !=
':')
2351 while (isspace (*string1))
2353 while (string2 < end_str2 && isspace (*string2))
2367 if (strncmp (string1, string2, cmplen) != 0)
2373 if (string2 != end_str2)
2379 skip_ws (string1, string2, end_str2);
2383 if (*string1 ==
'(')
2385 if (string2 == end_str2)
2396 return *string1 !=
'\0';
2400 if (*string1 != *string2)
2409 skip_ws (string1, string2, end_str2);
2413 const char *end_str1 = string1 + strlen (string1);
2417 cmplen = std::min (p1 - string1, p2 - string2);
2420 if (strncmp (string1, string2, cmplen) != 0)
2425 if (p1 - string1 != p2 - string2)
2427 if (strncmp (string1, string2, cmplen) != 0)
2434 if (*string1 ==
'\0' || string2 == end_str2)
2436 if (*string1 ==
'(' || *string2 ==
'(')
2447 && (tolower ((
unsigned char) *string1)
2448 != tolower ((
unsigned char) *string2)))
2461 if (string2 == end_str2)
2481 if (match_for_lcd != NULL)
2483 while ((string1 = strstr (string1,
"[abi:")) != NULL)
2485 const char *abi_start = string1;
2491 if (abi_start != string1)
2499 return (*string1 !=
'\0' && *string1 !=
'(');
2508 strncmp_iw (
const char *string1,
const char *string2,
size_t string2_len)
2563 const char *saved_string1 = string1, *saved_string2 = string2;
2571 char c1 =
'X', c2 =
'X';
2573 while (*string1 !=
'\0' && *string2 !=
'\0')
2575 while (isspace (*string1))
2577 while (isspace (*string2))
2583 c1 = tolower ((
unsigned char) *string1);
2584 c2 = tolower ((
unsigned char) *string2);
2594 if (*string1 !=
'\0')
2607 if (*string2 ==
'\0')
2612 if (*string2 ==
'\0')
2617 if (*string2 ==
'\0' || *string2 ==
'(')
2633 string1 = saved_string1;
2634 string2 = saved_string2;
2641 streq (
const char *lhs,
const char *rhs)
2643 return !strcmp (lhs, rhs);
2658 if (template_string != (
char *) NULL && string_to_compare != (
char *) NULL
2659 && strlen (string_to_compare) <= strlen (template_string))
2661 (
startswith (template_string, string_to_compare));
2680 Set number of characters where GDB should wrap lines of its output."),
_(
"\ 2681 Show number of characters where GDB should wrap lines of its output."),
_(
"\ 2682 This affects where GDB wraps its output to fit the screen width.\n\ 2683 Setting this to \"unlimited\" or zero prevents GDB from wrapping its output."),
2689 Set number of lines in a page for GDB output pagination."),
_(
"\ 2690 Show number of lines in a page for GDB output pagination."),
_(
"\ 2691 This affects the number of lines after which GDB will pause\n\ 2692 its output and ask you whether to continue.\n\ 2693 Setting this to \"unlimited\" or zero causes GDB never pause during output."),
2700 Set state of GDB output pagination."),
_(
"\ 2701 Show state of GDB output pagination."),
_(
"\ 2702 When pagination is ON, GDB pauses at end of each screenful of\n\ 2703 its output and asks you whether to continue.\n\ 2704 Turning pagination off is an alternative to \"set height unlimited\"."),
2711 Set printing of 8-bit characters in strings as \\nnn."),
_(
"\ 2712 Show printing of 8-bit characters in strings as \\nnn."), NULL,
2714 show_sevenbit_strings,
2718 &debug_timestamp,
_(
"\ 2719 Set timestamping of debugging messages."),
_(
"\ 2720 Show timestamping of debugging messages."),
_(
"\ 2721 When set, debugging messages will be marked with seconds and microseconds."),
2739 addr &= ((
CORE_ADDR) 1 << addr_bit) - 1;
2759 addr &= ((
CORE_ADDR) 1 << addr_bit) - 1;
2771 address &= ((
CORE_ADDR) 1 << addr_bit) - 1;
2800 return *addr_ap == *addr_bp;
2809 if (my_string[0] ==
'0' && tolower (my_string[1]) ==
'x')
2814 for (i = 2; my_string[i] !=
'\0'; i++)
2816 if (isdigit (my_string[i]))
2817 addr = (my_string[i] -
'0') + (addr * 16);
2818 else if (isxdigit (my_string[i]))
2819 addr = (tolower (my_string[i]) -
'a' + 0xa) + (addr * 16);
2821 error (
_(
"invalid hex \"%s\""), my_string);
2829 for (i = 0; my_string[i] !=
'\0'; i++)
2831 if (isdigit (my_string[i]))
2832 addr = (my_string[i] -
'0') + (addr * 10);
2834 error (
_(
"invalid decimal \"%s\""), my_string);
2867 #if defined (_WIN32) 2870 DWORD len = GetFullPathName (filename, MAX_PATH, buf, NULL);
2876 if (len > 0 && len < MAX_PATH)
2881 char *rp = canonicalize_file_name (filename);
2895 gdb_realpath_check_trailer (
const char *input,
const char *trailer)
2899 size_t len = strlen (result.get ());
2900 size_t trail_len = strlen (trailer);
2903 && strcmp (result.get () + len - trail_len, trailer) == 0);
2907 gdb_realpath_tests ()
2910 gdb_realpath_check_trailer (
"./xfullpath.exp",
"/xfullpath.exp");
2912 gdb_realpath_check_trailer (
"../../defs.h",
"/defs.h");
2914 gdb_realpath_check_trailer (
"./a",
"/a");
2916 gdb_realpath_check_trailer (
"/root_file_which_should_exist",
2917 "/root_file_which_should_exist");
2919 gdb_realpath_check_trailer (
"xfullpath.exp",
"xfullpath.exp");
2921 gdb_realpath_check_trailer (
"a",
"a");
2923 gdb_realpath_check_trailer (
"",
"");
2934 const char *base_name = lbasename (filename);
2940 if (base_name == filename)
2943 dir_name = (
char *) alloca ((
size_t) (base_name - filename + 2));
2947 strncpy (dir_name, filename, base_name - filename);
2948 dir_name[base_name - filename] =
'\000';
2950 #ifdef HAVE_DOS_BASED_FILE_SYSTEM 2953 if (strlen (dir_name) == 2 && isalpha (dir_name[0]) && dir_name[1] ==
':')
2956 dir_name[3] =
'\000';
2964 const char *real_path = path_storage.get ();
2965 if (IS_DIR_SEPARATOR (real_path[strlen (real_path) - 1]))
2966 result = concat (real_path, base_name, (
char *) NULL);
2968 result = concat (real_path,
SLASH_STRING, base_name, (
char *) NULL);
2980 gdb_assert (path != NULL && path[0] !=
'\0');
2985 if (IS_ABSOLUTE_PATH (path))
2993 path, (
char *) NULL));
3001 return (v + n - 1) & -n;
3018 size_t total =
size * count;
3019 void *ptr = obstack_alloc ((
struct obstack *) data, total);
3043 const char *base = lbasename (filename);
3045 while (base > filename && IS_DIR_SEPARATOR (base[-1]))
3048 if (base == filename)
3051 dirname =
std::string (filename, base - filename);
3055 if (base - filename == 2 && IS_ABSOLUTE_PATH (base)
3056 && !IS_DIR_SEPARATOR (filename[0]))
3057 dirname[base++ - filename] =
'.';
3067 char **
argv = buildargv (s);
3069 if (s != NULL &&
argv == NULL)
3081 return * (
int *) ap - * (
int *)
bp;
3089 const char **s1 = (
const char **) arg1;
3090 const char **s2 = (
const char **) arg2;
3092 return strcmp (*s1, *s2);
3095 #define AMBIGUOUS_MESS1 ".\nMatching formats:" 3096 #define AMBIGUOUS_MESS2 \ 3097 ".\nUse \"set gnutarget format-name\" to specify the format." 3107 if (error_tag != bfd_error_file_ambiguously_recognized || matching == NULL)
3108 return bfd_errmsg (error_tag);
3112 for (p = matching; *p; p++)
3113 ret_len += strlen (*p) + 1;
3114 ret = (
char *)
xmalloc (ret_len + 1);
3118 strcpy (retp, bfd_errmsg (error_tag));
3119 retp += strlen (retp);
3122 retp += strlen (retp);
3124 for (p = matching; *p; p++)
3126 sprintf (retp,
" %s", *p);
3127 retp += strlen (retp);
3147 dummy = (
char *) args;
3150 if ((
pid == 0 &&
dummy == args) ||
dummy != &args[strlen (args)])
3151 error (
_(
"Illegal process-id: %s."), args);
3205 char *
string = *stringp, *s;
3206 const size_t from_len = strlen (from);
3207 const size_t to_len = strlen (to);
3211 s = strstr (s, from);
3215 if ((s ==
string || IS_DIR_SEPARATOR (s[-1])
3217 && (s[from_len] ==
'\0' || IS_DIR_SEPARATOR (s[from_len])
3223 = (
char *)
xrealloc (
string, (strlen (
string) + to_len + 1));
3226 s = s -
string + string_new;
3227 string = string_new;
3230 memmove (&s[to_len], &s[from_len], strlen (&s[from_len]) + 1);
3231 memcpy (s, to, to_len);
3249 sigalrm_handler (
int signo)
3268 pid_t waitpid_result;
3276 #if defined (HAVE_SIGACTION) && defined (SA_RESTART) 3277 struct sigaction sa, old_sa;
3279 sa.sa_handler = sigalrm_handler;
3280 sigemptyset (&sa.sa_mask);
3282 sigaction (SIGALRM, &sa, &old_sa);
3286 ofunc = signal (SIGALRM, sigalrm_handler);
3292 waitpid_result = waitpid (
pid,
status, 0);
3296 #if defined (HAVE_SIGACTION) && defined (SA_RESTART) 3297 sigaction (SIGALRM, &old_sa, NULL);
3299 signal (SIGALRM,
ofunc);
3306 if (waitpid_result ==
pid)
3328 #ifdef HAVE_DOS_BASED_FILE_SYSTEM 3330 char *pattern_slash, *string_slash;
3334 pattern_slash = (
char *) alloca (strlen (pattern) + 1);
3335 strcpy (pattern_slash, pattern);
3336 pattern = pattern_slash;
3337 for (; *pattern_slash != 0; pattern_slash++)
3338 if (IS_DIR_SEPARATOR (*pattern_slash))
3339 *pattern_slash =
'/';
3341 string_slash = (
char *) alloca (strlen (
string) + 1);
3342 strcpy (string_slash,
string);
3343 string = string_slash;
3344 for (; *string_slash != 0; string_slash++)
3345 if (IS_DIR_SEPARATOR (*string_slash))
3346 *string_slash =
'/';
3350 #ifdef HAVE_CASE_INSENSITIVE_FILE_SYSTEM 3351 flags |= FNM_CASEFOLD;
3354 return fnmatch (pattern,
string,
flags);
3368 const char *p = path;
3370 if (HAS_DRIVE_SPEC (p))
3372 p = STRIP_DRIVE_SPEC (p);
3378 if (IS_DIR_SEPARATOR (*p))
3384 if (p > path + 1 && IS_DIR_SEPARATOR (p[-1]))
3388 if (p > path && !IS_DIR_SEPARATOR (p[-1]))
3404 const char *p = path;
3411 if (HAS_DRIVE_SPEC (p))
3413 p = STRIP_DRIVE_SPEC (p);
3419 while (*p !=
'\0' && !IS_DIR_SEPARATOR (*p))
void error_no_arg(const char *why)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t err
void vwarning(const char *string, va_list args)
pid_t wait_to_die_with_timeout(pid_t pid, int *status, int timeout)
ssize_t read(int fd, void *buf, size_t count)
char * hex_string(LONGEST num)
int count_path_elements(const char *path)
const char * target_charset(struct gdbarch *gdbarch)
int target_supports_terminal_ours(void)
void fprintf_symbol_filtered(struct ui_file *stream, const char *name, enum language lang, int arg_mode)
int putchar_unfiltered(int c)
const char * should_dump_core
hashval_t core_addr_hash(const void *ap)
CORE_ADDR string_to_core_addr(const char *my_string)
int tui_get_command_dimension(unsigned int *width, unsigned int *height)
static bool valid_identifier_name_char(int ch)
void fputs_unfiltered(const char *buf, struct ui_file *file)
void ui_unregister_input_event_handler(struct ui *ui)
void error_stream(const string_file &stream)
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 bpstat_clear_actions(void)
unsigned m_save_lines_per_page
int strcmp_iw(const char *string1, const char *string2)
void dummy_obstack_deallocate(void *object, void *data)
static struct internal_problem demangler_warning_problem
void warning(const char *fmt,...)
int fputc_filtered(int c, struct ui_file *stream)
int ui_file_isatty(struct ui_file *file)
int query(const char *ctlstr,...)
int(* deprecated_query_hook)(const char *, va_list) ATTRIBUTE_FPTR_PRINTF(1
static void show_debug_timestamp(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
ULONGEST align_down(ULONGEST v, int n)
static void set_screen_size(void)
static const char *const internal_problem_modes[]
int unpush_target(struct target_ops *t)
void verror(const char *string, va_list args)
void * memset(T *s, int c, size_t n)=delete
void internal_error(const char *file, int line, const char *fmt,...)
void print_sys_errmsg(const char *string, int errcode)
struct ui_out * interp_ui_out(struct interp *interp)
const struct language_defn * language_def(enum language lang)
void print_spaces(int n, struct ui_file *file)
static void vfprintf_maybe_filtered(static void fputs_maybe_filtered(const char struct ui_file *, const char *, va_list, int)
void add_setshow_enum_cmd(const char *name, enum command_class theclass, const char *const *enumlist, const char **var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
const char * warning_pre_print
#define DIRNAME_SEPARATOR
gdb::unique_xmalloc_ptr< char > gdb_realpath_keepfile(const char *filename)
void gdb_print_host_address_1(const void *addr, struct ui_file *stream)
int yquery(const char *ctlstr,...)
static struct internal_problem internal_warning_problem
static void ATTRIBUTE_NORETURN abort_with_message(const char *msg)
gdb::unique_xmalloc_ptr< char > gdb_realpath(const char *filename)
char * skip_spaces(char *chp)
void vprintf_filtered(const char *format, va_list args)
char * make_hex_string(const gdb_byte *data, size_t length)
const char * strip_leading_path_elements(const char *path, int n)
static void prompt_for_continue(void)
void demangler_warning(const char *file, int line, const char *string,...)
static void show_pagination_enabled(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static unsigned int chars_per_line
void free_section_addr_info(struct section_addr_info *sap)
void substitute_path_component(char **stringp, const char *from, const char *to)
static bool skip_abi_tag(const char **name)
struct cmd_list_element * prefix
static unsigned int lines_per_page
struct cmd_list_element * maintenance_set_cmdlist
void printf_filtered(const char *format,...)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
static void set_internal_problem_cmd(const char *args, int from_tty)
#define host_address_to_string(ADDR)
int strncmp_iw_with_mode(const char *string1, const char *string2, size_t string2_len, strncmp_iw_mode mode, enum language language, completion_match_for_lcd *match_for_lcd)
void demangler_vwarning(const char *file, int line, const char *fmt, va_list ap)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_const_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
struct cleanup * make_cleanup_unpush_target(struct target_ops *ops)
int strncmp_iw(const char *string1, const char *string2, size_t string2_len)
static void do_free_section_addr_info(void *arg)
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
void null_cleanup(void *arg)
static void fputs_maybe_filtered(const char *linebuffer, struct ui_file *stream, int filter)
~set_batch_flag_and_restore_page_info()
struct cmd_list_element * setlist
void add_setshow_uinteger_cmd(const char *name, enum command_class theclass, unsigned int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
void fputstr_unfiltered(const char *str, int quoter, struct ui_file *stream)
static char * wrap_pointer
static void ATTRIBUTE_PRINTF(4, 0)
std::string ldirname(const char *filename)
static void show_lines_per_page(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void convert_between_encodings(const char *from, const char *to, const gdb_byte *bytes, unsigned int num_bytes, int width, struct obstack *output, enum transliterations translit)
static void add_internal_problem_command(struct internal_problem *problem)
std::unique_ptr< T, xfree_deleter< T > > unique_xmalloc_ptr
void reset_prompt_for_continue_wait_time(void)
int fputc_unfiltered(int c, struct ui_file *stream)
std::string string_vprintf(const char *fmt, va_list args)
static const char * wrap_indent
int core_addr_eq(const void *ap, const void *bp)
int gdbarch_significant_addr_bit(struct gdbarch *gdbarch)
CORE_ADDR address_significant(gdbarch *gdbarch, CORE_ADDR addr)
int input_interactive_p(struct ui *)
const char internal_problem_yes[]
static const char * cp_skip_operator_token(const char *token, const char *end)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
set_batch_flag_and_restore_page_info()
int(*) void(* deprecated_warning_hook)(const char *, va_list) ATTRIBUTE_FPTR_PRINTF(1
void free_char_ptr_vec(VEC(char_ptr) *char_ptr_vec)
static void show_chars_per_line(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
unsigned m_save_chars_per_line
void puts_filtered_tabular(char *string, int width, int right)
char * gdb_readline_wrapper(const char *)
enum prompt_state prompt_state
void vfprintf_filtered(struct ui_file *stream, const char *format, va_list args)
void _initialize_utils(void)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
void internal_vwarning(const char *file, int line, const char *fmt, va_list ap)
void vfprintf_unfiltered(struct ui_file *stream, const char *format, va_list args)
struct cmd_list_element * showlist
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
void reset(const char *str)
int streq(const char *lhs, const char *rhs)
void puts_filtered(const char *string)
struct cleanup * make_cleanup_value_free_to_mark(struct value *mark)
void quit_force(int *exit_arg, int from_tty)
void free_current_contents(void *ptr)
static void do_value_free_to_mark(void *value)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
static int can_dump_core_warn(enum resource_limit_kind limit_kind, const char *reason)
void fputstrn_unfiltered(const char *str, int n, int quoter, struct ui_file *stream)
static void do_free_char_ptr_vec(void *arg)
static void do_bpstat_clear_actions_cleanup(void *unused)
void perror_warning_with_name(const char *string)
int host_hex_value(char c)
void reinitialize_more_filter(void)
void mark_ignored_range(const char *begin, const char *end)
static int host_char_to_target(struct gdbarch *gdbarch, int c, int *target_c)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
static int startswith(const char *string, const char *pattern)
void puts_debug(char *prefix, char *string, char *suffix)
int filtered_printing_initialized(void)
int nquery(const char *ctlstr,...)
int gdbarch_addr_bit(struct gdbarch *gdbarch)
int putchar_filtered(int c)
static char * wrap_buffer
static void timestamp(struct mi_timestamp *tv)
struct cmd_list_element * setprintlist
char * xstrprintf(const char *format,...)
const char * gdb_bfd_errmsg(bfd_error_type error_tag, char **matching)
void printf_unfiltered(const char *format,...)
struct cmd_list_element * setdebuglist
void printfi_filtered(int spaces, const char *format,...)
volatile int sync_quit_force_run
int user_settable_should_quit
int compare_positive_ints(const void *ap, const void *bp)
static void ours_for_output()
void(* deprecated_error_begin_hook)(void)
int parse_escape(struct gdbarch *gdbarch, const char **string_ptr)
void throw_perror_with_name(enum errors errcode, const char *string)
static unsigned int lines_printed
int(*) void(*) void(* deprecated_interactive_hook)(void)
int myread(int desc, char *addr, int len)
static void show_internal_problem_cmd(const char *args, int from_tty)
void wrap_here(const char *indent)
void vprintf_unfiltered(const char *format, va_list args)
void * hashtab_obstack_allocate(void *data, size_t size, size_t count)
PTR xrealloc(PTR ptr, size_t size)
void fprintfi_filtered(int spaces, struct ui_file *stream, const char *format,...)
std::chrono::steady_clock::duration get_prompt_for_continue_wait_time()
static void set_width(void)
void print_spaces_filtered(int n, struct ui_file *stream)
void initialize_utils(void)
char * hex_string_custom(LONGEST num, int width)
T & emplace(Args &&... args)
ULONGEST align_up(ULONGEST v, int n)
int strcmp_iw_ordered(const char *string1, const char *string2)
quit_handler_ftype * quit_handler
void puts_unfiltered(const char *string)
gdb::unique_xmalloc_ptr< char > gdb_abspath(const char *path)
char * language_demangle(const struct language_defn *current_language, const char *mangled, int options)
struct cleanup * make_bpstat_clear_actions_cleanup(void)
const char internal_problem_ask[]
void throw_verror(enum errors error, const char *fmt, va_list ap)
void ui_register_input_event_handler(struct ui *ui)
int xsnprintf(char *str, size_t size, const char *format,...)
const char * c_str() const
static struct internal_problem internal_error_problem
void default_quit_handler(void)
char * safe_strerror(int)
void ui_file_write(struct ui_file *file, const char *buf, long length_buf)
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct cleanup * make_cleanup_free_char_ptr_vec(VEC(char_ptr) *char_ptr_vec)
void internal_verror(const char *file, int line, const char *fmt, va_list ap)
static void skip_ws(const char *&string1, const char *&string2, const char *end_str2)
int parse_pid_to_attach(const char *args)
static void set_width_command(const char *args, int from_tty, struct cmd_list_element *c)
std::string string_printf(const char *fmt,...)
void value_free_to_mark(const struct value *mark)
int gdb_filename_fnmatch(const char *pattern, const char *string, int flags)
static sighandler_t ofunc
int user_settable_should_dump_core
void perror_with_name(const char *string)
struct cmd_list_element * showprintlist
void malloc_failure(long size)
const char * print_core_address(struct gdbarch *gdbarch, CORE_ADDR address)
unsigned long long ULONGEST
static int ignore(struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
void throw_quit(const char *fmt,...)
static void set_height_command(const char *args, int from_tty, struct cmd_list_element *c)
struct interp * top_level_interpreter(void)
int can_dump_core(enum resource_limit_kind limit_kind)
static unsigned int chars_printed
struct cmd_list_element * showdebuglist
EXTERN_C int tgetnum(const char *)
void warn_cant_dump_core(const char *reason)
const char * host_charset(void)
void init_page_info(void)
int compare_strings(const void *arg1, const void *arg2)
void gdb_flush(struct ui_file *file)
struct cleanup * make_cleanup_free_section_addr_info(struct section_addr_info *addrs)
static bool cp_is_operator(const char *string, const char *start)
static void printchar(int c, void(*do_fputs)(const char *, struct ui_file *), void(*do_fprintf)(struct ui_file *, const char *,...) ATTRIBUTE_FPTR_PRINTF_2, struct ui_file *stream, int quoter)
struct cmd_list_element * maintenance_show_cmdlist
void set_screen_width_and_height(int width, int height)
void fputstrn_filtered(const char *str, int n, int quoter, struct ui_file *stream)
void register_test(const std::string &name, selftest *test)
static std::string perror_string(const char *prefix)
void error(const char *fmt,...)
void fputstr_filtered(const char *str, int quoter, struct ui_file *stream)
void throw_error(enum errors error, const char *fmt,...)
static void do_unpush_target(void *arg)
void do_cleanups(struct cleanup *old_chain)
#define SELF_CHECK(VALUE)
int subset_compare(const char *string_to_compare, const char *template_string)
const char internal_problem_no[]