Skip to main content
Share Your Experience: Take the 2024 Developer Survey
6 votes
Accepted

GDB-MI - Displaying complex data-types

After some research, I found out that the <complex data type> string is indeed added by Emacs. In particular, Emacs uses the "--simple-values" flag sent to the GDB-MI interface to only retrieve ...
Xaldew's user avatar
  • 1,231
6 votes
Accepted

How can I prevent gdb *input/output* buffer from aggressively popping up in frame?

As soon as emacs 25 lands, there will be a variable gdb-display-io-nopopup to fix this problem
ajp's user avatar
  • 403
5 votes
Accepted

How to attach/connect two subprocesses?

For two processes A and B mutually killing each other you can use the following approach: Start the first process just with start-process and remember its process (as lisp object). Start the second ...
Tobias's user avatar
  • 33.2k
3 votes

emacs in --deamon mode dies when X display socket closes. How to prevent this?

The answer to the question is to use the Lucid version of emacs. With Ubuntu, the package is called emacs25-lucid. From comments in the code and it also pops out on stderr if you can managed to get ...
pedz's user avatar
  • 375
3 votes

Stuck at input emacs gdb debugging C program /* enter doesn't end text input */

Type your input in the "input/output" window. Not in the "gud" window. In the layout shown in GDB User Interface Layout it is the one labled "I/O buffer for debugged pgm"
emacs-user's user avatar
2 votes
Accepted

gdb Info manual

Apparently the doc in info format is not directly available. However the texinfo file (from wich the info file is generated) is included in the sources as doc/gdb.texinfo. So if you install gdb ...
JeanPierre's user avatar
  • 7,475
2 votes

Highlight current line in GUD disassembler window

