Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 29, 2015, 16:44 UTC
- Message-ID
- <xmqqpozxsjyc.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CACsJy8C94gzE0CQH=f5=qeMj=DnE3bJ3EnLYbhxgrTG=W4r89A@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 10 quoted lines
> On Mon, Oct 26, 2015 at 2:15 PM, Johannes Schindelin > <johannes.schindelin@gmx.de> wrote: >> When prefixing a Git call in the test suite with 'TEST_GDB_GIT=1 ', it >> will now be run with GDB, allowing the developer to debug test failures >> more conveniently. > > I'm very slowly catching up with git traffic. Apologies if it's > already mentioned elsewhere since I have only read this mail thread. > > Is it more convenient to add a sh function "gdb" instead?
Changing a line of git invocation you want to debug from
git frotz &&
to
debug git frotz &&
indeed is slightly more pleasing to the eye than
TEST_GDB_GIT=1 git frotz &&
I do not terribly care either way, as long as that feature is availble ;-)
Either way these tweaks are temporary changes we make while figuring out where things go wrong, and from that point of view, (1) the longer and more cumbersome to type, the more cumbersome to use, but (2) the longer and more visually identifiable, the easier to spot in "diff" a tweak you forgot to revert before committing.
> We can even go further with supporting gdbserver function, to launch > gdbserver, then I can debug from outside, works even without -v -i.
Yes, that may be useful, but you can do so whether you use your shell function or TEST_GDB_GIT=1 that trigeers inside the "git" wrapper in bin-wrappers, I would think.