Questions tagged [gdb]
64 questions
63
votes
5 answers
Accessing Windows localhost from WSL2?
I have Windows 11 with WSL2 (Ubuntu) installed on it.
I've setup a gdb listener server on my Windows localhost and want to access it from Wsl2, but it seems my Windows machine and WSL are using different network adapters.
>ipconfig
Windows IP…
25
votes
2 answers
How do I turn off GDB TUI?
I have this GDB TUI/layout on. How do I return to the default GDB view?
I can't just restart GDB, because I have important backtrace on my hand and as long as I have these extra windows I can't scroll well on the basic view.
user40167
- 717
14
votes
3 answers
Closing open file without killing the process
I have java(yeah java...) application running on CentOS 7.
After a while, there are many "deleted" files that bother me.
for deleted files used(not the issue):
lsof | grep "(deleted)"
I found them in /proc/pid/fd/... and my question is how can I…
igor
- 473
12
votes
3 answers
In GDB, how can I jump directly up to the topmost call stack frame?
I have a C program that seg faults after descending deep into an infinite recursive mess. Backtracing the process in GDB is useless because the call stack frame is at least 1000 frames deep, and the repeated function calls are series of four common…
dandrews
- 223
11
votes
5 answers
Why can't I find termcap library when I build gdb?
make and then failed with:
configure: error: no termcap library found, but that termcap lib is just there, why can't make find it?
checking for library containing zlibVersion... -lz
checking zlib.h usability... yes
checking zlib.h presence...…
hugemeow
- 2,329
9
votes
5 answers
How to dump memory to a file in gdb (osx)? Need to rescue my work
I need to know how I can dump memory in Safari.app, to a file.
I've entered gdb attach 6741 (my safari PID).
Now what?
I tried searching for help on gdb on google, but I couldn't find anything that told me what to do, even when searching for "how to…
boytheo
9
votes
0 answers
GDB 7.6 TUI does not refresh the display, creating artifacts
I'm using GDB 7.6 on a remote server.
When I start gdb, everything is fine, as long as the program to debug is not run. I can use up and down arrows to navigate through GDB history, etc. No display bug to report.
When I create a breakpoint somewhere…
hdl
- 199
8
votes
5 answers
sending one key stroke to two windows (Ubuntu)
I'm running Ubuntu Linux. I have two open Terminal windows running side by side. I'm looking to be able to hit the enter key once, and have that key stroke sent to both windows.
(What I'm doing is stepping through some code on two different systems…
Jenna
8
votes
1 answer
How to codesign gdb on OS X Mojave?
After installing gdb from homebrew (via $ brew install gdb), I followed these instructions to give gdb permissions to attach to a process.
When I got to the step that runs the command:
$ codesign --entitlements gdb-entitlement.xml -fs gdb-cert…
camercu
- 461
6
votes
2 answers
Software: Launching League of Legends spectator mode from Command Line (Mac)
Background: tl;dr at the end
League of Legends has a spectator mode, in which you can watch someone else's game (essentially a replay) with a 3 minute delay.
Popular LoL website OP.GG has figured out a clever way of hosting these spectator games on…
Alex Popov
- 183
5
votes
4 answers
How to change the default directory in emacs?
When I'm using
M-x gdb
when lots of source files are open in emacs, the default directory in emacs is often different with the directory of my working copy to run that file i want to run.
It's always painful to type the correct full path of the…
user2195
4
votes
1 answer
What is batch mode execution in GDB?
I read a comment like - "Runs gdb in batch mode".
So wanted to understand what does batch mode execution mean for GDB?
And what is the other mode of execution for GDB?
Darshan L
- 669
3
votes
2 answers
GDB Hangs after “New Thread” on macOS
I have built GDB from source on macOS 12.0 and codesigned it. However, every time I try to debug a program, I get this:
(gdb) b main
Breakpoint 1 at 0x10000324f: file main.cpp, line 50.
(gdb) run
Starting program: /Users/tjcaul/Documents/C++/a.out…
tjcaul
- 283
3
votes
1 answer
How to install GDB 8 in CentOS 7
I need to install GDB 8.0 or above in my CentOS 7. My current version of gdb is 7.6.1.
I have followed the guide at devtoolset-7-gdb | Install HowTo:
yum install centos-release-scl-rh
yum --enablerepo=centos-sclo-rh-testing install…
AgnosticCucumber
- 131
3
votes
2 answers
How to tell emacs gdb to show current code line in the center of buffer?
Using the debugger in emacs is nice: You can step through the code with the next command, and emacs will always show the code line that is currently executed, like this:
int x;
int y;
=>int z;
But unfortunately, if your file is long, that…
dehmann
- 2,333