Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

emacs gdb source code window focus issue

Tags:

emacs

gdb

I am using emacs 25.1 and gdb 7.12 now. but when I run "M-x gdb -i=mi a.out",then set break point and issue next command, a source code window alway popup to get focus, then if I want to issue next command again, I have to switch to the gdb window firstly, otherwise, keyboard input will be direct to the source code file.

We should keep focus on the gdb window rather than switch focus to the source code window.

Am I wrong to use this gdb mode? BTW,gud-gdb mode works fine.enter image description here

like image 525
beetlej Avatar asked Nov 30 '16 14:11

beetlej


1 Answers

A couple of things:

1) They (I know, I know ... who's "They"? :-) have mucked with gdb.

2) See #1

I'm generally a solution type of person, but workaround works in this case, for now.

a) Use gud-gdb instead of gdb

b) To keep the gdb command window from being clobbered, use:

set-window-dedicated-p

I use as follows:

(defun pgmdb (pgm)
    (gud-gdb (format "gdb -fullname %s" pgm))
    (set-window-dedicated-p nil t)
    )

That keeps the former functionality somewhat intact.

Hope this helps.

like image 56
davernator Avatar answered Nov 15 '22 06:11

davernator