aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2004-05-30 00:09:37 +0000
committerNick Roberts2004-05-30 00:09:37 +0000
commitf2f82fa491294e51620ef6eddfd03912e28e2936 (patch)
tree468dae3b831aff58233cb3efb65fa977c85cca1e
parentf471ca2b249c08bd262a9b73654261b248606c90 (diff)
downloademacs-f2f82fa491294e51620ef6eddfd03912e28e2936.tar.gz
emacs-f2f82fa491294e51620ef6eddfd03912e28e2936.zip
(gdb-current-frame, gud-watch)
(gdb-locals-mode, gdb-frame-handler): Display current frame in the modeline of the locals buffer. (gdb-goto-breakpoint): Handle gdbmi. (gdb-get-frame-number): Change for gdbmi.
-rw-r--r--lisp/progmodes/gdb-ui.el30
1 files changed, 21 insertions, 9 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 6fce273f6ee..2f267787707 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -40,8 +40,15 @@
40;; Kingdon and uses GDB's annotation interface. You don't need to know about 40;; Kingdon and uses GDB's annotation interface. You don't need to know about
41;; annotations to use this mode as a debugger, but if you are interested 41;; annotations to use this mode as a debugger, but if you are interested
42;; developing the mode itself, then see the Annotations section in the GDB 42;; developing the mode itself, then see the Annotations section in the GDB
43;; info manual. Some GDB/MI commands are also used through th CLI command 43;; info manual.
44;; 'interpreter mi <mi-command>'. 44;;
45;; GDB developers plan to make the annotation interface obsolete. A new
46;; interface called GDB/MI (machine interface) has been designed to replace
47;; it. Some GDB/MI commands are used in this file through the CLI command
48;; 'interpreter mi <mi-command>'. A file called gdb-mi.el is included in the
49;; GDB repository for future releases (6.2 onwards) that uses GDB/MI as the
50;; primary interface to GDB. It is still under development and is part of a
51;; process to migrate Emacs from annotations to GDB/MI.
45;; 52;;
46;; Known Bugs: 53;; Known Bugs:
47;; 54;;
@@ -53,7 +60,7 @@
53(defvar gdb-current-address "main" "Initialisation for Assembler buffer.") 60(defvar gdb-current-address "main" "Initialisation for Assembler buffer.")
54(defvar gdb-previous-address nil) 61(defvar gdb-previous-address nil)
55(defvar gdb-previous-frame nil) 62(defvar gdb-previous-frame nil)
56(defvar gdb-current-frame "main") 63(defvar gdb-current-frame nil)
57(defvar gdb-current-language nil) 64(defvar gdb-current-language nil)
58(defvar gdb-view-source t "Non-nil means that source code can be viewed.") 65(defvar gdb-view-source t "Non-nil means that source code can be viewed.")
59(defvar gdb-selected-view 'source "Code type that user wishes to view.") 66(defvar gdb-selected-view 'source "Code type that user wishes to view.")
@@ -175,7 +182,7 @@ detailed description of this mode.
175 (setq gdb-current-address "main") 182 (setq gdb-current-address "main")
176 (setq gdb-previous-address nil) 183 (setq gdb-previous-address nil)
177 (setq gdb-previous-frame nil) 184 (setq gdb-previous-frame nil)
178 (setq gdb-current-frame "main") 185 (setq gdb-current-frame nil)
179 (setq gdb-view-source t) 186 (setq gdb-view-source t)
180 (setq gdb-selected-view 'source) 187 (setq gdb-selected-view 'source)
181 (setq gdb-var-list nil) 188 (setq gdb-var-list nil)
@@ -214,7 +221,7 @@ speedbar."
214 (require 'tooltip) 221 (require 'tooltip)
215 (let ((expr (tooltip-identifier-from-point (point)))) 222 (let ((expr (tooltip-identifier-from-point (point))))
216 (if (and (string-equal gdb-current-language "c") 223 (if (and (string-equal gdb-current-language "c")
217 gdb-use-colon-colon-notation) 224 gdb-use-colon-colon-notation gdb-current-frame)
218 (setq expr (concat gdb-current-frame "::" expr))) 225 (setq expr (concat gdb-current-frame "::" expr)))
219 (catch 'already-watched 226 (catch 'already-watched
220 (dolist (var gdb-var-list) 227 (dolist (var gdb-var-list)
@@ -1219,8 +1226,10 @@ static char *magick[] = {
1219 (interactive) 1226 (interactive)
1220 (save-excursion 1227 (save-excursion
1221 (beginning-of-line 1) 1228 (beginning-of-line 1)
1222 (re-search-forward "in\\s-+\\S-+\\s-+at\\s-+" nil t) 1229 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdbmi))
1223 (looking-at "\\(\\S-*\\):\\([0-9]+\\)")) 1230 (looking-at "[0-9]*\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\\(\\S-*\\):\\([0-9]+\\)")
1231 (re-search-forward "in\\s-+\\S-+\\s-+at\\s-+" nil t)
1232 (looking-at "\\(\\S-*\\):\\([0-9]+\\)")))
1224 (if (match-string 2) 1233 (if (match-string 2)
1225 (let ((line (match-string 2)) 1234 (let ((line (match-string 2))
1226 (file (match-string 1))) 1235 (file (match-string 1)))
@@ -1311,7 +1320,7 @@ static char *magick[] = {
1311 1320
1312(defun gdb-get-frame-number () 1321(defun gdb-get-frame-number ()
1313 (save-excursion 1322 (save-excursion
1314 (let* ((pos (re-search-backward "^#\\([0-9]*\\)" nil t)) 1323 (let* ((pos (re-search-backward "^#*\\([0-9]*\\)" nil t))
1315 (n (or (and pos (match-string-no-properties 1)) "0"))) 1324 (n (or (and pos (match-string-no-properties 1)) "0")))
1316 n))) 1325 n)))
1317 1326
@@ -1502,7 +1511,7 @@ static char *magick[] = {
1502 1511
1503\\{gdb-locals-mode-map}" 1512\\{gdb-locals-mode-map}"
1504 (setq major-mode 'gdb-locals-mode) 1513 (setq major-mode 'gdb-locals-mode)
1505 (setq mode-name "Locals") 1514 (setq mode-name (concat "Locals:" gdb-current-frame))
1506 (setq buffer-read-only t) 1515 (setq buffer-read-only t)
1507 (use-local-map gdb-locals-mode-map) 1516 (use-local-map gdb-locals-mode-map)
1508 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) 1517 (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
@@ -1999,6 +2008,9 @@ BUFFER nil or omitted means use the current buffer."
1999 (if (looking-at ".*=\\s-+0x\\(\\S-*\\)\\s-+in\\s-+\\(\\S-*?\\);? ") 2008 (if (looking-at ".*=\\s-+0x\\(\\S-*\\)\\s-+in\\s-+\\(\\S-*?\\);? ")
2000 (progn 2009 (progn
2001 (setq gdb-current-frame (match-string 2)) 2010 (setq gdb-current-frame (match-string 2))
2011 (if (gdb-get-buffer 'gdb-locals-buffer)
2012 (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer)
2013 (setq mode-name (concat "Locals:" gdb-current-frame))))
2002 (let ((address (match-string 1))) 2014 (let ((address (match-string 1)))
2003 ;; remove leading 0s from output of info frame command. 2015 ;; remove leading 0s from output of info frame command.
2004 (if (string-match "^0+\\(.*\\)" address) 2016 (if (string-match "^0+\\(.*\\)" address)