This is the solution I came up with using hl-line. I needed to advise the function that updates the disassembly buffer and invoke hl-line-highlight directly to make it work. (defadvice gdb-...
nispio's user avatar
  • 8,235
2 votes

What is the good resource for getting started using EMACS?

If your project uses cmake, cmake-ide is a good start. Or else, use company(auto completion)+counsel-gtags(code navigation)+global You can use helm-gtags instead of counsel-gtags. Both packages are ...
chen bin's user avatar
  • 4,877
2 votes
Accepted

How to set gud gdb -i=mi not to replace current buffer?

The automatic pop-up of the i/o buffer can be disabled by setting gdb-display-io-nopopup to t. In your .emacs file, add: ;; Prevent gdb from popping i/o window to the foreground on every output op (...
Pablo Halpern's user avatar
2 votes

Preventing shell mode from treating ! as a history reference

Figured it out: (setq shell-input-autoexpand nil). I spent a long while looking at comint-input-autoexpand which was getting mysteriously set to 'history: this is done by shell-mode based on shell-...
Nick Barnes's user avatar
2 votes
Accepted

gdb over ssh via tramp fails (but gdb-gud works?)

This is bug#44151, see https://debbugs.gnu.org/44151. I've fixed this in Tramp 2.4.4.3, which will be released later today on GNU ELPA. Note that this bug describes a further problem, which seems to ...
Michael Albinus's user avatar
2 votes

How to automatically restore the previous window layout after gdb?

Try this: ;; Select a register number which is unlikely to get used elsewere (defconst my-windows-config-register 313465989 "Internal used") (defvar my-windows-config nil) (defun set-my-windows-...
Andreas Röhler's user avatar
1 vote

gdb input/output buffer not working

Apparently the target output stream is not redirected while debugging on a remote target, so you need to set this. This snippet helped me solving the issue: (defun private-gdbmi-bnf-target-stream-...
clanghans's user avatar
1 vote
Accepted

How to delete the contents of a buffer by name

In general, if you don't know the exact name of the buffer, you need to call buffer-list to obtain the list of buffers and filter the result to only act on the desired buffer(s). Untested code: (defun ...
Gilles 'SO- stop being evil''s user avatar
1 vote
Accepted

How to make gdb mode send proper filename to gdbserver? Running gdb from pure terminal works

I made this work by passing argument when launching gdb. M-x gdb RET gdb -i=mi -ex "target extended-remote <remote>:44421" -ex "set remote exec-file ./executable" --args "-c config.xml" Then ...
themagicalyang's user avatar
1 vote
Accepted

in a custom lisp function how to run command after gdb loaded

The hook variable gdb-mode-hook is probably what you are looking for. Citation from the GUD-manual On startup, GUD runs one of the following hooks: gdb-mode-hook, if you are using GDB; dbx-mode-...
Tobias's user avatar
  • 33.2k
1 vote

Run gdb from the command line

You can pass options to Emacs to make it run code when it starts: -l /path/to/file.el, -f function-called-without-arguments, --eval "(some-lisp-code 'taking-care-of \"quoting for the shell\")". The ...
Gilles 'SO- stop being evil''s user avatar
1 vote

Run gdb from the command line

man emacs gives the following - perhaps one of these invocations would help: The following options are Lisp-oriented (these options are processed in the order encountered): -f function, ...
wef's user avatar
  • 452
1 vote

Problem debugging in `gud-mode' (M-x `gdb' with `many-windows' enabled)

I solved this by upgrading to gdb-8.2.
John DeBord's user avatar
1 vote

Highlight current line in GUD disassembler window

Thanks to @lawlist nudging me into the source code, I found out that gdb mode will highlight the line for me, but only on the condition that the window containing the disassembly does not have fringes....
nispio's user avatar
  • 8,235
1 vote
Accepted

How to step into a c++ std library function in gdb/gud

There's nothing you can do with Emacs that will change how this works, since you're just asking Emacs to ask gdb to step. Try compiling your program with -Og -ggdb, to ensure that you have the maximum ...
db48x's user avatar
  • 18.2k
1 vote

How to open 3 emacs windows when debugging using gdb

For anyone else's benefit, you can use gdb-many-windows like: Compile your executable (don't forget to compile with the -g flag). m-x gdb m-x gdb-many-windows You then get the same sort of ...
arcomber's user avatar
  • 207
1 vote

Can't start gdb over ssh

My problem was I didn't have gdb installed on the remote side.
Robin Green's user avatar
1 vote
Accepted

Bindings for source code when debugging in gdb/gud

The right place is gud-minor-mode-map. I have got the following bindings in my setup. Pick whatever suits you for your setup. (defun gdbTZA-gud-run-or-cont (arg) "Combination of `gud-run' and `gud-...
Tobias's user avatar
  • 33.2k
1 vote

Under gdb-mi can I attach a command to a breakpoint?

I also like to use commands attached to a breakpoint. If I enter the gdb command: comm 3, it starts collecting the commands for the breakpoint, but when I enter end it does not recognize the command ...
Bruce's user avatar
  • 11
1 vote

Under gdb-mi can I attach a command to a breakpoint?

Given the "rough edge" I referenced in my original question I decided to investigate prompt handling in gud.el. Based on nothing more than a hunch I tried changing the two lines (~783 in function gud-...
John Yates's user avatar
1 vote
Accepted

Use a specific font face for gdb buffers

Maybe something like this? (add-hook 'gdb-mode-hook 'my-buffer-face-mode-fixed) (advice-add 'gdb-parent-mode :after 'my-buffer-face-mode-fixed) Some of the buffers are in non-gdb modes, however (e.g....
Muir's user avatar
  • 321
1 vote

Command history not saved while using GDB from Emacs

Try: (add-hook 'kill-buffer-hook 'comint-write-input-ring) For some reason gdb, as one of the comint modes, does not do this by default. Note: gdb gud buffer has to be killed. By default tt is not ...
folq's user avatar
  • 161
1 vote
Accepted

Start Emacs with entering gdb mi mode (NOT after startup and enter gdb mi manually)

The following works: emacs --eval "(gdb \"gdb -i=mi\")"
phonycollectibles's user avatar
1 vote
Accepted

gdb-many-windows causes hangs in emacs 24.5

If thats indeed gdb-many-windows problem. One can avoid using gdb-many-windows and define similar functionality inside the function gdb-get-source-file. You can modify the source file and build from ...
phonycollectibles's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible