-
Notifications
You must be signed in to change notification settings - Fork 6
Explain gtest experimental #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
The program that I tested against was: This was generated by Claude Code and provides a single failing test to step back into. With the exception handling + this additional Gtests support it's able to navigate straight to the test failure of interest and analyse within it. In principle we could also set time limits to the boundaries of that test case - I've not experimented with that. In the general case we might also want to be able to identify stale state from previous tests in the recording so it's not clear to me that doing so would always be a good thing. |
The symbol for this counter appears to have a couple of spellings that come up in practice in different programs. The field is still in the same place in the structure returned by `__cxa_get_globals()` so in future we might want to just look at it by offset, rather than name. For now this will do.
This was the majority of the implementation for the `reverse_step_into_current_line` tool but it will also be useful for other cases where we need to wind back into to a specific function whilst capturing return values or exceptions.
This identifies tests more specifically and also makes it possible to derive the specific test class name from the annotation, which is useful for setting breakpoints.
We can retrieve this using the layout of the structure as it's part of the ABI. That means we can be independent of debug information for the C++ runtime.
4ec4c9b to
3794d21
Compare
| """ | ||
| Is this program linked against gtest libraries? | ||
| """ | ||
| obj_paths = [Path(o.filename) for o in gdb.objfiles() if o.filename is not None] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a generator expression to avoid going through all the object files.
Early support for debugging Google Test binaries.
This makes use of the
gtest_annotationsaddon, which uses theundoexlibrary to create annotations within a recording. This allows Explain to list test results, jump to specific test failures and then resume debugging the case at hand.If Google Test support is not present the relevant tools will return an error (ideally we'd only expose them when Google Test support is present but Claude doesn't handle tool changes currently).