summaryrefslogtreecommitdiff
path: root/lisp/progmodes/gdb-ui.el
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2007-01-06 15:25:16 +0000
committerKaroly Lorentey <lorentey@elte.hu>2007-01-06 15:25:16 +0000
commit191ae1cf7cd2571277635b3b8e488e773ca5c9b9 (patch)
treee0b26e3040767dae38fb39a03b757da05088c58f /lisp/progmodes/gdb-ui.el
parent382707ecfb50f8c7794a7ba3d8cd9db9b6cd29d0 (diff)
parentf85c5e3b72855951b071eacb7b6e2d002c5fc4be (diff)
downloademacs-191ae1cf7cd2571277635b3b8e488e773ca5c9b9.tar.gz
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-585 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-586 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-587 Update from erc--emacs--22 * emacs@sv.gnu.org/emacs--devo--0--patch-588 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-589 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-590 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-591 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-592
Diffstat (limited to 'lisp/progmodes/gdb-ui.el')
-rw-r--r--lisp/progmodes/gdb-ui.el22
1 files changed, 17 insertions, 5 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 3a253796f28..980c6b3f07b 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -896,6 +896,12 @@ Changed values are highlighted with the face `font-lock-warning-face'."
:group 'gud
:version "22.1")
+(defcustom gdb-max-children 40
+ "Maximum number of children allowed before Emacs asks"
+ :type 'integer
+ :group 'gud
+ :version "22.1")
+
(defun gdb-speedbar-expand-node (text token indent)
"Expand the node the user clicked on.
TEXT is the text of the button we clicked on, a + or - item.
@@ -904,11 +910,17 @@ INDENT is the current indentation depth."
(if (and gud-comint-buffer (buffer-name gud-comint-buffer))
(progn
(cond ((string-match "+" text) ;expand this node
- (if (and (eq (buffer-local-value
- 'gud-minor-mode gud-comint-buffer) 'gdba)
- (string-equal gdb-version "pre-6.4"))
- (gdb-var-list-children token)
- (gdb-var-list-children-1 token)))
+ (let* ((var (assoc token gdb-var-list))
+ (expr (nth 1 var)) (children (nth 2 var)))
+ (if (or (<= (string-to-number children) gdb-max-children)
+ (y-or-n-p
+ (format
+ "%s has %s children. Continue? " expr children)))
+ (if (and (eq (buffer-local-value
+ 'gud-minor-mode gud-comint-buffer) 'gdba)
+ (string-equal gdb-version "pre-6.4"))
+ (gdb-var-list-children token)
+ (gdb-var-list-children-1 token)))))
((string-match "-" text) ;contract this node
(dolist (var gdb-var-list)
(if (string-match (concat token "\\.") (car var))