annotate lisp/eos/sun-eos-debugger-extra.el @ 111:164ab62060bf

Added tag r20-1b7 for changeset fe104dbd9147
author cvs
date Mon, 13 Aug 2007 09:19:47 +0200
parents 376386a54a3c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; sun-eos-debugger.el --- Implements the XEmacs/SPARCworks Debugger interface
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) Sun Microsystems, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Maintainer: Eduardo Pelegri-Llopart <eduardo.pelegri-llopart@Eng.Sun.COM>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Author: Eduardo Pelegri-Llopart <eduardo.pelegri-llopart@Eng.Sun.COM>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; Keywords: SPARCworks EOS Era on SPARCworks Debugger dbx
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; Please send feedback to eduardo.pelegri-llopart@eng.sun.com
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; debugger buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 (require 'eos-common "sun-eos-common")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 (require 'eos-debugger "sun-eos-debugger")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 (require 'eos-menubar "sun-eos-menubar")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 (defvar eos::debugger-buffer "*Eos Debugger Log*"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 "name of buffer where to log debugger activity; see eos::use-debugger-buffer")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 (defvar eos::dbx-buffer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 (defvar eos::key-mode 'none "Style of key mode interaction for Eos")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 (defun eos::ensure-debugger-buffer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; will ensure a debugger buffer, with the proper major mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 (let ((buf (get-buffer eos::debugger-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 (if buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (switch-to-buffer buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (setq buf (get-buffer-create eos::debugger-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (set-buffer buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (eos::debugger-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (toggle-read-only -1) ; writeable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (eos::insert-string-as-extent "[Debugger] " t (get-face 'bold))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (toggle-read-only 1) ; read-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (defun eos::synchronize-debugger-buffer ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;; ensure all views of this buffer are at the end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (eos::ensure-debugger-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (let ((x (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (goto-char x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (mapcar (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (lambda (win)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (set-window-point win x)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (get-buffer-window-list eos::debugger-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (defvar eos::debugger-mode-map nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (if eos::debugger-mode-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (setq eos::debugger-mode-map (make-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (set-keymap-name eos::debugger-mode-map 'eos::debugger-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (define-key eos::debugger-mode-map [(meta p)] 'eos::debugger-previous-cmd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (define-key eos::debugger-mode-map [(meta n)] 'eos::debugger-next-cmd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (define-key eos::debugger-mode-map [return] 'eos::debugger-send-cmd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (defun eos::debugger-mode ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 "local mode"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (kill-all-local-variables)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (setq major-mode 'eos::debugger-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (setq mode-name "eos::debugger")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (setq truncate-lines t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (set-syntax-table emacs-lisp-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (use-local-map eos::debugger-mode-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ;; Handling of command lists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (defvar eos::current-command nil "Current command navigated; as an extent")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (defvar eos::last-command nil "last command sent to debugger, as an extent")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (defun eos::debugger-previous-cmd ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 ;; present the previous command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (let ((xt nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (if (null eos::current-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (setq xt eos::last-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (setq xt (extent-property
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 eos::current-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 'previous-command)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (if xt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (eos::debugger-delete-last-cmd-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (insert (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (extent-start-position xt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (1- (extent-end-position xt)) ; remove <CR>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (setq eos::current-command xt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (error "no previous command")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (defun eos::debugger-next-cmd ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 ;; present the next command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (let ((xt nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (if (null eos::current-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (error "no next command")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (setq xt (extent-property
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 eos::current-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 'next-command)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (eos::debugger-delete-last-cmd-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (if xt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (insert (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (extent-start-position xt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (1- (extent-end-position xt)) ; remove <CR>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (setq eos::current-command xt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (setq eos::current-command nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (defun eos::debugger-delete-last-cmd-line ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 ;; delete the last command line, not yet inputed, returns that cmd line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (let ((e (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (let* ((xt (extent-at (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (p (extent-end-position xt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (str (buffer-substring p e))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (delete-region p e)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 str
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (defun eos::debugger-send-cmd ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 ;; send the message in the current line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (let ((e (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (let* ((xt (extent-at (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (p (extent-end-position xt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (str (buffer-substring p e))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (delete-region p e)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (eos::send-spider-current-do-msg (concat str "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (setq eos::current-command nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 ;; client
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (defun get-buffer-window-list (buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 ;; like get-buffer-window except that will generate a list of windows
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ;; instead of just the first one"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (let* ((buf (get-buffer buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (win1 (next-window nil 'foo t t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (win win1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (first t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (ret nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (if (null buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (while (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (and first win)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (not (or first (equal win win1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (setq first nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (if (equal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 buf
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (window-buffer win))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (setq ret (cons win ret)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (setq win (next-window win t t t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 ret)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (defun eos::dbx-process ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ;; Returns nil, or the corresponding process where to insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (let ((pl (process-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (found-proc nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (while (and pl (null found-proc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (let* ((proc (car pl))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (name (process-name proc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (if (and (>= (length name) 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (equal (substring name 0 3) "Eos"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (setq found-proc proc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (setq pl (cdr pl))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 found-proc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (defun eos::insert-echo (process string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (if (null process)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (set-buffer (process-buffer process))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 ;; (let ((beg (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 ;; (insert-before-markers string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (insert-before-markers string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (if (process-mark process)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (set-marker (process-mark process) (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (if (eq (process-buffer process)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (goto-char (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (defun eos::insert-on-debugger-buffer (msg rdonly face &optional previous-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 ;; will insert MSG at end of debugger buffer with RDONLY property and with FACE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 ;; If PREVIOUS-COMMAND is given, the newly created extent will be doubly linked into this one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 ;; using 'previous-command and 'next-command properties
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (let ((fr (selected-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (buf (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (xt nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (eos::ensure-debugger-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (toggle-read-only -1) ; not read-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (eos::insert-echo (eos::dbx-process) msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (setq xt (eos::insert-string-as-extent msg rdonly face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (if previous-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (set-extent-property xt 'previous-command previous-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (set-extent-property previous-command 'next-command xt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (toggle-read-only 1) ; now read-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (switch-to-buffer buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (select-frame fr)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 xt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (defun eos::insert-string-as-extent (msg rdonly face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 ;; insert MSG as a extent with RDONLY and FACE. Returns the extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (let ((here nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (xt nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 (setq here (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (insert msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (setq xt (make-extent here (point) nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (if rdonly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (set-extent-property xt 'read-only t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (set-extent-property xt 'duplicable nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (set-extent-face xt face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (eos::synchronize-debugger-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 xt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (require 'comint)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (defvar eos::dbx-program "dbx")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (defvar eos::dbx-switches (list "-editor"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (defun eos::expand-file-name (file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 ;; expand file name depending on first character
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 ((null file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 ((eq (elt file 0) ?~)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (expand-file-name file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 ((eq (elt file 0) ?$)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (substitute-in-file-name file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (t file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (defun eos::read-dbx-request (program switches)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 ;; will prompt to the user with PROGRAM and SWITCHES, let her modify this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 ;; and then will read the result and split it into program and switches.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (let* ((prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (concat program " " (mapconcat 'identity switches " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (ret (read-from-minibuffer "Run dbx as: " prompt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (ret2 (split-string ret " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 ;; some testing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (cons (car ret2) (cdr ret2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (defun eos::dbx ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 ;; Run an inferior dbx -editor process, with I/O through buffer *Eos Dbx*.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 ;; If buffer exists but dbx process is not running, make new dbx.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 ;; If buffer exists and dbx process is running,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 ;; just switch to buffer `*Eos Dbx*'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (let ((buffer "*Eos Dbx*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (buffer-name "Eos Dbx")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (input nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (cond ((not (comint-check-proc buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (setq input (eos::read-dbx-request eos::dbx-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 eos::dbx-switches))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (setq eos::dbx-program (car input))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (setq eos::dbx-switches (cdr input))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (message "Starting Dbx subprocess")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (setq buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (set-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (apply 'make-comint
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 buffer-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (eos::expand-file-name eos::dbx-program)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (mapcar 'eos::expand-file-name eos::dbx-switches))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (comint-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (if (and (eq (device-type (frame-device (selected-frame))) 'tty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (eq eos::key-mode 'none)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (yes-or-no-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 "Do you want the prefix map activated?"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (eos::set-key-mode 'prefix))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (setq eos::dbx-or-debugger 'dbx)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 (setq eos::dbx-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (make-local-variable 'kill-buffer-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (setq kill-buffer-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (list (function (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 ((null (eos::dbx-process)) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 ((not (eq (process-status (eos::dbx-process)) 'run)) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 ((yes-or-no-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 "Warning! Killing this buffer will kill a dbx process, proceed? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (eos::internal-clear-annotations t t t t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (t (error "kill-buffer aborted!")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (message "Reusing existing dbx buffer and dbx process")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (switch-to-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 ;; Actions to start a debugger in the background.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (defvar eos::debugger-process nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 "Debugger process for the background. Only one per XEmacs")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (defvar eos::dbx-or-debugger nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (defun eos::start-debugger ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 "Start an \"debugger -editor\" in the background. Will ask for confirmation if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 XEmacs somehow believes there is already one running"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (if (and (or (not (processp eos::debugger-process))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 (not (eq (process-status eos::debugger-process) 'run))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (yes-or-no-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 "Warning! XEmacs believes there already is a debugger -editor, proceed? "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (or (not (eos::dbx-process))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (not (eq (process-status (eos::dbx-process)) 'run))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 (yes-or-no-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 "Warning! XEmacs believes there already is a dbx -editor, proceed? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (setq eos::debugger-process
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (start-process "*eos debugger*" nil "debugger" "-editor"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (message "Starting Debugger subprocess")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (eos::select-debugger-frame (selected-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (setq eos::dbx-or-debugger 'debugger)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 ;; Ditto for dbx.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (defun eos::start-dbx ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 "Start an \"dbx -editor\" as a subprocess. Will ask for confirmation if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 XEmacs somehow believes there is already one running"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 (if (and (or (not (processp eos::debugger-process))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (not (eq (process-status eos::debugger-process) 'run))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 (yes-or-no-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 "Warning! XEmacs believes there already is a debugger -editor, proceed? "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (or (not (eos::dbx-process))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (not (eq (process-status (eos::dbx-process)) 'run))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (yes-or-no-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 "Warning! XEmacs believes there already is a dbx -editor, proceed? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (eos::select-debugger-frame (selected-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (eos::dbx)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 ;; Communication commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (defun eos::spider-do-callback (msg pat)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 ;; Callback after processing a spider_do request
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (eos::insert-on-debugger-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (format "%s" (get-tooltalk-message-attribute msg 'arg_val 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (get-face 'bold))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (destroy-tooltalk-message msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (defvar eos::last-command-was-print nil "(eos:: internal)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (defun eos::spro_spider_output (msg pat)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 ;; For spider output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (let ((s (get-tooltalk-message-attribute msg 'arg_val 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (err (get-tooltalk-message-attribute msg 'arg_val 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (message (format "%s" s))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (eos::insert-on-debugger-buffer (format "%s" s)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (get-face 'default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 (if (and err (not (string-equal err "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 (eos::insert-on-debugger-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (insert (format "STDERR> %s" err))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (get-face 'default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 (destroy-tooltalk-message msg)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 (defun eos::spro_spider_output-common (msg pat)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 ;; For spider output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 (if eos::last-command-was-print
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 (eos::spro_spider_print_output msg pat)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 (eos::spro_spider_output msg pat)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 (defmacro eos::spider-tt-args (cmd spider-id clique-id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (` (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 'class TT_REQUEST
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 'address TT_HANDLER
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 'scope TT_SESSION
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 'handler (, spider-id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 'op "SPRO_SPIDER_DO"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 'callback 'eos::spider-do-callback
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 'args (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (list 'TT_IN (, clique-id) "Context_ID")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (list 'TT_IN (, cmd) "string")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 (list 'TT_OUT))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (defun eos::send-spider-do-msg (cmd spider-id clique-id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 ;; Send CMD, a string, to SPIDER-ID, using CLIQUE-ID
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 (let ((msg (make-tooltalk-message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 (eos::spider-tt-args cmd spider-id clique-id))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (setq eos::last-command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 (eos::insert-on-debugger-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 cmd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 (get-face 'italic)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 eos::last-command))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 (setq eos::current-command eos::last-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (send-tooltalk-message msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 (destroy-tooltalk-message msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 (defvar eos::no-connection-box
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 '("XEmacs does not know the ID of a debugger to connect to.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 You may need to reissue a debug or attach command from the debugger.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 Consult the introduction to Eos (Help->SPARCworks...) for more details."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 ["Dismiss" (message "Command aborted") t]))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 (defun eos::send-spider-current-do-msg (cmd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 ;; Send CMD to the current dbx engine using the current debugger clique;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 ;;The cmd ends in a new-line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (if (null eos::current-debugger-clique-id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 (popup-dialog-box eos::no-connection-box)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (eos::send-spider-do-msg cmd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 eos::current-dbx-proc-id
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 eos::current-debugger-clique-id)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (defun eos::dbx-cmd (arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 "Send CMD to the current dbx engine using the current debugger clique;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 The cmd does not end in a new-line; a new-line will be added"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (interactive "sDbx cmd: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (eos::send-spider-current-do-msg (concat arg "\n")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 ;; Extra patterns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 (defvar eos::dbx-extra-pattern-list nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 (defun eos::debugger-extra-startup ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 ;; Actions to do at startup for eos-debugger-extra.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (setq eos::dbx-extra-pattern-list ; list of extra TT patterns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 (eos::create-debugger-extra-patterns))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (eos::ensure-available-print-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (eos::define-prefix-map) ; initialize keymap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (defun eos::create-debugger-extra-patterns ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 ;; returns a list of patterns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (make-an-observer "SPRO_SPIDER_OUTPUT" 'eos::spro_spider_output-common)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 (defun eos::register-debugger-extra-patterns ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 ;; register additional dbx patterns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (mapcar 'register-tooltalk-pattern eos::dbx-extra-pattern-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (defun eos::unregister-debugger-extra-patterns ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 ;; unregister additional dbx patterns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (mapcar 'unregister-tooltalk-pattern eos::dbx-extra-pattern-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 ;; Common commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (defun eos::type () (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 (if (eq eos::dbx-or-debugger 'debugger)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (call-interactively 'eos::dbx-cmd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 (if (buffer-live-p eos::dbx-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 (switch-to-buffer eos::dbx-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (message "no dbx subprocess buffer known"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 (defun eos::run () (interactive) (eos::dbx-cmd "run"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (defun eos::fix () (interactive) (eos::dbx-cmd "fix"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 (defun eos::build () (interactive) (eos::dbx-cmd "make"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 (defun eos::cont () (interactive) (eos::dbx-cmd "cont"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 (defun eos::cont-and-dismiss () (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 (eos::dismiss-print-frame) (eos::cont))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 (defun eos::clear-all () (interactive) (eos::dbx-cmd "clear"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 (defun eos::next () (interactive) (eos::dbx-cmd "next"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (defun eos::next-and-dismiss () (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (eos::dismiss-print-frame) (eos::next))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (defun eos::step () (interactive) (eos::dbx-cmd "step"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 (defun eos::step-and-dismiss () (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 (eos::dismiss-print-frame) (eos::step))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 (defun eos::step-up () (interactive) (eos::dbx-cmd "step up"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 (defun eos::up () (interactive) (eos::dbx-cmd "up" ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 (defun eos::down () (interactive) (eos::dbx-cmd "down"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 (defun eos::pop () (interactive) (eos::dbx-cmd "pop"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (defun eos::stop-at ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 (let ((name (buffer-file-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 (if (null name) (error "Buffer has no associated file"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 (eos::dbx-cmd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 (format "stop at \"%s\":%d" name (eos::line-at (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 (defun eos::clear-at ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 (let ((name (buffer-file-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 (if (null name) (error "Buffer has no associated file"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 (eos::dbx-cmd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (format "clear \"%s\":%d" name (eos::line-at (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (defun eos::stop-in ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (eos::dbx-cmd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 (format "stop in %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 (if (eq 'x (device-type (selected-device)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 (x-get-selection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (buffer-substring (point) (mark)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (setq zmacs-region-stays t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 (defun eos::func ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (eos::dbx-cmd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (format "func %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (if (eq 'x (device-type (selected-device)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (x-get-selection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (buffer-substring (point) (mark)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (setq zmacs-region-stays t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (defun eos::cont-to ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 (let ((name (buffer-file-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 (if (null name) (error "Buffer has no associated file"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 (eos::dbx-cmd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (format "stop at \"%s\":%d -temp; cont" name (eos::line-at (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 (defun eos::print-normal ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 (eos::dbx-cmd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 (format "print %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 (if (eq 'x (device-type (selected-device)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 (x-get-selection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 (buffer-substring (point) (mark)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 (setq zmacs-region-stays t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 (defun eos::print*-normal ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 (eos::dbx-cmd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 (format "print *(%s)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 (if (eq 'x (device-type (selected-device)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 (x-get-selection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 (buffer-substring (point) (mark)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 (setq zmacs-region-stays t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 ;; specialization for print commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 (defun eos::send-spider-print-msg (expr)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 ;; Print EXPR using separate frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 (setq eos::last-command-was-print t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 (eos::dbx-cmd (format "print %s" expr)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 (defun eos::send-spider-print*-msg (expr)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 ;; Send *EXPR using separate frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 (setq eos::last-command-was-print t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 (eos::dbx-cmd (format "print *(%s)" expr)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 (defun eos::print () (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 (eos::send-spider-print-msg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 (if (eq 'x (device-type (selected-device)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 (x-get-selection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 (buffer-substring (point) (mark)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 (setq zmacs-region-stays t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 (defun eos::print* () (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 (eos::send-spider-print*-msg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 (if (eq 'x (device-type (selected-device)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 (x-get-selection)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 (buffer-substring (point) (mark)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 (setq zmacs-region-stays t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 ;; Print on separate frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 (defun eos::buffer-line-size (buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 (or (bufferp buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 (setq buffer (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 (switch-to-buffer buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 (eos::line-at (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 ;; Handling of a collection of print frames
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 ;; (currently only one)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 (defvar eos::print-frame nil "Frame for prints")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 (defvar eos::print-buffer " *Eos Print Output*" "Buffer for prints")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 (defun eos::new-available-print-frame()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 ;; returns an available print frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 ;; currently just returns the one frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 (require 'eos-toolbar "sun-eos-toolbar")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 (let ((scr (selected-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 (buf (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 ;; create frames
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 (if (and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 (frame-live-p eos::print-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 (or (not (frame-live-p eos::debugger-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 (not (eq eos::print-frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 eos::debugger-frame))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 (make-frame-visible eos::print-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 eos::print-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 (setq eos::print-frame (make-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 ;; no modeline visible...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 (set-face-background 'modeline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 (face-background (get-face 'default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 eos::print-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 (set-face-foreground 'modeline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 (face-background (get-face 'default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 eos::print-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 ;; there is redundancy below.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 (select-frame eos::print-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 (switch-to-buffer eos::print-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 (set-buffer-menubar nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 (add-spec-to-specifier (eos::toolbar-position) eos::print-toolbar (selected-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 (add-spec-to-specifier has-modeline-p nil (selected-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 (select-frame scr)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 (switch-to-buffer buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 eos::print-frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 ;; set delete-frame-hook and check for this frame... then do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 (defun eos::ensure-available-print-frame ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 ;; ensures that there is at least one available print frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 (defun eos::show-print-frame ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 (setq eos::print-frame (eos::new-available-print-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 (select-frame eos::print-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 (switch-to-buffer eos::print-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 (set-frame-height eos::print-frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 (+ 1 (eos::buffer-line-size eos::print-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 (defun eos::dismiss-print-frame ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 (if (frame-live-p eos::print-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 (make-frame-invisible eos::print-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 (select-frame (car (visible-frame-list))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 ;; print output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 (defun eos::spro_spider_print_output (msg pat)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 ;; For spider print output (switched with spro_spider_output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 (let ((buf (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 (scr (selected-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 (save-excursion ; does not work in callbacks?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 (switch-to-buffer eos::print-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 (delete-region (point-min) (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 (insert (format "%s" (get-tooltalk-message-attribute msg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 'arg_val 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 (let ((err (get-tooltalk-message-attribute msg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 'arg_val 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 (if (and err (not (string-equal err "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 (insert (format "STDERR> %s" err))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 (eos::show-print-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 (select-frame scr)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 (switch-to-buffer buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 (destroy-tooltalk-message msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 (setq eos::last-command-was-print nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 ;; User interface
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 (defvar eos::prefix-map (make-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 (defun eos::define-prefix-map ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 (define-key eos::prefix-map "%" 'eos::dbx-cmd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 (define-key eos::prefix-map "r" 'eos::run)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 (define-key eos::prefix-map "f" 'eos::fix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 (define-key eos::prefix-map "p" 'eos::print)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 (define-key eos::prefix-map "\C-p" 'eos::print*)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 (define-key eos::prefix-map "c" 'eos::cont)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 (define-key eos::prefix-map "b" 'eos::stop-at)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 (define-key eos::prefix-map "\C-b" 'eos::clear-at)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 (define-key eos::prefix-map "n" 'eos::next)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 (define-key eos::prefix-map "s" 'eos::step)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 (define-key eos::prefix-map "\C-s" 'eos::step-up)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 (define-key eos::prefix-map "u" 'eos::up)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 (define-key eos::prefix-map "d" 'eos::down)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 (defun eos::set-key-mode (mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 ;; Set the key MODE to either 'none, 'prefix, or 'function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 (setq eos::key-mode mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 ((eq eos::key-mode 'none)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 (define-key global-map "\C-cd" nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 (eos::remove-function-keys)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 (add-submenu nil (append '("SPARCworks") eos::short-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 ((eq eos::key-mode 'prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 (define-key global-map "\C-cd" eos::prefix-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 (eos::remove-function-keys)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 (add-submenu nil (append '("SPARCworks") eos::long-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 ((eq eos::key-mode 'function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 (define-key global-map "\C-cd" nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 (eos::add-function-keys)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 (add-submenu nil (append '("SPARCworks") eos::long-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 (error "unimplemented")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 (defun eos::add-function-keys ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 (global-set-key [f6] 'eos::dbx-cmd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 (global-set-key [(control f6)] 'eos::run)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 (global-set-key [(shift f6)] 'eos::fix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 (global-set-key [f7] 'eos::print)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 (global-set-key [(control f7)] 'eos::print*)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 (global-set-key [(shift f7)] 'eos::dismiss-print-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 (global-set-key [f8] 'eos::cont)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 (global-set-key [(control f8)] 'eos::stop-at)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 (global-set-key [(shift f8)] 'eos::clear-at)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 (global-set-key [f9] 'eos::next)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 (global-set-key [(control f9)] 'eos::step)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 (global-set-key [(shift f9)] 'eos::step-up)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 (defun eos::remove-function-keys ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 (global-set-key [f6] nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 (global-set-key [(control f6)] nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 (global-set-key [(shift f6)] nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 (global-set-key [f7] nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 (global-set-key [(control f7)] nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 (global-set-key [(shift f7)] nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 (global-set-key [f8] nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 (global-set-key [(control f8)] nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 (global-set-key [(shift f8)] nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 (global-set-key [f9] nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 (global-set-key [(control f9)] nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 (global-set-key [(shift f9)] nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 ;; Provides popup access
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 (defvar eos::popup-mode nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 (defvar eos::saved-global-popup-menu nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 (defun eos::toggle-popup-menu ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 ;; Toggle whether to use or not popup menus for SPARCworks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 (if eos::popup-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 (setq global-popup-menu eos::saved-global-popup-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 (eos::push-popup-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 (setq eos::popup-mode (null eos::popup-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 (defun eos::push-popup-menu ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 (setq eos::saved-global-popup-menu global-popup-menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 (setq global-popup-menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 (append
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 '("SPARCworks Command"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839 ["Stop At" eos::stop-at t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 ["Clear At" eos::clear-at t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 ["Stop In" eos::stop-in t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 ["Cont To" eos::cont-to t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 ["Print" eos::print t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 ["Print*" eos::print* t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 "---"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 ["Read a Dbx Command" eos::dbx-cmd t]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 "---")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 eos::saved-global-popup-menu))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 (provide 'eos-debugger)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 ;;; sun-eos-debugger.el ends here