21 #include "dyn-string.h"
28 #ifdef HAVE_SYS_RESOURCE_H
29 #include <sys/resource.h>
41 #include "timeval-utils.h"
51 #include "filenames.h"
63 #include "readline/readline.h"
75 #if !HAVE_DECL_REALLOC
76 extern PTR realloc ();
102 static struct timeval prompt_for_continue_wait_time;
106 static
int debug_timestamp = 0;
131 show_sevenbit_strings (struct ui_file *file,
int from_tty,
135 "in strings as \\nnn is %s.\n"),
161 freeargv ((
char **) arg);
173 dyn_string_delete ((dyn_string_t) arg);
217 struct obstack *ob = arg;
219 obstack_free (ob, NULL);
247 struct ui_out *uiout = arg;
250 warning (
_(
"Cannot restore redirection of the current output protocol"));
335 htab_t htab = htab_voidp;
432 enum language saved_lang = (uintptr_t) p;
446 (
void *) (uintptr_t) saved_lang);
478 void **location = ptr;
480 if (location == NULL)
482 _(
"free_current_contents: NULL pointer"));
483 if (*location != NULL)
502 (*deprecated_warning_hook) (
string, args);
510 if (warning_pre_print)
522 verror (
const char *
string, va_list args)
533 error ((
"%s"), message);
538 static void ATTRIBUTE_NORETURN
554 #ifdef HAVE_SETRLIMIT
555 struct rlimit rlim = { RLIM_INFINITY, RLIM_INFINITY };
557 setrlimit (RLIMIT_CORE, &rlim);
571 #ifdef HAVE_GETRLIMIT
575 if (getrlimit (RLIMIT_CORE, &rlim) != 0)
581 if (rlim.rlim_cur == 0)
585 if (rlim.rlim_max == 0)
599 _(
"%s\nUnable to dump core, use `ulimit -c"
600 " unlimited' before executing GDB next time.\n"),
613 if (!core_dump_allowed)
616 return core_dump_allowed;
662 static char msg[] =
"Recursive internal problem.\n";
679 if (write (STDERR_FILENO, msg,
sizeof (msg)) !=
sizeof (msg))
695 "A problem internal to GDB has been detected,\n"
696 "further debugging may prove unreliable.",
697 file, line, problem->name, msg);
705 fputs (reason, stderr);
716 if (problem->should_quit != internal_problem_ask
721 if (problem->should_quit == internal_problem_ask)
729 quit_p =
query (
_(
"%s\nQuit this debugging session? "), reason);
731 else if (problem->should_quit == internal_problem_yes)
733 else if (problem->should_quit == internal_problem_no)
744 if (problem->should_dump_core == internal_problem_ask)
755 dump_core_p =
query (
_(
"%s\nCreate a core file of GDB? "), reason);
758 else if (problem->should_dump_core == internal_problem_yes)
760 else if (problem->should_dump_core == internal_problem_no)
776 #ifdef HAVE_WORKING_FORK
794 internal_vproblem (&internal_error_problem, file, line, fmt, ap);
805 internal_vproblem (&internal_warning_problem, file, line, fmt, ap);
815 internal_vproblem (&demangler_warning_problem, file, line, fmt, ap);
823 va_start (ap,
string);
863 set_cmd_list =
xmalloc (
sizeof (*set_cmd_list));
864 show_cmd_list =
xmalloc (
sizeof (*set_cmd_list));
865 *set_cmd_list = NULL;
866 *show_cmd_list = NULL;
868 set_doc =
xstrprintf (
_(
"Configure what GDB does when %s is detected."),
871 show_doc =
xstrprintf (
_(
"Show what GDB does when %s is detected."),
877 concat (
"maintenance set ", problem->
name,
" ",
884 concat (
"maintenance show ", problem->
name,
" ",
890 set_doc =
xstrprintf (
_(
"Set whether GDB should quit "
891 "when an %s is detected"),
893 show_doc =
xstrprintf (
_(
"Show whether GDB will quit "
894 "when an %s is detected"),
897 internal_problem_modes,
913 set_doc =
xstrprintf (
_(
"Set whether GDB should create a core "
914 "file of GDB when %s is detected"),
916 show_doc =
xstrprintf (
_(
"Show whether GDB will create a core "
917 "file of GDB when %s is detected"),
920 internal_problem_modes,
947 combined = (
char *)
xmalloc (strlen (err) + strlen (prefix) + 3);
948 strcpy (combined, prefix);
949 strcat (combined,
": ");
950 strcat (combined, err);
970 bfd_set_error (bfd_error_no_error);
1007 combined = (
char *) alloca (strlen (err) + strlen (
string) + 3);
1008 strcpy (combined,
string);
1009 strcat (combined,
": ");
1010 strcat (combined, err);
1040 throw_quit (
"Quit (expect signal SIGINT when the program is resumed)");
1066 _(
"virtual memory exhausted: can't allocate %ld bytes."),
1086 val =
read (desc, addr, len);
1090 return orglen -
len;
1116 char *result =
xmalloc (length * 2 + 1);
1121 for (i = 0; i < length; ++i)
1151 size_t length = regerror (code, rx, NULL, 0);
1152 char *result =
xmalloc (length);
1154 regerror (code, rx, result, length);
1169 code = regcomp (pattern, rx, REG_NOSUB);
1175 error ((
"%s: %s"), message, err);
1194 defaulted_query (
const char *ctlstr,
const char defchar, va_list args)
1199 char def_answer, not_def_answer;
1200 char *y_string, *n_string, *question, *prompt;
1203 struct timeval prompt_started, prompt_ended, prompt_delta;
1206 if (defchar ==
'\0')
1210 not_def_answer =
'N';
1214 else if (defchar ==
'y')
1218 not_def_answer =
'N';
1226 not_def_answer =
'Y';
1246 "input not from terminal]\n"),
1247 y_string, n_string, def_answer);
1262 question, y_string, n_string,
1267 gettimeofday (&prompt_started, NULL);
1271 char *response, answer;
1276 if (response == NULL)
1283 answer = response[0];
1290 if (answer == not_def_answer)
1292 retval = !def_value;
1298 if (answer == def_answer
1299 || (defchar !=
'\0' && answer ==
'\0'))
1306 y_string, n_string);
1310 gettimeofday (&prompt_ended, NULL);
1311 timeval_sub (&prompt_delta, &prompt_ended, &prompt_started);
1312 timeval_add (&prompt_for_continue_wait_time,
1313 &prompt_for_continue_wait_time, &prompt_delta);
1334 va_start (args, ctlstr);
1335 ret = defaulted_query (ctlstr,
'n', args);
1352 va_start (args, ctlstr);
1353 ret = defaulted_query (ctlstr,
'y', args);
1369 va_start (args, ctlstr);
1370 ret = defaulted_query (ctlstr,
'\0', args);
1383 struct obstack host_data;
1388 obstack_init (&host_data);
1395 if (obstack_object_size (&host_data) == 1)
1398 *target_c = *(
char *) obstack_base (&host_data);
1423 int target_char = -2;
1424 int c = *(*string_ptr)++;
1448 if (isdigit (c) && c !=
'8' && c !=
'9')
1489 error (
_(
"The escape sequence `\\%c' is equivalent to plain `%c',"
1490 " which has no equivalent\nin the `%s' character set."),
1508 void (*do_fprintf) (
struct ui_file *,
const char *, ...)
1509 ATTRIBUTE_FPTR_PRINTF_2,
struct ui_file *stream,
int quoter)
1514 (c >= 0x7F && c < 0xA0) ||
1520 do_fputs (
"\\n", stream);
1523 do_fputs (
"\\b", stream);
1526 do_fputs (
"\\t", stream);
1529 do_fputs (
"\\f", stream);
1532 do_fputs (
"\\r", stream);
1535 do_fputs (
"\\e", stream);
1538 do_fputs (
"\\a", stream);
1541 do_fprintf (stream,
"\\%.3o", (
unsigned int) c);
1547 if (quoter != 0 && (c ==
'\\' || c == quoter))
1548 do_fputs (
"\\", stream);
1549 do_fprintf (stream,
"%c", c);
1578 for (i = 0; i < n; i++)
1588 for (i = 0; i < n; i++)
1600 _(
"Number of lines gdb thinks are in a page is %s.\n"),
1611 _(
"Number of characters gdb thinks "
1612 "are in a line is %s.\n"),
1661 #if defined(__GO32__)
1662 rows = ScreenRows ();
1663 cols = ScreenCols ();
1664 lines_per_page = rows;
1665 chars_per_line = cols;
1668 rl_reset_terminal (NULL);
1671 rl_get_screen_size (&rows, &cols);
1672 lines_per_page = rows;
1673 chars_per_line = cols;
1678 if (((rows <= 0) && (
tgetnum (
"li") < 0))
1680 || getenv (
"EMACS"))
1695 rl_catch_sigwinch = 0;
1705 return wrap_buffer != NULL;
1761 rl_set_screen_size (rows, cols);
1770 if (chars_per_line == 0)
1775 wrap_buffer = (
char *)
xmalloc (chars_per_line + 2);
1776 wrap_buffer[0] =
'\0';
1779 wrap_buffer = (
char *)
xrealloc (wrap_buffer, chars_per_line + 2);
1801 lines_per_page = height;
1802 chars_per_line = width;
1815 char cont_prompt[120];
1818 struct timeval prompt_started, prompt_ended, prompt_delta;
1820 gettimeofday (&prompt_started, NULL);
1825 strcpy (cont_prompt,
1826 "---Type <return> to continue, or q <return> to quit---");
1828 strcat (cont_prompt,
"\n\032\032prompt-for-continue\n");
1854 gettimeofday (&prompt_ended, NULL);
1855 timeval_sub (&prompt_delta, &prompt_ended, &prompt_started);
1856 timeval_add (&prompt_for_continue_wait_time,
1857 &prompt_for_continue_wait_time, &prompt_delta);
1866 while (*p ==
' ' || *p ==
'\t')
1886 static const struct timeval zero_timeval = { 0 };
1888 prompt_for_continue_wait_time = zero_timeval;
1896 return prompt_for_continue_wait_time;
1935 _(
"failed internal consistency check"));
1939 *wrap_pointer =
'\0';
1943 wrap_buffer[0] =
'\0';
1948 else if (chars_printed >= chars_per_line)
1961 wrap_indent = indent;
1987 if (((chars_printed - 1) / width + 2) * width >= chars_per_line)
1990 if (width >= chars_per_line)
1991 width = chars_per_line - 1;
1993 stringlen = strlen (
string);
1995 if (chars_printed > 0)
1996 spaces = width - (chars_printed - 1) % width - 1;
1998 spaces += width - stringlen;
2000 spacebuf = alloca (spaces + 1);
2001 spacebuf[spaces] =
'\0';
2003 spacebuf[spaces] =
' ';
2018 if (chars_printed > 0)
2042 const char *lineptr;
2044 if (linebuffer == 0)
2049 || !pagination_enabled
2063 lineptr = linebuffer;
2067 if (filter && (lines_printed >= lines_per_page - 1))
2070 while (*lineptr && *lineptr !=
'\n')
2073 if (*lineptr ==
'\t')
2076 *wrap_pointer++ =
'\t';
2082 chars_printed = ((chars_printed >> 3) + 1) << 3;
2088 *wrap_pointer++ = *lineptr;
2095 if (chars_printed >= chars_per_line)
2108 if (lines_printed >= lines_per_page - 1)
2115 *wrap_pointer =
'\0';
2123 chars_printed = strlen (wrap_indent)
2126 wrap_buffer[0] =
'\0';
2132 if (*lineptr ==
'\n')
2197 static int new_line = 1;
2198 static int return_p = 0;
2199 static char *prev_prefix =
"";
2200 static char *prev_suffix =
"";
2202 if (*
string ==
'\n')
2207 if ((return_p || (strcmp (prev_prefix, prefix) != 0)) && !new_line)
2221 prev_prefix = prefix;
2222 prev_suffix = suffix;
2225 while ((ch = *
string++) !=
'\0')
2261 return_p = ch ==
'\r';
2289 va_list args,
int filter)
2321 gettimeofday (&tm, NULL);
2323 len = strlen (linebuffer);
2324 need_nl = (len > 0 && linebuffer[len - 1] !=
'\n');
2327 (
long) tm.tv_sec, (
long) tm.tv_usec,
2329 need_nl ?
"\n":
"");
2355 va_start (args, format);
2365 va_start (args, format);
2379 va_start (args, format);
2392 va_start (args, format);
2403 va_start (args, format);
2416 va_start (args, format);
2445 static char *spaces = 0;
2446 static int max_spaces = -1;
2452 spaces = (
char *)
xmalloc (n + 1);
2453 for (t = spaces + n; t != spaces;)
2459 return spaces + max_spaces - n;
2493 if (demangled != NULL)
2513 while ((*string1 !=
'\0') && (*string2 !=
'\0'))
2515 while (isspace (*string1))
2519 while (isspace (*string2))
2526 && (tolower ((
unsigned char) *string1)
2527 != tolower ((
unsigned char) *string2)))
2529 if (*string1 !=
'\0')
2535 return (*string1 !=
'\0' && *string1 !=
'(') || (*string2 !=
'\0');
2578 const char *saved_string1 = string1, *saved_string2 = string2;
2586 char c1 =
'X', c2 =
'X';
2588 while (*string1 !=
'\0' && *string2 !=
'\0')
2590 while (isspace (*string1))
2592 while (isspace (*string2))
2598 c1 = tolower ((
unsigned char) *string1);
2599 c2 = tolower ((
unsigned char) *string2);
2609 if (*string1 !=
'\0')
2622 if (*string2 ==
'\0')
2627 if (*string2 ==
'\0')
2632 if (*string2 ==
'\0' || *string2 ==
'(')
2648 string1 = saved_string1;
2649 string2 = saved_string2;
2656 streq (
const char *lhs,
const char *rhs)
2658 return !strcmp (lhs, rhs);
2673 if (template_string != (
char *) NULL && string_to_compare != (
char *) NULL
2674 && strlen (string_to_compare) <= strlen (template_string))
2676 (
startswith (template_string, string_to_compare));
2695 Set number of characters where GDB should wrap lines of its output."),
_(
"\
2696 Show number of characters where GDB should wrap lines of its output."),
_(
"\
2697 This affects where GDB wraps its output to fit the screen width.\n\
2698 Setting this to \"unlimited\" or zero prevents GDB from wrapping its output."),
2704 Set number of lines in a page for GDB output pagination."),
_(
"\
2705 Show number of lines in a page for GDB output pagination."),
_(
"\
2706 This affects the number of lines after which GDB will pause\n\
2707 its output and ask you whether to continue.\n\
2708 Setting this to \"unlimited\" or zero causes GDB never pause during output."),
2714 &pagination_enabled,
_(
"\
2715 Set state of GDB output pagination."),
_(
"\
2716 Show state of GDB output pagination."),
_(
"\
2717 When pagination is ON, GDB pauses at end of each screenful of\n\
2718 its output and asks you whether to continue.\n\
2719 Turning pagination off is an alternative to \"set height unlimited\"."),
2726 Set printing of 8-bit characters in strings as \\nnn."),
_(
"\
2727 Show printing of 8-bit characters in strings as \\nnn."), NULL,
2729 show_sevenbit_strings,
2733 &debug_timestamp,
_(
"\
2734 Set timestamping of debugging messages."),
_(
"\
2735 Show timestamping of debugging messages."),
_(
"\
2736 When set, debugging messages will be marked with seconds and microseconds."),
2757 addr &= ((
CORE_ADDR) 1 << addr_bit) - 1;
2769 address &= ((
CORE_ADDR) 1 << addr_bit) - 1;
2798 return *addr_ap == *addr_bp;
2807 if (my_string[0] ==
'0' && tolower (my_string[1]) ==
'x')
2812 for (i = 2; my_string[i] !=
'\0'; i++)
2814 if (isdigit (my_string[i]))
2815 addr = (my_string[i] -
'0') + (addr * 16);
2816 else if (isxdigit (my_string[i]))
2817 addr = (tolower (my_string[i]) -
'a' + 0xa) + (addr * 16);
2819 error (
_(
"invalid hex \"%s\""), my_string);
2827 for (i = 0; my_string[i] !=
'\0'; i++)
2829 if (isdigit (my_string[i]))
2830 addr = (my_string[i] -
'0') + (addr * 10);
2832 error (
_(
"invalid decimal \"%s\""), my_string);
2865 #if defined (_WIN32)
2868 DWORD
len = GetFullPathName (filename, MAX_PATH, buf, NULL);
2874 if (len > 0 && len < MAX_PATH)
2875 return xstrdup (buf);
2879 char *rp = canonicalize_file_name (filename);
2887 return xstrdup (filename);
2896 const char *base_name = lbasename (filename);
2903 if (base_name == filename)
2904 return xstrdup (filename);
2906 dir_name = alloca ((
size_t) (base_name - filename + 2));
2910 strncpy (dir_name, filename, base_name - filename);
2911 dir_name[base_name - filename] =
'\000';
2913 #ifdef HAVE_DOS_BASED_FILE_SYSTEM
2916 if (strlen (dir_name) == 2 && isalpha (dir_name[0]) && dir_name[1] ==
':')
2919 dir_name[3] =
'\000';
2927 if (IS_DIR_SEPARATOR (real_path[strlen (real_path) - 1]))
2928 result = concat (real_path, base_name, (
char *) NULL);
2930 result = concat (real_path,
SLASH_STRING, base_name, (
char *) NULL);
2947 gdb_assert (path != NULL && path[0] !=
'\0');
2950 return tilde_expand (path);
2952 if (IS_ABSOLUTE_PATH (path))
2953 return xstrdup (path);
2959 path, (
char *) NULL);
2967 return (v + n - 1) & -n;
2984 size_t total = size * count;
2985 void *ptr = obstack_alloc ((
struct obstack *) data, total);
2987 memset (ptr, 0, total);
3008 const char *base = lbasename (filename);
3011 while (base > filename && IS_DIR_SEPARATOR (base[-1]))
3014 if (base == filename)
3017 dirname =
xmalloc (base - filename + 2);
3018 memcpy (dirname, filename, base - filename);
3022 if (base - filename == 2 && IS_ABSOLUTE_PATH (base)
3023 && !IS_DIR_SEPARATOR (filename[0]))
3024 dirname[base++ - filename] =
'.';
3026 dirname[base - filename] =
'\0';
3038 char **argv = buildargv (s);
3040 if (s != NULL && argv == NULL)
3050 return * (
int *) ap - * (
int *) bp;
3058 const char **s1 = (
const char **) arg1;
3059 const char **s2 = (
const char **) arg2;
3061 return strcmp (*s1, *s2);
3064 #define AMBIGUOUS_MESS1 ".\nMatching formats:"
3065 #define AMBIGUOUS_MESS2 \
3066 ".\nUse \"set gnutarget format-name\" to specify the format."
3076 if (error_tag != bfd_error_file_ambiguously_recognized || matching == NULL)
3077 return bfd_errmsg (error_tag);
3081 for (p = matching; *p; p++)
3082 ret_len += strlen (*p) + 1;
3087 strcpy (retp, bfd_errmsg (error_tag));
3088 retp += strlen (retp);
3091 retp += strlen (retp);
3093 for (p = matching; *p; p++)
3095 sprintf (retp,
" %s", *p);
3096 retp += strlen (retp);
3116 dummy = (
char *) args;
3117 pid = strtoul (args, &dummy, 0);
3119 if ((pid == 0 && dummy == args) || dummy != &args[strlen (args)])
3120 error (
_(
"Illegal process-id: %s."), args);
3169 if (producer != NULL &&
startswith (producer,
"GNU "))
3184 cs = &producer[strlen (
"GNU ")];
3185 while (*cs && !isspace (*cs))
3187 if (*cs && isspace (*cs))
3189 if (sscanf (cs,
"%d.%d", major, minor) == 2)
3228 char *
string = *stringp, *s;
3229 const size_t from_len = strlen (from);
3230 const size_t to_len = strlen (to);
3234 s = strstr (s, from);
3238 if ((s ==
string || IS_DIR_SEPARATOR (s[-1])
3240 && (s[from_len] ==
'\0' || IS_DIR_SEPARATOR (s[from_len])
3245 string_new =
xrealloc (
string, (strlen (
string) + to_len + 1));
3248 s = s -
string + string_new;
3249 string = string_new;
3252 memmove (&s[to_len], &s[from_len], strlen (&s[from_len]) + 1);
3253 memcpy (s, to, to_len);
3271 sigalrm_handler (
int signo)
3290 pid_t waitpid_result;
3298 #if defined (HAVE_SIGACTION) && defined (SA_RESTART)
3299 struct sigaction sa, old_sa;
3301 sa.sa_handler = sigalrm_handler;
3302 sigemptyset (&sa.sa_mask);
3304 sigaction (SIGALRM, &sa, &old_sa);
3308 ofunc = (void (*)()) signal (SIGALRM, sigalrm_handler);
3314 waitpid_result = waitpid (pid, status, 0);
3318 #if defined (HAVE_SIGACTION) && defined (SA_RESTART)
3319 sigaction (SIGALRM, &old_sa, NULL);
3321 signal (SIGALRM,
ofunc);
3326 waitpid_result = waitpid (pid, status,
WNOHANG);
3328 if (waitpid_result == pid)
3350 #ifdef HAVE_DOS_BASED_FILE_SYSTEM
3352 char *pattern_slash, *string_slash;
3356 pattern_slash = alloca (strlen (pattern) + 1);
3357 strcpy (pattern_slash, pattern);
3358 pattern = pattern_slash;
3359 for (; *pattern_slash != 0; pattern_slash++)
3360 if (IS_DIR_SEPARATOR (*pattern_slash))
3361 *pattern_slash =
'/';
3363 string_slash = alloca (strlen (
string) + 1);
3364 strcpy (string_slash,
string);
3365 string = string_slash;
3366 for (; *string_slash != 0; string_slash++)
3367 if (IS_DIR_SEPARATOR (*string_slash))
3368 *string_slash =
'/';
3372 #ifdef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
3373 flags |= FNM_CASEFOLD;
3376 return fnmatch (pattern,
string, flags);
void error_no_arg(const char *why)
struct cleanup * make_cleanup_freeargv(char **arg)
void vwarning(const char *string, va_list args)
pid_t wait_to_die_with_timeout(pid_t pid, int *status, int timeout)
void target_terminal_ours(void)
ssize_t read(int fd, void *buf, size_t count)
char * hex_string(LONGEST num)
struct cleanup * make_cleanup_free_so(struct so_list *so)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **prefixlist, const char *prefixname, int allow_unknown, struct cmd_list_element **list)
const char * target_charset(struct gdbarch *gdbarch)
int target_supports_terminal_ours(void)
char * gdb_realpath(const char *filename)
void fprintf_symbol_filtered(struct ui_file *stream, const char *name, enum language lang, int arg_mode)
struct cleanup * compile_rx_or_error(regex_t *pattern, const char *rx, const char *message)
int putchar_unfiltered(int c)
void free_char_ptr_vec(VEC(char_ptr)*char_ptr_vec)
char * gdb_abspath(const char *path)
const char * should_dump_core
hashval_t core_addr_hash(const void *ap)
void value_free_to_mark(struct value *mark)
CORE_ADDR string_to_core_addr(const char *my_string)
int tui_get_command_dimension(unsigned int *width, unsigned int *height)
static void do_free_so(void *arg)
void fputs_unfiltered(const char *buf, struct ui_file *file)
int producer_is_gcc_ge_4(const char *producer)
void bpstat_clear_actions(void)
int strcmp_iw(const char *string1, const char *string2)
void dummy_obstack_deallocate(void *object, void *data)
struct cleanup * make_cleanup_restore_uinteger(unsigned int *variable)
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_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
char * xstrvprintf(const char *format, va_list ap)
void warning(const char *fmt,...)
int fputc_filtered(int c, struct ui_file *stream)
int ui_file_isatty(struct ui_file *file)
struct type ** const(pascal_builtin_types[])
int query(const char *ctlstr,...)
struct cleanup * make_cleanup_value_free(struct value *value)
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)
char * ui_file_xstrdup(struct ui_file *file, long *length)
enum language set_language(enum language lang)
static void do_restore_current_language(void *p)
void ui_file_delete(struct ui_file *file)
ULONGEST align_down(ULONGEST v, int n)
struct ui_file * gdb_stdout
static void set_screen_size(void)
static const char *const internal_problem_modes[]
struct ui_file ** variable
char * ldirname(const char *filename)
int unpush_target(struct target_ops *t)
void verror(const char *string, va_list args)
struct cleanup * make_cleanup_ui_out_redirect_pop(struct ui_out *uiout)
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)
int ui_out_is_mi_like_p(struct ui_out *uiout)
void quit_force(char *args, int from_tty)
void value_free(struct value *val)
static void do_freeargv(void *arg)
#define DIRNAME_SEPARATOR
int yquery(const char *ctlstr,...)
enum language la_language
static void ATTRIBUTE_NORETURN abort_with_message(const char *msg)
void vprintf_filtered(const char *format, va_list args)
char * make_hex_string(const gdb_byte *data, size_t length)
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)
struct cleanup * make_cleanup_restore_page_info(void)
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)
struct cmd_list_element * prefix
static unsigned int lines_per_page
struct cmd_list_element * maintenance_set_cmdlist
static void do_fclose_cleanup(void *arg)
struct cleanup * make_cleanup_restore_ui_file(struct ui_file **variable)
void printf_filtered(const char *format,...)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
static void do_restore_ui_file(void *p)
void demangler_vwarning(const char *file, int line, const char *fmt, va_list ap)
char * get_regcomp_error(int code, regex_t *rx)
struct cleanup * make_cleanup_unpush_target(struct target_ops *ops)
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)
struct cmd_list_element * setlist
void fputstr_unfiltered(const char *str, int quoter, struct ui_file *stream)
struct cleanup * make_cleanup_free_char_ptr_vec(VEC(char_ptr)*char_ptr_vec)
static char * wrap_pointer
static void ATTRIBUTE_PRINTF(4, 0)
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 do_value_free(void *value)
struct cleanup * make_cleanup_restore_integer(int *variable)
struct cleanup * make_cleanup_dtor(make_cleanup_ftype *function, void *arg, make_cleanup_dtor_ftype *dtor)
char * gdb_realpath_keepfile(const char *filename)
static void add_internal_problem_command(struct internal_problem *problem)
void reset_prompt_for_continue_wait_time(void)
int fputc_unfiltered(int c, struct ui_file *stream)
void gdb_bfd_unref(struct bfd *abfd)
static void do_clear_parser_state(void *ptr)
int core_addr_eq(const void *ap, const void *bp)
void initialize_file_ftype(void)
struct cleanup * set_batch_flag_and_make_cleanup_restore_page_info(void)
const char internal_problem_yes[]
void fprintf_filtered(struct ui_file *stream, const char *format,...)
void target_check_pending_interrupt(void)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t err
int(*) void(* deprecated_warning_hook)(const char *, va_list) ATTRIBUTE_FPTR_PRINTF(1
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_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static void show_chars_per_line(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void puts_filtered_tabular(char *string, int width, int right)
char * gdb_readline_wrapper(const char *)
void vfprintf_filtered(struct ui_file *stream, const char *format, va_list args)
struct cleanup * make_cleanup_dyn_string_delete(dyn_string_t arg)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int status
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)
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 free_current_contents(void *ptr)
static void do_value_free_to_mark(void *value)
static void show_internal_problem_cmd(char *args, int from_tty)
void free_so(struct so_list *so)
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)
static void do_bfd_close_cleanup(void *arg)
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 error_stream(struct ui_file *stream)
void reinitialize_more_filter(void)
struct cleanup * make_cleanup_clear_parser_state(struct parser_state **p)
static int host_char_to_target(struct gdbarch *gdbarch, int c, int *target_c)
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 void set_width_command(char *args, int from_tty, struct cmd_list_element *c)
static char * wrap_buffer
static void timestamp(struct mi_timestamp *tv)
struct cmd_list_element * setprintlist
char * xstrprintf(const char *format,...)
void wrap_here(char *indent)
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
struct cleanup * make_cleanup_bfd_unref(bfd *abfd)
int compare_positive_ints(const void *ap, const void *bp)
struct ui_file * gdb_stdlog
static void do_regfree_cleanup(void *r)
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)
struct cleanup * make_regfree_cleanup(regex_t *r)
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)
int input_from_terminal_p(void)
void fprintfi_filtered(int spaces, struct ui_file *stream, const char *format,...)
struct cleanup * make_cleanup_fclose(FILE *file)
static void set_width(void)
void print_spaces_filtered(int n, struct ui_file *stream)
initialize_file_ftype _initialize_utils
void initialize_utils(void)
char * hex_string_custom(LONGEST num, int width)
ULONGEST align_up(ULONGEST v, int n)
int strcmp_iw_ordered(const char *string1, const char *string2)
const struct language_defn * current_language
void puts_unfiltered(const char *string)
void gdb_print_host_address(const void *addr, struct ui_file *stream)
char * language_demangle(const struct language_defn *current_language, const char *mangled, int options)
struct cleanup * make_bpstat_clear_actions_cleanup(void)
static void do_obstack_free(void *arg)
struct cleanup * make_cleanup_ui_file_delete(struct ui_file *arg)
const char internal_problem_ask[]
void throw_verror(enum errors error, const char *fmt, va_list ap)
int xsnprintf(char *str, size_t size, const char *format,...)
int check_quit_flag(void)
struct ui_file * gdb_stderr
char * safe_strerror(int)
const char * host_address_to_string(const void *addr)
void ui_file_write(struct ui_file *file, const char *buf, long length_buf)
static char * perror_string(const char *prefix)
void internal_verror(const char *file, int line, const char *fmt, va_list ap)
char ** gdb_buildargv(const char *s)
static void do_dyn_string_delete(void *arg)
int parse_pid_to_attach(const char *args)
struct cleanup * make_cleanup_htab_delete(htab_t htab)
int gdb_filename_fnmatch(const char *pattern, const char *string, int flags)
int user_settable_should_dump_core
void perror_with_name(const char *string)
struct cmd_list_element * showprintlist
static void do_restore_page_info_cleanup(void *arg)
void malloc_failure(long size)
static void set_height_command(char *args, int from_tty, struct cmd_list_element *c)
const char * print_core_address(struct gdbarch *gdbarch, CORE_ADDR address)
int producer_is_gcc(const char *producer, int *major, int *minor)
int ui_out_redirect(struct ui_out *uiout, struct ui_file *outstream)
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,...)
struct interp * top_level_interpreter(void)
int can_dump_core(enum resource_limit_kind limit_kind)
static unsigned int chars_printed
static void restore_integer(void *p)
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 subset_compare(char *string_to_compare, char *template_string)
int compare_strings(const void *arg1, const void *arg2)
struct timeval get_prompt_for_continue_wait_time(void)
void gdb_flush(struct ui_file *file)
struct cleanup * make_cleanup_free_section_addr_info(struct section_addr_info *addrs)
struct cleanup * make_cleanup_obstack_free(struct obstack *obstack)
static char * wrap_indent
static void do_ui_out_redirect_pop(void *arg)
static void set_internal_problem_cmd(char *args, int from_tty)
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)
struct cleanup * make_cleanup_restore_current_language(void)
void error(const char *fmt,...)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t int int rusage_t pid_t pid
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)
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_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
static void do_htab_delete_cleanup(void *htab_voidp)
const char internal_problem_no[]
const ULONGEST const LONGEST len
static void do_ui_file_delete(void *arg)