I use gdb-many-windows
in emacs
for my debugging.
Recently, I discovered how to move a buffer to another X window using C-x 5 2
.
I find it convenient: since I use multiple displays, I can have one window with source and variables, and gdb's command line in another window.
But my problem is when I perform a step-by-step in gdb
: when it opens another source file, it does that in the same window where the command line is located, while I expect it to be updated in the other window.
Does anybody know how to tweak gdb
or emacs
to do that? Thanks,
This is really useful - Emacs separates out the source code, the program output, the interpreter into separate windows so you can navigate your program more easily. However, there's even more that Emacs can show in separate windows by navigating to the GUD menu and then GDB-Windows option:
If the variable gdb-many-windows is nil (the default), M-x gdb normally displays only the GUD interaction buffer. However, if the variable gdb-show-main is also non- nil , it starts with two windows: one displaying the GUD interaction buffer, and the other showing the source for the main function of the program you are debugging.
To toggle between the many windows layout and a simple layout with just the GUD interaction buffer and a source file, type M-x gdb-many-windows .
Step through a program using the step (execute line by line, entering any function calls) and next (execute line by line, skipping over function calls). If you're debugging inside of Emacs, gdb will draw an arrow before the to-be-executed line of your source file.
The value display-buffer-reuse-frames
does address exactly this "issue". Session-wide setting in configuration file:
(setq-default display-buffer-reuse-frames t)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With