2 (require 'load-relative)
3 (load-file "./regexp-helper.el")
4 (load-file "../realgud/common/regexp.el")
5 (load-file "../realgud/debugger/trepanx/init.el")
7 (declare-function realgud-cmdbuf-info-loc-regexp 'realgud-buffer-command)
8 (declare-function cmdbuf-loc-match 'realgud-regexp)
9 (declare-function realgud-loc-pat-regexp 'realgud-regexp)
10 (declare-function realgud-loc-pat-file-group 'realgud-regexp)
11 (declare-function realgud-loc-pat-line-group 'realgud-regexp)
12 (declare-function realgud-cmdbuf-info-file-group 'realgud-regexp)
13 (declare-function realgud-cmdbuf-info-line-group 'realgud-regexp)
14 (declare-function realgud-cmdbuf-info 'realgud-regexp)
15 (declare-function make-realgud-cmdbuf-info 'realgud-regexp)
16 (declare-function __FILE__ 'require-relative)
22 (defvar realgud-pat-hash)
29 ;; Some setup usually done in setting up the buffer.
30 ;; We customize this for the debugger trepan. Others may follow.
31 ;; FIXME: encapsulate this.
32 (setq dbg-name "trepanx")
33 (setq loc-pat (gethash "loc" (gethash dbg-name realgud-pat-hash)))
34 (setq xagent-pat (gethash "rubinius-backtrace-Xagent" (gethash dbg-name realgud-pat-hash)))
36 (setq test-dbgr (make-realgud-cmdbuf-info
37 :debugger-name dbg-name
38 :loc-regexp (realgud-loc-pat-regexp loc-pat)
39 :file-group (realgud-loc-pat-file-group loc-pat)
40 :line-group (realgud-loc-pat-line-group loc-pat)))
43 (defun xagent-match(text)
44 (string-match (realgud-loc-pat-regexp xagent-pat) test-text)
47 (setq test-text "-- (../rbx-trepanning/tmp/rbxtest.rb:7 @5)")
48 (assert-t (numberp (cmdbuf-loc-match test-text test-dbgr)) "basic location")
50 (note "extract file name")
51 (setq test-text "-- (../rbx-trepanning/tmp/rbxtest.rb:7 @5)")
52 (assert-equal 0 (cmdbuf-loc-match test-text test-dbgr))
53 (assert-equal "../rbx-trepanning/tmp/rbxtest.rb"
54 (match-string (realgud-cmdbuf-info-file-group test-dbgr)
56 (setq test-text "-- (../rbx-trepanning/tmp/rbxtest.rb:7 @5)")
59 (realgud-cmdbuf-info-line-group test-dbgr)
60 test-text) "extract line number")
62 (setq test-text "0xbfb63710: RakeFileUtils#ruby in /home/rocky-rvm/.rvm/gems/rbx-head/gems/rake-0.8.7/lib/rake.rb:1094 (+61)")
63 (assert-t (numberp (xagent-match test-text)) "basic xagent location")