• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/progmodes/

Lines Matching +defs:file +defs:name +defs:handler +defs:alist

10 ;; This file is part of GNU Emacs.
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
38 ;; gud-gdb-command-name, then start it with M-x gdba.
40 ;; This file has evolved from gdba.el that was included with GDB 5.0 and
48 ;; it. Some GDB/MI commands are used in this file through the CLI command
49 ;; 'interpreter mi <mi-command>'. A file called gdb-mi.el is included with
103 (defvar speedbar-initial-expansion-list-name)
119 (defvar gdb-main-file nil "Source file from which program execution begins.")
125 (defvar gdb-location-alist nil
185 (defvar gdb-source-file-list nil
193 (1 font-lock-variable-name-face)
198 (1 font-lock-variable-name-face)
202 (1 font-lock-variable-name-face))
210 (1 font-lock-variable-name-face)
224 and source-file directory for your debugger.
229 other with the source file with the main routine of the inferior.
297 (defcustom gdb-cpp-define-alist-program "gcc -E -dM -"
298 "Shell command for generating a list of defined macros in a source file.
303 Set `gdb-cpp-define-alist-flags' for any include paths or
309 (defcustom gdb-cpp-define-alist-flags ""
310 "Preprocessor flags for `gdb-cpp-define-alist-program'."
316 "Non-nil means display source file containing the main routine at startup.
325 buffer and the other with the source file with the main routine
340 (if (and buffer (buffer-name buffer))
359 (buffer-name gud-comint-buffer))
375 (buffer-name gud-comint-buffer))
379 (kill-buffer (gdb-inferior-io-name)))
382 (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.")
384 (defun gdb-create-define-alist ()
385 "Create an alist of #define directives for GUD tooltips."
386 (let* ((file (buffer-file-name))
390 (call-process shell-file-name
391 (if (file-exists-p file) file nil)
393 (concat gdb-cpp-define-alist-program " "
394 gdb-cpp-define-alist-flags)))))
395 (define-list (split-string output "\n" t)) (name))
396 (setq gdb-define-alist nil)
398 (setq name (nth 1 (split-string define "[( ]")))
399 (push (cons name define) gdb-define-alist))))
425 (defconst gdb-source-file-regexp "\\(.+?\\), \\|\\([^, \n].*$\\)")
431 (while (re-search-forward gdb-source-file-regexp nil t)
432 (push (file-name-nondirectory (or (match-string 1) (match-string 2)))
433 gdb-source-file-list))
436 (when (and buffer-file-name
437 (member (file-name-nondirectory buffer-file-name)
438 gdb-source-file-list))
442 (make-local-variable 'gdb-define-alist)
443 (gdb-create-define-alist)
444 (add-hook 'after-save-hook 'gdb-create-define-alist nil t))))))
446 (propertize "ready" 'face font-lock-variable-name-face)))
469 (gud-def gud-break (if (not (string-match "Machine" mode-name))
477 (gud-def gud-remove (if (not (string-match "Machine" mode-name))
485 (gud-def gud-until (if (not (string-match "Machine" mode-name))
543 gdb-main-file nil
552 gdb-location-alist nil
553 gdb-source-file-list nil
591 (list "server interpreter mi \"-file-list-exec-source-files\"\n"
595 ;; Find source file and compilation directory here.
687 With arg, enter name of variable to be watched in the minibuffer."
710 `(lambda () (gdb-var-create-handler ,expr)))))))
714 "name=\"\\(.*?\\)\",.*numchild=\"\\(.*?\\)\",\\(?:.*value=\\(\".*\"\\),\\)?.*type=\"\\(.*?\\)\"")
716 (defun gdb-var-create-handler (expr)
731 speedbar-initial-expansion-list-name "GUD")
741 `(lambda () (gdb-var-evaluate-expression-handler
760 (defun gdb-var-evaluate-expression-handler (varnum changed)
774 `(lambda () (gdb-var-list-children-handler ,varnum)))))
777 "child={.*?name=\"\\(.*?\\)\",.*?exp=\"\\(.*?\\)\",.*?\
780 (defun gdb-var-list-children-handler (varnum)
802 `(lambda () (gdb-var-evaluate-expression-handler
811 'gdb-var-update-handler))
815 "{.*?name=\"\\(.*?\\)\",.*?in_scope=\"\\(.*?\\)\",.*?\
818 (defun gdb-var-update-handler ()
834 `(lambda () (gdb-var-evaluate-expression-handler ,varnum t))))))))
881 `(lambda () (gdb-edit-value-handler ,value))))))
883 (defun gdb-edit-value-handler (value)
907 (if (and gud-comint-buffer (buffer-name gud-comint-buffer))
934 gud-target-name))
963 (name (funcall (gdb-rules-name-maker rules)))
964 (new (get-buffer-create name)))
976 (defun gdb-rules-name-maker (rules) (car (cdr rules)))
992 ;; NAME - Return a name for this buffer type.
1014 'gdb-partial-output-name)
1016 (defun gdb-partial-output-name ()
1024 'gdb-inferior-io-name
1027 (defun gdb-inferior-io-name ()
1051 (special-display-frame-alist gdb-frame-parameters))
1070 (substring (buffer-name) 1 (- (length (buffer-name)) 1))
1100 "Send end-of-file to the program being debugged."
1117 ;; The handler function will be called from the partial-output buffer when the
1197 (defcustom gud-gdba-command-name "gdb -annotate=3"
1239 ;; Do not use this except as an annotation handler.
1253 "An annotation handler for `pre-prompt'.
1267 "An annotation handler for `prompt'.
1271 (propertize "initializing..." 'face font-lock-variable-name-face))
1279 (let ((handler
1282 (funcall handler))))
1294 "An annotation handler for non-top-level prompts."
1298 "An annotation handler for `starting'.
1330 "An annotation handler for `breakpoint' and other annotations.
1343 "An annotation handler for `exited' and `signalled'.
1398 "An annotation handler for `stopped'.
1438 "An annotation handler for `post-prompt'.
1449 ;; Do this through gdb-get-selected-frame -> gdb-frame-handler
1499 (gud-find-file (car gud-last-last-frame)))))
1544 ;; Call the handler for this annotation.
1633 ;; NAME is the function name. DEMAND-PREDICATE tests if output is really needed.
1637 (defmacro def-gdb-auto-update-trigger (name demand-predicate gdb-command
1638 output-handler)
1639 `(defun ,name (&optional ignored)
1641 (not (member ',name
1645 (list ,gdb-command ',output-handler))
1646 (push ',name gdb-pending-triggers)))))
1648 (defmacro def-gdb-auto-update-handler (name trigger buf-key custom-defun)
1649 `(defun ,name ()
1669 trigger-name gdb-command
1670 output-handler-name custom-defun)
1672 (def-gdb-auto-update-trigger ,trigger-name
1676 ,output-handler-name)
1677 (def-gdb-auto-update-handler ,output-handler-name
1678 ,trigger-name ,buffer-key ,custom-defun)))
1686 'gdb-breakpoints-buffer-name
1693 ;; It defines a function to serve as the annotation handler that
1700 ;; This also defines a function to be the handler for the output
1703 gdb-info-breakpoints-handler
1802 (not (string-match "\\` ?\\*.+\\*\\'" (buffer-name))))
1825 '(face font-lock-function-name-face))
1828 (file (match-string 1)))
1832 (unless (file-exists-p file)
1833 (setq file (cdr (assoc bptno gdb-location-alist))))
1834 (if (and file
1835 (not (string-equal file "File not found")))
1837 (find-file-noselect file 'nowarn)
1861 '(face font-lock-function-name-face))
1867 '(face font-lock-variable-name-face)))))))
1933 (defun gdb-breakpoints-buffer-name ()
1947 (special-display-frame-alist gdb-frame-parameters))
1980 (setq mode-name "Breakpoints")
2021 (file (match-string 2))
2024 (let* ((buffer (find-file-noselect
2025 (if (file-exists-p file) file
2026 (cdr (assoc bptno gdb-location-alist)))))
2049 'gdb-stack-buffer-name
2055 gdb-info-stack-handler
2087 'face font-lock-function-name-face)
2091 'face font-lock-function-name-face))
2095 'face font-lock-variable-name-face))))
2108 (file (match-string 1))
2122 (with-current-buffer (gud-find-file (car gud-last-last-frame))
2123 (setq fringe-indicator-alist
2126 (defun gdb-stack-buffer-name ()
2140 (special-display-frame-alist gdb-frame-parameters))
2158 (setq mode-name "Frames")
2195 'gdb-threads-buffer-name
2201 gdb-info-threads-handler
2216 (defun gdb-threads-buffer-name ()
2230 (special-display-frame-alist gdb-frame-parameters))
2243 '((") +\\([^ ]+\\) (" (1 font-lock-function-name-face))
2244 ("in \\([^ ]+\\) (" (1 font-lock-function-name-face))
2245 ("\\(\\(\\sw\\|[_.]\\)+\\)=" (1 font-lock-variable-name-face)))
2254 (setq mode-name "Threads")
2287 'gdb-registers-buffer-name
2294 gdb-info-registers-handler
2309 'face font-lock-variable-name-face)
2341 (setq mode-name "Registers")
2347 (if gdb-all-registers (setq mode-name "Registers:All"))
2351 (defun gdb-registers-buffer-name ()
2365 (special-display-frame-alist gdb-frame-parameters))
2376 (setq mode-name "Registers")))
2379 (setq mode-name "Registers:All")))
2414 'gdb-memory-buffer-name
2421 gdb-read-memory-handler
2595 '(;; <__function.name+n>
2596 ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" (1 font-lock-function-name-face))
2606 (setq mode-name "Memory")
2676 (defun gdb-memory-buffer-name ()
2690 (special-display-frame-alist
2701 'gdb-locals-buffer-name
2707 gdb-info-locals-handler)
2736 (defun gdb-info-locals-handler ()
2777 (setq mode-name (concat "Locals:" gdb-selected-frame))
2788 (defun gdb-locals-buffer-name ()
2802 (special-display-frame-alist gdb-frame-parameters))
2897 (special-display-frame-alist
2909 (defun gdb-set-window-buffer (name)
2910 (set-window-buffer (selected-window) (get-buffer name))
2926 (gdb-set-window-buffer (gdb-locals-buffer-name))
2930 (gud-find-file (car gud-last-last-frame))
2931 (if gdb-main-file
2932 (gud-find-file gdb-main-file)
2934 ;; can't find a source file.
2943 (gdb-set-window-buffer (gdb-stack-buffer-name))
2946 (gdb-set-window-buffer (gdb-breakpoints-buffer-name))
2962 (gud-find-file (car gud-last-last-frame))
2963 (gud-find-file gdb-main-file)))
2974 (if (string-match "\\` ?\\*.+\\*\\'" (buffer-name))
2979 (kill-local-variable 'gdb-define-alist))))))
2983 (setq fringe-indicator-alist '((overlay-arrow . right-triangle)))
2991 (remove-hook 'after-save-hook 'gdb-create-define-alist t))
2994 "Find the source file where the program starts and displays it with related
2999 (setq gdb-main-file (match-string 0)))
3008 (display-buffer (gud-find-file gdb-main-file))))))
3011 "Find the directory containing the relevant source file.
3014 (catch 'file-not-found
3017 (delete (cons bptno "File not found") gdb-location-alist)
3018 (push (cons bptno (match-string 0)) gdb-location-alist))
3020 (unless (assoc bptno gdb-location-alist)
3021 (push (cons bptno "File not found") gdb-location-alist)
3022 (message-box "Cannot find source file for breakpoint location.\n\
3024 (throw 'file-not-found nil))
3026 (find-file-noselect (match-string 0))
3035 (add-hook 'find-file-hook 'gdb-find-file-hook)
3037 (defun gdb-find-file-hook ()
3038 "Set up buffer for debugging if file is part of the source code
3040 (if (and (buffer-name gud-comint-buffer)
3045 ;;Pre GDB 6.3 "info sources" doesn't give absolute file name.
3047 (file-name-nondirectory buffer-file-name)
3048 buffer-file-name)
3049 gdb-source-file-list)
3050 (with-current-buffer (find-buffer-visiting buffer-file-name)
3168 'gdb-assembler-buffer-name
3171 ;; We can't use def-gdb-auto-update-handler because we don't want to use
3173 (defun gdb-assembler-handler ()
3203 (setq fringe-indicator-alist
3239 '(;; <__function.name+n>
3241 (1 font-lock-function-name-face))
3242 ;; 0xNNNNNNNN <__function.name+n>: opcode
3246 ("%\\sw+" . font-lock-variable-name-face)
3249 (2 font-lock-function-name-face))
3259 (setq mode-name (concat "Machine:" gdb-selected-frame))
3271 (defun gdb-assembler-buffer-name ()
3287 (special-display-frame-alist gdb-frame-parameters))
3306 (if (equal (cdr item) '(gdb-assembler-handler))
3314 'gdb-assembler-handler))
3323 (list (concat gdb-server-prefix "info frame\n") 'gdb-frame-handler))
3327 (defun gdb-frame-handler ()
3342 (setq mode-name (concat "Locals:" gdb-selected-frame))))
3345 (setq mode-name (concat "Machine:" gdb-selected-frame))))
3351 (string-equal (buffer-name buffer)
3352 (file-name-nondirectory (match-string 3))))
3354 (setq fringe-indicator-alist
3367 (defconst gdb-source-file-regexp-1 "fullname=\"\\(.*?\\)\"")
3374 (while (re-search-forward gdb-source-file-regexp-1 nil t)
3375 (push (match-string 1) gdb-source-file-list))
3378 (when (member buffer-file-name gdb-source-file-list)
3383 (make-local-variable 'gdb-define-alist)
3384 (gdb-create-define-alist)
3385 (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))))
3387 (propertize "ready" 'face font-lock-variable-name-face)))
3397 `(lambda () (gdb-var-list-children-handler-1 ,varnum)))))
3400 "child={.*?name=\"\\(.+?\\)\",.*?exp=\"\\(.+?\\)\",.*?\
3404 (defun gdb-var-list-children-handler-1 (varnum)
3435 'gdb-var-update-handler-1))
3439 "{.*?name=\"\\(.*?\\)\",.*?\\(?:value=\\(\".*?\"\\),\\)?.*?\
3442 (defun gdb-var-update-handler-1 ()
3466 'gdb-registers-buffer-name
3474 gdb-data-list-register-values-handler)
3479 (defun gdb-data-list-register-values-handler ()
3527 'face font-lock-variable-name-face)
3543 'gdb-get-changed-registers-handler))
3548 (defun gdb-get-changed-registers-handler ()
3562 'gdb-locals-buffer-name
3570 gdb-stack-list-locals-handler)
3573 "{.*?name=\"\\(.*?\\)\",.*?type=\"\\(.*?\\)\"")
3605 (defun gdb-stack-list-locals-handler ()
3630 (buffer-read-only nil) (name) (value))
3633 (setq name (car local))
3637 (add-text-properties 0 (length name)
3641 name)
3648 (concat name "\t" (nth 1 local)