1 ;;; Copyright (C) 2010-2012, 2014-2015 Rocky Bernstein <rocky@gnu.org>
2 ;;; trepan2: Python 2.5 but less than 3K
4 (eval-when-compile (require 'cl))
6 (require 'load-relative)
7 (require-relative-list '("../../common/regexp"
11 (require-relative-list '("../../lang/python") "realgud-lang-")
13 (defvar realgud-pat-hash)
14 (declare-function make-realgud-loc-pat (realgud-loc))
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")
21 (declare-function make-realgud-loc 'realgud-loc)
23 (setf (gethash "loc-callback-fn" realgud:trepan2-pat-hash) 'realgud:trepan2-loc-fn-callback)
25 ;; Regular expression that describes a trepan2 location generally shown
26 ;; before a command prompt.
29 ;; (/usr/bin/zonetab2pot.py:15): <module>
30 ;; (/usr/bin/zonetab2pot.py:15 remapped <string>): <module>
32 ;; (c:\\mydirectory\\gcd.py:10): <module>
33 (setf (gethash "loc" realgud:trepan2-pat-hash)
34 realgud:python-trepan-loc-pat)
36 (setf (gethash "prompt" realgud:trepan2-pat-hash)
41 ;; Regular expression that describes a trepan2 backtrace line.
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()
49 (setf (gethash "debugger-backtrace" realgud:trepan2-pat-hash)
50 realgud:python-trepan-backtrace-pat)
52 ;; Regular expression that describes a Python backtrace line.
53 (setf (gethash "lang-backtrace" realgud:trepan2-pat-hash)
54 realgud-python-backtrace-loc-pat)
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)
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)
64 ;; Regular expression for a termination message.
65 (setf (gethash "termination" realgud:trepan2-pat-hash)
66 "^trepan2: That's all, folks...\n")
68 (setf (gethash "font-lock-keywords" realgud:trepan2-pat-hash)
69 realgud:python-debugger-font-lock-keywords)
71 (setf (gethash "trepan2" realgud-pat-hash) realgud:trepan2-pat-hash)
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'")
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)
81 (provide-me "realgud:trepan2-")