X \\< --> word begin (word is composed of 0..9a..zA...Z)
X \\> --> word end (word is composed of 0..9a..zA...Z)
X \\b --> word bound
X \\B --> not word bound
X \\| --> means OR
X \\` --> begin buffer
X \\\' --> end buffer
X
X
>> WARNING : be carefull with \\| (OR) : the re_match() function
>> will NOT correctly update the string for a pattern which is
>> optional !
>> --> The number SHOULD NOT point to a patterm which is optional !
X
*/
X
X /* (PW)5DEC90: I have a problem if we say \\(Bpt.*\n\\)? in exec pattern.
X That is why I have two cases : with or without Bpt...
X Note that 'exec without Message' includes 'exec with Message'.
X We display 'Bpt...' in the message window. */
X
X /* (PW)14JAN91 (v1.01) : use
X \\(\\([0-9]+:.*\n\\(\\( .*\n\\)*}\n\\)?\\)*\\)
X instead of
X \\(\\([0-9]+:.*\n\\)*\\)
X for display pattern.
X */
X
X
static PatternRec output_pattern[] = {
X /* exec with Message after */
X {"\\(.*\n\\)*\032\032\\([^ ]+\\):\\([0-9]+\\):\\([0-9]+\\):\\([^ ]+\\):0x.+\n\\([ ]*[^0-9].*\n\\)\\(\\([0-9]+:.*\n\\(\\( .*\n\\)*}\n\\)?\\)*\\)",
X NULL,
X {6, -1, -1, 3, 2, 7}
X },
X /* exec with Message before */
X {"\\(.*\n\\)*\\([ ]*[^ ].*\n\\)\032\032\\([^ ]+\\):\\([0-9]+\\):\\([0-9]+\\):\\([^ ]+\\):0x.+\n\\(\\([0-9]+:.*\n\\(\\( .*\n\\)*}\n\\)?\\)*\\)",
X NULL,
X {2, -1, -1, 4, 3, 7}
X },
X /* exec without Message */
X {"\\(.*\n\\)*\032\032\\(\\([^ ]+\\):\\([0-9]+\\):\\([0-9]+\\):\\([^ ]+\\):0x.+\n\\)\\(\\([0-9]+:.*\n\\(\\( .*\n\\)*}\n\\)?\\)*\\)",
X NULL,
X {2, -1, -1, 4, 3, 7}
X },
X /* done */
X {"\\(.*\n\\)*\n\\(Program terminated with signal \\|Program exited with code 0\\|Program exited normally\\).*\n\\(.*\n\\)*",
X NULL,
X {-1, -1, -1, -1, -1, -1}
X },
X /* break */
X {"\\(.*\n\\)*Breakpoint \\([0-9]+\\) at [^ ]+: file \\([^ ]+\\), line \\([0-9]+\\).\n",
X NULL,
X {-1, 2, -1, 4, 3, -1}
X },
X /* info directories */
X {"Source directories searched:[ ]*\\([^ ]+\\)[ ]*\n",
X NULL,
X { -1, -1, -1, -1, 1, -1}
X },
X /* up, down */
X {"\\(.*\n\\)*\\(#[0-9]+[ ]+\\(0x[^ ]+[ ]+in[ ]+\\)?\\([^ ]+\\).*\n\\)\\(Source file is more recent than executable.\n\\)?\032\032\\([^ ]+\\):\\([0-9]+\\):\\([0-9]+\\):\\([^ ]+\\):0x.+\n",
X NULL,
X {2, -1, 4, 7, 6, -1}
X },
X /* bell */
X {"\\(Undefined command: .*\n\\|Already at the \\(top\\|bottom\\) call level\n\\|\
No active stack frames\n\\|no program to run\n\\|no process to run\n\\|\
program is not active\n\\|can't continue execution\n\\|\
.*\ncan't write to process.*\n\\|\
\\(Top\\|End\\)-of-file; did not find search string:.*\n\\)",
X NULL,
X {-1, -1, -1, -1, -1}
X },
X /* search */
X {"\\([0-9]+\\).*\n",
X NULL,
X {-1, -1, -1, 1, -1, -1}
X },
X /* info line */
X {"\\(Line \\(number \\)?[0-9]+ \\(of\\|is out of range for\\) \"\\([^ ]+\\)\".*\\)\n",
X NULL,
X {-1, -1, -1, -1, 4, -1}
X },
X /* print */
X {"\\(warning: .*\n\\)?\\(\\(.*\\) = .*\n\\(.*\n\\)*\\)",
X NULL,
X { 3, -1, -1, -1, -1, 2}
X },
X /* start gdb (debug) */
X {"\\(.*\n\\)*Type \"help\" for a list of commands.\n",
X NULL,
X { -1, -1, -1, -1, -1, -1}
X },
X /* directory */
X {"\\([^ ]+ is already in the source path.[ ]*\n\\)*Source directories searched:[ ]*\\([^ ]+\\)[ ]*\n",
X NULL,
X { -1, -1, -1, -1, 1, -1}
X },
X /* list */
X {"\\(.*\n\\)*\\(\\([0-9]+\\).*\n\\)",
X NULL,
X { -1, -1, -1, 3, -1, -1}
X },
X /* display */
X {"\\([0-9]+:.*\n\\)",
X NULL,
X { -1, -1, -1, -1, -1, 1}
X },
X /* info display */
X {"\\(\\([0-9]+:.*\n\\(\\( .*\n\\)*}\n\\)?\\)*\\)",
X NULL,
X { -1, -1, -1, -1, -1, 1}
X },
X /* pwd or cd */
X {"Working directory[ ]+\\([^ ]+\\).[ ]*\n\\([ ]*(canonically[ ]+\\([^ ]+\\)).\n\\)?",
X NULL,
X { 1, -1, -1, -1, -1, 3}
X },
X /* program received signal */
X {"\\(.*\n\\)*\n\\(Program received signal \\([-]?[0-9]+\\), [^ ]+.*\n\\)\\(.*\n\\)*",
X NULL,
X { 2, 3, -1, -1, -1, -1}
X },
X /* special for test in filter_display_info() */
X {"\\([^0-9].*\n\\)*\\([0-9]+:.*\n\\)\\(.*\n\\)*",
X NULL,
X { -1, -1, -1, -1, -1, 2}
X },
X /* special for test in filter_reading_symbols() */
X {"\\(.*\n\\)*\\(Reading in symbols for .*done.\n\\)\\(.*\n\\)*",
X NULL,
X { 2, -1, -1, -1, -1, -1}
X },
X {"\\(.*\n\\)*", NULL, {-1, -1, -1, -1, -1, -1}
X },
X NULL
};
X
/*
X
X To simplify the patterns, I used for example :
X
X "fr[ame]*" instead of "frame\\|fram\\|fra||fr".
X
X This will cause 'frmeame' to be accepted. But this is
X no problem because 'Undefined command' output is parsed
X before parsing the command line (see parse() in parser.c).
*/
X
static PatternRec command_pattern[] = {
X /* run -r - cont - c - next - n - step - s - nexti - ni - stepi - si - return
X jump - until - u */
X {"[ ]*\\(run\\|r\\|cont\\|c\\|next\\|n\\|step\\|s\\|nexti\\|stepi\\|ni\\|si\\|ret[urn]*\\|j[ump]*\\|unt[il]*\\|u\\)\\( .*\\)?\n",
X NULL, {-1, -1, -1, -1, -1, -1}},
X /* break - tbreak */
X {"[ ]*\\(t\\)?\\(b\\|br\\|bre\\|brea\\|break\\)\\( .*\\)?\n",