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

DotnetRuntime provider needs to handle WCHAR strings #87978

Closed
LakshanF opened this issue Jun 23, 2023 · 3 comments
Closed

DotnetRuntime provider needs to handle WCHAR strings #87978

LakshanF opened this issue Jun 23, 2023 · 3 comments
Assignees
Milestone

Comments

@LakshanF
Copy link
Contributor

Currently the dotnetruntime provider doesn't correctly handle WCHAR strings. For example, the EventPipeWriteEventExceptionThrown_V1 will not print the correct values for the exception type and message. The Windows EtwProvider correctly handles this case.

This issue should wait for the likely refactoring that will happen when fixing #87445.

@LakshanF LakshanF added this to the 8.0.0 milestone Jun 23, 2023
@LakshanF LakshanF self-assigned this Jun 23, 2023
@ghost
Copy link

ghost commented Jun 23, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Currently the dotnetruntime provider doesn't correctly handle WCHAR strings. For example, the EventPipeWriteEventExceptionThrown_V1 will not print the correct values for the exception type and message. The Windows EtwProvider correctly handles this case.

This issue should wait for the likely refactoring that will happen when fixing #87445.

Author: LakshanF
Assignees: LakshanF
Labels:

area-NativeAOT-coreclr

Milestone: 8.0.0

@elinor-fung
Copy link
Member

I think this just needs a version of WriteToBuffer for const WCHAR* strings. It's currently calling the template function, which won't compute the byte count like we want for strings:

template <typename T>
bool WriteToBuffer(const T &value, BYTE *&buffer, size_t& offset, size_t& size, bool &fixedBuffer)
{
if (sizeof(T) + offset > size)
{
if (!ResizeBuffer(buffer, size, offset, size + sizeof(T), fixedBuffer))
return false;
}
memcpy(buffer + offset, (char *)&value, sizeof(T));
offset += sizeof(T);
return true;
}

@ghost ghost added in-pr There is an active PR which will close this issue when it is merged and removed in-pr There is an active PR which will close this issue when it is merged labels Jul 4, 2023
@LakshanF
Copy link
Contributor Author

LakshanF commented Jul 6, 2023

@elinor-fung's above PR (#88365) fixes this and was incorporated into PR #87785 which was merged.

@LakshanF LakshanF closed this as completed Jul 6, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants