]> code.delx.au - gnu-emacs-elpa/blob - packages/realgud/realgud/debugger/zshdb/init.el
4931105979a6746abfe52df6b0370081e7237ad2
[gnu-emacs-elpa] / packages / realgud / realgud / debugger / zshdb / init.el
1 ;;; Copyright (C) 2010, 2014-2015 Rocky Bernstein <rocky@gnu.org>
2 ;;; Regular expressions for Z shell debugger: zshdb
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:zshdb-pat-hash)
14 (declare-function make-realgud-loc-pat (realgud-loc))
15
16 (defvar realgud:zshdb-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 zshdb location generally shown
22 ;; before a command prompt.
23 ;; For example:
24 ;; (/etc/init.d/apparmor:35):
25 (setf (gethash "loc" realgud:zshdb-pat-hash) realgud:POSIX-debugger-loc-pat)
26
27 ;; Regular expression that describes a zshdb command prompt
28 ;; For example:
29 ;; zshdb<10>
30 ;; zshdb<(5)>
31 ;; zshdb<<1>>
32 (setf (gethash "prompt" realgud:zshdb-pat-hash)
33 (make-realgud-loc-pat
34 :regexp "^zshdb[<]+[(]*\\([0-9]+\\)[)]*[>]+ "
35 :num 1
36 ))
37
38 ;; Regular expression that describes a "breakpoint set" line.
39 (setf (gethash "brkpt-set" realgud:zshdb-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:zshdb-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 `/etc/apparmor/fns' at line 24
51 ;; ##1 /etc/apparmor/fns called from file `/etc/init.d/apparmor' at line 35
52 ;; ##2 /etc/init.d/apparmor called from file `/usr/bin/zshdb' at line 129
53 (setf (gethash "debugger-backtrace" realgud:zshdb-pat-hash)
54 realgud:POSIX-debugger-backtrace-pat)
55
56 ;; Regular expression that for a termination message.
57 (setf (gethash "termination" realgud:zshdb-pat-hash)
58 "^zshdb: That's all, folks...\n")
59
60 (setf (gethash "font-lock-keywords" realgud:zshdb-pat-hash)
61 realgud:POSIX-debugger-font-lock-keywords)
62
63 (setf (gethash "zshdb" realgud-pat-hash) realgud:zshdb-pat-hash)
64
65 (defvar realgud:zshdb-command-hash (make-hash-table :test 'equal)
66 "Hash key is command name like 'quit' and the value is
67 the zshdb command to use, like 'quit!'")
68
69 (setf (gethash "zshdb" realgud-command-hash) realgud:zshdb-command-hash)
70
71 (setf (gethash "clear" realgud:zshdb-command-hash) "clear %l")
72 (setf (gethash "quit" realgud:zshdb-command-hash) "quit")
73 (setf (gethash "until" realgud:zshdb-command-hash) "continue %l")
74
75 (provide-me "realgud:zshdb-")