aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2005-05-03 06:47:18 +0000
committerNick Roberts2005-05-03 06:47:18 +0000
commit0d2794e36229828136ae5166563a36effb87dd82 (patch)
tree07a77f5b8ef47a6563fd4dbeb0e55e592e0e7da0
parent64f3c670bd6a21cd71ed10831b2a4664960fd9be (diff)
downloademacs-0d2794e36229828136ae5166563a36effb87dd82.tar.gz
emacs-0d2794e36229828136ae5166563a36effb87dd82.zip
Replace string-to-int with string-to-number.
(gud-find-file): Handle gdb-define-alist.
-rw-r--r--lisp/progmodes/gud.el35
1 files changed, 20 insertions, 15 deletions
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 9a5d609c523..e98cb9eee58 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -228,6 +228,10 @@ Uses `gud-<MINOR-MODE>-directories' to find the source files."
228 (with-current-buffer buf 228 (with-current-buffer buf
229 (set (make-local-variable 'gud-minor-mode) minor-mode) 229 (set (make-local-variable 'gud-minor-mode) minor-mode)
230 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) 230 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
231 (when (memq gud-minor-mode '(gdbmi gdba))
232 (make-local-variable 'gdb-define-alist)
233 (unless gdb-define-alist (gdb-create-define-alist))
234 (add-hook 'after-save-hook 'gdb-create-define-alist nil t))
231 (make-local-variable 'gud-keep-buffer)) 235 (make-local-variable 'gud-keep-buffer))
232 buf))) 236 buf)))
233 237
@@ -474,7 +478,7 @@ off the specialized speedbar mode."
474 478
475 ;; Extract the frame position from the marker. 479 ;; Extract the frame position from the marker.
476 gud-last-frame (cons (match-string 1 gud-marker-acc) 480 gud-last-frame (cons (match-string 1 gud-marker-acc)
477 (string-to-int (match-string 2 gud-marker-acc))) 481 (string-to-number (match-string 2 gud-marker-acc)))
478 482
479 ;; Append any text before the marker to the output we're going 483 ;; Append any text before the marker to the output we're going
480 ;; to return - we don't include the marker in this text. 484 ;; to return - we don't include the marker in this text.
@@ -775,14 +779,14 @@ SKIP is the number of chars to skip on each lines, it defaults to 0."
775 gud-marker-acc start) 779 gud-marker-acc start)
776 (setq gud-last-frame 780 (setq gud-last-frame
777 (cons (match-string 3 gud-marker-acc) 781 (cons (match-string 3 gud-marker-acc)
778 (string-to-int (match-string 4 gud-marker-acc))))) 782 (string-to-number (match-string 4 gud-marker-acc)))))
779 ;; System V Release 4.0 quite often clumps two lines together 783 ;; System V Release 4.0 quite often clumps two lines together
780 ((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n\\([0-9]+\\):" 784 ((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n\\([0-9]+\\):"
781 gud-marker-acc start) 785 gud-marker-acc start)
782 (setq gud-sdb-lastfile (match-string 2 gud-marker-acc)) 786 (setq gud-sdb-lastfile (match-string 2 gud-marker-acc))
783 (setq gud-last-frame 787 (setq gud-last-frame
784 (cons gud-sdb-lastfile 788 (cons gud-sdb-lastfile
785 (string-to-int (match-string 3 gud-marker-acc))))) 789 (string-to-number (match-string 3 gud-marker-acc)))))
786 ;; System V Release 4.0 790 ;; System V Release 4.0
787 ((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n" 791 ((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n"
788 gud-marker-acc start) 792 gud-marker-acc start)
@@ -791,7 +795,7 @@ SKIP is the number of chars to skip on each lines, it defaults to 0."
791 gud-marker-acc start)) 795 gud-marker-acc start))
792 (setq gud-last-frame 796 (setq gud-last-frame
793 (cons gud-sdb-lastfile 797 (cons gud-sdb-lastfile
794 (string-to-int (match-string 1 gud-marker-acc))))) 798 (string-to-number (match-string 1 gud-marker-acc)))))
795 (t 799 (t
796 (setq gud-sdb-lastfile nil))) 800 (setq gud-sdb-lastfile nil)))
797 (setq start (match-end 0))) 801 (setq start (match-end 0)))
@@ -877,7 +881,7 @@ containing the executable being debugged."
877 gud-marker-acc start)) 881 gud-marker-acc start))
878 (setq gud-last-frame 882 (setq gud-last-frame
879 (cons (match-string 2 gud-marker-acc) 883 (cons (match-string 2 gud-marker-acc)
880 (string-to-int (match-string 1 gud-marker-acc))) 884 (string-to-number (match-string 1 gud-marker-acc)))
881 start (match-end 0))) 885 start (match-end 0)))
882 886
883 ;; Search for the last incomplete line in this chunk 887 ;; Search for the last incomplete line in this chunk
@@ -924,7 +928,7 @@ containing the executable being debugged."
924 ;; Extract the frame position from the marker. 928 ;; Extract the frame position from the marker.
925 gud-last-frame 929 gud-last-frame
926 (cons (match-string 1 gud-marker-acc) 930 (cons (match-string 1 gud-marker-acc)
927 (string-to-int (match-string 2 gud-marker-acc))) 931 (string-to-number (match-string 2 gud-marker-acc)))
928 932
929 ;; Append any text before the marker to the output we're going 933 ;; Append any text before the marker to the output we're going
930 ;; to return - we don't include the marker in this text. 934 ;; to return - we don't include the marker in this text.
@@ -1032,7 +1036,7 @@ a better solution in 6.1 upwards.")
1032 (if (file-exists-p file) 1036 (if (file-exists-p file)
1033 (setq gud-last-frame 1037 (setq gud-last-frame
1034 (cons (match-string 1 result) 1038 (cons (match-string 1 result)
1035 (string-to-int (match-string 2 result)))))) 1039 (string-to-number (match-string 2 result))))))
1036 result) 1040 result)
1037 ((string-match ; kluged-up marker as above 1041 ((string-match ; kluged-up marker as above
1038 "\032\032\\([0-9]*\\):\\(.*\\)\n" result) 1042 "\032\032\\([0-9]*\\):\\(.*\\)\n" result)
@@ -1040,7 +1044,7 @@ a better solution in 6.1 upwards.")
1040 (if (and file (file-exists-p file)) 1044 (if (and file (file-exists-p file))
1041 (setq gud-last-frame 1045 (setq gud-last-frame
1042 (cons file 1046 (cons file
1043 (string-to-int (match-string 1 result)))))) 1047 (string-to-number (match-string 1 result))))))
1044 (setq result (substring result 0 (match-beginning 0)))))) 1048 (setq result (substring result 0 (match-beginning 0))))))
1045 (or result ""))) 1049 (or result "")))
1046 1050
@@ -1077,7 +1081,7 @@ This was tested using R4.11.")
1077 (while (string-match re gud-marker-acc start) 1081 (while (string-match re gud-marker-acc start)
1078 (setq gud-last-frame 1082 (setq gud-last-frame
1079 (cons (match-string 4 gud-marker-acc) 1083 (cons (match-string 4 gud-marker-acc)
1080 (string-to-int (match-string 3 gud-marker-acc))) 1084 (string-to-number (match-string 3 gud-marker-acc)))
1081 start (match-end 0))) 1085 start (match-end 0)))
1082 1086
1083 ;; Search for the last incomplete line in this chunk 1087 ;; Search for the last incomplete line in this chunk
@@ -1196,7 +1200,7 @@ containing the executable being debugged."
1196 result) 1200 result)
1197 (string-match "[^: \t]+:[ \t]+\\([^:]+\\): [^:]+: \\([0-9]+\\):" 1201 (string-match "[^: \t]+:[ \t]+\\([^:]+\\): [^:]+: \\([0-9]+\\):"
1198 result)) 1202 result))
1199 (let ((line (string-to-int (match-string 2 result))) 1203 (let ((line (string-to-number (match-string 2 result)))
1200 (file (gud-file-name (match-string 1 result)))) 1204 (file (gud-file-name (match-string 1 result))))
1201 (if file 1205 (if file
1202 (setq gud-last-frame (cons file line)))))) 1206 (setq gud-last-frame (cons file line))))))
@@ -1298,7 +1302,7 @@ into one that invokes an Emacs-enabled debugging session.
1298 ;; Extract the frame position from the marker. 1302 ;; Extract the frame position from the marker.
1299 gud-last-frame 1303 gud-last-frame
1300 (cons (match-string 1 gud-marker-acc) 1304 (cons (match-string 1 gud-marker-acc)
1301 (string-to-int (match-string 3 gud-marker-acc))) 1305 (string-to-number (match-string 3 gud-marker-acc)))
1302 1306
1303 ;; Append any text before the marker to the output we're going 1307 ;; Append any text before the marker to the output we're going
1304 ;; to return - we don't include the marker in this text. 1308 ;; to return - we don't include the marker in this text.
@@ -1396,7 +1400,7 @@ and source-file directory for your debugger."
1396 gud-last-frame 1400 gud-last-frame
1397 (let ((file (match-string gud-pdb-marker-regexp-file-group 1401 (let ((file (match-string gud-pdb-marker-regexp-file-group
1398 gud-marker-acc)) 1402 gud-marker-acc))
1399 (line (string-to-int 1403 (line (string-to-number
1400 (match-string gud-pdb-marker-regexp-line-group 1404 (match-string gud-pdb-marker-regexp-line-group
1401 gud-marker-acc)))) 1405 gud-marker-acc))))
1402 (if (string-equal file "<string>") 1406 (if (string-equal file "<string>")
@@ -2028,7 +2032,7 @@ nil)
2028 ;; (<file-name> . <line-number>) . 2032 ;; (<file-name> . <line-number>) .
2029 (if (if (match-beginning 1) 2033 (if (if (match-beginning 1)
2030 (let (n) 2034 (let (n)
2031 (setq n (string-to-int (substring 2035 (setq n (string-to-number (substring
2032 gud-marker-acc 2036 gud-marker-acc
2033 (1+ (match-beginning 1)) 2037 (1+ (match-beginning 1))
2034 (- (match-end 1) 2)))) 2038 (- (match-end 1) 2))))
@@ -2039,7 +2043,7 @@ nil)
2039 (gud-jdb-find-source (match-string 2 gud-marker-acc))) 2043 (gud-jdb-find-source (match-string 2 gud-marker-acc)))
2040 (setq gud-last-frame 2044 (setq gud-last-frame
2041 (cons file-found 2045 (cons file-found
2042 (string-to-int 2046 (string-to-number
2043 (let 2047 (let
2044 ((numstr (match-string 4 gud-marker-acc))) 2048 ((numstr (match-string 4 gud-marker-acc)))
2045 (if (string-match "[.,]" numstr) 2049 (if (string-match "[.,]" numstr)
@@ -2187,7 +2191,7 @@ gud, see `gud-mode'."
2187 ;; Extract the frame position from the marker. 2191 ;; Extract the frame position from the marker.
2188 gud-last-frame 2192 gud-last-frame
2189 (cons (match-string 2 gud-marker-acc) 2193 (cons (match-string 2 gud-marker-acc)
2190 (string-to-int (match-string 4 gud-marker-acc))) 2194 (string-to-number (match-string 4 gud-marker-acc)))
2191 2195
2192 ;; Append any text before the marker to the output we're going 2196 ;; Append any text before the marker to the output we're going
2193 ;; to return - we don't include the marker in this text. 2197 ;; to return - we don't include the marker in this text.
@@ -2977,6 +2981,7 @@ class of the file (using s to separate nested class ids)."
2977 (message "gud-find-class: class for file %s not found in gud-jdb-class-source-alist!" f) 2981 (message "gud-find-class: class for file %s not found in gud-jdb-class-source-alist!" f)
2978 nil)))) 2982 nil))))
2979 2983
2984
2980;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2985;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2981;;; GDB script mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2986;;; GDB script mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2982;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2987;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;