emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el,v


From: Nick Roberts
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el,v
Date: Fri, 05 Jan 2007 04:20:21 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Nick Roberts <nickrob>  07/01/05 04:20:20

Index: gdb-ui.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/gdb-ui.el,v
retrieving revision 1.194
retrieving revision 1.195
diff -u -b -r1.194 -r1.195
--- gdb-ui.el   26 Dec 2006 22:02:17 -0000      1.194
+++ gdb-ui.el   5 Jan 2007 04:20:20 -0000       1.195
@@ -896,6 +896,12 @@
   :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 @@
   (if (and gud-comint-buffer (buffer-name gud-comint-buffer))
       (progn
        (cond ((string-match "+" text)  ;expand this node
+              (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)))
+                      (gdb-var-list-children-1 token)))))
              ((string-match "-" text)  ;contract this node
               (dolist (var gdb-var-list)
                 (if (string-match (concat token "\\.") (car var))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]