Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [gdb]

GNU Project Debugger - Start it via `M-x gdb` to run the debugger on Ada, C, C++, Objective-C, Pascal, Fortran, Java and other languages.

Filter by
Sorted by
Tagged with
0 votes
0 answers
13 views

Projectile GDB Remote I/O

Trying to debug a remote application. On a different architecture system and have the I/O flooding my GUD command window. I'm wondering how I can launch gdb or configure GUD in a way to get the remote ...
Alec Cox's user avatar
1 vote
0 answers
23 views

ASM debugging : How to watch registers in GUD's speedbar?

I'm trying to debug a programm written in ASM with GDB through Emacs's GUD interface. I've enabled (gdb-many-windows), set a watchpoint on $rax which gives me the changes of the register's value in ...
vmonteco's user avatar
  • 111
0 votes
1 answer
88 views

How to watch variables in gdb?

Is there any buffer in emacs' gdb that can print selected variables (e.g. print *display) on each change (step, next, finish etc.)? It would be useful as opposed to typing print variable each time.
Daniel Krajnik's user avatar
0 votes
1 answer
72 views

How to make gdb show locals buffer in a different window?

Using gdb in emacs, gdb shows the source code to the right of the gdb prompt. According to the documentation, I can do M-x gdb-display-locals-buffer which displays the local variables. However, when I ...
Peter Petigru's user avatar
0 votes
0 answers
21 views

Freezing when using gdb via TRAMP with gdb-many-windows enabled

The problem may be because I am doing this via Tramp, connecting to an Amazon ec2 instance where gdb is installed. I had Emacs 28.2, and now I've upgraded to 29.1 and the same problem occurs. If I ...
Eric Auld's user avatar
2 votes
2 answers
260 views

I can't run gdb in emacs

I want to debug some C++ code in emacs with gdb. I tried to enter gdb with the command: M-x RET gdb RET Then I get a prompt that reads: Enable debuginfod for this session? (y or [n]) Whatever I type,...
MySQLInjection's user avatar
0 votes
0 answers
55 views

python source code with using realgud:gdb and pdb

Following invokes pdb in shell. I have to type list to look at the python source. Instead is there a way to open the python source file, just like how the c++ source file is opened when a gdb ...
user40923's user avatar
1 vote
1 answer
78 views

realgud sets wrong path through tramp when setting breakpoint through GUI

I'm on my Windows machine with a file open on a remote linux server through tramp. I'm using realgud:gdb to debug my C++ file. In the (gdb) prompt, I can set breakpoint just fine using (gdb) b /path/...
JakeTuero's user avatar
1 vote
0 answers
38 views

emacs gdb how to keep only one history

As in title, When I do use gdb mode with Emacs the history run with the command M-r and C-c C-x seems to be different, depending on which frame the gdb was started in the first place! How do I make ...
paul424's user avatar
  • 11
0 votes
1 answer
297 views

gdb input/output buffer not working

I start gdb (with many-windows) through projectile-run-gdb but stdin/out is not displayed in the input/output buffer. And I have no clue where to look for the issue. Google search did not bring up any ...
clanghans's user avatar
0 votes
1 answer
638 views

What’s the most common way to debug C++ on Mac

I'm wondering what's the most common way to debug C++ programs using emacs for Mac users? I’m currently using gdb, which takes a moment for me to make it work for Mac, so I’m now considering give dap-...
Yuxiang Wei's user avatar
2 votes
1 answer
43 views

Preventing shell mode from treating ! as a history reference

Various command-line tools, such as gdb, ftp, sftp, etc, use ! to prefix a command to be run in a shell. So (for instance) !mkdir foo will make a directory called foo. When using these tools inside ...
Nick Barnes's user avatar
0 votes
1 answer
96 views

Changing Breakpoint Icons in GDB

So I've recently started using gud's M-x gdb instead of gdb on it's own, as it provides Emacs with some nice IDE features, mainly being able to see where you are in the code, and where you have set ...
Vent's user avatar
  • 77
1 vote
1 answer
56 views

How to suppress certain parts of gud-gdb -i=mi output in gud buffer?

I start gdb in emacs with 'gdb' command. Is there a way to hide certain lines from being shown in gud buffer? For example, when I do C-c C-c on a running program, I see the following in the buffer: ...
Evgenii.Balai's user avatar
1 vote
1 answer
612 views

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

I am running into an issue where the gdb command fails over tramp. The remote host is a simple linux box I am accessing via ssh. Even when I run emacs without my init file it still happens. Emacs 27....
dvonn42's user avatar
  • 13
0 votes
0 answers
103 views

Configuring emacs gdb behavior

