emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp/progmodes gdb-ui.el [EMACS_23_1_RC]


From: Nick Roberts
Subject: [Emacs-diffs] emacs/lisp/progmodes gdb-ui.el [EMACS_23_1_RC]
Date: Thu, 06 Aug 2009 08:04:41 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         EMACS_23_1_RC
Changes by:     Nick Roberts <nickrob>  09/08/06 08:04:41

Modified files:
        lisp/progmodes : gdb-ui.el 

Log message:
        (gdb-recording): New variable.
        (gdb): Define new commands for reverse execution.
        (gdb-toggle-recording): Start/stop recording of debug session.
        (gdb-recording-handler): Handler for output from above command.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/progmodes/gdb-ui.el?cvsroot=emacs&only_with_tag=EMACS_23_1_RC&r1=1.256.2.3&r2=1.256.2.4

Patches:
Index: gdb-ui.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/Attic/gdb-ui.el,v
retrieving revision 1.256.2.3
retrieving revision 1.256.2.4
diff -u -b -r1.256.2.3 -r1.256.2.4
--- gdb-ui.el   2 Jul 2009 06:36:43 -0000       1.256.2.3
+++ gdb-ui.el   6 Aug 2009 08:04:40 -0000       1.256.2.4
@@ -141,6 +141,8 @@
 Emacs can't find.")
 (defvar gdb-active-process nil
   "GUD tooltips display variable values when t, and macro definitions 
otherwise.")
+(defvar gdb-recording nil
+  "If t, then record session for playback and reverse execution")
 (defvar gdb-error "Non-nil when GDB is reporting an error.")
 (defvar gdb-macro-info nil
   "Non-nil if GDB knows that the inferior includes preprocessor macro info.")
@@ -295,12 +297,19 @@
   (gud-def gud-stepi  "stepi %p"    "\C-i" "Step one instruction with 
display.")
   (gud-def gud-next   "next %p"     "\C-n" "Step one line (skip functions).")
   (gud-def gud-nexti  "nexti %p" nil   "Step one instruction (skip 
functions).")
-  (gud-def gud-cont   "cont"     "\C-r" "Continue with display.")
+  (gud-def gud-cont   "continue"     "\C-r" "Continue with display.")
   (gud-def gud-finish "finish"   "\C-f" "Finish executing current function.")
   (gud-def gud-jump
           (progn (gud-call "tbreak %f:%l") (gud-call "jump %f:%l"))
           "\C-j" "Set execution address to current line.")
 
+  (gud-def gud-rstep   "reverse-step %p"  nil "Reverse step one source line 
with display.")
+  (gud-def gud-rstepi  "reverse-stepi %p" nil "Reverse step one instruction 
with display.")
+  (gud-def gud-rnext   "reverse-next %p"  nil "Reverse step one line (skip 
functions).")
+  (gud-def gud-rnexti  "reverse-nexti %p" nil "Reverse step one instruction 
(skip functions).")
+  (gud-def gud-rcont   "reverse-continue" nil "Reverse continue with display.")
+  (gud-def gud-rfinish "reverse-finish"   nil "Reverse finish executing 
current function.")
+
   (gud-def gud-up     "up %p"     "<" "Up N stack frames (numeric arg).")
   (gud-def gud-down   "down %p"   ">" "Down N stack frames (numeric arg).")
   (gud-def gud-print  "print %e"  "\C-p" "Evaluate C expression at point.")
@@ -563,6 +572,33 @@
        (setq varnumlet (concat varnumlet "." component)))
       expr)))
 
+(defun gdb-toggle-recording ()
+"Start/stop recording of debug session."
+  (interactive)
+  (if gud-running
+      (message-box "Recording cannot be started or stopped while your program 
is still running")
+      (gdb-enqueue-input
+       (list (concat gdb-server-prefix
+                    (if gdb-recording "record stop\n" "target record\n"))
+            'gdb-recording-handler))))
+
+;; Convenience function for tool bar.
+(defalias 'gdb-toggle-recording-1 'gdb-toggle-recording)
+
+(defun gdb-recording-handler ()
+  (goto-char (point-min))
+  (if (re-search-forward "current architecture doesn't support record 
function" nil t)
+      (message-box "Not enabled.  The current architecture doesn't support the 
process record function.")
+    (goto-char (point-min))
+    (if (re-search-forward "Undefined target command" nil t)
+       (message-box "Not enabled.  Process record requires GDB 7.0 onwards.")
+      (goto-char (point-min))
+      (if (re-search-forward "the program is not being run" nil t)
+         (message-box "Not enabled.  Starting process recording requires an 
active target (running process).")
+       (setq gdb-recording (not gdb-recording))
+       ;; Actually forcing the tool-bar to update.
+       (force-mode-line-update)))))
+
 (defun gdb-init-1 ()
   (gud-def gud-break (if (not (string-match "Machine" mode-name))
                         (gud-call "break %f:%l" arg)
@@ -659,7 +695,8 @@
        gdb-printing t
        gud-old-arrow nil
        gdb-thread-indicator nil
-       gdb-register-names nil)
+       gdb-register-names nil
+       gdb-recording nil)
 
   (setq gdb-buffer-type 'gdba)
 




reply via email to

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