changeset 62049:471fca8487d3

Replace string-to-int with string-to-number. (gud-find-file): Handle gdb-define-alist.
author Nick Roberts <nickrob@snap.net.nz>
date Tue, 03 May 2005 06:47:18 +0000
parents 55735e23c27d
children 9658387c7d01
files lisp/progmodes/gud.el
diffstat 1 files changed, 20 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gud.el	Tue May 03 06:46:27 2005 +0000
+++ b/lisp/progmodes/gud.el	Tue May 03 06:47:18 2005 +0000
@@ -228,6 +228,10 @@
       (with-current-buffer buf
 	(set (make-local-variable 'gud-minor-mode) minor-mode)
 	(set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
+	(when (memq gud-minor-mode '(gdbmi gdba))
+	  (make-local-variable 'gdb-define-alist)
+	  (unless  gdb-define-alist (gdb-create-define-alist))
+	  (add-hook 'after-save-hook 'gdb-create-define-alist nil t))
 	(make-local-variable 'gud-keep-buffer))
       buf)))
 
@@ -474,7 +478,7 @@
 
        ;; Extract the frame position from the marker.
        gud-last-frame (cons (match-string 1 gud-marker-acc)
-			    (string-to-int (match-string 2 gud-marker-acc)))
+			    (string-to-number (match-string 2 gud-marker-acc)))
 
        ;; Append any text before the marker to the output we're going
        ;; to return - we don't include the marker in this text.
@@ -775,14 +779,14 @@
 			gud-marker-acc start)
 	  (setq gud-last-frame
 		(cons (match-string 3 gud-marker-acc)
-		      (string-to-int (match-string 4 gud-marker-acc)))))
+		      (string-to-number (match-string 4 gud-marker-acc)))))
 	 ;; System V Release 4.0 quite often clumps two lines together
 	 ((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n\\([0-9]+\\):"
 			gud-marker-acc start)
 	  (setq gud-sdb-lastfile (match-string 2 gud-marker-acc))
 	  (setq gud-last-frame
 		(cons gud-sdb-lastfile
-		      (string-to-int (match-string 3 gud-marker-acc)))))
+		      (string-to-number (match-string 3 gud-marker-acc)))))
 	 ;; System V Release 4.0
 	 ((string-match "^\\(BREAKPOINT\\|STEPPED\\) process [0-9]+ function [^ ]+ in \\(.+\\)\n"
 			gud-marker-acc start)
@@ -791,7 +795,7 @@
 					      gud-marker-acc start))
 	       (setq gud-last-frame
 		     (cons gud-sdb-lastfile
-			   (string-to-int (match-string 1 gud-marker-acc)))))
+			   (string-to-number (match-string 1 gud-marker-acc)))))
 	 (t
 	  (setq gud-sdb-lastfile nil)))
       (setq start (match-end 0)))
@@ -877,7 +881,7 @@
 		gud-marker-acc start))
       (setq gud-last-frame
 	    (cons (match-string 2 gud-marker-acc)
-		  (string-to-int (match-string 1 gud-marker-acc)))
+		  (string-to-number (match-string 1 gud-marker-acc)))
 	    start (match-end 0)))
 
     ;; Search for the last incomplete line in this chunk
@@ -924,7 +928,7 @@
        ;; Extract the frame position from the marker.
        gud-last-frame
        (cons (match-string 1 gud-marker-acc)
-	     (string-to-int (match-string 2 gud-marker-acc)))
+	     (string-to-number (match-string 2 gud-marker-acc)))
 
        ;; Append any text before the marker to the output we're going
        ;; to return - we don't include the marker in this text.
@@ -1032,7 +1036,7 @@
 	    (if (file-exists-p file)
 		(setq gud-last-frame
 		      (cons (match-string 1 result)
-			    (string-to-int (match-string 2 result))))))
+			    (string-to-number (match-string 2 result))))))
 	  result)
 	 ((string-match			; kluged-up marker as above
 	   "\032\032\\([0-9]*\\):\\(.*\\)\n" result)
@@ -1040,7 +1044,7 @@
 	    (if (and file (file-exists-p file))
 		(setq gud-last-frame
 		      (cons file
-			    (string-to-int (match-string 1 result))))))
+			    (string-to-number (match-string 1 result))))))
 	  (setq result (substring result 0 (match-beginning 0))))))
     (or result "")))
 
@@ -1077,7 +1081,7 @@
     (while (string-match re gud-marker-acc start)
       (setq gud-last-frame
 	    (cons (match-string 4 gud-marker-acc)
-		  (string-to-int (match-string 3 gud-marker-acc)))
+		  (string-to-number (match-string 3 gud-marker-acc)))
 	    start (match-end 0)))
 
     ;; Search for the last incomplete line in this chunk
@@ -1196,7 +1200,7 @@
 			      result)
                 (string-match "[^: \t]+:[ \t]+\\([^:]+\\): [^:]+: \\([0-9]+\\):"
                               result))
-            (let ((line (string-to-int (match-string 2 result)))
+            (let ((line (string-to-number (match-string 2 result)))
                   (file (gud-file-name (match-string 1 result))))
               (if file
                   (setq gud-last-frame (cons file line))))))
@@ -1298,7 +1302,7 @@
        ;; Extract the frame position from the marker.
        gud-last-frame
        (cons (match-string 1 gud-marker-acc)
-	     (string-to-int (match-string 3 gud-marker-acc)))
+	     (string-to-number (match-string 3 gud-marker-acc)))
 
        ;; Append any text before the marker to the output we're going
        ;; to return - we don't include the marker in this text.
@@ -1396,7 +1400,7 @@
        gud-last-frame
        (let ((file (match-string gud-pdb-marker-regexp-file-group
 				 gud-marker-acc))
-	     (line (string-to-int
+	     (line (string-to-number
 		    (match-string gud-pdb-marker-regexp-line-group
 				  gud-marker-acc))))
 	 (if (string-equal file "<string>")
@@ -2028,7 +2032,7 @@
       ;;     (<file-name> . <line-number>) .
       (if (if (match-beginning 1)
 	      (let (n)
-		(setq n (string-to-int (substring
+		(setq n (string-to-number (substring
 					gud-marker-acc
 					(1+ (match-beginning 1))
 					(- (match-end 1) 2))))
@@ -2039,7 +2043,7 @@
 		    (gud-jdb-find-source (match-string 2 gud-marker-acc)))
 	      (setq gud-last-frame
 		    (cons file-found
-			  (string-to-int
+			  (string-to-number
 			   (let
                                ((numstr (match-string 4 gud-marker-acc)))
                              (if (string-match "[.,]" numstr)
@@ -2187,7 +2191,7 @@
        ;; Extract the frame position from the marker.
        gud-last-frame
        (cons (match-string 2 gud-marker-acc)
-	     (string-to-int (match-string 4 gud-marker-acc)))
+	     (string-to-number (match-string 4 gud-marker-acc)))
 
        ;; Append any text before the marker to the output we're going
        ;; to return - we don't include the marker in this text.
@@ -2977,6 +2981,7 @@
 	(message "gud-find-class: class for file %s not found in gud-jdb-class-source-alist!" f)
 	nil))))
 
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; GDB script mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;