Emacs 23.1.1 with gdb - force source windows

I am using emacs 23.1.1 with gdb and gdb-many-windows.

My question is, is it possible to force gdb to always use the main source window to go through the code. What happens is that when moving the frames of the stack, if I have the source file in other emacs frames, emacs brings that frame to the foreground, leaving the gud frame in the background with the keyboard focus.

What I would like to do is force emacs / gdb to use the primary source window for the entire trace, even if there is another frame with the same source file that lies somewhere.

Any ideas?

+6
emacs gdb
source share
1 answer

My version of emacs is 24.3. So I'm not sure that the following tip will help solve your problem:

(defadvice gud-display-line (before one-source-window activate) "Always use the same window to show source code." (let ((buf (get-file-buffer true-file))) (when (and buf gdb-source-window) (set-window-buffer gdb-source-window buf)))) 

I found gud-display-line with arg true-file argument in the old source: http://www.mit.edu/~mkgray/stuff/ath/afs/oldfiles/project/silk/root/afs/athena.mit. edu / contrib / xemacs / OldFiles / share / xemacs-packages / lisp / debug / gdb.el

Alternatively, gdb-source-window can be found in the discussion about 23.1: https://groups.google.com/forum/#!topic/gnu.emacs.bug/KS6bhNeJ9rc

Therefore, it looks like I used in 23.1.

To avoid splitting the window, you can try the following:

 (defadvice gud-display-line (around one-source-window activate) "Always use the same window to show source code." (let ((buf (get-file-buffer true-file))) (when (and buf gdb-source-window) (set-window-buffer gdb-source-window buf))) (let (split-width-threshold split-width-threshold) ad-do-it )) 
+3
source share

All Articles