home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- *
- * xdbx - X Window System interface to dbx
- *
- * Copyright 1989 The University of Texas at Austin
- *
- * Author: Po Cheung
- * Date: March 10, 1989
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation. The University of Texas at Austin makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- ******************************************************************************/
-
-
- /*
- * Regular expression pattern matching
- *
- * The reg_token array indicates the register no. for each token type.
- * reg_token[0] : message
- * reg_token[1] : stop number
- * reg_token[2] : function name
- * reg_token[3] : line number
- * reg_token[4] : file name
- */
-
- #define BRACKET "(%d)"
-
- #define TK_MESG 0
- #define TK_STOP 1
- #define TK_FUNC 2
- #define TK_LINE 3
- #define TK_FILE 4
-
- #define O_EXEC 0
- #define O_DONE 1
- #define O_STOPAT 2
- #define O_STOPIN 3
- #define O_UPDOWN 4
- #define O_BELL 5
- #define O_LIST 6
-
- #define C_EXEC 0
- #define C_STOPAT 1
- #define C_STOPIN 2
- #define C_UPDOWN 3
- #define C_DELETE 4
- #define C_FUNC 5
- #define C_FILE 6
- #define C_DEBUG 7
- #define C_CD 8
-
- static PatternRec output_pattern[] = {
- {"\\(.*\n\\)*\\(\\(stopped\\|Bus error\\|Segmentation fault\\|Interrupt\\|\
- signal.*\\) in \\([^ ]+\\) at line \\([0-9]+\\)\\( in file\
- \"\\([^ ]+\\)\"\\)?\\)\n",
- NULL,
- {2, -1, 4, 5, 7}
- },
- {"\\(.*\n\\)*\\(execution completed\\|program exited with [0-9]+\\)",
- NULL,
- {-1, -1, -1, -1, -1}
- },
- {"(\\([0-9]+\\)) stop at \\(\"\\([^ ]+\\)\":\\)?\\([0-9]+\\)\n",
- NULL,
- {-1, 1, -1, 4, 3}
- },
- {"(\\([0-9]+\\)) stop in \\([^ ]+\\)\n",
- NULL,
- {-1, 1, 2, -1, -1}
- },
- {"Current function is \\([^ ]+\\)\n[ ]*\\([0-9]+\\).*\n",
- NULL,
- {-1, -1, 1, 2, 3}
- },
- {"\\(Already at the \\(top\\|bottom\\) call level\n\\|No active stack \
- frames\n\\|no program to run\n\\|program is not active\n\\|can't continue \
- execution\n\\|.*\ncan't write to process.*\\)",
- NULL,
- {-1, -1, -1, -1, -1}
- },
- {"[ ]*[0-9]+.*\n[ ]*[0-9]+.*\n[ ]*[0-9]+.*\n[ ]*[0-9]+.*\n[ ]*[0-9]+.*\n\
- [ ]*\\([0-9]+\\).*\n",
- NULL,
- {-1, -1, -1, 1, -1}
- },
- NULL
- };
-
-
- static PatternRec command_pattern[] = {
- {"[ ]*\\(run\\|cont\\|next\\|step\\).*\n", NULL, {-1, -1, -1, -1, -1}},
- {"[ ]*stop[ ]+at[ ]+[0-9]+.*\n", NULL, {-1, -1, -1, -1, -1}},
- {"[ ]*stop[ ]+in[ ]+.*\n", NULL, {-1, -1, -1, -1, -1}},
- {"[ ]*\\(up\\|down\\).*\n", NULL, {-1, -1, -1, -1, -1}},
- {"[ ]*delete.*\n", NULL, {-1, -1, -1, 1, -1}},
- {"[ ]*func[ ]*\\([^ ]+\\)[ ]*\n", NULL, {-1, -1, 1, -1, -1}},
- {"[ ]*file[ ]*\\([^ ]+\\)[ ]*\n", NULL, {-1, -1, -1, -1, 1}},
- {"[ ]*debug[ ]*\\([^ ]+\\)[ ]*\n", NULL, {-1, -1, -1, -1, 1}},
- {"[ ]*cd[ ]*\\([^ ]+\\)[ ]*\n", NULL, {-1, -1, -1, -1, 1}},
- NULL
- };
-