The GNU Debugger (GDB) is a portable debugger that runs on many Unix-like systems and works for many programming languages.
Questions tagged [gdb]
180 questions
10
votes
3 answers
gdb in one command
When I debug an executable program with arguments arg1 arg2 with gdb I perform the following sequence
gdb
file ./program
run arg1 arg2
bt
quit
How can I do the same from one command line in shell script?

Viesturs
- 943
- 3
- 12
- 16
6
votes
1 answer
How to produce a VLC stack trace?
I've reported a VLC bug and included the output of gdb's bt full, but the response from a project representative is that the trace is "incomplete". How can I produce a trace that would be usable to a developer? Their documentation and bug feedback…

l0b0
- 51,350
5
votes
1 answer
How to set up gdb to scan through heap memory?
I want to print out and analyze the contents of the system heap. Obviously, this should be a privileged operation, and might go against the grain of what GDB was intended to do.
Specifically, I want to scan across the entire systems heap, and not…

MrSynAckSter
- 249
4
votes
2 answers
How to build the GDB documentation from source?
I've downloaded the GDB source:
git clone git://sourceware.org/git/binutils-gdb.git
now how do I generate the documentation from source as can be downloaded from: https://sourceware.org/gdb/current/onlinedocs/ ?
I'm especially interested in the…

Ciro Santilli OurBigBook.com
- 18,092
- 4
- 117
- 102
4
votes
2 answers
gdb always program exited with code 01
I am using scientific linux. I am trying to compile a project that uses a bunch of cpp files. Right now, it compiles successfully, but the values/data I'm getting are definitely wrong.
In the directory user/project/Build, I enter make to compile and…

user4352158
- 441
- 2
- 7
- 9
3
votes
1 answer
Which gdb set commands to use when target has stripped libraries and binaries and host has corresponding tree with the ".debug" directories
I have a setup at hand where target device has only stripped libraries and binaries . Target has gdbserver. On host I am using gdb-multiarch. Host has a directory that contains respective ".debug" directories. This directory on host does not contain…

sob
- 382
3
votes
1 answer
gdb stl functions still show as inlined after disabling optimizations
I have built gdb-7.12 with python support in my ubuntu 14.04 and have enabled pretty printing and configured my gdbinit file by following https://sourceware.org/gdb/wiki/STLSupport.
But whenever i print the size of any container:
p…
2
votes
0 answers
Setting breakpoints remotely with gdb/gdbserver
I'm debugging a vulnerable app on a remote host. I've set up gbserver on the host with:
gdbserver host:1234 /my/target/app
On my local host I've connected with:
$ gdb /same/target/app
gdb$ target extended-remote 192.168.0.100:1234
I connect…

Juicy
- 3,875
1
vote
1 answer
Start GDB with No Help Information
Every time I start gdb, the following information is displayed:
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free…

Ziqi Fan
- 237
- 1
- 2
- 9
1
vote
1 answer
Transferring control of ptrace to another process
I asked this question in the reverse engineering stackexchange: https://reverseengineering.stackexchange.com/questions/15169/transferring-control-of-ptrace-to-another-process
because I thought a ptrace question was most appropriate there.
I didn't…

Thad_The_Man
- 33
- 4
1
vote
0 answers
Why would gdb ignore Control C
Centos7, gdb 'GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7'.
Here's what I do:
I use gdb -p to attach to a process.
Set a breakpoint
'c'
Now, I realize that I should have set two breakpoints. OK, I hit 'Control-C'. GDB ignores me, it does…

bmargulies
- 421
0
votes
0 answers
Gdb stuck in tty
I'm trying to debug Hyprland and running it with gdb completely freezes all keyboard input and forces you to restart the computer. You can't Ctrl+C or Ctrl+Alt+F[1-6] to get away. It's completely stuck.
Does anyone know what may be causing it? Or…

Daniel Krajnik
- 309
0
votes
0 answers
gdb watch a expr in a loop
code snippet:
foreach(lc, vars)
{
if (IsA(lfirst(lc), Var))
{
Var *var = (Var *) lfirst(lc);
/* if system column, return error */
if (var->varattno < 0)
ereport(ERROR,
…

jian
- 567
0
votes
1 answer
gdb execute through to a specific function
https://git.postgresql.org/cgit/postgresql.git/tree/src/test/modules/delay_execution/delay_execution.c
https://stackoverflow.com/questions/11967440/stepping-into-specific-function-in-gdb
I loaded the module delay_execution.
then gdb -p $proc
quite…

jian
- 567
0
votes
0 answers
Unable to break to libc function from gdb
Target:
gdbserver --wrapper env "LD_PRELOAD=/test.so" -- :1234 /bin/true
Debugger:
# gdb-multiarch -ex 'set arc arm' -ex 'target remote :1234'
...
For help, type "help".
Type "apropos word" to search for commands related to "word".
The target…

user212942
- 111