Skip to content
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

Wide strings only show the first character in the Watch window #180

Closed
zobermiller opened this issue Mar 29, 2024 · 1 comment
Closed

Wide strings only show the first character in the Watch window #180

zobermiller opened this issue Mar 29, 2024 · 1 comment

Comments

@zobermiller
Copy link

I have the following code snippet:

#include <stdio.h>

int main()
{
    char* string1 = "This is a narrow string.\n";
    wchar_t* string2 = L"This is a wide string.\n";

    return 0;
}

Compiled with

cl /Zi /Od main.c

string1 shows the entire string contents in the Watch window, but string2 only shows the first "T":

image

Changing the View Rule to "text" or something else doesn't have any effect, though using something like array:20 will allow me to expand it to see all the characters in an array-like format.

I assume this is because technically speaking the second byte of the "T" character is a 0, so it thinks that's the end of the null-terminated string. But just a guess.

@ryanfleury
Copy link
Collaborator

Fixed in 4b3941c. This is in dev and will be in the next release. The text view rule is still not going to visualize these correctly yet, but that is still an actively under-development feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants