Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
3answers
41 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....
0
votes
0answers
37 views

GDB command becomes unresponsive after printing “No such file or directory.”

I'm attempting to debug a program using M-x gdb -i=mi --args <prog> <args> in Emacs. Everything works fine until I get to a function from a source file that was not compiled with debugging ...
1
vote
1answer
38 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>......
1
vote
2answers
37 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
0answers
18 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 ...
0
votes
1answer
36 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
0answers
16 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
0answers
40 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
1answer
59 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
0answers
77 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'...
0
votes
0answers
47 views

Stepping through source in emacs, line pointer will not advance past file open line

I have just started using emacs for debugging and I have two questions. First, I am working in gdb-many-windows mode. I have set a breakpoint and it gets properly hit in the source code window, ...
0
votes
0answers
70 views

Debugging with gdb does not allow user to enter multiple console inputs

I wrote the following C++ program in Emacs named check_emacs_debug.cpp #include <iostream> int main() { for(int i = 0; i < 10; ++i) //Breakpoint { int num; std::...
0
votes
1answer
150 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
2answers
134 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 ...
4
votes
1answer
383 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 ...
1
vote
0answers
89 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
1answer
235 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
0answers
116 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
1answer
1k 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
2answers
69 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
1answer
77 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 ...
3
votes
2answers
168 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
0answers
69 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 ...
2
votes
0answers
142 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 ...
0
votes
1answer
280 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
1answer
235 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
2answers
431 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 ...
1
vote
1answer
187 views

Conditional Keybinding for gdb: gud-step if debugging, otherwise gud-run

I have been trying around getting one keybinding <F7> to perform one gud-step command if a debugging process is running. If it is not running it shall perform gud-run. I am not very familiar ...
1
vote
0answers
34 views

Too many empty prompt lines when repeating the last command in GDB in Emacs

GDB has a feature: when the user wants to repeat the previous command (for example "n"), she can simply hit Enter. When using GDB with a source code viewer in a terminal (gdb -tui), repeat the last ...
1
vote
0answers
159 views

gdb input/output window

I run M-x gdb using emacs integrated with the shell (-nw) but when I debug programs it doesn't display the output step by step. I mean that it returns the output only at the end when the program ...
7
votes
2answers
613 views

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

When using gdb with M-x gdb, the *input/output* buffer always pops up aggressively in any frame which has focus and isn't already displaying it. I would like the *input/output* buffer to stay quietly ...
1
vote
2answers
130 views

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

I use gdb-mi in order to have access to gdb-many-windows functionality. I would like to access gdb's ability to attach a list of commands to execute once a breakpoint gets hit. Documentation ...
3
votes
1answer
476 views

Is it possible to use mozilla's rr with gdb multi-window?

I have started using mozilla's rr (timetravelling debugger, github here) on the command line for debugging c++ code. In emacs I can start it with gud-gdb and writing rr replay (as mentioned here or ...
1
vote
0answers
65 views

Jumping from gud-interaction-buffer to code

I'm trying to use GUD more as a front-end to GDB. I mostly work in the interaction buffer as I do normally on the command line. However when I come across a particular line in the code (through bt or ...
1
vote
1answer
767 views

How to browse through the gdb command history in gud?

From time to time I am using gdb through the gud Emacs interface to debug my C programs. Nevertheless, I find extremely annoying to not be able to browse the gdb command history by just using the Up ...
0
votes
1answer
219 views

How to get the gdb GUI to work?

I can't figure out how to enable the gdb-gui. Instead of this: I only get this: GNU gdb (GDB) Red Hat Enterprise Linux (7.2-83.el6) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+:...
1
vote
1answer
38 views

How to load a new version of emacs module from a file?

I am trying to debug a c++ program using M-x gdb but I get nothing but a (gdb) prompt. This question has a comment which suggests to load the latest version of gdb-mi.el. Can you try download ...
15
votes
1answer
1k views

How do I debug an emacs crash?

I am debugging why emacs crashes when using a function from a package1. The aim of this debug process is to get useful data to submit using M-x report-emacs-bug. To get help on how to debug emacs ...
1
vote
1answer
588 views

Using different gdb in emacs

I built a new version of GDB and it works properly from terminal. Now I want it to be executed when I run M-x gdb from emacs.
0
votes
1answer
572 views

Emacs GDB does not load shared library symbols

I am trying to debug a C/MPI library that I have built. All objects are compiled using GCC and -ggdb, they are also linked using -ggdb. When I try to attach a gdb session to the process with the -p ...
2
votes
1answer
450 views

How can I delete all the gdb related windows/buffers after `q` in gdb CLI window

I use (setq gdb-many-windows t) and (setq gdb-show-main t) configurations in my init.el, so after executing M-x gdb, there will be six windows in the frame, after typing q in the main gdb cli window ...