When debugging with gud and gdb in many-windows mode, some source files are opened in the gud interaction window instead of the source window.

This appears to happen to files, and only those files, which were open in Emacs before gud was started.

I've replicated the behavior without my environment using emacs -Q

This is currently in version 24.5.1 but I also experienced the behavior in 24.4.

My bug report is here: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22374


2 Answers 2


I'm having similar issue with 24.5.1 which comes with Ubuntu 16 LTS.

Seems to be somehow related to this issue and using "gud-gdb" command as suggested in an answer to revert to the old GUD behavior solved my problem.

And within that issue, another answer describes the issue of the usage of "dedicated window" with new GUD in more details.


I also had problems with gdb-many-windows. My window and buffer setup was always messed after certain events. I decided to rewrite it myself, so I can also customize my window setup better. You have to take a look at the relations between gdb-many-windows, gdb-restore-windows and gdb-setup-windows.

If you only want to fix your problem with the source file, you should look for this snippet (gud-find-file gdb-main-file). This is actually responsible for opening your source file. However there seems to be a problem with the code that uses it.

So far it works for me just fine, though I expect different problems, because I've removed some code.

EDIT: I just recognized, that there seems to be a problem with gud-find-file. However I couldn't fix it yet.

  • Thanks for pointing out gud-find-file. I'll look there for a possible work-around or fix.
    – Mike B
    Oct 12, 2016 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.