diff options
| author | Nick Roberts | 2007-01-05 04:20:20 +0000 |
|---|---|---|
| committer | Nick Roberts | 2007-01-05 04:20:20 +0000 |
| commit | e1204172cebc642dc8f5f7bc2f1fea3d65804465 (patch) | |
| tree | 5853aaa4ffc38897cb0e4aeb6e8d704aa7fa6593 | |
| parent | 10dc9f9eba4636988cc3fee62abc8c93ca402fa0 (diff) | |
| download | emacs-e1204172cebc642dc8f5f7bc2f1fea3d65804465.tar.gz emacs-e1204172cebc642dc8f5f7bc2f1fea3d65804465.zip | |
(gdb-max-children): New customizable variable.
(gdb-speedbar-expand-node): Ask user for confirmation before expanding
large structures/arrays.
| -rw-r--r-- | lisp/progmodes/gdb-ui.el | 22 |
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'." | |||
| 896 | :group 'gud | 896 | :group 'gud |
| 897 | :version "22.1") | 897 | :version "22.1") |
| 898 | 898 | ||
| 899 | (defcustom gdb-max-children 40 | ||
| 900 | "Maximum number of children allowed before Emacs asks" | ||
| 901 | :type 'integer | ||
| 902 | :group 'gud | ||
| 903 | :version "22.1") | ||
| 904 | |||
| 899 | (defun gdb-speedbar-expand-node (text token indent) | 905 | (defun gdb-speedbar-expand-node (text token indent) |
| 900 | "Expand the node the user clicked on. | 906 | "Expand the node the user clicked on. |
| 901 | TEXT is the text of the button we clicked on, a + or - item. | 907 | TEXT is the text of the button we clicked on, a + or - item. |
| @@ -904,11 +910,17 @@ INDENT is the current indentation depth." | |||
| 904 | (if (and gud-comint-buffer (buffer-name gud-comint-buffer)) | 910 | (if (and gud-comint-buffer (buffer-name gud-comint-buffer)) |
| 905 | (progn | 911 | (progn |
| 906 | (cond ((string-match "+" text) ;expand this node | 912 | (cond ((string-match "+" text) ;expand this node |
| 907 | (if (and (eq (buffer-local-value | 913 | (let* ((var (assoc token gdb-var-list)) |
| 908 | 'gud-minor-mode gud-comint-buffer) 'gdba) | 914 | (expr (nth 1 var)) (children (nth 2 var))) |
| 909 | (string-equal gdb-version "pre-6.4")) | 915 | (if (or (<= (string-to-number children) gdb-max-children) |
| 910 | (gdb-var-list-children token) | 916 | (y-or-n-p |
| 911 | (gdb-var-list-children-1 token))) | 917 | (format |
| 918 | "%s has %s children. Continue? " expr children))) | ||
| 919 | (if (and (eq (buffer-local-value | ||
| 920 | 'gud-minor-mode gud-comint-buffer) 'gdba) | ||
| 921 | (string-equal gdb-version "pre-6.4")) | ||
| 922 | (gdb-var-list-children token) | ||
| 923 | (gdb-var-list-children-1 token))))) | ||
| 912 | ((string-match "-" text) ;contract this node | 924 | ((string-match "-" text) ;contract this node |
| 913 | (dolist (var gdb-var-list) | 925 | (dolist (var gdb-var-list) |
| 914 | (if (string-match (concat token "\\.") (car var)) | 926 | (if (string-match (concat token "\\.") (car var)) |