[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ilisp + dbl
On Sat, 2 May 92 13:45:11 JST, weigert@etl.go.jp (Thomas Weigert) said:
TW> I finally broke down and installed Ilisp to run akcl under.
TW> Sadly enough it turns out that there is no support for dbl
TW> provided. It would really hurt to not have access to dbl, so
TW> I guess I am saddled with rewriting dbl.el to just be an
TW> extension to ilisp-mode, rather than being its own mode.
TW> However, it seems that lots of people must have had the same
TW> problem. Probably there already exists an dbl+ilisp
TW> integration. If so, I would appreciate any info on that.
Well, I have hacked the dbl.el file, in order for the above
to work. I hope I did not make any big mistakes, but it
seems to work for me. Note that I had to rename the keys for
next, step, and continue, since they overlap with existing
comint commands.
Anyways, I include the patches below, in case somebody is
interested. If there are better solutions, I would
appreciate hearing about them.
Thomas.
--------------------- patch to dbl.el included ----------------------
*** dbl.el Thu Apr 2 13:58:34 1992
--- ilisp/dbl-ilisp.el Mon May 4 17:04:01 1992
***************
*** 2,8 ****
;; Author: W. Schelter, University of Texas
;; wfs@rascal.ics.utexas.edu
;; Rewritten by rms.
!
;; Some ideas are due to Masanobu.
;; This file is part of GNU Emacs.
--- 2,13 ----
;; Author: W. Schelter, University of Texas
;; wfs@rascal.ics.utexas.edu
;; Rewritten by rms.
! ;;
! ;; Some minor changes to allow dbl to be used together with ilisp.
! ;; (Involves mainly removing dbl as a major mode, and to add dbl
! ;; bindings to ilisp-mode)
! ;; Added by weigert@mcs.anl.gov, Mai 1992.
! ;;
;; Some ideas are due to Masanobu.
;; This file is part of GNU Emacs.
***************
*** 29,40 ****
;; other. A small arrow in the source window, indicates the current
;; line.
! ;; Starting up:
!
! ;; In order to use this facility, invoke the command DBL to obtain a
! ;; shell window with the appropriate command bindings. You will be asked
! ;; for the name of a file to run. Dbl will be invoked on this file, in a
! ;; window named *dbl-foo* if the file is foo.
;; M-s steps by one line, and redisplays the source file and line.
--- 34,48 ----
;; other. A small arrow in the source window, indicates the current
;; line.
! ;; In order to use this facility, name this file dbl-ilisp.el, and add
! ;; soomething like the following to your .emacs, or call dbl anytime
! ;; after the inferior lisp process has been started up.
! ;; (autoload 'dbl "dbl-ilisp" "Run the dbl lisp debugger" t nil)
! ;; (setq ilisp-load-hook
! ;; '(lambda ()
! ;; (add-hook 'ilisp-init-hook
! ;; (function (lambda () (dbl)))))
! ;; )
;; M-s steps by one line, and redisplays the source file and line.
***************
*** 56,76 ****
;; dbl-display-frame is invoked automatically when a filename-and-line-number
;; appears in the output.
-
- (require 'shell)
(require 'akcl)
(defvar dbl-prompt-pattern "\\(^(.*gdb[+]*) *\\)\\|\\(^[^#$%>]*[#$%>]+ *\\)"
"A regexp to recognize the prompt for dbl or dbl+.")
! (defvar dbl-mode-map nil
! "Keymap for dbl-mode.")
!
! (if dbl-mode-map
! nil
! (setq dbl-mode-map (copy-keymap shell-mode-map))
! (define-key dbl-mode-map "\C-cl" 'dbl-find-line)
! )
(define-key ctl-x-map " " 'dbl-break)
;(define-key ctl-x-map "&" 'send-dbl-command)
--- 64,75 ----
;; dbl-display-frame is invoked automatically when a filename-and-line-number
;; appears in the output.
(require 'akcl)
(defvar dbl-prompt-pattern "\\(^(.*gdb[+]*) *\\)\\|\\(^[^#$%>]*[#$%>]+ *\\)"
"A regexp to recognize the prompt for dbl or dbl+.")
! (define-key ilisp-mode-map "\C-c\C-l" 'dbl-find-line)
(define-key ctl-x-map " " 'dbl-break)
;(define-key ctl-x-map "&" 'send-dbl-command)
***************
*** 88,110 ****
(or doc "")
'(interactive "p")
(list 'dbl-call cstr))
! (list 'define-key 'dbl-mode-map key (list 'quote fun)))))
! (def-dbl ":step" "\M-s" "Step one source line with display")
! (def-dbl ":step" "\M-i" "Step one instruction with display")
! (def-dbl ":next" "\M-n" "Step one source line (skip functions)")
! (def-dbl ":r" "\M-c" "Continue with display")
(def-dbl "finish" "\C-c\C-f" "Finish executing current function")
! (def-dbl ":up" "\M-u" "Go up N stack frames (numeric arg) with display")
! (def-dbl ":down" "\M-d" "Go down N stack frames (numeric arg) with display")
(defun dbl-mode ()
"Major mode for interacting with an inferior Dbl process.
The following commands are available:
! \\{dbl-mode-map}
\\[dbl-display-frame] displays in the other window
the last line referred to in the dbl buffer.
--- 87,111 ----
(or doc "")
'(interactive "p")
(list 'dbl-call cstr))
! (list 'define-key 'ilisp-mode-map key (list 'quote fun)))))
! ;;; Note that these bindings conflict with compint-prev-similar-input and
! ;;; comint-next-input
! (def-dbl ":step" "\M-\C-s" "Step one source line with display")
! (def-dbl ":next" "\M-\C-n" "Step one source line (skip functions)")
! (def-dbl ":r" "\M-\C-c" "Continue with display")
(def-dbl "finish" "\C-c\C-f" "Finish executing current function")
! (def-dbl ":up" "\M-u" "Go up N stack frames (numeric arg) with display")
! (def-dbl ":down" "\M-d" "Go down N stack frames (numeric arg) with display")
+
(defun dbl-mode ()
"Major mode for interacting with an inferior Dbl process.
The following commands are available:
! \\{ilisp-mode-map}
\\[dbl-display-frame] displays in the other window
the last line referred to in the dbl buffer.
***************
*** 117,123 ****
at, by doing \\[dbl-break].
Commands:
! Many commands are inherited from shell mode.
Additionally we have:
\\[dbl-display-frame] display frames file in other window
--- 118,124 ----
at, by doing \\[dbl-break].
Commands:
! Many commands are inherited from ilisp mode.
Additionally we have:
\\[dbl-display-frame] display frames file in other window
***************
*** 126,136 ****
\\[send-dbl-command] used for special printing of an arg at the current point.
C-x SPACE sets break point at current line."
(interactive)
! (kill-all-local-variables)
! (setq major-mode 'dbl-mode)
! (setq mode-name "Inferior Dbl")
! (setq mode-line-process '(": %s"))
! (use-local-map dbl-mode-map)
(make-local-variable 'last-input-start)
(setq last-input-start (make-marker))
(make-local-variable 'last-input-end)
--- 127,133 ----
\\[send-dbl-command] used for special printing of an arg at the current point.
C-x SPACE sets break point at current line."
(interactive)
! (use-local-map ilisp-mode-map)
(make-local-variable 'last-input-start)
(setq last-input-start (make-marker))
(make-local-variable 'last-input-end)
***************
*** 143,182 ****
(setq dbl-delete-prompt-marker nil)
(make-local-variable 'dbl-filter-accumulator)
(setq dbl-filter-accumulator nil)
! (make-local-variable 'shell-prompt-pattern)
! (setq shell-prompt-pattern dbl-prompt-pattern)
! (run-hooks 'shell-mode-hook 'dbl-mode-hook))
(defvar current-dbl-buffer nil)
! (defvar dbl-command-name "/bin/csh"
! "Pathname for executing dbl.")
!
!
! (defun dbl (arg)
" makes a dbl buffer, suitable for running an inferior akcl.
It has special keybindings for stepping and viewing sources.
Once in the buffer invoke the lisp. Enter the debug loop with
! (si::dbl) or :dbl in a debug loop.
! " (interactive "sName: ")
! (let ((file arg) tem
! (dir default-directory))
! (switch-to-buffer (concat "*dbl-" file "*"))
! (setq default-directory
! (if (and (setq tem (file-name-directory file))
! (file-directory-p tem))
! tem dir))
! (or (bolp) (newline))
! (insert "Current directory is " default-directory "\n")
! (make-shell (concat "dbl-" file) dbl-command-name nil )
! (dbl-mode)
! (set-process-filter (get-buffer-process (current-buffer)) 'dbl-filter)
! (set-process-sentinel (get-buffer-process (current-buffer)) 'dbl-sentinel)
! (dbl-set-buffer)))
(defun dbl-set-buffer ()
! (cond ((eq major-mode 'dbl-mode)
! (setq current-dbl-buffer (current-buffer)))))
;; This function is responsible for inserting output from DBL
;; into the buffer.
--- 140,162 ----
(setq dbl-delete-prompt-marker nil)
(make-local-variable 'dbl-filter-accumulator)
(setq dbl-filter-accumulator nil)
! (run-hooks 'dbl-mode-hook))
(defvar current-dbl-buffer nil)
! (defun dbl ()
" makes a dbl buffer, suitable for running an inferior akcl.
It has special keybindings for stepping and viewing sources.
Once in the buffer invoke the lisp. Enter the debug loop with
! (si::dbl) or :dbl in a debug loop."
! (interactive)
! (dbl-mode)
! (set-process-filter (get-buffer-process (current-buffer)) 'dbl-filter)
! (set-process-sentinel (get-buffer-process (current-buffer)) 'dbl-sentinel)
! (dbl-set-buffer))
(defun dbl-set-buffer ()
! (setq current-dbl-buffer (current-buffer)))
;; This function is responsible for inserting output from DBL
;; into the buffer.