1 ;;; Copyright (C) 2010-2011, 2015 Rocky Bernstein <rocky@gnu.org>
2 ;;; Regular expressions for Bash shell debugger: bashdb
4 (eval-when-compile (require 'cl))
6 (require 'load-relative)
7 (require-relative-list '("../../common/regexp"
11 (require-relative-list '("../../lang/posix-shell") "realgud-lang-")
13 (defvar realgud:bashdb-pat-hash)
14 (declare-function make-realgud-loc-pat (realgud-loc))
16 (defvar realgud:bashdb-pat-hash (make-hash-table :test 'equal)
17 "Hash key is the what kind of pattern we want to match:
18 backtrace, prompt, etc. The values of a hash entry is a
19 realgud-loc-pat struct")
21 ;; Regular expression that describes a bashdb location generally shown
22 ;; before a command prompt.
24 ;; (/etc/init.d/apparmor:35):
25 (setf (gethash "loc" realgud:bashdb-pat-hash) realgud:POSIX-debugger-loc-pat)
27 ;; Regular expression that describes a bashdb command prompt
32 (setf (gethash "prompt" realgud:bashdb-pat-hash)
34 :regexp "^bashdb[<]+[(]*\\([0-9]+\\)[)]*[>]+ "
38 ;; Regular expression that describes a "breakpoint set" line
39 (setf (gethash "brkpt-set" realgud:bashdb-pat-hash)
40 realgud:POSIX-debugger-brkpt-set-pat)
42 ;; Regular expression that describes a debugger "delete" (breakpoint) response.
44 ;; Removed 1 breakpoint(s).
45 (setf (gethash "brkpt-del" realgud:bashdb-pat-hash)
46 realgud:POSIX-debugger-brkpt-del-pat)
48 ;; Regular expression that describes a debugger "backtrace" command line.
50 ;; ->0 in file `../bashdb/test/example/subshell.sh' at line 6
51 ;; ##1 source("../bashdb/shell.sh") called from file `/bin/bashdb' at line 140
52 ;; ##2 main() called from file `/bin/bashdb' at line 0
53 (setf (gethash "debugger-backtrace" realgud:bashdb-pat-hash)
54 realgud:POSIX-debugger-backtrace-pat)
56 ;; Regular expression for a termination message.
57 (setf (gethash "termination" realgud:bashdb-pat-hash)
58 "^bashdb: That's all, folks...\n")
60 (setf (gethash "font-lock-keywords" realgud:bashdb-pat-hash)
61 realgud:POSIX-debugger-font-lock-keywords)
63 (setf (gethash "bashdb" realgud-pat-hash) realgud:bashdb-pat-hash)
65 (defvar realgud:bashdb-command-hash (make-hash-table :test 'equal)
66 "Hash key is command name like 'quit' and the value is
67 the bashdb command to use, like 'quit!'")
69 (setf (gethash "bashdb" realgud-command-hash) realgud:bashdb-command-hash)
71 (setf (gethash "clear" realgud:bashdb-command-hash) "clear %l")
72 (setf (gethash "quit" realgud:bashdb-command-hash) "quit!")
73 (setf (gethash "until" realgud:bashdb-command-hash) "continue %l")
75 (provide-me "realgud:bashdb-")