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.
64
questions
0
votes
1
answer
74
views
Disabling autocompletions in gud-gdb
I'm debugging a large C/C++ project (several millions lines of code, adding debug symbols to exec make it grow by 2.5Go) using GUD (gdb 12.1) on Emacs 29.1.
My issue is that in the gud-<...
0
votes
0
answers
16
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 ...
1
vote
0
answers
29
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 ...
0
votes
1
answer
139
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.
0
votes
1
answer
135
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 ...
2
votes
2
answers
366
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,...
1
vote
1
answer
90
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/...
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 ...
0
votes
1
answer
317
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 ...
0
votes
1
answer
712
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-...
2
votes
1
answer
44
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 ...
0
votes
1
answer
103
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 ...
1
vote
1
answer
64
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:
...
1
vote
1
answer
635
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....
0
votes
0
answers
117
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 ...
1
vote
2
answers
60
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 ...
1
vote
0
answers
189
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 ...
1
vote
2
answers
289
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.
0
votes
1
answer
316
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 ...
1
vote
1
answer
287
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 ...
0
votes
0
answers
76
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 ...
2
votes
1
answer
627
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 ...
0
votes
1
answer
196
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 ...
0
votes
0
answers
207
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 ...
3
votes
0
answers
436
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?
4
votes
1
answer
957
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/...
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....
1
vote
1
answer
265
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>......
2
votes
2
answers
526
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 ...
0
votes
0
answers
179
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 ...
1
vote
1
answer
1k
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 ...
1
vote
2
answers
429
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 ...
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'...
1
vote
1
answer
399
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:...
1
vote
0
answers
336
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'...
1
vote
1
answer
647
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 ...
1
vote
1
answer
404
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 ...
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 ...
3
votes
0
answers
312
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 ...
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 ...
1
vote
0
answers
482
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 ...
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)...
1
vote
2
answers
234
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 ...
5
votes
1
answer
203
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 ...
2
votes
2
answers
369
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 ...
1
vote
0
answers
162
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 ...
4
votes
1
answer
454
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
...
1
vote
1
answer
628
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
...
2
votes
1
answer
480
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 ...
1
vote
2
answers
842
views
How to automatically restore the previous window layout after gdb?
I am unable to find any gdb-kill-hook or similar.
After calling gdb with gdb-many-windows the frame gets a new window layout.
I am trying to store the previous layout in a register and to restore it ...