Skip to content

Instantly share code, notes, and snippets.

View kiprasmel's full-sized avatar

Kipras Melnikovas kiprasmel

View GitHub Profile
@kiprasmel
kiprasmel / debugging-git.md
Created March 21, 2024 12:53 — forked from phil-blain/debugging-git.md
Debugging Git for Git developers on Linux and macOS

Debugging Git

Some tips about debugging Git with GDB and LLDB.

Compiling Git for debugging

By default, Git's Makefile compiles Git with debug symbols (-g), but with optimization level -O2, which can lead to some variable being optimized out and thus making the executable harder to debug.

To compile with -O0, you can tweak CFLAGS using config.mak:

$ cat config.mak