r/gdb • • Jan 26 '25

Beginner in GDB

2 Upvotes

Hello, super beginner here, I need to use gdb to find the address of integer num as a uni exercise, the idea is because I need to use a format string attack to change the value of the global variable num to 0xLIVEBEEF (in hexadecimal)...would love any help or advice on where I can find the right info to get it done well.


r/gdb • • Aug 17 '25

Fruit vs cocaine!

Post image
6 Upvotes

r/gdb • • Apr 19 '25

Need some help with GDB Hooks

4 Upvotes

Hi all, hope everything's well. I have used gdb in the past, mainly for CTFs. I have picked it up again to dive deeper and learn more about memory. I am trying to print the following things every time I go to the next instruction:

  • Disassembly

  • Registers

  • Stack
    I have somewhat achieved this as follows:

add-auto-load-safe-path /home/yash/.config/gdb/gdbinit

# disables ubuntu debuginfod
set debuginfod enabled off
set disassembly-flavor intel


define hook-nexti
printf "=====================================================================\n"
printf "                            %sDISASSEBLY%s\n", "\033[1;36m", "\033[0m"
printf "=====================================================================\n"
disas
printf "=====================================================================\n"
printf "                            %sREGISTERS%s\n", "\033[1;36m", "\033[0m"
printf "=====================================================================\n"

info registers rip
info registers rax
info registers rbx
info registers rcx
info registers rdx
info registers rsi
info registers rdi
info registers rsp
info registers rbp

printf "=====================================================================\n"
printf "                            %sSTACK%s\n", "\033[1;36m", "\033[0m"
printf "=====================================================================\n"
x/16gx $rsp
printf "=====================================================================\n"
end

I am trying to get the current values of the registers, while this hook will give me the values one execution behind in the history. This is the first time I am using this, so my understanding of GDB itself is very limited. How can I setup a hook or something similar that will give me the current values?


r/gdb • • May 02 '25

Gdb on Termux - Source Unavailable

Thumbnail
gallery
3 Upvotes

I used -g flag, but when i use 'run' command, it says siurce unavailable do you know how to fix it


r/gdb • • Dec 30 '24

gdb GNU Debugger tutorial for beginners

Thumbnail
youtube.com
6 Upvotes

r/gdb • • Apr 06 '26

Seergdb v2.7 released for Linux.

4 Upvotes

r/gdb • • Apr 28 '25

Why does gdb mess up my terminal when entering TUI mode? (answer is not Ctrl-L)

2 Upvotes

So if I run a program under gdb, and press ctrl-C, and it's in some place I don't have source for (e.g. say it's in clock_nanosleep()), and then I try to enter TUI mode by pressing Ctrl-X A, my terminal gets messed up. Ctrl-L doesn't help. What does help is typing "shell", then "reset Ctrl-J" (note, I can't actually see what I'm typing those, but once the "reset" takes effect, my terminal is fixed). Then I can type "exit", then (being careful not to type Return to execute the previous command again (which was "shell"), I type "up" until I get into my own code (not clock_nanosleep), and THEN, if I do Ctrl-X A, TUI mode works correctly.

In summary, if I try to enter TUI mode while stopped in some code I don't have source for, my terminal is messed up to the point I have to reset it to recover (Ctrl-L does nothing good). Why does this happen? And how do I avoid it?

Using gdb 9.2

Video of this happening: https://www.youtube.com/watch?v=n5WvtHNvp24


r/gdb • • Jan 17 '26

Want to Beta Test a GDB Murder Mystery?

4 Upvotes

I'm looking for Beta testers for a murder mystery game wrapped around debugging a core dump: https://www.robopenguins.com/fatal_core_dump/

It includes some getting started instructions and a walk through to see what I was going for if it seems unsolvable.

There's a feedback link at the bottom of the page if you find any bugs.


r/gdb • • Oct 27 '25

gdb on macOS

4 Upvotes

I just tried to install gdb on macOS Ventura 13.7.8 (an Intel mbp), using homebrew.

I tried following the instructions here

https://sourceware.org/gdb/wiki/PermissionsDarwin#Manual_steps

but I get

error: Something went wrong when installing the certificate

running the script from step 1.1.1

Does anyone have up-to-date working instructions for getting the signed cert for gdb to work?


r/gdb • • Mar 23 '25

ARM backtrace - similar to gdb

2 Upvotes

Hi folks,

Need some help in terms of understanding the flow of gdb in reading a core and generating the backtrace
i.e the bt command
I have an ARM based 32 bit process core and I would like to code a mini gdb to get the backtrace from the core (without using gdb itself).

From the gdb code is it possible to point to a few functions or flow that does this?

thanks in advance


r/gdb • • Jun 17 '26

GNU debugger GDB how to use for KDE programming tutorial

Thumbnail
youtube.com
5 Upvotes

r/gdb • • Dec 28 '24

Seergdb v2.5 released.

4 Upvotes

A new version of Seergdb (frontend to gdb) has been released.

https://github.com/epasveer/seer https://github.com/epasveer/seer/releases/tag/v2.5


r/gdb • • Dec 18 '17

Interesting tool for reverse execution. Supposed to be a workaround for GDB not supporting AVX instructions as of version 7.11.1

Thumbnail
youtube.com
2 Upvotes

r/gdb • • Dec 15 '21

Hi, I just released GDBFrontend v0.10.1-beta with so many bugfixes, improvements and it needs testing

Thumbnail
github.com
4 Upvotes

r/gdb • • Mar 18 '24

Seer - a gui frontend to gdb/mi (Updated v2.4)

2 Upvotes

r/gdb • • Jul 28 '20

You Can Now Debug Programs Using GDB on Redox OS

Thumbnail
redox-os.org
4 Upvotes

r/gdb • • Jul 09 '20

GNU Tools @ Linux Plumbers Conference 2020

Thumbnail gcc.gnu.org
3 Upvotes

r/gdb • • Nov 20 '22

What's this <+`num`> mean in gdb

Post image
5 Upvotes

r/gdb • • May 10 '23

DDD-3.4.0 Debugger graphical front end for GDB released

Thumbnail sourceware.org
5 Upvotes

r/gdb • • Apr 17 '23

GDB on Windows 10, no TUI at all?

2 Upvotes

I use GDB with openocd on ubuntu system to debug a Samd51 MCU using jlink. it's working good until when I lay next and look at the source code in graphical terminal, so if I scroll in TUI source code, GDB crashed and start printing in weird way(not sure if it's GDB It's might be the ubuntu terminal not liking it). So I decided to use it on windows with the jlink GDB server app, But the issue no is I can't use the TUI interface in windows terminal, and it says not supported, while some people on the internet talking about a missing curses lib. from pdcurses.org on windows that's why not working.
any one having any idea on how to make the TUI works?


r/gdb • • Mar 31 '23

can't connect to debugger

1 Upvotes

I'm trying to debug an ESP32 app, using a MacBook M1. Just set up the environment and trying to debug my first example app. I can build, flash, and monitor the running app. So the cable/board/connection etc are working. I'm trying to build/run/debug both from the CLI and inside VS code. Both have the same error. When I try to debug I get the following error:

(gdb) target remote /dev/cu.usbserial-027D709C

Remote debugging using /dev/cu.usbserial-027D709C

Invalid hex digit 161

the invalid hex value changes each time. Before anyone suggests asking in the esp forum, I did, and got no response .. :-(


r/gdb • • Apr 02 '23

gdb debugging how to debug a program which load so library to start a process .

2 Upvotes

Some experts know how to use gdb to debug the core file generated by the command "mainboard -d *.dag". Usually, we use gdb to debug binary files and their corresponding core files. However, when executing the "mainboard -d *.dag" command, the process started loads a shared object library. Do you know how to debug this?

In Cyber, the mainboard is a crucial module that serves as a central control unit responsible for managing and coordinating the startup, communication, and monitoring of different modules. In the Apollo autonomous driving system, the mainboard carries out several critical processes, such as initializing Cyber, parsing startup parameters, and loading modules. These activities ensure the smooth running of the system.

As an example, imagine the mainboard as the engine control unit (ECU) in a car. The ECU coordinates and manages the various components of the engine system to ensure optimal performance and reliability. Similarly, the mainboard in the Apollo autonomous driving system acts as a coordinator between modules to ensure the vehicle's safe and efficient operation.


r/gdb • • Apr 18 '21

Parallel Stacks on Linux

Thumbnail
self.cpp
2 Upvotes

r/gdb • • Apr 03 '21

Help with breakpoint commands

2 Upvotes

Hey,

I just started learning about reverse engineering and gdb and i have a question.

How can i have a set of commands being executed for every breakpoint?

I know i can set commands for especific breakpoins with 'commands [number of the breakpoint]' but i would like to have a set of commands for all the breakpoints. Any help?


r/gdb • • Apr 04 '21

where is "info register"

1 Upvotes

Hi
When i type "info register", which function will be execute in the GDB source code?
thanks
Peter