Debugging git on MS Windows

158 views
Skip to first unread message

Thiago Farina

unread,
Aug 3, 2009, 2:14:27 PM8/3/09
to msysGit
Hi guys,

How can I debug git on Windows? I'm able to compile git through the
make that was installed by msysgit installation.
But I want to debug, not only build. I think is not possible to
compile and debug git with Visual Studio, or is it possible?

If is not possible, what are the other methods to debug git?

Thanks all!
Message has been deleted

Johannes Schindelin

unread,
Aug 3, 2009, 7:39:03 PM8/3/09
to Thiago Farina, msysGit
Hi,

On Mon, 3 Aug 2009, Thiago Farina wrote:

> How can I debug git on Windows? I'm able to compile git through the
> make that was installed by msysgit installation.
> But I want to debug, not only build. I think is not possible to
> compile and debug git with Visual Studio, or is it possible?

Did you actually just go and try to debug it?

Ciao,
Dscho

Thiago Farina

unread,
Aug 3, 2009, 8:56:39 PM8/3/09
to msysGit
Yeah, I mean, I created a Solution in Visual Studio that I imported
all *.c and *.h files from git.
But it requires many headers that only mingw provide, like unistd.h,
sys/param.h, dirent.h, sys/time.h, fnmatch.h, utime.h. So I can't
compile because of these headers, and I read something that git
depends in many others third_party libraries, like curl, openssl, etc.

I thought that if you guys are building the msysGit, you must are
debugging it somehow that I don't know.

On Aug 3, 8:39 pm, Johannes Schindelin <Johannes.Schinde...@gmx.de>
wrote:

Janos Laube

unread,
Aug 3, 2009, 10:43:01 PM8/3/09
to Thiago Farina, msysGit
> Yeah, I mean, I created a Solution in Visual Studio that I imported
> all *.c and *.h files from git.

msvc is not supported

> I thought that if you guys are building the msysGit, you must are
> debugging it somehow that I don't know.

yes, with gdb :-)

Thiago Farina

unread,
Aug 3, 2009, 11:58:58 PM8/3/09
to msysGit
Thanks for the hint.

For those who are interested in debugging git on windows:
I downloaded the dgb from here:http://sourceforge.net/projects/mingw/
files/GNU%20Source-Level%20Debugger/

After I searched for a tutorial how to use gdb, and I found this
tutorial: http://www.chemie.fu-berlin.de/chemnet/use/info/gdb/gdb_toc.html

And I succeeded to debug git on windows. But I felt so strange to have
to be typing the commands all the time.

The steps I'm doing to debug are:
- c:\mingw\bin\gdb.exe c:\msysgit\bin\git.exe
- <gdb> b git.c:458
- <gdb> run
- continue or step
- print variable_name

I was more accustomed to just press F5 (debug) and then F11 in Visual
Studio.

Erik Faye-Lund

unread,
Aug 4, 2009, 3:45:10 AM8/4/09
to Thiago Farina, msysGit
On Tue, Aug 4, 2009 at 5:58 AM, Thiago Farina<thiago...@gmail.com> wrote:
> For those who are interested in debugging git on windows:
> I downloaded the dgb from here:http://sourceforge.net/projects/mingw/
> files/GNU%20Source-Level%20Debugger/

...or they could just download the msysgit environment, which already
includes gdb.

> I was more accustomed to just press F5 (debug) and then F11 in Visual
> Studio.

unfortunately, that's the cost of using mingw.


--
Erik "kusma" Faye-Lund
kusm...@gmail.com
(+47) 986 59 656

Johannes Schindelin

unread,
Aug 4, 2009, 8:00:12 AM8/4/09
to Erik Faye-Lund, Thiago Farina, msysGit
Hi,

On Tue, 4 Aug 2009, Erik Faye-Lund wrote:

> On Tue, Aug 4, 2009 at 5:58 AM, Thiago Farina<thiago...@gmail.com> wrote:
> > For those who are interested in debugging git on windows:
> > I downloaded the dgb from here:http://sourceforge.net/projects/mingw/
> > files/GNU%20Source-Level%20Debugger/
>
> ...or they could just download the msysgit environment, which already
> includes gdb.

Maybe the word "complete" is missing from "msysGit is the build
environment for Git for Windows".

> > I was more accustomed to just press F5 (debug) and then F11 in Visual
> > Studio.
>
> unfortunately, that's the cost of using mingw.

There's ddd, I hear. I'm not opposed to bundling it if somebody does the
work of verifying that it works nicely, and of making a proper patch. Not
opposed at all.

Ciao,
Dscho

Johannes Sixt

unread,
Aug 4, 2009, 2:38:03 PM8/4/09
to Johannes Schindelin, Erik Faye-Lund, Thiago Farina, msysGit
Johannes Schindelin schrieb:

> There's ddd, I hear. I'm not opposed to bundling it if somebody does the
> work of verifying that it works nicely, and of making a proper patch. Not
> opposed at all.

Of course, I'm opposed to that idea. :-)

Bundle KDbg!! Oh, wait... KDbg does not exist for Windows :(

-- Hannes

Johan 't Hart

unread,
Aug 4, 2009, 5:20:51 PM8/4/09
to msy...@googlegroups.com, msysGit
Thiago Farina schreef:

> I was more accustomed to just press F5 (debug) and then F11 in Visual
> Studio.
>

Eclipse runs on Windows. It runs fine with the msys/mingw build
environment. Maybe there's a way you could use that one for git as well.
It has a nice gui for debugging. And once you get used to it, it is
close in user experience terms of Visual Studio...

Once you get it running, please tell us how :)

Thiago Farina

unread,
Aug 4, 2009, 7:26:08 PM8/4/09
to Johan 't Hart, msysGit
Ok, I'm trying this options as you suggested. But I have no experience
with this IDE, and I don't like eclipse, but I will try.

Do you know how can I set the include paths?
For example how eclipse will know that the "fnmatch.h" in under
compat/fnmatch directory?
In Visual Studio I know how to do this but, but in eclipse no.

Johannes Schindelin

unread,
Aug 5, 2009, 4:30:27 AM8/5/09
to Johannes Sixt, Erik Faye-Lund, Thiago Farina, msysGit
Hi,

I'm not opposed to that, either, if you get it to run and provide me with
a patch I can lazily apply while continuing to nurse my White Russian.

Ciao,
Dscho

Phil Lawrence

unread,
Aug 5, 2009, 9:46:25 AM8/5/09
to Johannes Schindelin, Johannes Sixt, Erik Faye-Lund, Thiago Farina, msysGit

Now that's funny! Love this group.

Phil Lawrence

Johan 't Hart

unread,
Aug 5, 2009, 4:15:59 PM8/5/09
to msy...@googlegroups.com, msysGit
Thiago Farina schreef:

> Do you know how can I set the include paths?
> For example how eclipse will know that the "fnmatch.h" in under
> compat/fnmatch directory?
> In Visual Studio I know how to do this but, but in eclipse no.
>

In eclipse do:
- Rightclick project
- Properties
- C/C++ Build
- Settings
- GCC C++ Compiler
- Directories

Here you can add include directories to your eclipse config.

Johan 't Hart

unread,
Aug 5, 2009, 4:17:06 PM8/5/09
to msy...@googlegroups.com, msysGit
Thiago Farina schreef:

> Do you know how can I set the include paths?
> For example how eclipse will know that the "fnmatch.h" in under
> compat/fnmatch directory?
> In Visual Studio I know how to do this but, but in eclipse no.
>

Sorry, I meant GCC C Compiler in stead of GCC C++ Compiler :)

Reply all
Reply to author
Forward
0 new messages