I've been using gdb in emacs for a bit now and I mostly love it, but there are some minor quirks about its behavior that I find bothersome and I wanted to know how to go about tweaking them. I also ...
Onye's user avatar
  • 101
1 vote
2 answers
58 views

How do I get the name of the file being executed in a perldb-mode-hook?

I've been adding some modifications to the perldb which goes through gud. When started it calls its perldb-mode-hook so that and .perldb is where I'm working. From within the hook I can get the ...
Bion Pohl's user avatar
1 vote
0 answers
185 views

Start Emacs with gdb with a different main source file

I often run Gdb in a dedicated Emacs session. I have code to run gdb when Emacs start and set up Many-Windows mode. For one particular project, there are many programs, all written in C, that share a ...
Gilles 'SO- stop being evil''s user avatar
1 vote
2 answers
271 views

How to delete the contents of a buffer by name

For example in gdb mode, there is a buffer named *input/output of <program name>*, that I want to clear each time I press C-c l.
Bite Bytes's user avatar
0 votes
1 answer
297 views

monitor commands from gud/gdb command line not showing output

In a plain terminal, I can run gdb, connect to gdb server via 'target remote :nnnn` and then use the 'monitor' command to send commands to the remote app, and the results from running those commands ...
Greg Sullivan's user avatar
1 vote
1 answer
271 views

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

I am trying to debug an application on a remote environment. Ofcourse running Tramp over gdb works as in https://www.gnu.org/software/emacs/manual/html_node/tramp/Remote-processes.html, but you miss ...
themagicalyang's user avatar
0 votes
0 answers
75 views

Stepping through c code in emacs

I am trying to step through code in emacs and am looking for a plugin which will displa the contents of an element when I hover over it. Is there any plugin like this currently? How do you step ...
pluto's user avatar
  • 1
2 votes
1 answer
586 views

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

My initial quest is Can emacs on Mac using native window system connect to an emacs server on a Linux system but I got off on a tangent that might work ok but I hit a speed bump. As described in the ...
pedz's user avatar
  • 375
0 votes
1 answer
191 views

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

below are my set up for launching gdb in Emacs. (defun debug-gdb-advanced () (interactive) (delete-other-windows) ; close all other panes (split-window-horizontally) ; split pane ...
Dennis's user avatar
  • 43
0 votes
0 answers
204 views

When gdb debugging, can local window in emacs show c++ object's value correctly?

Suppose I've this code: #include "map" #include "string" using namespace std; int main () { map<string, string> m = {{"1", "2"}}; return 0; } If I set BP at "return 0" and when it's ...
kgflying's user avatar
  • 141
3 votes
0 answers
428 views

Valgrind interface for emacs

Is there an interface similar to 'gdb-mi' for using Valgrind in emacs? What are some ways to use Valgrind inside emacs?
hrkrshnn's user avatar
  • 439
4 votes
1 answer
929 views

GDB-MI - Displaying complex data-types

The GDB local variable window (in the multi-window view) usually works fine to track local variables. However, I've recently been coding a lot in C++, and almost all variables are some kind of struct/...
Xaldew's user avatar
  • 1,231
1 vote
2 answers
1k views

Run gdb from the command line

I use emacs/gdb for debugging. Generally, I emacs M-x then type gdb type exe name. Every debug, I've gone through these 3 steps. I want to know: is it possible to run gdb from the command line, e....
kgflying's user avatar
  • 141
1 vote
1 answer
251 views

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

I'm debugging a large codebase (written in C++). Everything works perfectly if I run gdb from a regular terminal as follows: $ gdb <program-name> Reading symbols from <program-name>......
John DeBord's user avatar
2 votes
2 answers
498 views

Highlight current line in GUD disassembler window

I am using GUD for debugging C code. Because many of the lines and variables have been optimized away, it is necessary to follow the C source and the corresponding disassembly simultaneously. I want ...
nispio's user avatar
  • 8,235
0 votes
0 answers
175 views

Gdb: run a hook when the program is being started

I'm using M-x gdb to debug a program that produces some output. The output appears in the buffer *input/output of a.out*. I often run the same program multiple times during a session, often after ...
Gilles 'SO- stop being evil''s user avatar
1 vote
1 answer
960 views

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

This is most likely an issue with g++/gdb/other, but an indirect issue within Emacs nonetheless. Whilst debugging, I would like for Emacs to step into the standard library implementation of the ...
John DeBord's user avatar
1 vote
2 answers
402 views

How to open 3 emacs windows when debugging using gdb

I am debugging a program that outputs 8 or more lines of display and requires input. So my IO window has to be say 10 rows or so in height. But I also want to see the source code AND of course the ...
arcomber's user avatar
  • 207
1 vote
0 answers
65 views

Show the current command line the frame title in a GDB session

I sometimes run multiple instances of Emacs, each running a GDB session. These GDB sessions are often running different versions of the same program, or the same program with different arguments, so I'...
Gilles 'SO- stop being evil''s user avatar
1 vote
1 answer
394 views

Can't start gdb over ssh

I am able to open a remote C source file using tramp (via ssh). However, when I try to debug it using M-x gdb gdb -i=mi /ssh:localhost#8022:/usr/bin/httrack I get Current directory is /ssh:...
Robin Green's user avatar
1 vote
0 answers
331 views

M-x gdb don't create new frames

When I run M-xgdb, Emacs opens a new frame with the code being debugged. This is while having two buffers open in the original frame: the one with debugger's console and another one with the program'...
wvxvw's user avatar
  • 11.4k
1 vote
1 answer
629 views

Bindings for source code when debugging in gdb/gud

We can define a bunch of bindings for gud-mode through gud-mode-map. But it seems these bindings only hold when the active window is one of the dedicated gdb windows (or simply the comint window if ...
yafov's user avatar
  • 314
1 vote
2 answers
398 views

What is the good resource for getting started using EMACS? [duplicate]

I have not used EMACS seriously in 20 years. I work on a Mac and am a vi/Eclipse person now. I want to switch back to EMACS for C and C++ programming. When I was researching EMACS add-on packages ...
user1172468's user avatar
  • 1,047
5 votes
2 answers
2k views

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

When using gdb -i=mi to debug a program, I typically split the window into two buffers vertically. But every time my program prints something gud automatically replaces my source code buffer with I/O ...
Mingheng Wang's user avatar
3 votes
0 answers
305 views

Why don't I get a source window using realgud:gdb?

using GNU Emacs 25.2.1 (x86_64-w64-mingw32) and realgud 20171006.1840 (from marmalade), I can't use realgud for debugging with gdb: I start it as described in the docu: M-x load-library RET realgud ...
Markus's user avatar
  • 481
0 votes
1 answer
1k views

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

Hello I am novice programmer and I am trying to debug a simple C program, using getline (from the K&R book at the beginning) - input ends on newline. I have a problem with gdb on Emacs. When I ...
user16547's user avatar
1 vote
0 answers
464 views

How I can show the breakpoints dots per-line on file-buffer using gud-gdb?

Using gdb defined by package gdb-mi.el I got the breakpoints red dots after click on line with mouse or defining on gdb buffer. However, using a alternative wrapper for gdb present on the stantard ...
Manoel Vilela's user avatar
0 votes
1 answer
4k views

GUD debugger says: Undefined command: "-interpreter-exec"

I am following the tutorial Open GDB (within Emacs for added functionality) on Emacs 25.2.1 with Evil Spacemacs and Ivy (the commands gud-gdb and gdb get the same results): SPC f f (counsel-find-file)...
wolfv's user avatar
  • 1,393
1 vote
2 answers
214 views

gdb Info manual

I can't seem to find the gdb Info manual file on the gnu.org documentation page for gdb, which only seems to have a PDF version and an online version. I've found and manually installed several other ...
yroc's user avatar
  • 113
5 votes
1 answer
201 views

How to attach/connect two subprocesses?

The general case: Simply put, given that I start two processes (Aand B) with, e.g., async-start-process, what is best way of killing B if A terminates? My specific usecase: I'm debugging embedded ...
thomsten's user avatar
2 votes
2 answers
363 views

Use a specific font face for gdb buffers

Need Default emacs font for most buffers is okay. But for coding-related activities I need a smaller, crisp font. What works In the spirit of Is it possible to change the font size in specific ...
Stéphane Gourichon's user avatar
1 vote
0 answers
157 views

Getting gdb to work for this project

For this project, I cannot seem to get M-x gdb to work in Emacs 25.1 (on Ubuntu 14.04.5 64-bit if it matters - this should be the case for any Ubuntu-based Linux in general I imagine). Steps to ...
space_voyager's user avatar
4 votes
1 answer
437 views

Command history not saved while using GDB from Emacs

I usually debug in console gdb and now I'm trying to move to Emacs. In my ~/.gdbinit I have the following lines setting up history: # save history of unlimited size, write always to ~/.gdb_history ...
ars's user avatar
  • 183
1 vote
1 answer
617 views

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

How do I start emacs with a command and its option, for example, I want emacs start with entering gdb mi mode, otherwise it does not go to the gdb mode during startup. The following works: emacs gdb ...
phonycollectibles's user avatar
2 votes
1 answer
477 views

gdb-many-windows causes hangs in emacs 24.5

When running gdb -i=miand then attach to the process for debugging, emacs hangs for like 5 minutes before I can type anything. After trial and error I found it is caused by the following line in my ...
cdnszip's user avatar
  • 347