aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2003-06-18 22:36:40 +0000
committerNick Roberts2003-06-18 22:36:40 +0000
commitdeaef2892996cd45d1cd00eca41db93238e20003 (patch)
tree2d090517aebf3c516009880889e729a003b67734
parentf6bf87c5a1f8f119c4e5f8a9da9d42505479fde3 (diff)
downloademacs-deaef2892996cd45d1cd00eca41db93238e20003.tar.gz
emacs-deaef2892996cd45d1cd00eca41db93238e20003.zip
(gud-menu-map): Add dbx support for "run" and
"nexti". (dbx): Define gud-nexti and gud-run. (gud-find-expr, gud-find-fortran-expr): New functions. (gud-find-expr): New variable. (gud-find-c-expr): Simplify.
-rw-r--r--lisp/progmodes/gud.el52
1 files changed, 32 insertions, 20 deletions
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 7df9155ca01..e449553fd9b 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -95,7 +95,7 @@ Used to grey out relevant toolbar icons.")
95 '(([refresh] "Refresh" . gud-refresh) 95 '(([refresh] "Refresh" . gud-refresh)
96 ([run] menu-item "Run" gud-run 96 ([run] menu-item "Run" gud-run
97 :enable (and (not gud-running) 97 :enable (and (not gud-running)
98 (memq gud-minor-mode '(gdba gdb jdb)))) 98 (memq gud-minor-mode '(gdba gdb dbx jdb))))
99 ([goto] menu-item "Continue to selection" gud-until 99 ([goto] menu-item "Continue to selection" gud-until
100 :enable (and (not gud-running) 100 :enable (and (not gud-running)
101 (memq gud-minor-mode '(gdba gdb)))) 101 (memq gud-minor-mode '(gdba gdb))))
@@ -129,7 +129,7 @@ Used to grey out relevant toolbar icons.")
129 ([nexti] menu-item "Next Instruction" gud-nexti 129 ([nexti] menu-item "Next Instruction" gud-nexti
130 :enable (and (not gud-running) 130 :enable (and (not gud-running)
131 (memq gud-minor-mode 131 (memq gud-minor-mode
132 '(gdba gdb)))) 132 '(gdba gdb dbx))))
133 ([step] menu-item "Step Line" gud-step 133 ([step] menu-item "Step Line" gud-step
134 :enable (not gud-running)) 134 :enable (not gud-running))
135 ([next] menu-item "Next Line" gud-next 135 ([next] menu-item "Next Line" gud-next
@@ -1053,8 +1053,10 @@ and source-file directory for your debugger."
1053 (gud-def gud-step "step %p" "\C-s" "Step one line with display.") 1053 (gud-def gud-step "step %p" "\C-s" "Step one line with display.")
1054 (gud-def gud-stepi "stepi %p" "\C-i" "Step one instruction with display.") 1054 (gud-def gud-stepi "stepi %p" "\C-i" "Step one instruction with display.")
1055 (gud-def gud-next "next %p" "\C-n" "Step one line (skip functions).") 1055 (gud-def gud-next "next %p" "\C-n" "Step one line (skip functions).")
1056 (gud-def gud-nexti "nexti %p" nil "Step one instruction (skip functions).")
1056 (gud-def gud-cont "cont" "\C-r" "Continue with display.") 1057 (gud-def gud-cont "cont" "\C-r" "Continue with display.")
1057 (gud-def gud-print "print %e" "\C-p" "Evaluate C expression at point.") 1058 (gud-def gud-print "print %e" "\C-p" "Evaluate C expression at point.")
1059 (gud-def gud-run "run" nil "Run the program.")
1058 1060
1059 (setq comint-prompt-regexp "^[^)\n]*dbx) *") 1061 (setq comint-prompt-regexp "^[^)\n]*dbx) *")
1060 (setq paragraph-start comint-prompt-regexp) 1062 (setq paragraph-start comint-prompt-regexp)
@@ -2578,7 +2580,7 @@ Obeying it means displaying in another window the specified file and line."
2578 (if (bolp) 1 0))) 2580 (if (bolp) 1 0)))
2579 (cdr frame))))) 2581 (cdr frame)))))
2580 ((eq key ?e) 2582 ((eq key ?e)
2581 (setq subst (gud-find-c-expr))) 2583 (setq subst (gud-find-expr)))
2582 ((eq key ?a) 2584 ((eq key ?a)
2583 (setq subst (gud-read-address))) 2585 (setq subst (gud-read-address)))
2584 ((eq key ?c) 2586 ((eq key ?c)
@@ -2652,21 +2654,31 @@ Obeying it means displaying in another window the specified file and line."
2652 (gud-display-frame) 2654 (gud-display-frame)
2653 (recenter arg)) 2655 (recenter arg))
2654 2656
2655;; Code for parsing expressions out of C code. The single entry point is 2657;; Code for parsing expressions out of C or Fortran code. The single entry
2656;; find-c-expr, which tries to return an lvalue expression from around point. 2658;; point is gud-find-expr, which tries to return an lvalue expression from
2657;; 2659;; around point.
2658;; The rest of this file is a hacked version of gdbsrc.el by 2660
2661(defvar gud-find-expr 'gud-find-c-expr)
2662
2663(defun gud-find-expr (&rest args)
2664 (apply gud-find-expr args))
2665
2666(defun gud-find-fortran-expr ()
2667 ;; Consider \n as punctuation (end of expression).
2668 (with-syntax-table fortran-gud-syntax-table
2669 (gud-find-c-expr)))
2670
2671;; The next eight functions are hacked from gdbsrc.el by
2659;; Debby Ayers <ayers@asc.slb.com>, 2672;; Debby Ayers <ayers@asc.slb.com>,
2660;; Rich Schaefer <schaefer@asc.slb.com> Schlumberger, Austin, Tx. 2673;; Rich Schaefer <schaefer@asc.slb.com> Schlumberger, Austin, Tx.
2661 2674
2662(defun gud-find-c-expr () 2675(defun gud-find-c-expr ()
2663 "Returns the C expr that surrounds point." 2676 "Returns the expr that surrounds point."
2664 (interactive) 2677 (interactive)
2665 (save-excursion 2678 (save-excursion
2666 (let (p expr test-expr) 2679 (let ((p (point))
2667 (setq p (point)) 2680 (expr (gud-innermost-expr))
2668 (setq expr (gud-innermost-expr)) 2681 (test-expr (gud-prev-expr)))
2669 (setq test-expr (gud-prev-expr))
2670 (while (and test-expr (gud-expr-compound test-expr expr)) 2682 (while (and test-expr (gud-expr-compound test-expr expr))
2671 (let ((prev-expr expr)) 2683 (let ((prev-expr expr))
2672 (setq expr (cons (car test-expr) (cdr expr))) 2684 (setq expr (cons (car test-expr) (cdr expr)))
@@ -2786,14 +2798,14 @@ Link exprs of the form:
2786 ((= (cdr first) (cdr second)) nil) 2798 ((= (cdr first) (cdr second)) nil)
2787 ((= syntax ?.) t) 2799 ((= syntax ?.) t)
2788 ((= syntax ?\ ) 2800 ((= syntax ?\ )
2789 (setq span-start (char-after (- span-start 1))) 2801 (setq span-start (char-after (- span-start 1)))
2790 (setq span-end (char-after span-end)) 2802 (setq span-end (char-after span-end))
2791 (cond 2803 (cond
2792 ((= span-start ?)) t) 2804 ((= span-start ?)) t)
2793 ((= span-start ?]) t) 2805 ((= span-start ?]) t)
2794 ((= span-end ?() t) 2806 ((= span-end ?() t)
2795 ((= span-end ?[) t) 2807 ((= span-end ?[) t)
2796 (t nil))) 2808 (t nil)))
2797 (t nil)))) 2809 (t nil))))
2798 2810
2799(defun gud-find-class (f line) 2811(defun gud-find-class (f line)