Skip to content

Instantly share code, notes, and snippets.

View HomyeeKing's full-sized avatar
👀
source code

Homyee King HomyeeKing

👀
source code
View GitHub Profile
@phil-blain
phil-blain / debugging-git.md
Last active May 11, 2024 11:17
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