]> code.delx.au - gnu-emacs-elpa/blob - packages/realgud/realgud/debugger/bashdb/init.el
Add 'packages/realgud/' from commit 'd811316e6a0f4eeee8a1347f504c196c86baa2cb'
[gnu-emacs-elpa] / packages / realgud / realgud / debugger / bashdb / init.el
1 ;;; Copyright (C) 2010-2011, 2015 Rocky Bernstein <rocky@gnu.org>
2 ;;; Regular expressions for Bash shell debugger: bashdb
3
4 (eval-when-compile (require 'cl))
5
6 (require 'load-relative)
7 (require-relative-list '("../../common/regexp"
8 "../../common/loc"
9 "../../common/init")
10 "realgud-")
11 (require-relative-list '("../../lang/posix-shell") "realgud-lang-")
12
13 (defvar realgud:bashdb-pat-hash)
14 (declare-function make-realgud-loc-pat (realgud-loc))
15
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")
20
21 ;; Regular expression that describes a bashdb location generally shown
22 ;; before a command prompt.
23 ;; For example:
24 ;; (/etc/init.d/apparmor:35):
25 (setf (gethash "loc" realgud:bashdb-pat-hash) realgud:POSIX-debugger-loc-pat)
26
27 ;; Regular expression that describes a bashdb command prompt
28 ;; For example:
29 ;; bashdb<10>
30 ;; bashdb<(5)>
31 ;; bashdb<<1>>
32 (setf (gethash "prompt" realgud:bashdb-pat-hash)
33 (make-realgud-loc-pat
34 :regexp "^bashdb[<]+[(]*\\([0-9]+\\)[)]*[>]+ "
35 :num 1
36 ))
37
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)
41
42 ;; Regular expression that describes a debugger "delete" (breakpoint) response.
43 ;; For example:
44 ;; Removed 1 breakpoint(s).
45 (setf (gethash "brkpt-del" realgud:bashdb-pat-hash)
46 realgud:POSIX-debugger-brkpt-del-pat)
47
48 ;; Regular expression that describes a debugger "backtrace" command line.
49 ;; For example:
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)
55
56 ;; Regular expression for a termination message.
57 (setf (gethash "termination" realgud:bashdb-pat-hash)
58 "^bashdb: That's all, folks...\n")
59
60 (setf (gethash "font-lock-keywords" realgud:bashdb-pat-hash)
61 realgud:POSIX-debugger-font-lock-keywords)
62
63 (setf (gethash "bashdb" realgud-pat-hash) realgud:bashdb-pat-hash)
64
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!'")
68
69 (setf (gethash "bashdb" realgud-command-hash) realgud:bashdb-command-hash)
70
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")
74
75 (provide-me "realgud:bashdb-")