Skip to content

STL.natvis: Add c_str intrinsic function#5997

Merged
StephanTLavavej merged 1 commit intomicrosoft:mainfrom
gregg-miskelly:dev/greggm/c_str
Jan 15, 2026
Merged

STL.natvis: Add c_str intrinsic function#5997
StephanTLavavej merged 1 commit intomicrosoft:mainfrom
gregg-miskelly:dev/greggm/c_str

Conversation

@gregg-miskelly
Copy link
Member

This PR adds a c_str intrinsic function to std::basic_string so that it is easier to compare the value of an std::string in a conditional breakpoint. Ideally, we would also include operator== and operator!= implementations, but CppDebug doesn't have a good way of implementing that currently, but this is still a useful start.

Example of comparing an std::string too a string literal in a conditional breakpoints with this change: strcmp(myStdStringVariable.c_str(), "some_literal") == 0

This PR adds a `c_str` intrinsic function to std::basic_string so that it is easier to compare the value of an std::string in a conditional breakpoint.
@gregg-miskelly gregg-miskelly requested a review from a team as a code owner January 7, 2026 17:36
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Jan 7, 2026
@StephanTLavavej StephanTLavavej added visualizer How the VS debugger displays STL types enhancement Something can be improved labels Jan 7, 2026
@StephanTLavavej StephanTLavavej moved this from Initial Review to Ready To Merge in STL Code Reviews Jan 7, 2026
@StephanTLavavej
Copy link
Member

@gregg-miskelly Thanks for triple-mirroring this as VS-PR-698144! I'll get this merged to GitHub and MSVC in my next merge batch.

@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej moved this from Ready To Merge to Merging in STL Code Reviews Jan 15, 2026
@StephanTLavavej StephanTLavavej merged commit f10833d into microsoft:main Jan 15, 2026
45 checks passed
@github-project-automation github-project-automation bot moved this from Merging to Done in STL Code Reviews Jan 15, 2026
@StephanTLavavej
Copy link
Member

Thanks for improving one of our most important visualizers, and congratulations on your first microsoft/STL commit! 😸

🟥🟩
🟦🟨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Something can be improved visualizer How the VS debugger displays STL types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants