diff options
| author | Nick Roberts | 2005-11-18 02:47:21 +0000 |
|---|---|---|
| committer | Nick Roberts | 2005-11-18 02:47:21 +0000 |
| commit | 4130aa2c84a393c0d6559fbf94fc10243ac0c2a0 (patch) | |
| tree | 47b042ed8c41993d614474db1d664e908f998440 | |
| parent | 3d18d67771338fd394b914a8d8417f942de22561 (diff) | |
| download | emacs-4130aa2c84a393c0d6559fbf94fc10243ac0c2a0.tar.gz emacs-4130aa2c84a393c0d6559fbf94fc10243ac0c2a0.zip | |
(gdb-ann3): Move definition of gud-pp to here.
Make it work in the speedbar.
(gdb-find-watch-expression): New function.
| -rw-r--r-- | lisp/progmodes/gdb-ui.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index f8f80ce6f66..92265dd46da 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el | |||
| @@ -337,6 +337,15 @@ With arg, use separate IO iff arg is positive." | |||
| 337 | (file-name-nondirectory file) ":1\n") | 337 | (file-name-nondirectory file) ":1\n") |
| 338 | `(lambda () (gdb-set-gud-minor-mode ,buffer))))))))) | 338 | `(lambda () (gdb-set-gud-minor-mode ,buffer))))))))) |
| 339 | 339 | ||
| 340 | (defun gdb-find-watch-expression () | ||
| 341 | (let* ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list)) | ||
| 342 | (varno (nth 1 var)) (expr)) | ||
| 343 | (string-match "\\(var[0-9]+\\)\\.\\(.*\\)" varno) | ||
| 344 | (dolist (var1 gdb-var-list) | ||
| 345 | (if (string-equal (nth 1 var1) (match-string 1 varno)) | ||
| 346 | (setq expr (concat (car var1) "." (match-string 2 varno))))) | ||
| 347 | expr)) | ||
| 348 | |||
| 340 | (defun gdb-ann3 () | 349 | (defun gdb-ann3 () |
| 341 | (setq gdb-debug-log nil) | 350 | (setq gdb-debug-log nil) |
| 342 | (set (make-local-variable 'gud-minor-mode) 'gdba) | 351 | (set (make-local-variable 'gud-minor-mode) 'gdba) |
| @@ -369,6 +378,15 @@ With arg, use separate IO iff arg is positive." | |||
| 369 | (gud-def gud-go (gud-call (if gdb-active-process "continue" "run") arg) | 378 | (gud-def gud-go (gud-call (if gdb-active-process "continue" "run") arg) |
| 370 | nil "Start or continue execution.") | 379 | nil "Start or continue execution.") |
| 371 | 380 | ||
| 381 | ;; For debugging Emacs only. | ||
| 382 | (gud-def gud-pp | ||
| 383 | (gud-call | ||
| 384 | (concat | ||
| 385 | "pp1 " (if (eq (buffer-local-value | ||
| 386 | 'major-mode (window-buffer)) 'speedbar-mode) | ||
| 387 | (gdb-find-watch-expression) "%e")) arg) | ||
| 388 | nil "Print the emacs s-expression.") | ||
| 389 | |||
| 372 | (define-key gud-minor-mode-map [left-margin mouse-1] | 390 | (define-key gud-minor-mode-map [left-margin mouse-1] |
| 373 | 'gdb-mouse-set-clear-breakpoint) | 391 | 'gdb-mouse-set-clear-breakpoint) |
| 374 | (define-key gud-minor-mode-map [left-fringe mouse-1] | 392 | (define-key gud-minor-mode-map [left-fringe mouse-1] |