[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/gdb-ui.el
From: |
Nick Roberts |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/gdb-ui.el |
Date: |
Sat, 07 Jun 2003 21:20:51 -0400 |
Index: emacs/lisp/gdb-ui.el
diff -c emacs/lisp/gdb-ui.el:1.34 emacs/lisp/gdb-ui.el:1.35
*** emacs/lisp/gdb-ui.el:1.34 Sun May 25 12:51:34 2003
--- emacs/lisp/gdb-ui.el Sat Jun 7 21:20:51 2003
***************
*** 31,37 ****
;; It separates the input/output of your program from that of GDB and displays
;; expressions and their current values in their own buffers. It also uses
;; features of Emacs 21 such as the display margin for breakpoints, and the
! ;; toolbar (see the GDB User Interface section in the Emacs info manual).
;; Start the debugger with M-x gdba.
--- 31,37 ----
;; It separates the input/output of your program from that of GDB and displays
;; expressions and their current values in their own buffers. It also uses
;; features of Emacs 21 such as the display margin for breakpoints, and the
! ;; toolbar (see the GDB Graphical Interface section in the Emacs info manual).
;; Start the debugger with M-x gdba.
***************
*** 62,67 ****
--- 62,68 ----
(defvar gdb-current-address nil "Initialisation for Assembler buffer.")
(defvar gdb-previous-address nil)
+ (defvar gdb-previous-frame nil)
(defvar gdb-display-in-progress nil)
(defvar gdb-dive nil)
(defvar gdb-view-source t "Non-nil means that source code can be viewed")
***************
*** 160,165 ****
--- 161,167 ----
;; (re-)initialise
(setq gdb-current-address "main")
(setq gdb-previous-address nil)
+ (setq gdb-previous-frame nil)
(setq gdb-display-in-progress nil)
(setq gdb-dive nil)
(setq gdb-view-source t)
***************
*** 1162,1169 ****
(goto-char (point-max))
(insert-before-markers string))
(if (not (string-equal string ""))
! (select-window
! (gdb-display-buffer (gdb-get-create-buffer 'gdb-inferior-io)))))
(defun gdb-clear-inferior-io ()
(with-current-buffer (gdb-get-create-buffer 'gdb-inferior-io)
--- 1164,1170 ----
(goto-char (point-max))
(insert-before-markers string))
(if (not (string-equal string ""))
! (gdb-display-buffer (gdb-get-create-buffer 'gdb-inferior-io))))
(defun gdb-clear-inferior-io ()
(with-current-buffer (gdb-get-create-buffer 'gdb-inferior-io)
***************
*** 2316,2322 ****
(setq flag (char-after (match-beginning 1)))
(setq address (match-string 2))
;; remove leading 0s from output of info break.
! (if (string-match "0+\\(.*\\)" address)
(setq address (match-string 1 address)))
(with-current-buffer buffer
(goto-char (point-min))
--- 2317,2323 ----
(setq flag (char-after (match-beginning 1)))
(setq address (match-string 2))
;; remove leading 0s from output of info break.
! (if (string-match "^0+\\(.*\\)" address)
(setq address (match-string 1 address)))
(with-current-buffer buffer
(goto-char (point-min))
***************
*** 2375,2405 ****
;; modified because if gdb-current-address has changed value a new command
;; must be enqueued to update the buffer with the new output
(defun gdb-invalidate-assembler (&optional ignored)
! (if (and (gdb-get-buffer 'gdb-assembler-buffer)
! (or (not (member 'gdb-invalidate-assembler
! (gdb-get-pending-triggers)))
! (not (string-equal gdb-current-address gdb-previous-address))))
(progn
! ;; take previous disassemble command off the queue
! (with-current-buffer gud-comint-buffer
! (let ((queue (gdb-get-idle-input-queue)) (item))
! (dolist (item queue)
! (if (equal (cdr item) '(gdb-assembler-handler))
! (gdb-set-idle-input-queue
! (delete item (gdb-get-idle-input-queue)))))))
! (gdb-enqueue-idle-input
! (list (concat "server disassemble " gdb-current-address "\n")
! 'gdb-assembler-handler))
! (gdb-set-pending-triggers
! (cons 'gdb-invalidate-assembler
! (gdb-get-pending-triggers)))
! (setq gdb-previous-address gdb-current-address))))
(defun gdb-get-current-frame ()
(if (not (member 'gdb-get-current-frame (gdb-get-pending-triggers)))
(progn
(gdb-enqueue-idle-input
! (list (concat "server frame\n") 'gdb-frame-handler))
(gdb-set-pending-triggers
(cons 'gdb-get-current-frame
(gdb-get-pending-triggers))))))
--- 2376,2411 ----
;; modified because if gdb-current-address has changed value a new command
;; must be enqueued to update the buffer with the new output
(defun gdb-invalidate-assembler (&optional ignored)
! (if (gdb-get-buffer 'gdb-assembler-buffer)
(progn
! (if (string-equal gdb-current-frame gdb-previous-frame)
! (gdb-assembler-custom)
! (if (or (not (member 'gdb-invalidate-assembler
! (gdb-get-pending-triggers)))
! (not (string-equal gdb-current-address
! gdb-previous-address)))
! (progn
! ;; take previous disassemble command off the queue
! (with-current-buffer gud-comint-buffer
! (let ((queue (gdb-get-idle-input-queue)) (item))
! (dolist (item queue)
! (if (equal (cdr item) '(gdb-assembler-handler))
! (gdb-set-idle-input-queue
! (delete item (gdb-get-idle-input-queue)))))))
! (gdb-enqueue-idle-input
! (list (concat "server disassemble " gdb-current-address "\n")
! 'gdb-assembler-handler))
! (gdb-set-pending-triggers
! (cons 'gdb-invalidate-assembler
! (gdb-get-pending-triggers)))
! (setq gdb-previous-address gdb-current-address)
! (setq gdb-previous-frame gdb-current-frame)))))))
(defun gdb-get-current-frame ()
(if (not (member 'gdb-get-current-frame (gdb-get-pending-triggers)))
(progn
(gdb-enqueue-idle-input
! (list (concat "server info frame\n") 'gdb-frame-handler))
(gdb-set-pending-triggers
(cons 'gdb-get-current-frame
(gdb-get-pending-triggers))))))
***************
*** 2409,2433 ****
(delq 'gdb-get-current-frame (gdb-get-pending-triggers)))
(with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
(goto-char (point-min))
! (if (looking-at "^#[0-9]*\\s-*\\(\\S-*\\) in \\(\\S-*\\)")
(progn
(setq gdb-current-frame (match-string 2))
(let ((address (match-string 1)))
! ;; remove leading 0s from output of frame command.
! (if (string-match "0x0+\\(.*\\)" address)
(setq gdb-current-address
(concat "0x" (match-string 1 address)))
! (setq gdb-current-address address)))
! (if (or (if (not (looking-at ".*) at "))
(progn (setq gdb-view-source nil) t))
(eq gdb-selected-view 'assembler))
(progn
(set-window-buffer
gdb-source-window
(gdb-get-create-buffer 'gdb-assembler-buffer))
! (gdb-invalidate-assembler))))
! (if (looking-at "^#0\\s-*\\(\\S-*\\)")
! (setq gdb-current-frame (match-string 1))))))
(provide 'gdb-ui)
--- 2415,2438 ----
(delq 'gdb-get-current-frame (gdb-get-pending-triggers)))
(with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
(goto-char (point-min))
! (forward-line)
! (if (looking-at ".*= 0x\\(\\S-*\\) in \\(\\S-*\\)")
(progn
(setq gdb-current-frame (match-string 2))
(let ((address (match-string 1)))
! ;; remove leading 0s from output of info frame command.
! (if (string-match "^0+\\(.*\\)" address)
(setq gdb-current-address
(concat "0x" (match-string 1 address)))
! (setq gdb-current-address (concat "0x" address))))
! (if (or (if (not (looking-at ".*(\\S-*:[0-9]*)"))
(progn (setq gdb-view-source nil) t))
(eq gdb-selected-view 'assembler))
(progn
(set-window-buffer
gdb-source-window
(gdb-get-create-buffer 'gdb-assembler-buffer))
! (gdb-invalidate-assembler)))))))
(provide 'gdb-ui)
- [Emacs-diffs] Changes to emacs/lisp/gdb-ui.el,
Nick Roberts <=