]> code.delx.au - gnu-emacs-elpa/blob - packages/realgud/realgud/debugger/trepan2/init.el
87d1306425b2f500663867bda3d288b14d56bfb2
[gnu-emacs-elpa] / packages / realgud / realgud / debugger / trepan2 / init.el
1 ;;; Copyright (C) 2010-2012, 2014-2015 Rocky Bernstein <rocky@gnu.org>
2 ;;; trepan2: Python 2.5 but less than 3K
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/python") "realgud-lang-")
12
13 (defvar realgud-pat-hash)
14 (declare-function make-realgud-loc-pat (realgud-loc))
15
16 (defvar realgud:trepan2-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 (declare-function make-realgud-loc 'realgud-loc)
22
23 (setf (gethash "loc-callback-fn" realgud:trepan2-pat-hash) 'realgud:trepan2-loc-fn-callback)
24
25 ;; Regular expression that describes a trepan2 location generally shown
26 ;; before a command prompt.
27 ;;
28 ;; For example:
29 ;; (/usr/bin/zonetab2pot.py:15): <module>
30 ;; (/usr/bin/zonetab2pot.py:15 remapped <string>): <module>
31 ;; or MS Windows:
32 ;; (c:\\mydirectory\\gcd.py:10): <module>
33 (setf (gethash "loc" realgud:trepan2-pat-hash)
34 realgud:python-trepan-loc-pat)
35
36 (setf (gethash "prompt" realgud:trepan2-pat-hash)
37 (make-realgud-loc-pat
38 :regexp "^(trepan2) "
39 ))
40
41 ;; Regular expression that describes a trepan2 backtrace line.
42 ;; For example:
43 ;; ->0 get_distribution(dist='trepan==0.3.9')
44 ;; called from file '/python2.7/dist-packages/pkg_res.py' at line 341
45 ;; ##1 load_entry_point(dist='tr=0.3.9', group='console_scripts', name='tr')
46 ;; called from file '/python2.7/dist-packages/pkg_res.py' at line 351
47 ;; ##2 <module> exec()
48
49 (setf (gethash "debugger-backtrace" realgud:trepan2-pat-hash)
50 realgud:python-trepan-backtrace-pat)
51
52 ;; Regular expression that describes a Python backtrace line.
53 (setf (gethash "lang-backtrace" realgud:trepan2-pat-hash)
54 realgud-python-backtrace-loc-pat)
55
56 ;; Regular expression that describes a "breakpoint set" line
57 (setf (gethash "brkpt-set" realgud:trepan2-pat-hash)
58 realgud:python-trepan-brkpt-set-pat)
59
60 ;; Regular expression that describes a "delete breakpoint" line
61 (setf (gethash "brkpt-del" realgud:trepan2-pat-hash)
62 realgud:python-trepan-brkpt-del-pat)
63
64 ;; Regular expression for a termination message.
65 (setf (gethash "termination" realgud:trepan2-pat-hash)
66 "^trepan2: That's all, folks...\n")
67
68 (setf (gethash "font-lock-keywords" realgud:trepan2-pat-hash)
69 realgud:python-debugger-font-lock-keywords)
70
71 (setf (gethash "trepan2" realgud-pat-hash) realgud:trepan2-pat-hash)
72
73 (defvar realgud:trepan2-command-hash (make-hash-table :test 'equal)
74 "Hash key is command name like 'shell' and the value is
75 the trepan2 command to use, like 'python'")
76
77 (setf (gethash "shell" realgud:trepan2-command-hash) "python")
78 (setf (gethash "until" realgud:trepan2-command-hash) "continue %l")
79 (setf (gethash "trepan2" realgud-command-hash) realgud:trepan2-command-hash)
80
81 (provide-me "realgud:trepan2-")