Re: How can I debug git source code interactively with debugger like gdb?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 18, 2017 at 12:42 PM, 小川恭史 <aiueogawa217@xxxxxxxxx> wrote:
> I wanna learn how daily git command works when I run specific git command.

1. Obtain the sources and compile Git yourself
    (git clone https://kernel.googlesource.com/pub/scm/git/git
     cd git && make && make install).
   Documentation/* and the Makefile are pretty verbose if you want
   to compile for some non-mainstream hardware or OS.
2. "gdb git" and debug away.
  Note, that some Git commands call other git commands,
  So running the command with "GIT_TRACE=1 git <cmd>"
  first may be helpful for diagnosis as well.
  (See the general git man page that has a couple of env vars
   that aid in debugging)

> I wanna know which function is actually called then, how variables
> changes its value, and how some object is stored into database.

For understanding Gits model, it may be easier to read a book, such
as "git from the bottom up" as that conveys the concepts better.

The source code is riddled with handling corner cases, error handling
and other implementation details that are usually not interesting but
rather tedious.

> How can I debug git source code interactively with debugger like gdb?

Also checkout ddd, a graphical frontend of gdb.

Cheers,
Stefan




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux