From: Jon Forrest <nobozo@gmail.com>
To: Patrick Steinhardt <ps@pks.im>, Ben Knoble <ben.knoble@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Using Visual Studio Code to Debug/Trace Git?
Date: Mon, 13 Jan 2025 09:03:05 -0800 [thread overview]
Message-ID: <b94df609-372e-4227-8674-a05a67161a15@gmail.com> (raw)
In-Reply-To: <Z4TJIzVc4Ib2QyPV@pks.im>
On 1/13/25 12:04 AM, Patrick Steinhardt wrote:
> There are two ways to realize what you want right now:
>
> - Import the CMake build instructions that we have in
> "contrib/buildsystems". It has existed for a rather long time, but
> is not an officially supported way to build Git. It's also lacking a
> couple of features that you can expect from our Makefile, like
> building docs. It may be good enough though.
>
> - Generate a Visual Studio solution via Meson by installing Meson and
> then running `meson setup --backend=vs2022 build-msvc`. This has
> only landed in Git v2.48 and is thus really new. As such it is still
> marked experimental, but will become an official way to build Git
> and is more feature complete.
>
> I'm aware of an issue with Visual Studio right now though when using it
> with Meson that keeps it from working -- I'll send a patch series later
> today to fix that issue, and then it should be a good way to build Git
> on Windows via MSVC.
Thanks for your thoughtful reply. I'll look into what you describe.
In the mean time, I've discovered another method that seems
to be working, for the very limited execution tracing I'm
doing. What I do, on Fedora 41 Workstation, is to build
Git from source using the standard method. This has the side
effect of generating various .h files that themselves aren't
part of the distribution. Then, using Visual Studio Code,
I open the Git source directory, open common-main.c, and then
set a breakpoint at main(). I can then click on Run->Start Debugging
which starts git and breaks at main(). From there I can set whatever
additional breakpoints I want.
This method has allowed me to trace various things but I'm not sure
if it's a complete solution, especially when forking new processes
or using threads. The one very minor problem I've noticed so far
is that the executable file generated by VSC isn't called 'git'.
I welcome corrections or comments.
I hope this helps other people.
Cordially,
Jon Forrest
next prev parent reply other threads:[~2025-01-13 17:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-10 17:11 Using Visual Studio Code to Debug/Trace Git? Jon Forrest
2025-01-10 20:38 ` Ben Knoble
2025-01-13 8:04 ` Patrick Steinhardt
2025-01-13 17:03 ` Jon Forrest [this message]
2025-02-12 18:32 ` Jon Forrest
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b94df609-372e-4227-8674-a05a67161a15@gmail.com \
--to=nobozo@gmail.com \
--cc=ben.knoble@gmail.com \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).