22#include "gdbsupport/gdb_wait.h"
27#ifdef HAVE_SYS_RESOURCE_H
28#include <sys/resource.h>
52#include "gdbsupport/gdb_obstack.h"
63#include "readline/readline.h"
68#include "gdbsupport/gdb_regex.h"
69#include "gdbsupport/job-control.h"
70#include "gdbsupport/selftest.h"
71#include "gdbsupport/gdb_optional.h"
74#include "gdbsupport/pathstuff.h"
76#include "gdbsupport/scope-exit.h"
79#include "gdbsupport/gdb-safe-ctype.h"
81#include "gdbsupport/buildargv.h"
113 gdb_printf (file, _(
"Printing of 8-bit characters "
114 "in strings as \\nnn is %s.\n"),
143 (*deprecated_warning_hook) (string, args);
146 gdb::optional<target_terminal::scoped_restore_terminal_state> term_state;
149 term_state.emplace ();
166 throw_verror (GENERIC_ERROR,
string, args);
171static void ATTRIBUTE_NORETURN
188 struct rlimit rlim = { (rlim_t) RLIM_INFINITY, (rlim_t) RLIM_INFINITY };
190 setrlimit (RLIMIT_CORE, &rlim);
196 signal (SIGABRT, SIG_DFL);
213 if (getrlimit (RLIMIT_CORE, &rlim) != 0)
219 if (rlim.rlim_cur == 0)
224 if (rlim.rlim_max == 0)
238 _(
"%s\nUnable to dump core, use `ulimit -c"
239 " unlimited' before executing GDB next time.\n"),
252 if (!core_dump_allowed)
255 return core_dump_allowed;
321 const
char *file,
int line, const
char *fmt, va_list ap)
330 static const char msg[] =
"Recursive internal problem.\n";
347 if (write (STDERR_FILENO, msg,
sizeof (msg)) !=
sizeof (msg))
363 std::string msg = string_vprintf (fmt, ap);
364 reason = string_printf (
"%s:%d: %s: %s\n"
365 "A problem internal to GDB has been detected,\n"
366 "further debugging may prove unreliable.",
367 file, line, problem->name, msg.c_str ());
373 fputs (reason.c_str (), stderr);
378 gdb::optional<target_terminal::scoped_restore_terminal_state> term_state;
381 term_state.emplace ();
392 || problem->should_print_backtrace)
395 if (problem->should_print_backtrace)
407 quit_p =
query (_(
"%s\nQuit this debugging session? "),
415 internal_error (_(
"bad switch"));
436 dump_core_p =
query (_(
"%s\nCreate a core file of GDB? "),
445 internal_error (_(
"bad switch"));
458#ifdef HAVE_WORKING_FORK
477 throw_quit (_(
"Command aborted."));
507 va_start (ap,
string);
535 *set_cmd_list = NULL;
536 *show_cmd_list = NULL;
542 = xstrprintf (_(
"Configure what GDB does when %s is detected."),
543 problem->
name).release ();
545 = xstrprintf (_(
"Show what GDB does when %s is detected."),
546 problem->
name).release ();
549 set_doc, show_doc, set_cmd_list, show_cmd_list,
554 std::string set_quit_doc
555 = string_printf (_(
"Set whether GDB should quit when an %s is "
556 "detected."), problem->
name);
557 std::string show_quit_doc
558 = string_printf (_(
"Show whether GDB will quit when an %s is "
559 "detected."), problem->
name);
563 set_quit_doc.c_str (),
564 show_quit_doc.c_str (),
574 std::string set_core_doc
575 = string_printf (_(
"Set whether GDB should create a core file of "
576 "GDB when %s is detected."), problem->
name);
577 std::string show_core_doc
578 = string_printf (_(
"Show whether GDB will create a core file of "
579 "GDB when %s is detected."), problem->
name);
583 set_core_doc.c_str (),
584 show_core_doc.c_str (),
594 std::string set_bt_doc
595 = string_printf (_(
"Set whether GDB should print a backtrace of "
596 "GDB when %s is detected."), problem->
name);
597 std::string show_bt_doc
598 = string_printf (_(
"Show whether GDB will print a backtrace of "
599 "GDB when %s is detected."), problem->
name);
603 show_bt_doc.c_str (),
618 std::string combined = perror_string (
string);
619 warning (_(
"%s"), combined.c_str ());
628 safe_strerror (saved_errno));
639 throw_forced_quit (
"SIGTERM");
653 throw_quit (
"Quit (expect signal SIGINT when the program is resumed)");
680 internal_error (_(
"virtual memory exhausted: can't allocate %ld bytes."),
685 internal_error (_(
"virtual memory exhausted."));
709 val =
read (desc, addr, len);
772defaulted_query (const
char *ctlstr, const
char defchar, va_list args)
776 char def_answer, not_def_answer;
777 const char *y_string, *n_string;
784 not_def_answer =
'N';
788 else if (defchar ==
'y')
792 not_def_answer =
'N';
800 not_def_answer =
'Y';
825 "input not from terminal]\n"),
826 y_string, n_string, def_answer);
838 std::string question = string_vprintf (ctlstr, args);
840 = string_printf (_(
"%s%s(%s or %s) %s"),
842 question.c_str (), y_string, n_string,
847 using namespace std::chrono;
848 steady_clock::time_point prompt_started = steady_clock::now ();
854 char *response, answer;
859 if (response == NULL)
861 gdb_printf (
"EOF [assumed %c]\n", def_answer);
866 answer = response[0];
873 if (answer == not_def_answer)
881 if (answer == def_answer
882 || (defchar !=
'\0' && answer ==
'\0'))
913 va_start (args, ctlstr);
914 ret = defaulted_query (ctlstr,
'n', args);
931 va_start (args, ctlstr);
932 ret = defaulted_query (ctlstr,
'y', args);
948 va_start (args, ctlstr);
949 ret = defaulted_query (ctlstr,
'\0', args);
965 auto_obstack host_data;
968 (gdb_byte *) &the_char, 1, 1,
971 if (obstack_object_size (&host_data) == 1)
974 *target_c = *(
char *) obstack_base (&host_data);
998 int target_char = -2;
999 int c = *(*string_ptr)++;
1018 int i = fromhex (c);
1023 if (ISDIGIT (c) && c !=
'8' && c !=
'9')
1064 error (_(
"The escape sequence `\\%c' is equivalent to plain `%c',"
1065 " which has no equivalent\nin the `%s' character set."),
1078 _(
"Number of lines gdb thinks are in a page is %s.\n"),
1089 _(
"Number of characters gdb thinks "
1090 "are in a line is %s.\n"),
1138#if defined(__GO32__)
1139 rows = ScreenRows ();
1140 cols = ScreenCols ();
1145 rl_reset_terminal (NULL);
1148 rl_get_screen_size (&rows, &cols);
1168 if (((rows <= 0) && (
tgetnum ((
char *)
"li") < 0))
1171 || getenv (
"EMACS") || getenv (
"INSIDE_EMACS"))
1186 rl_catch_sigwinch = 0;
1259 rl_set_screen_size (rows, cols);
1304 rl_get_screen_size (&rows, &cols);
1307 _(
"Number of characters gdb thinks "
1308 "are in a line is %u%s.\n"),
1313 _(
"Number of characters readline reports "
1314 "are in a line is %d%s.\n"),
1319 ?
" (unlimited - 1)"
1322#ifdef HAVE_LIBCURSES
1324 _(
"Number of characters curses thinks "
1325 "are in a line is %d.\n"),
1330 _(
"Number of characters environment thinks "
1331 "are in a line is %s (COLUMNS).\n"),
1332 getenv (
"COLUMNS"));
1335 _(
"Number of lines gdb thinks are in a page is %u%s.\n"),
1340 _(
"Number of lines readline reports "
1341 "are in a page is %d%s.\n"),
1345#ifdef HAVE_LIBCURSES
1347 _(
"Number of lines curses thinks "
1348 "are in a page is %d.\n"),
1353 _(
"Number of lines environment thinks "
1354 "are in a page is %s (LINES).\n"),
1391 char cont_prompt[120];
1394 using namespace std::chrono;
1395 steady_clock::time_point prompt_started = steady_clock::now ();
1398 scoped_restore save_paging = make_scoped_restore (&
m_paging,
true);
1404 m_stream->
puts ((
"\n\032\032pre-prompt-for-continue\n"));
1406 strcpy (cont_prompt,
1407 "--Type <RET> for more, q to quit, "
1408 "c to continue without paging--");
1410 strcat (cont_prompt,
"\n\032\032prompt-for-continue\n");
1427 m_stream->
puts ((
"\n\032\032post-prompt-for-continue\n"));
1431 char *p = ignore.get ();
1433 while (*p ==
' ' || *p ==
'\t')
1437 throw_quit (
"Quit");
1439 disable_pagination =
true;
1455 using namespace std::chrono;
1462std::chrono::steady_clock::duration
1566 stringlen = strlen (
string);
1571 spaces += width - stringlen;
1573 spacebuf = (
char *) alloca (spaces + 1);
1574 spacebuf[spaces] =
'\0';
1576 spacebuf[spaces] =
' ';
1600 const char *lineptr;
1602 if (linebuffer == 0)
1617 = make_scope_exit ([&] ()
1634 lineptr = linebuffer;
1645 while (*lineptr && *lineptr !=
'\n')
1650 if (*lineptr ==
'\t')
1659 else if (*lineptr ==
'\033'
1665 lineptr += skip_bytes;
1667 else if (*lineptr ==
'\r')
1691 bool did_paginate =
false;
1722 did_paginate =
true;
1746 else if (did_paginate)
1751 if (*lineptr ==
'\n')
1761 buffer_clearer.release ();
1769 std::string str (buf, length_buf);
1770 this->
puts (str.c_str ());
1785 scoped_restore save_enabled
1787 scoped_restore save_disabled
1789 scoped_restore save_batch
1791 scoped_restore save_lines
1794 scoped_restore save_chars
1796 scoped_restore save_printed
1799 pager.puts (
"aaaaaaaaaaaa");
1800 pager.wrap_here (2);
1801 pager.puts (
"bbbbbbbbbbbb\n");
1803 SELF_CHECK (strfile->
string () ==
"aaaaaaaaaaaa\n bbbbbbbbbbbb\n");
1811 stream->
puts (linebuffer);
1833 while (*str && highlight.exec (str, 1, &pmatch, 0) == 0)
1835 size_t n_highlight = pmatch.rm_eo - pmatch.rm_so;
1838 while (pmatch.rm_so > 0)
1847 while (n_highlight > 0)
1870 return stream->
putc (c);
1876 stream->
vprintf (format, args);
1890 va_start (args, format);
1899 const char *format, ...)
1904 va_start (args, format);
1915 va_start (args, format);
1926 va_start (args, format);
1928 file.vprintf (format, args);
1929 gdb_stdout->puts_unfiltered (file.string ().c_str ());
1950 static char *spaces = 0;
1951 static int max_spaces = -1;
1956 spaces = (
char *)
xmalloc (n + 1);
1957 for (t = spaces + n; t != spaces;)
1963 return spaces + max_spaces - n;
1993 gdb::unique_xmalloc_ptr<char> demangled
1995 gdb_puts (demangled ? demangled.get () :
name, stream);
2006 return (ISALNUM (ch) || ch ==
'_');
2015 const char *p =
token;
2016 while (p != end && !ISSPACE (*p) && *p !=
'(')
2029 static const char *ops[] =
2035 "-=",
"--",
"->",
"-",
2044 "<<=",
"<=",
"<<",
"<",
2045 ">>=",
">=",
">>",
">",
2049 for (
const char *op : ops)
2051 size_t oplen = strlen (op);
2052 size_t lencmp = std::min<size_t> (oplen, end - p);
2054 if (strncmp (p, op, lencmp) == 0)
2068skip_ws (
const char *&string1,
const char *&string2,
const char *end_str2)
2070 while (ISSPACE (*string1))
2072 while (string2 < end_str2 && ISSPACE (*string2))
2083 return ((
string == start
2097 const char *p = *
name;
2099 if (startswith (p,
"[abi:"))
2122 const char *p = *
name;
2128 if (template_param_list_end == NULL)
2131 p = template_param_list_end + 1;
2136 while (ISSPACE (*q))
2154 bool ignore_template_params)
2156 const char *string1_start = string1;
2157 const char *end_str2 = string2 + string2_len;
2158 bool skip_spaces =
true;
2163 gdb_assert (match_for_lcd ==
nullptr || match_for_lcd->
empty ());
2171 skip_ws (string1, string2, end_str2);
2172 skip_spaces =
false;
2190 if (string2 == end_str2
2193 const char *abi_start = string1;
2199 if (match_for_lcd != NULL && abi_start != string1)
2202 while (ISSPACE (*string1))
2233 && *string1 ==
'<' && *string2 !=
'<')
2236 const char *template_start = string1;
2242 if (*string2 !=
'\0'
2243 && match_for_lcd != NULL && template_start != string1)
2248 if (*string1 ==
'\0' || string2 == end_str2)
2252 if (have_colon_op && string1[0] ==
':' && string1[1] ==
':')
2254 if (*string2 !=
':')
2260 if (string2 == end_str2)
2263 if (*string2 !=
':')
2269 while (ISSPACE (*string1))
2271 while (string2 < end_str2 && ISSPACE (*string2))
2285 if (strncmp (string1, string2, cmplen) != 0)
2291 if (string2 != end_str2)
2297 skip_ws (string1, string2, end_str2);
2301 if (*string1 ==
'(')
2303 if (string2 == end_str2)
2314 return *string1 !=
'\0';
2318 if (*string1 != *string2)
2327 skip_ws (string1, string2, end_str2);
2331 const char *end_str1 = string1 + strlen (string1);
2335 cmplen = std::min (p1 - string1, p2 - string2);
2338 if (strncmp (string1, string2, cmplen) != 0)
2343 if (p1 - string1 != p2 - string2)
2345 if (strncmp (string1, string2, cmplen) != 0)
2352 if (*string1 ==
'\0' || string2 == end_str2)
2354 if (*string1 ==
'(' || *string2 ==
'(')
2359 skip_ws (string1, string2, end_str2);
2360 if (*string1 ==
'<' || *string2 ==
'<')
2371 && (TOLOWER ((
unsigned char) *string1)
2372 != TOLOWER ((
unsigned char) *string2)))
2385 if (string2 == end_str2)
2405 if (match_for_lcd != NULL)
2407 while ((string1 = strstr (string1,
"[abi:")) != NULL)
2409 const char *abi_start = string1;
2415 if (abi_start != string1)
2424 if (*string1 ==
'(')
2430 if (*string1 ==
'(')
2432 else if (*string1 ==
')')
2436 while (*string1 !=
'\0' && p_count > 0);
2442 return *string1 ==
'@';
2445 return *string1 ==
'\0' ? 0 : 1;
2457#define CHECK_MATCH_LM(S1, S2, MODE, LANG, LCD) \
2458 SELF_CHECK (strncmp_iw_with_mode ((S1), (S2), strlen ((S2)), \
2459 strncmp_iw_mode::MODE, \
2460 (LANG), (LCD)) == 0)
2462#define CHECK_MATCH_LANG(S1, S2, MODE, LANG) \
2463 CHECK_MATCH_LM ((S1), (S2), MODE, (LANG), nullptr)
2465#define CHECK_MATCH(S1, S2, MODE) \
2466 CHECK_MATCH_LANG ((S1), (S2), MODE, language_minimal)
2468#define CHECK_NO_MATCH_LM(S1, S2, MODE, LANG, LCD) \
2469 SELF_CHECK (strncmp_iw_with_mode ((S1), (S2), strlen ((S2)), \
2470 strncmp_iw_mode::MODE, \
2473#define CHECK_NO_MATCH_LANG(S1, S2, MODE, LANG) \
2474 CHECK_NO_MATCH_LM ((S1), (S2), MODE, (LANG), nullptr)
2476#define CHECK_NO_MATCH(S1, S2, MODE) \
2477 CHECK_NO_MATCH_LANG ((S1), (S2), MODE, language_minimal)
2480check_scope_operator (
enum language lang)
2482 CHECK_MATCH_LANG (
"::",
"::",
NORMAL, lang);
2483 CHECK_MATCH_LANG (
"::foo",
"::",
NORMAL, lang);
2484 CHECK_MATCH_LANG (
"::foo",
"::foo",
NORMAL, lang);
2485 CHECK_MATCH_LANG (
" :: foo ",
"::foo",
NORMAL, lang);
2486 CHECK_MATCH_LANG (
"a::b",
"a ::b",
NORMAL, lang);
2487 CHECK_MATCH_LANG (
"a::b",
"a\t::b",
NORMAL, lang);
2488 CHECK_MATCH_LANG (
"a::b",
"a \t::b",
NORMAL, lang);
2489 CHECK_MATCH_LANG (
"a::b",
"a\t ::b",
NORMAL, lang);
2490 CHECK_MATCH_LANG (
"a::b",
"a:: b",
NORMAL, lang);
2491 CHECK_MATCH_LANG (
"a::b",
"a::\tb",
NORMAL, lang);
2492 CHECK_MATCH_LANG (
"a::b",
"a:: \tb",
NORMAL, lang);
2493 CHECK_MATCH_LANG (
"a::b",
"a::\t b",
NORMAL, lang);
2494 CHECK_MATCH_LANG (
"a::b",
"a :: b",
NORMAL, lang);
2495 CHECK_MATCH_LANG (
"a::b",
"a ::\tb",
NORMAL, lang);
2496 CHECK_MATCH_LANG (
"a::b",
"a\t:: b",
NORMAL, lang);
2497 CHECK_MATCH_LANG (
"a::b",
"a \t::\t b",
NORMAL, lang);
2498 CHECK_MATCH_LANG (
"a ::b",
"a::b",
NORMAL, lang);
2499 CHECK_MATCH_LANG (
"a\t::b",
"a::b",
NORMAL, lang);
2500 CHECK_MATCH_LANG (
"a \t::b",
"a::b",
NORMAL, lang);
2501 CHECK_MATCH_LANG (
"a\t ::b",
"a::b",
NORMAL, lang);
2502 CHECK_MATCH_LANG (
"a:: b",
"a::b",
NORMAL, lang);
2503 CHECK_MATCH_LANG (
"a::\tb",
"a::b",
NORMAL, lang);
2504 CHECK_MATCH_LANG (
"a:: \tb",
"a::b",
NORMAL, lang);
2505 CHECK_MATCH_LANG (
"a::\t b",
"a::b",
NORMAL, lang);
2506 CHECK_MATCH_LANG (
"a :: b",
"a::b",
NORMAL, lang);
2507 CHECK_MATCH_LANG (
"a ::\tb",
"a::b",
NORMAL, lang);
2508 CHECK_MATCH_LANG (
"a\t:: b",
"a::b",
NORMAL, lang);
2509 CHECK_MATCH_LANG (
"a \t::\t b",
"a::b",
NORMAL, lang);
2510 CHECK_MATCH_LANG (
"a::b::c",
"a::b::c",
NORMAL, lang);
2511 CHECK_MATCH_LANG (
" a:: b:: c",
"a::b::c",
NORMAL, lang);
2512 CHECK_MATCH_LANG (
"a::b::c",
" a:: b:: c",
NORMAL, lang);
2513 CHECK_MATCH_LANG (
"a ::b ::c",
"a::b::c",
NORMAL, lang);
2514 CHECK_MATCH_LANG (
"a::b::c",
"a :: b:: c",
NORMAL, lang);
2515 CHECK_MATCH_LANG (
"\ta::\tb::\tc",
"\ta::\tb::\tc",
NORMAL, lang);
2516 CHECK_MATCH_LANG (
"a\t::b\t::c\t",
"a\t::b\t::c\t",
NORMAL, lang);
2517 CHECK_MATCH_LANG (
" \ta:: \tb:: \tc",
" \ta:: \tb:: \tc",
NORMAL, lang);
2518 CHECK_MATCH_LANG (
"\t a::\t b::\t c",
"\t a::\t b::\t c",
NORMAL, lang);
2519 CHECK_MATCH_LANG (
"a::b::c",
"\ta::\tb::\tc",
NORMAL, lang);
2520 CHECK_MATCH_LANG (
"a::b::c",
"a\t::b\t::c\t",
NORMAL, lang);
2521 CHECK_MATCH_LANG (
"a::b::c",
" \ta:: \tb:: \tc",
NORMAL, lang);
2522 CHECK_MATCH_LANG (
"a::b::c",
"\t a::\t b::\t c",
NORMAL, lang);
2523 CHECK_MATCH_LANG (
"\ta::\tb::\tc",
"a::b::c",
NORMAL, lang);
2524 CHECK_MATCH_LANG (
"a\t::b\t::c\t",
"a::b::c",
NORMAL, lang);
2525 CHECK_MATCH_LANG (
" \ta:: \tb:: \tc",
"a::b::c",
NORMAL, lang);
2526 CHECK_MATCH_LANG (
"\t a::\t b::\t c",
"a::b::c",
NORMAL, lang);
2527 CHECK_MATCH_LANG (
"a :: b:: c\t",
"\ta :: b\t:: c\t\t",
NORMAL, lang);
2528 CHECK_MATCH_LANG (
" a::\t \t b:: c\t",
"\ta ::b:: c\t\t",
2530 CHECK_MATCH_LANG (
"a :: b :: \t\t\tc\t",
2531 "\t\t\t\ta :: \t\t\t b \t\t::c",
2533 CHECK_MATCH_LANG (
"a::b()",
"a",
NORMAL, lang);
2534 CHECK_MATCH_LANG (
"a::b()",
"a::",
NORMAL, lang);
2535 CHECK_MATCH_LANG (
"a::b()",
"a::b",
NORMAL, lang);
2536 CHECK_MATCH_LANG (
"a::b(a)",
"a",
NORMAL, lang);
2537 CHECK_MATCH_LANG (
"a::b(a)",
"a::",
NORMAL, lang);
2538 CHECK_MATCH_LANG (
"a::b(a)",
"a::b",
NORMAL, lang);
2539 CHECK_MATCH_LANG (
"a::b(a,b)",
"a",
NORMAL, lang);
2540 CHECK_MATCH_LANG (
"a::b(a,b)",
"a::",
NORMAL, lang);
2541 CHECK_MATCH_LANG (
"a::b(a,b)",
"a::b",
NORMAL, lang);
2542 CHECK_MATCH_LANG (
"a::b(a,b,c)",
"a",
NORMAL, lang);
2543 CHECK_MATCH_LANG (
"a::b(a,b,c)",
"a::",
NORMAL, lang);
2544 CHECK_MATCH_LANG (
"a::b(a,b,c)",
"a::b",
NORMAL, lang);
2546 CHECK_NO_MATCH_LANG (
"a::",
"::a",
NORMAL, lang);
2547 CHECK_NO_MATCH_LANG (
"::a",
"::a()",
NORMAL, lang);
2548 CHECK_NO_MATCH_LANG (
"::",
"::a",
NORMAL, lang);
2549 CHECK_NO_MATCH_LANG (
"a:::b",
"a::b",
NORMAL, lang);
2550 CHECK_NO_MATCH_LANG (
"a::b()",
"a::b(a)",
NORMAL, lang);
2551 CHECK_NO_MATCH_LANG (
"a::b(a)",
"a::b()",
NORMAL, lang);
2552 CHECK_NO_MATCH_LANG (
"a::b(a,b)",
"a::b(a,a)",
NORMAL, lang);
2553 CHECK_NO_MATCH_LANG (
"a::b",
"a()",
NORMAL, lang);
2554 CHECK_NO_MATCH_LANG (
"a::b",
"a::()",
NORMAL, lang);
2555 CHECK_NO_MATCH_LANG (
"a::b",
"a::b()",
NORMAL, lang);
2556 CHECK_NO_MATCH_LANG (
"a::b",
"a(a)",
NORMAL, lang);
2557 CHECK_NO_MATCH_LANG (
"a::b",
"a::(a)",
NORMAL, lang);
2558 CHECK_NO_MATCH_LANG (
"a::b",
"a::b()",
NORMAL, lang);
2559 CHECK_NO_MATCH_LANG (
"a::b",
"a(a,b)",
NORMAL, lang);
2560 CHECK_NO_MATCH_LANG (
"a::b",
"a::(a,b)",
NORMAL, lang);
2561 CHECK_NO_MATCH_LANG (
"a::b",
"a::b(a,b)",
NORMAL, lang);
2562 CHECK_NO_MATCH_LANG (
"a::b",
"a(a,b,c)",
NORMAL, lang);
2563 CHECK_NO_MATCH_LANG (
"a::b",
"a::(a,b,c)",
NORMAL, lang);
2564 CHECK_NO_MATCH_LANG (
"a::b",
"a::b(a,b,c)",
NORMAL, lang);
2570strncmp_iw_with_mode_tests ()
2577 CHECK_MATCH (
"",
"",
NORMAL);
2578 CHECK_MATCH (
"foo",
"foo",
NORMAL);
2579 CHECK_MATCH (
" foo",
"foo",
NORMAL);
2580 CHECK_MATCH (
"foo ",
"foo",
NORMAL);
2581 CHECK_MATCH (
" foo ",
"foo",
NORMAL);
2582 CHECK_MATCH (
" foo",
"foo",
NORMAL);
2583 CHECK_MATCH (
"foo ",
"foo",
NORMAL);
2584 CHECK_MATCH (
" foo ",
"foo",
NORMAL);
2585 CHECK_MATCH (
"\tfoo",
"foo",
NORMAL);
2586 CHECK_MATCH (
"foo\t",
"foo",
NORMAL);
2587 CHECK_MATCH (
"\tfoo\t",
"foo",
NORMAL);
2588 CHECK_MATCH (
" \tfoo \t",
"foo",
NORMAL);
2589 CHECK_MATCH (
"\t foo\t ",
"foo",
NORMAL);
2590 CHECK_MATCH (
"\t \t \t\t\t\t foo\t\t\t \t\t \t \t \t \t ",
2593 "\t \t \t\t\t\t foo\t\t\t \t\t \t \t \t \t ",
2595 CHECK_MATCH (
"foo bar",
"foo",
NORMAL);
2596 CHECK_NO_MATCH (
"foo",
"bar",
NORMAL);
2597 CHECK_NO_MATCH (
"foo bar",
"foobar",
NORMAL);
2598 CHECK_NO_MATCH (
" foo ",
"bar",
NORMAL);
2599 CHECK_NO_MATCH (
"foo",
" bar ",
NORMAL);
2600 CHECK_NO_MATCH (
" \t\t foo\t\t ",
"\t \t \tbar\t",
NORMAL);
2601 CHECK_NO_MATCH (
"@!%&",
"@!%&foo",
NORMAL);
2604 CHECK_MATCH (
"foo()",
"foo()",
NORMAL);
2605 CHECK_MATCH (
"foo ()",
"foo()",
NORMAL);
2606 CHECK_MATCH (
"foo ()",
"foo()",
NORMAL);
2607 CHECK_MATCH (
"foo\t()",
"foo()",
NORMAL);
2608 CHECK_MATCH (
"foo\t ()",
"foo()",
NORMAL);
2609 CHECK_MATCH (
"foo \t()",
"foo()",
NORMAL);
2610 CHECK_MATCH (
"foo()",
"foo ()",
NORMAL);
2611 CHECK_MATCH (
"foo()",
"foo ()",
NORMAL);
2612 CHECK_MATCH (
"foo()",
"foo\t()",
NORMAL);
2613 CHECK_MATCH (
"foo()",
"foo\t ()",
NORMAL);
2614 CHECK_MATCH (
"foo()",
"foo \t()",
NORMAL);
2615 CHECK_MATCH (
"foo()",
"foo()",
NORMAL);
2616 CHECK_MATCH (
"foo ()",
"foo ()",
NORMAL);
2617 CHECK_MATCH (
"foo ()",
"foo ()",
NORMAL);
2618 CHECK_MATCH (
"foo\t()",
"foo\t()",
NORMAL);
2619 CHECK_MATCH (
"foo\t ()",
"foo\t ()",
NORMAL);
2620 CHECK_MATCH (
"foo \t()",
"foo \t()",
NORMAL);
2621 CHECK_MATCH (
"foo(a)",
"foo(a)",
NORMAL);
2622 CHECK_MATCH (
"foo( a)",
"foo(a)",
NORMAL);
2623 CHECK_MATCH (
"foo(a )",
"foo(a)",
NORMAL);
2624 CHECK_MATCH (
"foo(\ta)",
"foo(a)",
NORMAL);
2625 CHECK_MATCH (
"foo(a\t)",
"foo(a)",
NORMAL);
2626 CHECK_MATCH (
"foo(\t a)",
"foo(a)",
NORMAL);
2627 CHECK_MATCH (
"foo( \ta)",
"foo(a)",
NORMAL);
2628 CHECK_MATCH (
"foo(a\t )",
"foo(a)",
NORMAL);
2629 CHECK_MATCH (
"foo(a \t)",
"foo(a)",
NORMAL);
2630 CHECK_MATCH (
"foo( a )",
"foo(a)",
NORMAL);
2631 CHECK_MATCH (
"foo(\ta\t)",
"foo(a)",
NORMAL);
2632 CHECK_MATCH (
"foo(\t a\t )",
"foo(a)",
NORMAL);
2633 CHECK_MATCH (
"foo( \ta \t)",
"foo(a)",
NORMAL);
2634 CHECK_MATCH (
"foo(a)",
"foo( a)",
NORMAL);
2635 CHECK_MATCH (
"foo(a)",
"foo(a )",
NORMAL);
2636 CHECK_MATCH (
"foo(a)",
"foo(\ta)",
NORMAL);
2637 CHECK_MATCH (
"foo(a)",
"foo(a\t)",
NORMAL);
2638 CHECK_MATCH (
"foo(a)",
"foo(\t a)",
NORMAL);
2639 CHECK_MATCH (
"foo(a)",
"foo( \ta)",
NORMAL);
2640 CHECK_MATCH (
"foo(a)",
"foo(a\t )",
NORMAL);
2641 CHECK_MATCH (
"foo(a)",
"foo(a \t)",
NORMAL);
2642 CHECK_MATCH (
"foo(a)",
"foo( a )",
NORMAL);
2643 CHECK_MATCH (
"foo(a)",
"foo(\ta\t)",
NORMAL);
2644 CHECK_MATCH (
"foo(a)",
"foo(\t a\t )",
NORMAL);
2645 CHECK_MATCH (
"foo(a)",
"foo( \ta \t)",
NORMAL);
2646 CHECK_MATCH (
"foo(a,b)",
"foo(a,b)",
NORMAL);
2647 CHECK_MATCH (
"foo(a ,b)",
"foo(a,b)",
NORMAL);
2648 CHECK_MATCH (
"foo(a\t,b)",
"foo(a,b)",
NORMAL);
2649 CHECK_MATCH (
"foo(a,\tb)",
"foo(a,b)",
NORMAL);
2650 CHECK_MATCH (
"foo(a\t,\tb)",
"foo(a,b)",
NORMAL);
2651 CHECK_MATCH (
"foo(a \t,b)",
"foo(a,b)",
NORMAL);
2652 CHECK_MATCH (
"foo(a\t ,b)",
"foo(a,b)",
NORMAL);
2653 CHECK_MATCH (
"foo(a,\tb)",
"foo(a,b)",
NORMAL);
2654 CHECK_MATCH (
"foo(a, \tb)",
"foo(a,b)",
NORMAL);
2655 CHECK_MATCH (
"foo(a,\t b)",
"foo(a,b)",
NORMAL);
2656 CHECK_MATCH (
"foo(a,b)",
"foo(a ,b)",
NORMAL);
2657 CHECK_MATCH (
"foo(a,b)",
"foo(a\t,b)",
NORMAL);
2658 CHECK_MATCH (
"foo(a,b)",
"foo(a,\tb)",
NORMAL);
2659 CHECK_MATCH (
"foo(a,b)",
"foo(a\t,\tb)",
NORMAL);
2660 CHECK_MATCH (
"foo(a,b)",
"foo(a \t,b)",
NORMAL);
2661 CHECK_MATCH (
"foo(a,b)",
"foo(a\t ,b)",
NORMAL);
2662 CHECK_MATCH (
"foo(a,b)",
"foo(a,\tb)",
NORMAL);
2663 CHECK_MATCH (
"foo(a,b)",
"foo(a, \tb)",
NORMAL);
2664 CHECK_MATCH (
"foo(a,b)",
"foo(a,\t b)",
NORMAL);
2665 CHECK_MATCH (
"foo(a,b,c,d)",
"foo(a,b,c,d)",
NORMAL);
2666 CHECK_MATCH (
" foo ( a , b , c , d ) ",
"foo(a,b,c,d)",
NORMAL);
2667 CHECK_MATCH (
" foo ( a , b , c , d ) ",
"foo( a , b , c , d )",
NORMAL);
2668 CHECK_MATCH (
"foo &\t*(\ta b *\t\t&)",
"foo",
NORMAL);
2669 CHECK_MATCH (
"foo &\t*(\ta b *\t\t&)",
"foo&*(a b * &)",
NORMAL);
2670 CHECK_MATCH (
"foo(a) b",
"foo(a)",
NORMAL);
2671 CHECK_MATCH (
"*foo(*a&)",
"*foo",
NORMAL);
2672 CHECK_MATCH (
"*foo(*a&)",
"*foo(*a&)",
NORMAL);
2673 CHECK_MATCH (
"*a&b#c/^d$foo(*a&)",
"*a&b#c/^d$foo",
NORMAL);
2674 CHECK_MATCH (
"* foo",
"*foo",
NORMAL);
2675 CHECK_MATCH (
"foo&",
"foo",
NORMAL);
2676 CHECK_MATCH (
"foo*",
"foo",
NORMAL);
2677 CHECK_MATCH (
"foo.",
"foo",
NORMAL);
2678 CHECK_MATCH (
"foo->",
"foo",
NORMAL);
2680 CHECK_NO_MATCH (
"foo",
"foo(",
NORMAL);
2681 CHECK_NO_MATCH (
"foo",
"foo()",
NORMAL);
2682 CHECK_NO_MATCH (
"foo",
"foo(a)",
NORMAL);
2683 CHECK_NO_MATCH (
"foo",
"foo(a)",
NORMAL);
2684 CHECK_NO_MATCH (
"foo",
"foo*",
NORMAL);
2685 CHECK_NO_MATCH (
"foo",
"foo (*",
NORMAL);
2686 CHECK_NO_MATCH (
"foo*",
"foo (*",
NORMAL);
2687 CHECK_NO_MATCH (
"foo *",
"foo (*",
NORMAL);
2688 CHECK_NO_MATCH (
"foo&",
"foo (*",
NORMAL);
2689 CHECK_NO_MATCH (
"foo &",
"foo (*",
NORMAL);
2690 CHECK_NO_MATCH (
"foo &*",
"foo (&)",
NORMAL);
2691 CHECK_NO_MATCH (
"foo & \t *\t",
"foo (*",
NORMAL);
2692 CHECK_NO_MATCH (
"foo & \t *\t",
"foo (*",
NORMAL);
2693 CHECK_NO_MATCH (
"foo(a*) b",
"foo(a) b",
NORMAL);
2694 CHECK_NO_MATCH (
"foo[aqi:A](a)",
"foo(b)",
NORMAL);
2695 CHECK_NO_MATCH (
"*foo",
"foo",
NORMAL);
2696 CHECK_NO_MATCH (
"*foo",
"foo*",
NORMAL);
2697 CHECK_NO_MATCH (
"*foo*",
"*foo&",
NORMAL);
2698 CHECK_NO_MATCH (
"*foo*",
"foo *",
NORMAL);
2699 CHECK_NO_MATCH (
"&foo",
"foo",
NORMAL);
2700 CHECK_NO_MATCH (
"&foo",
"foo&",
NORMAL);
2701 CHECK_NO_MATCH (
"foo&",
"&foo",
NORMAL);
2702 CHECK_NO_MATCH (
"foo",
"foo&",
NORMAL);
2703 CHECK_NO_MATCH (
"foo",
"foo*",
NORMAL);
2704 CHECK_NO_MATCH (
"foo",
"foo.",
NORMAL);
2705 CHECK_NO_MATCH (
"foo",
"foo->",
NORMAL);
2706 CHECK_NO_MATCH (
"foo bar",
"foo()",
NORMAL);
2707 CHECK_NO_MATCH (
"foo bar",
"foo bar()",
NORMAL);
2708 CHECK_NO_MATCH (
"foo()",
"foo(a)",
NORMAL);
2709 CHECK_NO_MATCH (
"*(*)&",
"*(*)*",
NORMAL);
2710 CHECK_NO_MATCH (
"foo(a)",
"foo()",
NORMAL);
2711 CHECK_NO_MATCH (
"foo(a)",
"foo(b)",
NORMAL);
2712 CHECK_NO_MATCH (
"foo(a,b)",
"foo(a,b,c)",
NORMAL);
2713 CHECK_NO_MATCH (
"foo(a\\b)",
"foo()",
NORMAL);
2714 CHECK_NO_MATCH (
"foo bar(a b c d)",
"foobar",
NORMAL);
2715 CHECK_NO_MATCH (
"foo bar(a b c d)",
"foobar ( a b c \td\t)\t",
NORMAL);
2724 CHECK_MATCH_LANG (
"operator foo(int&)",
"operator foo(int &)",
NORMAL,
2726 CHECK_MATCH_LANG (
"operator foo(int &)",
"operator foo(int &)",
NORMAL,
2728 CHECK_MATCH_LANG (
"operator foo(int\t&)",
"operator foo(int\t&)",
NORMAL,
2730 CHECK_MATCH_LANG (
"operator foo (int)",
"operator foo(int)",
NORMAL,
2732 CHECK_MATCH_LANG (
"operator foo\t(int)",
"operator foo(int)",
NORMAL,
2734 CHECK_MATCH_LANG (
"operator foo \t(int)",
"operator foo(int)",
NORMAL,
2736 CHECK_MATCH_LANG (
"operator foo (int)",
"operator foo \t(int)",
NORMAL,
2738 CHECK_MATCH_LANG (
"operator foo\t(int)",
"operator foo \t(int)",
NORMAL,
2740 CHECK_MATCH_LANG (
"operator foo \t(int)",
"operator foo \t(int)",
NORMAL,
2743 CHECK_MATCH_LANG (
"a::operator foo(int&)",
"a::operator foo(int &)",
NORMAL,
2745 CHECK_MATCH_LANG (
"a :: operator foo(int &)",
"a::operator foo(int &)",
NORMAL,
2747 CHECK_MATCH_LANG (
"a \t:: \toperator foo(int\t&)",
"a::operator foo(int\t&)",
NORMAL,
2749 CHECK_MATCH_LANG (
"a::operator foo (int)",
"a::operator foo(int)",
NORMAL,
2751 CHECK_MATCH_LANG (
"a::operator foo\t(int)",
"a::operator foo(int)",
NORMAL,
2753 CHECK_MATCH_LANG (
"a::operator foo \t(int)",
"a::operator foo(int)",
NORMAL,
2755 CHECK_MATCH_LANG (
"a::operator foo (int)",
"a::operator foo \t(int)",
NORMAL,
2757 CHECK_MATCH_LANG (
"a::operator foo\t(int)",
"a::operator foo \t(int)",
NORMAL,
2759 CHECK_MATCH_LANG (
"a::operator foo \t(int)",
"a::operator foo \t(int)",
NORMAL,
2762 CHECK_NO_MATCH_LANG (
"operator foo(int)",
"operator foo(char)",
NORMAL,
2764 CHECK_NO_MATCH_LANG (
"operator foo(int)",
"operator foo(int *)",
NORMAL,
2766 CHECK_NO_MATCH_LANG (
"operator foo(int)",
"operator foo(int &)",
NORMAL,
2768 CHECK_NO_MATCH_LANG (
"operator foo(int)",
"operator foo(int, char *)",
NORMAL,
2770 CHECK_NO_MATCH_LANG (
"operator foo(int)",
"operator bar(int)",
NORMAL,
2773 CHECK_NO_MATCH_LANG (
"a::operator b::foo(int)",
"a::operator a::foo(char)",
NORMAL,
2775 CHECK_NO_MATCH_LANG (
"a::operator foo(int)",
"a::operator foo(int *)",
NORMAL,
2777 CHECK_NO_MATCH_LANG (
"a::operator foo(int)",
"a::operator foo(int &)",
NORMAL,
2779 CHECK_NO_MATCH_LANG (
"a::operator foo(int)",
"a::operator foo(int, char *)",
NORMAL,
2781 CHECK_NO_MATCH_LANG (
"a::operator foo(int)",
"a::operator bar(int)",
NORMAL,
2788 CHECK_MATCH (
"foo[abi:a]",
"foo",
NORMAL);
2789 CHECK_MATCH (
"foo[abi:a]()",
"foo",
NORMAL);
2790 CHECK_MATCH (
"foo[abi:a](a)",
"foo",
NORMAL);
2791 CHECK_MATCH (
"foo[abi:a](a&,b*)",
"foo",
NORMAL);
2792 CHECK_MATCH (
"foo[abi:a](a,b)",
"foo(a,b)",
NORMAL);
2793 CHECK_MATCH (
"foo[abi:a](a,b) c",
"foo(a,b) c",
NORMAL);
2794 CHECK_MATCH (
"foo[abi:a](a)",
"foo(a)",
NORMAL);
2795 CHECK_MATCH (
"foo[abi:a](a,b)",
"foo(a,b)",
NORMAL);
2796 CHECK_MATCH (
"foo[abi:a]",
"foo[abi:a]",
NORMAL);
2797 CHECK_MATCH (
"foo[ abi:a]",
"foo[abi:a]",
NORMAL);
2798 CHECK_MATCH (
"foo[\tabi:a]",
"foo[abi:a]",
NORMAL);
2799 CHECK_MATCH (
"foo[ \tabi:a]",
"foo[abi:a]",
NORMAL);
2800 CHECK_MATCH (
"foo[\t abi:a]",
"foo[abi:a]",
NORMAL);
2801 CHECK_MATCH (
"foo[abi :a]",
"foo[abi:a]",
NORMAL);
2802 CHECK_MATCH (
"foo[abi\t:a]",
"foo[abi:a]",
NORMAL);
2803 CHECK_MATCH (
"foo[abi \t:a]",
"foo[abi:a]",
NORMAL);
2804 CHECK_MATCH (
"foo[abi\t :a]",
"foo[abi:a]",
NORMAL);
2805 CHECK_MATCH (
"foo[abi:a]",
"foo[ abi:a]",
NORMAL);
2806 CHECK_MATCH (
"foo[abi:a]",
"foo[\tabi:a]",
NORMAL);
2807 CHECK_MATCH (
"foo[abi:a]",
"foo[ \tabi:a]",
NORMAL);
2808 CHECK_MATCH (
"foo[abi:a]",
"foo[\t abi:a]",
NORMAL);
2809 CHECK_MATCH (
"foo[abi:a]",
"foo[abi :a]",
NORMAL);
2810 CHECK_MATCH (
"foo[abi:a]",
"foo[abi\t:a]",
NORMAL);
2811 CHECK_MATCH (
"foo[abi:a]",
"foo[abi \t:a]",
NORMAL);
2812 CHECK_MATCH (
"foo[abi:a]",
"foo[abi\t :a]",
NORMAL);
2813 CHECK_MATCH (
"foo[abi:a]",
"foo[abi:a ]",
NORMAL);
2814 CHECK_MATCH (
"foo[abi:a]",
"foo[abi:a\t]",
NORMAL);
2815 CHECK_MATCH (
"foo[abi:a]",
"foo[abi:a \t]",
NORMAL);
2816 CHECK_MATCH (
"foo[abi:a]",
"foo[abi:a\t ]",
NORMAL);
2817 CHECK_MATCH (
"foo[abi:a,b]",
"foo[abi:a,b]",
NORMAL);
2818 CHECK_MATCH (
"foo[abi:::]",
"foo[abi:::]",
NORMAL);
2819 CHECK_MATCH (
"foo[abi : : : ]",
"foo[abi:::]",
NORMAL);
2820 CHECK_MATCH (
"foo[abi:::]",
"foo[abi : : : ]",
NORMAL);
2821 CHECK_MATCH (
"foo[ \t abi \t:\t: : \t]",
2822 "foo[ abi : \t ::]",
2824 CHECK_MATCH (
"foo< bar< baz< quxi > > >(int)",
"foo<bar<baz<quxi>>>(int)",
2826 CHECK_MATCH (
"\tfoo<\tbar<\tbaz\t<\tquxi\t>\t>\t>(int)",
2827 "foo<bar<baz<quxi>>>(int)",
NORMAL);
2828 CHECK_MATCH (
" \tfoo \t< \tbar \t< \tbaz \t< \tquxi \t> \t> \t> \t( \tint \t)",
2829 "foo<bar<baz<quxi>>>(int)",
NORMAL);
2830 CHECK_MATCH (
"foo<bar<baz<quxi>>>(int)",
2831 "foo < bar < baz < quxi > > > (int)",
NORMAL);
2832 CHECK_MATCH (
"foo<bar<baz<quxi>>>(int)",
2833 "\tfoo\t<\tbar\t<\tbaz\t<\tquxi\t>\t>\t>\t(int)",
NORMAL);
2834 CHECK_MATCH (
"foo<bar<baz<quxi>>>(int)",
2835 " \tfoo \t< \tbar \t< \tbaz \t< \tquxi \t> \t> \t> \t( \tint \t)",
NORMAL);
2836 CHECK_MATCH (
"foo<bar<baz>>::foo(quxi &)",
"fo",
NORMAL);
2837 CHECK_MATCH (
"foo<bar<baz>>::foo(quxi &)",
"foo",
NORMAL);
2838 CHECK_MATCH (
"foo<bar<baz>>::foo(quxi &)",
"foo<bar<baz>>::",
NORMAL);
2839 CHECK_MATCH (
"foo<bar<baz>>::foo(quxi &)",
"foo<bar<baz> >::foo",
NORMAL);
2840 CHECK_MATCH (
"foo[abi:a][abi:b](bar[abi:c][abi:d])",
"foo[abi:a][abi:b](bar[abi:c][abi:d])",
2842 CHECK_MATCH (
"foo[abi:a][abi:b](bar[abi:c][abi:d])",
"foo",
NORMAL);
2843 CHECK_MATCH (
"foo[abi:a][abi:b](bar[abi:c][abi:d])",
"foo(bar)",
NORMAL);
2844 CHECK_MATCH (
"foo[abi:a][abi:b](bar[abi:c][abi:d])",
"foo[abi:a](bar)",
NORMAL);
2845 CHECK_MATCH (
"foo[abi:a][abi:b](bar[abi:c][abi:d])",
"foo(bar[abi:c])",
NORMAL);
2846 CHECK_MATCH (
"foo[abi:a][abi:b](bar[abi:c][abi:d])",
"foo[abi:a](bar[abi:c])",
NORMAL);
2847 CHECK_MATCH (
"foo[abi:a][abi:b](bar[abi:c][abi:d])",
"foo[abi:a][abi:b](bar)",
NORMAL);
2848 CHECK_MATCH (
"foo[abi:a][abi:b](bar[abi:c][abi:d])",
"foo[abi:a][abi:b](bar[abi:c])",
2850 CHECK_MATCH(
"foo<bar[abi:a]>(char *, baz[abi:b])",
"foo",
NORMAL);
2851 CHECK_NO_MATCH(
"foo<bar[abi:a]>(char *, baz[abi:b])",
"foo()",
NORMAL);
2852 CHECK_MATCH(
"foo<bar[abi:a]>(char *, baz[abi:b])",
"foo<bar>",
NORMAL);
2853 CHECK_MATCH(
"foo<bar[abi:a]>(char *, baz[abi:b])",
"foo<bar>(char*, baz)",
NORMAL);
2854 CHECK_MATCH(
"foo<bar[abi:a]>(char *, baz[abi:b])",
"foo<bar>(char*, baz[abi:b])",
2856 CHECK_NO_MATCH(
"foo<bar[abi:a]>(char *, baz[abi:b])",
"foo<bar>(char*, baz[abi:A])",
2858 CHECK_MATCH(
"foo<bar[abi:a]>(char *, baz[abi:b])",
"foo<bar[abi:a]>(char*, baz)",
2860 CHECK_NO_MATCH(
"foo<bar[abi:a]>(char *, baz[abi:b])",
"foo<bar[abi:A]>(char*, baz)",
2862 CHECK_MATCH(
"foo<bar[abi:a]>(char *, baz[abi:b])",
"foo<bar[abi:a]>(char*, baz[abi:b])",
2864 CHECK_NO_MATCH(
"foo<bar[abi:a]>(char *, baz[abi:b])",
2865 "foo<bar[abi:a]>(char*, baz[abi:B])",
NORMAL);
2867 CHECK_NO_MATCH (
"foo",
"foo[",
NORMAL);
2868 CHECK_NO_MATCH (
"foo",
"foo[]",
NORMAL);
2869 CHECK_NO_MATCH (
"foo",
"foo[ a]",
NORMAL);
2870 CHECK_NO_MATCH (
"foo",
"foo[a ]",
NORMAL);
2871 CHECK_NO_MATCH (
"foo",
"foo[ a ]",
NORMAL);
2872 CHECK_NO_MATCH (
"foo",
"foo[\ta]",
NORMAL);
2873 CHECK_NO_MATCH (
"foo",
"foo[a \t]",
NORMAL);
2874 CHECK_NO_MATCH (
"foo",
"foo[a\t ]",
NORMAL);
2875 CHECK_NO_MATCH (
"foo",
"foo[ \ta]",
NORMAL);
2876 CHECK_NO_MATCH (
"foo",
"foo[\t a]",
NORMAL);
2877 CHECK_NO_MATCH (
"foo",
"foo[ \ta \t]",
NORMAL);
2878 CHECK_NO_MATCH (
"foo",
"foo[\t a\t ]",
NORMAL);
2879 CHECK_NO_MATCH (
"foo",
"foo[abi]",
NORMAL);
2880 CHECK_NO_MATCH (
"foo",
"foo[ abi]",
NORMAL);
2881 CHECK_NO_MATCH (
"foo",
"foo[abi ]",
NORMAL);
2882 CHECK_NO_MATCH (
"foo",
"foo[\tabi]",
NORMAL);
2883 CHECK_NO_MATCH (
"foo",
"foo[abi\t]",
NORMAL);
2884 CHECK_NO_MATCH (
"foo",
"foo[ \tabi]",
NORMAL);
2885 CHECK_NO_MATCH (
"foo",
"foo[\t abi]",
NORMAL);
2886 CHECK_NO_MATCH (
"foo",
"foo[abi \t]",
NORMAL);
2887 CHECK_NO_MATCH (
"foo",
"foo[abi\t ]",
NORMAL);
2888 CHECK_NO_MATCH (
"foo",
"foo[abi :]",
NORMAL);
2889 CHECK_NO_MATCH (
"foo",
"foo[abi\t:]",
NORMAL);
2890 CHECK_NO_MATCH (
"foo",
"foo[abi \t:]",
NORMAL);
2891 CHECK_NO_MATCH (
"foo",
"foo[abi\t :]",
NORMAL);
2892 CHECK_NO_MATCH (
"foo",
"foo[abi: ]",
NORMAL);
2893 CHECK_NO_MATCH (
"foo",
"foo[abi:\t]",
NORMAL);
2894 CHECK_NO_MATCH (
"foo",
"foo[abi: \t]",
NORMAL);
2895 CHECK_NO_MATCH (
"foo",
"foo[abi:\t ]",
NORMAL);
2896 CHECK_NO_MATCH (
"foo",
"foo[abi: a]",
NORMAL);
2897 CHECK_NO_MATCH (
"foo",
"foo[abi:\ta]",
NORMAL);
2898 CHECK_NO_MATCH (
"foo",
"foo[abi: \ta]",
NORMAL);
2899 CHECK_NO_MATCH (
"foo",
"foo[abi:\t a]",
NORMAL);
2900 CHECK_NO_MATCH (
"foo",
"foo[abi:a ]",
NORMAL);
2901 CHECK_NO_MATCH (
"foo",
"foo[abi:a\t]",
NORMAL);
2902 CHECK_NO_MATCH (
"foo",
"foo[abi:a \t]",
NORMAL);
2903 CHECK_NO_MATCH (
"foo",
"foo[abi:a\t ]",
NORMAL);
2904 CHECK_NO_MATCH (
"foo[abi:a]()",
"foo(a)",
NORMAL);
2905 CHECK_NO_MATCH (
"foo[abi:a]()",
"foo(a)",
NORMAL);
2906 CHECK_NO_MATCH (
"foo[abi:a]()",
"foo(a)",
NORMAL);
2907 CHECK_NO_MATCH (
"foo[abi:a]()",
"foo(a)",
NORMAL);
2908 CHECK_NO_MATCH (
"foo[abi:a]()",
"foo(a) c",
NORMAL);
2909 CHECK_NO_MATCH (
"foo[abi:a]()",
"foo(a) .",
NORMAL);
2910 CHECK_NO_MATCH (
"foo[abi:a]()",
"foo(a) *",
NORMAL);
2911 CHECK_NO_MATCH (
"foo[abi:a]()",
"foo(a) &",
NORMAL);
2912 CHECK_NO_MATCH (
"foo[abi:a](a,b)",
"foo(a,b) c",
NORMAL);
2913 CHECK_NO_MATCH (
"foo[abi:a](a,b)",
"foo(a,b) .",
NORMAL);
2914 CHECK_NO_MATCH (
"foo[abi:a](a,b)",
"foo(a,b) *",
NORMAL);
2915 CHECK_NO_MATCH (
"foo[abi:a](a,b)",
"foo(a,b) &",
NORMAL);
2916 CHECK_NO_MATCH (
"foo[abi:a](a,b)",
"foo(a,b)c",
NORMAL);
2917 CHECK_NO_MATCH (
"foo[abi:a](a,b)",
"foo(a,b).",
NORMAL);
2918 CHECK_NO_MATCH (
"foo[abi:a](a,b)",
"foo(a,b)*",
NORMAL);
2919 CHECK_NO_MATCH (
"foo[abi:a](a,b)",
"foo(a,b)&",
NORMAL);
2920 CHECK_NO_MATCH (
"foo[abi:a](a,b) d",
"foo(a,b) c",
NORMAL);
2921 CHECK_NO_MATCH (
"foo[abi:a](a)",
"foo()",
NORMAL);
2922 CHECK_NO_MATCH (
"foo[abi:a](a)",
"foo(b)",
NORMAL);
2923 CHECK_NO_MATCH (
"foo[abi:a](a)",
"foo[abi:b](a)",
NORMAL);
2924 CHECK_NO_MATCH (
"foo[abi:a](a)",
"foo[abi:a](b)",
NORMAL);
2925 CHECK_NO_MATCH (
"foo[abi:]",
"foo[abi:a]",
NORMAL);
2926 CHECK_NO_MATCH (
"foo[abi:",
"foo[abi:a]",
NORMAL);
2927 CHECK_NO_MATCH (
"foo[abi:]",
"foo[abi:a",
NORMAL);
2928 CHECK_NO_MATCH (
"foo[abi:,]",
"foo[abi:a]",
NORMAL);
2929 CHECK_NO_MATCH (
"foo[abi:a,b]",
"foo[abi:a]",
NORMAL);
2930 CHECK_NO_MATCH (
"foo[abi::a]",
"foo[abi:a]",
NORMAL);
2931 CHECK_NO_MATCH (
"foo[abi:,([a]",
"foo[abi:a]",
NORMAL);
2933 CHECK_MATCH (
"foo <a, b [, c (",
"foo",
NORMAL);
2934 CHECK_MATCH (
"foo >a, b ], c )",
"foo",
NORMAL);
2935 CHECK_MATCH (
"@!%&\\*",
"@!%&\\*",
NORMAL);
2936 CHECK_MATCH (
"()",
"()",
NORMAL);
2937 CHECK_MATCH (
"*(*)*",
"*(*)*",
NORMAL);
2938 CHECK_MATCH (
"[]",
"[]",
NORMAL);
2939 CHECK_MATCH (
"<>",
"<>",
NORMAL);
2942 CHECK_MATCH (
"foo2",
"foo",
NORMAL);
2959 CHECK_NO_MATCH (
" \tfoo2 \t",
" \tfoo \t",
MATCH_PARAMS);
2960 CHECK_NO_MATCH (
"\t foo2\t ",
"\t foo\t ",
MATCH_PARAMS);
2974 CHECK_NO_MATCH (
"foo2 (args \t)",
"foo",
MATCH_PARAMS);
2975 CHECK_NO_MATCH (
"foo2 (args\t )",
"foo",
MATCH_PARAMS);
2976 CHECK_MATCH (
"foo[abi:a][abi:b](bar[abi:c][abi:d])",
"foo[abi:a][abi:b](bar[abi:c][abi:d])",
2978 CHECK_MATCH (
"foo[abi:a][abi:b](bar[abi:c][abi:d])",
"foo",
MATCH_PARAMS);
2980 CHECK_NO_MATCH (
"foo((())args(()))@plt",
"foo",
MATCH_PARAMS);
2981 CHECK_MATCH (
"foo((())args(()))",
"foo",
MATCH_PARAMS);
2987 CHECK_NO_MATCH (
"FoO",
"foo",
NORMAL);
2993 CHECK_MATCH (
"FoO",
"foo",
NORMAL);
2995 CHECK_MATCH (
"foo",
"FoO",
NORMAL);
2998 CHECK_MATCH (
"FoO[AbI:abC]()",
"foo",
NORMAL);
2999 CHECK_NO_MATCH (
"FoO[AbI:abC]()",
"foo",
MATCH_PARAMS);
3000 CHECK_MATCH (
"FoO2[AbI:abC]()",
"foo",
NORMAL);
3001 CHECK_NO_MATCH (
"FoO2[AbI:abC]()",
"foo",
MATCH_PARAMS);
3003 CHECK_MATCH (
"foo[abi:abc]()",
"FoO[AbI:abC]()",
NORMAL);
3004 CHECK_MATCH (
"foo[abi:abc]()",
"FoO[AbI:AbC]()",
MATCH_PARAMS);
3005 CHECK_MATCH (
"foo[abi:abc](xyz)",
"FoO[AbI:abC](XyZ)",
NORMAL);
3006 CHECK_MATCH (
"foo[abi:abc](xyz)",
"FoO[AbI:abC](XyZ)",
MATCH_PARAMS);
3007 CHECK_MATCH (
"foo[abi:abc][abi:def](xyz)",
"FoO[AbI:abC](XyZ)",
NORMAL);
3008 CHECK_MATCH (
"foo[abi:abc][abi:def](xyz)",
"FoO[AbI:abC](XyZ)",
3010 CHECK_MATCH (
"foo<bar<baz>>(bar<baz>)",
"FoO<bAr<BaZ>>(bAr<BaZ>)",
3012 CHECK_MATCH (
"foo<bar<baz>>(bar<baz>)",
"FoO<bAr<BaZ>>(bAr<BaZ>)",
3024strncmp_iw (
const char *string1,
const char *string2,
size_t string2_len)
3079 const char *saved_string1 = string1, *saved_string2 = string2;
3087 char c1 =
'X',
c2 =
'X';
3089 while (*string1 !=
'\0' && *string2 !=
'\0')
3091 while (ISSPACE (*string1))
3093 while (ISSPACE (*string2))
3099 c1 = TOLOWER ((
unsigned char) *string1);
3100 c2 = TOLOWER ((
unsigned char) *string2);
3110 if (*string1 !=
'\0')
3123 if (*string2 ==
'\0')
3128 if (*string2 ==
'\0')
3133 if (*string2 ==
'\0' || *string2 ==
'(')
3149 string1 = saved_string1;
3150 string2 = saved_string2;
3160 gdb_printf (file, _(
"Timestamping debugging messages is %s.\n"),
3179 if (addr_bit < (
sizeof (CORE_ADDR) * HOST_CHAR_BIT))
3180 addr &= ((CORE_ADDR) 1 << addr_bit) - 1;
3181 return hex_string (addr);
3191 if (addr_bit < (
sizeof (CORE_ADDR) * HOST_CHAR_BIT))
3192 address &= ((CORE_ADDR) 1 << addr_bit) - 1;
3198 return hex_string_custom (address, 8);
3200 return hex_string_custom (address, 16);
3209 if (my_string[0] ==
'0' && TOLOWER (my_string[1]) ==
'x')
3214 for (i = 2; my_string[i] !=
'\0'; i++)
3216 if (ISDIGIT (my_string[i]))
3217 addr = (my_string[i] -
'0') + (addr * 16);
3218 else if (ISXDIGIT (my_string[i]))
3219 addr = (TOLOWER (my_string[i]) -
'a' + 0xa) + (addr * 16);
3221 error (_(
"invalid hex \"%s\""), my_string);
3229 for (i = 0; my_string[i] !=
'\0'; i++)
3231 if (ISDIGIT (my_string[i]))
3232 addr = (my_string[i] -
'0') + (addr * 10);
3234 error (_(
"invalid decimal \"%s\""), my_string);
3244gdb_realpath_check_trailer (
const char *input,
const char *trailer)
3246 gdb::unique_xmalloc_ptr<char> result = gdb_realpath (input);
3248 size_t len = strlen (result.get ());
3249 size_t trail_len = strlen (trailer);
3251 SELF_CHECK (len >= trail_len
3252 && strcmp (result.get () + len - trail_len, trailer) == 0);
3256gdb_realpath_tests ()
3259 gdb_realpath_check_trailer (
"./xfullpath.exp",
"/xfullpath.exp");
3261 gdb_realpath_check_trailer (
"../../defs.h",
"/defs.h");
3263 gdb_realpath_check_trailer (
"./a",
"/a");
3265 gdb_realpath_check_trailer (
"/root_file_which_should_exist",
3266 "/root_file_which_should_exist");
3268 gdb_realpath_check_trailer (
"xfullpath.exp",
"xfullpath.exp");
3270 gdb_realpath_check_trailer (
"a",
"a");
3272 gdb_realpath_check_trailer (
"",
"");
3278gdb_argv_as_array_view_test ()
3283 gdb::array_view<char *> view =
argv.as_array_view ();
3285 SELF_CHECK (view.data () ==
nullptr);
3286 SELF_CHECK (view.size () == 0);
3289 gdb_argv
argv (
"une bonne 50");
3291 gdb::array_view<char *> view =
argv.as_array_view ();
3293 SELF_CHECK (view.size () == 3);
3294 SELF_CHECK (strcmp (view[0],
"une") == 0);
3295 SELF_CHECK (strcmp (view[1],
"bonne") == 0);
3296 SELF_CHECK (strcmp (view[2],
"50") == 0);
3308 std::string dirname;
3309 const char *base = lbasename (filename);
3311 while (base > filename && IS_DIR_SEPARATOR (base[-1]))
3314 if (base == filename)
3317 dirname = std::string (filename, base - filename);
3321 if (base - filename == 2 && IS_ABSOLUTE_PATH (base)
3322 && !IS_DIR_SEPARATOR (filename[0]))
3323 dirname[base++ - filename] =
'.';
3339 dummy = (
char *) args;
3342 if ((
pid == 0 &&
dummy == args) ||
dummy != &args[strlen (args)])
3343 error (_(
"Illegal process-id: %s."), args);
3356 char *
string = *stringp, *s;
3357 const size_t from_len = strlen (from);
3358 const size_t to_len = strlen (to);
3362 s = strstr (s, from);
3366 if ((s ==
string || IS_DIR_SEPARATOR (s[-1])
3367 || s[-1] == DIRNAME_SEPARATOR)
3368 && (s[from_len] ==
'\0' || IS_DIR_SEPARATOR (s[from_len])
3369 || s[from_len] == DIRNAME_SEPARATOR))
3374 = (
char *)
xrealloc (
string, (strlen (
string) + to_len + 1));
3377 s = s -
string + string_new;
3378 string = string_new;
3381 memmove (&s[to_len], &s[from_len], strlen (&s[from_len]) + 1);
3382 memcpy (s, to, to_len);
3400sigalrm_handler (
int signo)
3417wait_to_die_with_timeout (pid_t
pid,
int *
status,
int timeout)
3419 pid_t waitpid_result;
3421 gdb_assert (
pid > 0);
3422 gdb_assert (timeout >= 0);
3427#if defined (HAVE_SIGACTION) && defined (SA_RESTART)
3428 struct sigaction sa, old_sa;
3430 sa.sa_handler = sigalrm_handler;
3431 sigemptyset (&sa.sa_mask);
3433 sigaction (SIGALRM, &sa, &old_sa);
3437 ofunc = signal (SIGALRM, sigalrm_handler);
3443 waitpid_result = waitpid (
pid,
status, 0);
3447#if defined (HAVE_SIGACTION) && defined (SA_RESTART)
3448 sigaction (SIGALRM, &old_sa, NULL);
3450 signal (SIGALRM,
ofunc);
3455 waitpid_result = waitpid (
pid,
status, WNOHANG);
3457 if (waitpid_result ==
pid)
3474 gdb_assert ((
flags & FNM_FILE_NAME) != 0);
3477 gdb_assert ((
flags & FNM_NOESCAPE) != 0);
3479#ifdef HAVE_DOS_BASED_FILE_SYSTEM
3481 char *pattern_slash, *string_slash;
3485 pattern_slash = (
char *) alloca (strlen (pattern) + 1);
3486 strcpy (pattern_slash, pattern);
3487 pattern = pattern_slash;
3488 for (; *pattern_slash != 0; pattern_slash++)
3489 if (IS_DIR_SEPARATOR (*pattern_slash))
3490 *pattern_slash =
'/';
3492 string_slash = (
char *) alloca (strlen (
string) + 1);
3493 strcpy (string_slash,
string);
3494 string = string_slash;
3495 for (; *string_slash != 0; string_slash++)
3496 if (IS_DIR_SEPARATOR (*string_slash))
3497 *string_slash =
'/';
3501#ifdef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
3502 flags |= FNM_CASEFOLD;
3505 return fnmatch (pattern,
string,
flags);
3519 const char *p = path;
3521 if (HAS_DRIVE_SPEC (p))
3523 p = STRIP_DRIVE_SPEC (p);
3529 if (IS_DIR_SEPARATOR (*p))
3535 if (p > path + 1 && IS_DIR_SEPARATOR (p[-1]))
3539 if (p > path && !IS_DIR_SEPARATOR (p[-1]))
3555 const char *p = path;
3557 gdb_assert (n >= 0);
3562 if (HAS_DRIVE_SPEC (p))
3564 p = STRIP_DRIVE_SPEC (p);
3570 while (*p !=
'\0' && !IS_DIR_SEPARATOR (*p))
3589 const gdb_byte *source, ULONGEST source_offset,
3590 ULONGEST nbits,
int bits_big_endian)
3592 unsigned int buf, avail;
3597 if (bits_big_endian)
3600 dest_offset += nbits - 1;
3601 dest += dest_offset / 8;
3602 dest_offset = 7 - dest_offset % 8;
3603 source_offset += nbits - 1;
3604 source += source_offset / 8;
3605 source_offset = 7 - source_offset % 8;
3609 dest += dest_offset / 8;
3611 source += source_offset / 8;
3617 buf = *(bits_big_endian ? source-- : source++) >> source_offset;
3618 buf <<= dest_offset;
3619 buf |= *dest & ((1 << dest_offset) - 1);
3622 nbits += dest_offset;
3623 avail = dest_offset + 8 - source_offset;
3626 if (nbits >= 8 && avail >= 8)
3628 *(bits_big_endian ? dest-- : dest++) = buf;
3637 size_t len = nbits / 8;
3642 if (bits_big_endian)
3646 memcpy (dest + 1, source + 1, len);
3650 memcpy (dest, source, len);
3659 buf |= *(bits_big_endian ? source-- : source++) << avail;
3660 *(bits_big_endian ? dest-- : dest++) = buf;
3671 buf |= *source << avail;
3673 buf &= (1 << nbits) - 1;
3674 *dest = (*dest & (~0U << nbits)) | buf;
3680test_assign_set_return_if_changed ()
3685 for (
bool initial : {
false,
true })
3690 SELF_CHECK (a == 1);
3691 SELF_CHECK (changed == initial);
3694 for (
bool initial : {
false,
true })
3699 SELF_CHECK (a == 2);
3700 SELF_CHECK (changed ==
true);
3705 SELF_CHECK (a == 1);
3706 SELF_CHECK (changed ==
false);
3710 SELF_CHECK (a == 2);
3711 SELF_CHECK (changed ==
true);
3720Set number of characters where GDB should wrap lines of its output."), _(
"\
3721Show number of characters where GDB should wrap lines of its output."), _(
"\
3722This affects where GDB wraps its output to fit the screen width.\n\
3723Setting this to \"unlimited\" or zero prevents GDB from wrapping its output."),
3729Set number of lines in a page for GDB output pagination."), _(
"\
3730Show number of lines in a page for GDB output pagination."), _(
"\
3731This affects the number of lines after which GDB will pause\n\
3732its output and ask you whether to continue.\n\
3733Setting this to \"unlimited\" or zero causes GDB never pause during output."),
3740Set state of GDB output pagination."), _(
"\
3741Show state of GDB output pagination."), _(
"\
3742When pagination is ON, GDB pauses at end of each screenful of\n\
3743its output and asks you whether to continue.\n\
3744Turning pagination off is an alternative to \"set height unlimited\"."),
3751Set printing of 8-bit characters in strings as \\nnn."), _(
"\
3752Show printing of 8-bit characters in strings as \\nnn."), NULL,
3759Set timestamping of debugging messages."), _(
"\
3760Show timestamping of debugging messages."), _(
"\
3761When set, debugging messages will be marked with seconds and microseconds."),
3774 selftests::register_test (
"gdb_realpath", gdb_realpath_tests);
3775 selftests::register_test (
"gdb_argv_array_view", gdb_argv_as_array_view_test);
3776 selftests::register_test (
"strncmp_iw_with_mode",
3777 strncmp_iw_with_mode_tests);
3778 selftests::register_test (
"pager", test_pager);
3779 selftests::register_test (
"assign_set_return_if_changed",
3780 test_assign_set_return_if_changed);
void * xrealloc(void *ptr, size_t size)
void gdb_internal_backtrace_set_cmd(const char *args, int from_tty, cmd_list_element *c)
void gdb_internal_backtrace()
#define GDB_PRINT_INTERNAL_BACKTRACE_INIT_ON
const char * host_charset(void)
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)
const char * target_charset(struct gdbarch *gdbarch)
ui_file_style style() const
void mark_ignored_range(const char *begin, const char *end)
const std::string & string()
static void ours_for_output()
virtual void puts(const char *str)
void vprintf(const char *, va_list) ATTRIBUTE_PRINTF(2
virtual void emit_style_escape(const ui_file_style &style)
ui_file_style m_applied_style
bool can_emit_style_escape() override
struct cmd_list_element * showlist
struct cmd_list_element * showprintlist
void error_no_arg(const char *why)
struct cmd_list_element * setprintlist
struct cmd_list_element * setlist
struct cmd_list_element * showdebuglist
struct cmd_list_element * maintenanceinfolist
struct cmd_list_element * setdebuglist
struct cmd_list_element * maintenance_show_cmdlist
struct cmd_list_element * maintenance_set_cmdlist
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
set_show_commands add_setshow_uinteger_cmd(const char *name, enum command_class theclass, unsigned int *var, const literal_def *extra_literals, 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)
set_show_commands 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_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
set_show_commands add_setshow_prefix_cmd(const char *name, command_class theclass, const char *set_doc, const char *show_doc, cmd_list_element **set_subcommands_list, cmd_list_element **show_subcommands_list, cmd_list_element **set_list, cmd_list_element **show_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)
cli_style_option highlight_style
cli_style_option file_name_style
const char * find_toplevel_char(const char *s, char c)
char * gdb_readline_wrapper(const char *)
int(* deprecated_query_hook)(const char *, va_list) ATTRIBUTE_FPTR_PRINTF(1
quit_handler_ftype * quit_handler
int void(* deprecated_warning_hook)(const char *, va_list) ATTRIBUTE_FPTR_PRINTF(1
void default_quit_handler(void)
volatile bool sync_quit_force_run
ssize_t read(int fd, void *buf, size_t count)
EXTERN_C int tgetnum(const char *)
int gdbarch_addr_bit(struct gdbarch *gdbarch)
mach_port_t kern_return_t mach_port_t mach_msg_type_name_t msgportsPoly 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
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
struct interp * top_level_interpreter(void)
const struct language_defn * language_def(enum language lang)
static sighandler_t ofunc
bool user_settable_should_print_backtrace
bool user_settable_should_quit
bool should_print_backtrace
const char * should_dump_core
bool user_settable_should_dump_core
virtual gdb::unique_xmalloc_ptr< char > demangle_symbol(const char *mangled, int options) const
set_batch_flag_and_restore_page_info()
~set_batch_flag_and_restore_page_info()
unsigned m_save_chars_per_line
unsigned m_save_lines_per_page
std::string to_ansi() const
enum prompt_state prompt_state
bool input_interactive_p() const
void unregister_file_handler()
void(* call_readline)(gdb_client_data)
void register_file_handler()
bool target_supports_terminal_ours(void)
bool tui_get_command_dimension(unsigned int *width, unsigned int *height)
static styled_string_s * styled_string(const ui_file_style &style, const char *str, styled_string_s &&tmp={})
bool skip_ansi_escape(const char *buf, int *n_read)
void demangler_warning(const char *file, int line, const char *string,...)
const char internal_problem_ask[]
std::string ldirname(const char *filename)
void malloc_failure(long size)
void verror(const char *string, va_list args)
static bool skip_abi_tag(const char **name)
static bool pagination_disabled_for_command
int strncmp_iw(const char *string1, const char *string2, size_t string2_len)
void set_screen_width_and_height(int width, int height)
int nquery(const char *ctlstr,...)
static void ATTRIBUTE_NORETURN abort_with_message(const char *msg)
static void maintenance_info_screen(const char *args, int from_tty)
std::chrono::steady_clock::duration get_prompt_for_continue_wait_time()
void init_page_info(void)
void internal_verror(const char *file, int line, const char *fmt, va_list ap)
void reinitialize_more_filter(void)
const char * print_core_address(struct gdbarch *gdbarch, CORE_ADDR address)
int can_dump_core(enum resource_limit_kind limit_kind)
static void show_sevenbit_strings(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static const int sqrt_int_max
static void show_pagination_enabled(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void gdb_vprintf(struct ui_file *stream, const char *format, va_list args)
int query(const char *ctlstr,...)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
void demangler_vwarning(const char *file, int line, const char *fmt, va_list ap)
void perror_warning_with_name(const char *string)
void print_spaces(int n, struct ui_file *stream)
static void set_width(void)
static bool cp_is_operator(const char *string, const char *start)
static bool filter_initialized
const char * n_spaces(int n)
const char internal_problem_yes[]
static void add_internal_problem_command(struct internal_problem *problem)
int yquery(const char *ctlstr,...)
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, bool ignore_template_params)
int strcmp_iw_ordered(const char *string1, const char *string2)
void fputs_highlighted(const char *str, const compiled_regex &highlight, struct ui_file *stream)
int filtered_printing_initialized(void)
static struct internal_problem demangler_warning_problem
static void skip_ws(const char *&string1, const char *&string2, const char *end_str2)
void reset_prompt_for_continue_wait_time(void)
void copy_bitwise(gdb_byte *dest, ULONGEST dest_offset, const gdb_byte *source, ULONGEST source_offset, ULONGEST nbits, int bits_big_endian)
static void set_height_command(const char *args, int from_tty, struct cmd_list_element *c)
int gdb_filename_fnmatch(const char *pattern, const char *string, int flags)
static int host_char_to_target(struct gdbarch *gdbarch, int c, int *target_c)
static void show_lines_per_page(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static struct internal_problem internal_warning_problem
void fprintf_styled(struct ui_file *stream, const ui_file_style &style, const char *format,...)
static void show_debug_timestamp(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
int parse_escape(struct gdbarch *gdbarch, const char **string_ptr)
void gdb_printf(struct ui_file *stream, const char *format,...)
static bool skip_template_parameter_list(const char **name)
void(* deprecated_error_begin_hook)(void)
static const char * cp_skip_operator_token(const char *token, const char *end)
int count_path_elements(const char *path)
void fputs_styled(const char *linebuffer, const ui_file_style &style, struct ui_file *stream)
static int can_dump_core_warn(enum resource_limit_kind limit_kind, const char *reason)
static void set_width_command(const char *args, int from_tty, struct cmd_list_element *c)
static void show_chars_per_line(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static bool valid_identifier_name_char(int ch)
CORE_ADDR string_to_core_addr(const char *my_string)
void substitute_path_component(char **stringp, const char *from, const char *to)
void fprintf_symbol(struct ui_file *stream, const char *name, enum language lang, int arg_mode)
static unsigned int lines_per_page
const char * strip_leading_path_elements(const char *path, int n)
const char internal_problem_no[]
void gdb_flush(struct ui_file *stream)
void printf_unfiltered(const char *format,...)
void vwarning(const char *string, va_list args)
static struct internal_problem internal_error_problem
static std::chrono::steady_clock::duration prompt_for_continue_wait_time
static unsigned int chars_printed
EXTERN_C int _rl_term_autowrap
const char * warning_pre_print
void warn_cant_dump_core(const char *reason)
static const char *const internal_problem_modes[]
void puts_tabular(char *string, int width, int right)
void gdb_puts(const char *linebuffer, struct ui_file *stream)
int myread(int desc, char *addr, int len)
static void ATTRIBUTE_PRINTF(4, 0)
static unsigned int chars_per_line
void warning_filename_and_errno(const char *filename, int saved_errno)
void internal_vwarning(const char *file, int line, const char *fmt, va_list ap)
int parse_pid_to_attach(const char *args)
static void set_screen_size(void)
static unsigned int lines_printed
static bool readline_initialized(struct ui *ui)
int strcmp_iw(const char *string1, const char *string2)
void init_page_info(void)
void assign_set_if_changed(T &lval, const T &val, bool &changed)
bool assign_return_if_changed(T &lval, const T &val)