aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2005-03-01 10:43:05 +0000
committerNick Roberts2005-03-01 10:43:05 +0000
commit50af6c667d2f0f7dd6ff110a05bb6ed16f8bdb00 (patch)
tree5cc6e4982d88553a0088cba6b01a7c0828f77950
parent911ba5f88c5a78cfede43a264ddc97b031022929 (diff)
downloademacs-50af6c667d2f0f7dd6ff110a05bb6ed16f8bdb00.tar.gz
emacs-50af6c667d2f0f7dd6ff110a05bb6ed16f8bdb00.zip
(gdb-get-location): Use a warning instead
of an error if GDB can't find the source file.
-rw-r--r--lisp/progmodes/gdb-ui.el51
1 files changed, 28 insertions, 23 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 3c1251ba59b..e300b36457b 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -880,8 +880,7 @@ sink to `user' in `gdb-stopping', that is fine."
880 "An annotation handler for `post-prompt'. 880 "An annotation handler for `post-prompt'.
881This begins the collection of output from the current command if that 881This begins the collection of output from the current command if that
882happens to be appropriate." 882happens to be appropriate."
883 (if (not gdb-pending-triggers) 883 (unless gdb-pending-triggers
884 (progn
885 (gdb-get-current-frame) 884 (gdb-get-current-frame)
886 (gdb-invalidate-frames) 885 (gdb-invalidate-frames)
887 (gdb-invalidate-breakpoints) 886 (gdb-invalidate-breakpoints)
@@ -897,7 +896,7 @@ happens to be appropriate."
897 (setq gdb-var-changed t) ; force update 896 (setq gdb-var-changed t) ; force update
898 (dolist (var gdb-var-list) 897 (dolist (var gdb-var-list)
899 (setcar (nthcdr 5 var) nil)) 898 (setcar (nthcdr 5 var) nil))
900 (gdb-var-update))))) 899 (gdb-var-update))))
901 (let ((sink gdb-output-sink)) 900 (let ((sink gdb-output-sink))
902 (cond 901 (cond
903 ((eq sink 'user) t) 902 ((eq sink 'user) t)
@@ -1211,14 +1210,13 @@ static char *magick[] = {
1211 (goto-line (string-to-number line)) 1210 (goto-line (string-to-number line))
1212 (gdb-put-breakpoint-icon (eq flag ?y) bptno))) 1211 (gdb-put-breakpoint-icon (eq flag ?y) bptno)))
1213 (gdb-enqueue-input 1212 (gdb-enqueue-input
1214 (list (concat gdb-server-prefix "list " 1213 (list (concat "list "
1215 (match-string-no-properties 1) ":1\n") 1214 (match-string-no-properties 1) ":1\n")
1216 'ignore)) 1215 'ignore))
1217 (gdb-enqueue-input 1216 (gdb-enqueue-input
1218 (list (concat gdb-server-prefix "info source\n") 1217 (list "info source\n"
1219 `(lambda () 1218 `(lambda () (gdb-get-location
1220 (gdb-get-location 1219 ,bptno ,line ,flag)))))))))))
1221 ,bptno ,line ,flag)))))))))))
1222 (end-of-line))))) 1220 (end-of-line)))))
1223 (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))) 1221 (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom)))
1224 1222
@@ -2108,22 +2106,29 @@ buffers."
2108 "Find the directory containing the relevant source file. 2106 "Find the directory containing the relevant source file.
2109Put in buffer and place breakpoint icon." 2107Put in buffer and place breakpoint icon."
2110 (goto-char (point-min)) 2108 (goto-char (point-min))
2111 (if (search-forward "Located in " nil t) 2109 (catch 'file-not-found
2112 (if (looking-at "\\S-*") 2110 (if (search-forward "Located in " nil t)
2113 (push (cons bptno (match-string 0)) gdb-location-list)) 2111 (if (looking-at "\\S-*")
2114 (gdb-resync) 2112 (push (cons bptno (match-string 0)) gdb-location-list))
2115 (push (cons bptno "File not found") gdb-location-list) 2113 (gdb-resync)
2116 (error "Cannot find source file for breakpoint location. 2114 (push (cons bptno "File not found") gdb-location-list)
2115 (if (eq window-system 'x)
2116 (x-popup-dialog
2117 t '("Cannot find source file for breakpoint location.\n\
2118Add directory to search path for source files using the GDB command, dir."
2119 ("Ok" . nil)))
2120 (message "Cannot find source file for breakpoint location.\n\
2117Add directory to search path for source files using the GDB command, dir.")) 2121Add directory to search path for source files using the GDB command, dir."))
2118 (with-current-buffer 2122 (throw 'file-not-found nil))
2119 (find-file-noselect (match-string 0)) 2123 (with-current-buffer
2120 (save-current-buffer 2124 (find-file-noselect (match-string 0))
2121 (set (make-local-variable 'gud-minor-mode) 'gdba) 2125 (save-current-buffer
2122 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)) 2126 (set (make-local-variable 'gud-minor-mode) 'gdba)
2123 ;; only want one breakpoint icon at each location 2127 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map))
2124 (save-excursion 2128 ;; only want one breakpoint icon at each location
2125 (goto-line (string-to-number line)) 2129 (save-excursion
2126 (gdb-put-breakpoint-icon (eq flag ?y) bptno)))) 2130 (goto-line (string-to-number line))
2131 (gdb-put-breakpoint-icon (eq flag ?y) bptno)))))
2127 2132
2128(add-hook 'find-file-hook 'gdb-find-file-hook) 2133(add-hook 'find-file-hook 'gdb-find-file-hook)
2129 2134