emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp ChangeLog progmodes/gdb-mi.el progmo...


From: Dmitry Dzhus
Subject: [Emacs-diffs] emacs/lisp ChangeLog progmodes/gdb-mi.el progmo...
Date: Tue, 11 Aug 2009 10:49:01 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Dmitry Dzhus <sphinx>   09/08/11 10:49:00

Modified files:
        lisp           : ChangeLog 
        lisp/progmodes : gdb-mi.el gud.el 

Log message:
        *** empty log message ***

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15917&r2=1.15918
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/progmodes/gdb-mi.el?cvsroot=emacs&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/progmodes/gud.el?cvsroot=emacs&r1=1.167&r2=1.168

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15917
retrieving revision 1.15918
diff -u -b -r1.15917 -r1.15918
--- ChangeLog   10 Aug 2009 21:42:41 -0000      1.15917
+++ ChangeLog   11 Aug 2009 10:48:56 -0000      1.15918
@@ -1,3 +1,12 @@
+2009-08-11  Dmitry Dzhus  <address@hidden>
+
+       * progmodes/gud.el (gud-stop-subjob): Rewritten without macros
+       from `gdb-mi.el' to avoid extra tangling.
+
+       * progmodes/gdb-mi.el (gdb-gud-context-call): Reverting previous
+       change which breaks `gud-def' definitions. used in `gdb'.
+       (gdb-update-gud-running): No extra fuss for updating frame number.
+
 2009-08-10  Stefan Monnier  <address@hidden>
 
        * international/mule-cmds.el (mule-keymap, mule-menu-keymap)

Index: progmodes/gdb-mi.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/gdb-mi.el,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- progmodes/gdb-mi.el 9 Aug 2009 00:17:06 -0000       1.31
+++ progmodes/gdb-mi.el 11 Aug 2009 10:49:00 -0000      1.32
@@ -134,7 +134,14 @@
 (defvar gdb-frame-number nil
   "Selected frame level for main current thread.
 
-Reset whenever current thread changes.")
+Updated according to the following rules:
+
+When a thread is selected or current thread stops, set to \"0\".
+
+When current thread goes running (and possibly exits eventually),
+set to nil.
+
+May be manually changed by user with `gdb-select-frame'.")
 
 ;; Used to show overlay arrow in source buffer. All set in
 ;; gdb-get-main-selected-frame. Disassembly buffer should not use
@@ -565,12 +572,15 @@
         (gdb-current-context-command command t))
     command))
 
-;; TODO Document this. We use noarg when not in gud-def
-(defun gdb-gud-context-call (cmd1 &optional cmd2 noall noarg)
-  (gud-call
+(defmacro gdb-gud-context-call (cmd1 &optional cmd2 noall noarg)
+  "`gud-call' wrapper which adds --thread/--all options between
+CMD1 and CMD2. NOALL is the same as in `gdb-gud-context-command'.
+
+NOARG must be t when this macro is used outside `gud-def'"
+  `(gud-call
    (concat
-    (gdb-gud-context-command cmd1 noall)
-    cmd2) (when (not noarg) 'arg)))
+     (gdb-gud-context-command ,cmd1 ,noall)
+     ,cmd2) ,(when (not noarg) 'arg)))
 
 ;;;###autoload
 (defun gdb (command-line)
@@ -1655,11 +1665,9 @@
   (gdb-update-gud-running))
 
 (defun gdb-update-gud-running ()
-  "Set `gud-running' and `gdb-frame-number' according to the state
-of current thread.
+  "Set `gud-running' according to the state of current thread.
 
-`gdb-frame-number' is set to nil if new current thread is
-running.
+`gdb-frame-number' is set to 0 if current thread is now stopped.
 
 Note that when `gdb-gud-control-all-threads' is t, `gud-running'
 cannot be reliably used to determine whether or not execution
@@ -1673,12 +1681,10 @@
     (setq gud-running
           (string= (gdb-get-field (gdb-current-buffer-thread) 'state)
                    "running"))
-    ;; We change frame number only if the state of current thread has
-    ;; changed or there's no current thread.
-    (when (not (eq gud-running old-value))
-      (if (or gud-running (not (gdb-current-buffer-thread)))
-          (setq gdb-frame-number nil)
-        (setq gdb-frame-number "0")))))
+    ;; Set frame number to "0" when _current_ threads stops
+    (when (and (gdb-current-buffer-thread)
+               (not (eq gud-running old-value)))
+      (setq gdb-frame-number "0"))))
 
 (defun gdb-show-run-p ()
   "Return t if \"Run/continue\" should be shown on the toolbar."
@@ -1801,7 +1807,7 @@
 (defun gdb-thread-created (output-field))
 (defun gdb-thread-exited (output-field)
   "Handle =thread-exited async record: unset `gdb-thread-number'
-if current thread exited and update threads list."
+ if current thread exited and update threads list."
    (let* ((thread-id (gdb-get-field (gdb-json-string output-field) 'id)))
      (if (string= gdb-thread-number thread-id)
          (gdb-setq-thread-number nil))

Index: progmodes/gud.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/gud.el,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -b -r1.167 -r1.168
--- progmodes/gud.el    4 Aug 2009 17:16:58 -0000       1.167
+++ progmodes/gud.el    11 Aug 2009 10:49:00 -0000      1.168
@@ -133,7 +133,7 @@
           (and (eq gud-minor-mode 'gdbmi)
                (> (car (window-fringes)) 0)))))
 
-(declare-function gdb-gud-context-call "gdb-mi.el")
+(declare-function gdb-gud-context-command "gdb-mi.el")
 
 (defun gud-stop-subjob ()
   (interactive)
@@ -143,7 +143,7 @@
           ((eq gud-minor-mode 'jdb)
            (gud-call "suspend"))
           ((eq gud-minor-mode 'gdbmi)
-           (gdb-gud-context-call "-exec-interrupt" nil nil t))
+           (gud-call (gdb-gud-context-command "-exec-interrupt")))
           (t 
            (comint-interrupt-subjob)))))
 




reply via email to

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