I'm curious, how do Google staff debug their C++ code? Is there best practice for this? #4170
Unanswered
chjfth
asked this question in
Community Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As we all know, googletest is C++ library that helps other software's authors write good-quality test-code. Let me call the later "consumer-software".
If I'm the consumer-software's author, and assume my software targets Windows platform, I may use Visual Studio to organize my project(in .vcxproj). The Visual Studio is at the same time
So,
With the help of VSIDE, the Edit-Build-Debug cycle works smoothly for a programmer, great.
Now, let's try to put ourselves into the shoes of googletest's developer. When a Google staff wants to add features to googletest, or to fix a bug in it, how does he carry out the Edit-Build-Debug cycle?
I checked this googletest git repo, and read the docs there, but cannot find an answer.
Current googletest's doc says it is built with a tool named Bazel, a rather complex tool actually. I agree with the idea of using Bazel, because the googletest library is crossplatform, that is, it should be built to target Windows, Linux, macOS etc. So, organizing its own project using Visual Studio is not feasible, at least not enough.
But I realize that Bazel only copes with the "Build" phase in Edit-Build-Debug cycle. Now in year 2023, the googletest git repo no longer provides any IDE-specific project file within, so no .vcxproj files now.
Then my question is clear, how does the Google staff who maintains the googletest project carry out the Edit and Debug phase? Is there best practice(s) for them?
My best guess is, he may generate googletest static LIBs and testing EXEs using Bazel, then loads a generated EXE into his preferred source-code debugger, Visual Studio for example, and starts source line debugging there(no .vcxproj is required). He may edit source code from within VSIDE because VSIDE debugger naturally shows source code when it(debugger) stops at a breakpoint. But... without a .vcxproj to organize all related source files, that editing experience can be very crappy, for example, the IDE may not jump to a struct definition for us, because the IDE does not know where the containing header file resides. (Normally, IDE knows a list of "include paths" from a .vcxproj and the header files are found.)
Ugh, that is still cumbersome. Clever Google programmers must have better ways than that, right?
Yes, I'm very curious about the daily workflow of the Google staff, because when I try to debug the googletest library code myself, I find it not an easy/smooth/pleasant task. I googled the web, but no luck yet, few people seems to talk about this, so I ask it here.
I'll be really appreciative if a real Google staff could answer this question.
Beta Was this translation helpful? Give feedback.
All reactions