summaryrefslogtreecommitdiff
path: root/lisp/progmodes/gdb-ui.el
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2006-02-12 00:15:44 +0000
committerKaroly Lorentey <lorentey@elte.hu>2006-02-12 00:15:44 +0000
commit1913a2b35da45eeeb71ef851975be7d57c11de78 (patch)
tree6cd59883fb931999da5b62c03b321ade6f77e66e /lisp/progmodes/gdb-ui.el
parenta5805c9d0240fab504f2a3e32db6449392005fb6 (diff)
parenta528b71e55b2b244a5dd35318713ccb20398cbbf (diff)
downloademacs-1913a2b35da45eeeb71ef851975be7d57c11de78.tar.gz
emacs-1913a2b35da45eeeb71ef851975be7d57c11de78.tar.bz2
emacs-1913a2b35da45eeeb71ef851975be7d57c11de78.zip
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-49 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-50 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-51 Make constrain-to-field notice overlays * emacs@sv.gnu.org/emacs--devo--0--patch-52 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-53 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-54 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-55 Merge from erc--emacs--0 * emacs@sv.gnu.org/emacs--devo--0--patch-56 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-57 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-58 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-59 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-60 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-61 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-62 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-63 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-64 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-65 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-66 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-67 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-68 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-69 rcirc: Add flexible response formatting; Add nick abbrevs * emacs@sv.gnu.org/emacs--devo--0--patch-70 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-71 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-72 Update from CVS: man/dired.texi (Tumme): More tumme documentation. * emacs@sv.gnu.org/gnus--rel--5.10--patch-18 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-19 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-20 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-21 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-22 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-23 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-24 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-25 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-26 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-27 Update from CVS: lisp/gnus.el: Remove bogus comment. * emacs@sv.gnu.org/gnus--rel--5.10--patch-28 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-29 Add sendmail.el and smptmail.el from Emacs tree to contrib/ git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-508
Diffstat (limited to 'lisp/progmodes/gdb-ui.el')
-rw-r--r--lisp/progmodes/gdb-ui.el56
1 files changed, 44 insertions, 12 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index e7bda34e080..755e83646fc 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -4,7 +4,8 @@
;; Maintainer: FSF
;; Keywords: unix, tools
-;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006
+;; Free Software Foundation, Inc.
;; This file is part of GNU Emacs.
@@ -77,16 +78,9 @@
;;; TODO:
;; 1) Use MI command -data-read-memory for memory window.
-;; 2) Highlight changed register values (use MI commands
-;; -data-list-register-values and -data-list-changed-registers instead
-;; of 'info registers' after release of 22.1.
-;; 3) Use tree-widget.el instead of the speedbar for watch-expressions?
-;; 4) Mark breakpoint locations on scroll-bar of source buffer?
-;; 5) After release of 22.1, use "-var-list-children --all-values"
-;; and "-stack-list-locals --simple-values" which need GDB 6.1 onwards.
-;; 6) After release of 22.1, use "-var-update --all-values" which needs
-;; GDB 6.4 onwards.
-;; 7) With gud-print and gud-pstar, print the variable name in the GUD
+;; 2) Use tree-widget.el instead of the speedbar for watch-expressions?
+;; 3) Mark breakpoint locations on scroll-bar of source buffer?
+;; 4) With gud-print and gud-pstar, print the variable name in the GUD
;; buffer instead of the value's history number.
;;; Code:
@@ -1192,6 +1186,8 @@ happens to be appropriate."
(unless (or gdb-pending-triggers gdb-first-post-prompt)
(gdb-get-selected-frame)
(gdb-invalidate-frames)
+ ;; Regenerate breakpoints buffer in case it has been inadvertantly deleted.
+ (gdb-get-create-buffer 'gdb-breakpoints-buffer)
(gdb-invalidate-breakpoints)
;; Do this through gdb-get-selected-frame -> gdb-frame-handler
;; so gdb-frame-address is updated.
@@ -1645,12 +1641,19 @@ static char *magick[] = {
(define-key map [menu-bar breakpoints] (cons "Breakpoints" menu))
(define-key map " " 'gdb-toggle-breakpoint)
(define-key map "D" 'gdb-delete-breakpoint)
- (define-key map "q" 'kill-this-buffer)
+ ;; Don't bind "q" to kill-this-buffer as we need it for breakpoint icons.
+ (define-key map "q" 'gdb-delete-frame-or-window)
(define-key map "\r" 'gdb-goto-breakpoint)
(define-key map [mouse-2] 'gdb-goto-breakpoint)
(define-key map [follow-link] 'mouse-face)
map))
+(defun gdb-delete-frame-or-window ()
+ "Delete frame if there is only one window. Otherwise delete the window."
+ (interactive)
+ (if (one-window-p) (delete-frame)
+ (delete-window)))
+
(defun gdb-breakpoints-mode ()
"Major mode for gdb breakpoints.
@@ -2966,6 +2969,35 @@ BUFFER nil or omitted means use the current buffer."
(gdb-invalidate-assembler))
+;; For debugging Emacs only (assumes that usual stack buffer already exists).
+(defun gdb-xbacktrace ()
+ "Generate a full lisp level backtrace with arguments."
+ (interactive)
+ (setq my-frames nil)
+ (with-current-buffer (get-buffer-create "xbacktrace")
+ (erase-buffer))
+ (let (frame-number gdb-frame-number)
+ (with-current-buffer (gdb-get-buffer 'gdb-stack-buffer)
+ (save-excursion
+ (goto-char (point-min))
+ (while (search-forward "in Ffuncall " nil t)
+ (goto-char (line-beginning-position))
+ (looking-at "^#\\([0-9]+\\)")
+ (push (match-string-no-properties 1) my-frames)
+ (forward-line 1))))
+ (dolist (frame my-frames)
+ (gdb-enqueue-input (list (concat "server frame " frame "\n")
+ 'ignore))
+; (gdb-enqueue-input (list "server ppargs\n" 'gdb-get-arguments))
+ (gud-basic-call "server ppargs")
+)
+ (gdb-enqueue-input (list (concat "server frame " frame-number "\n")
+ 'ignore))))
+
+(defun gdb-get-arguments ()
+ (with-current-buffer "xbacktrace"
+ (insert-buffer-substring (gdb-get-buffer 'gdb-partial-output-buffer))))
+
;; Code specific to GDB 6.4
(defconst gdb-source-file-regexp-1 "fullname=\"\\(.*?\\)\"")