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

[BUG] Debug strings are truncated #880

Open
durandt opened this issue Jan 24, 2024 · 6 comments
Open

[BUG] Debug strings are truncated #880

durandt opened this issue Jan 24, 2024 · 6 comments
Assignees
Labels
area-dotnet-debugging Issues around .NET Debugging with console, ASP.NET, or Aspire area-maui bug Something isn't working triaged The issue has been triaged vs-sync Add this label to synchronize the issue to AzDo vs-syncd Linked to AzDO
Milestone

Comments

@durandt
Copy link

durandt commented Jan 24, 2024

Describe the Issue

I run VSCode on a M1 (ARM) mac and I have the C#, C# DevKit and MAUI extensions.

When I debug a MAUI app on the iPhone simulator and:
. hover over a variable, its value is truncated to 100 chars.
. type "variableName" in the Debug Console, the output is also truncated to 100 chars
. Add a watch for "variableName" and right-click it and use the "Copy Value" function, the copied value is also truncated to 100chars

Steps To Reproduce

Using VSCode for mac with C#, C# DevKit and MAUI extensions, create a string that has more than 100chars. (Assembly.GetExecutingAssembly().Location should do it)

Try to get the value of that variable using the debugger.

Se that the value is truncated to 100 chars if you try to hover it, to add it as watch and copy value or print it in the debug console.

Expected Behavior

Display/copy the whole (untruncated) value.

Environment Information

  • macOS M1 13.6.3 (22G436)
  • VSCode 1.85.1
  • C# extension v2.15.30
  • C# DevKit v1.2.7
  • .NET MAUI extension v0.7.10 (preview)
    | VS Bug 1975720
@durandt durandt added the bug Something isn't working label Jan 24, 2024
@microsoft-issue-labeler microsoft-issue-labeler bot added the area-dotnet-debugging Issues around .NET Debugging with console, ASP.NET, or Aspire label Jan 24, 2024
@durandt
Copy link
Author

durandt commented Jan 24, 2024

Related:

@mauroa mauroa self-assigned this Jan 25, 2024
@mauroa mauroa added triaged The issue has been triaged vs-sync Add this label to synchronize the issue to AzDo labels Jan 25, 2024
@JaneySprings
Copy link

Hi! I'm a .NET Meteor extension developer. I want to share my solution with Microsoft developers. I had the same problem and I moved all the settings from Mono debugger-libs to the VSCode extension settings:

image

This can be useful in some cases. Thanks!

@AllenD-MSFT AllenD-MSFT added the vs-syncd Linked to AzDO label Feb 22, 2024
Copy link

github-actions bot commented Apr 3, 2024

This issue has been marked as stale after 14 days of inactivity. @[ @mauroa @], could you please take a look?

@durandt
Copy link
Author

durandt commented Apr 26, 2024

Now running:

  • .NET MAUI v0.11.34 (pre-release)
  • C# v2.26.13 (pre-release)
  • C# Dev Kit v1.4.29

Strings are now truncated at 1000+ chars when hovering and not at all in debug console, which is really handy!

I have noticed a few glitches though for strings with more than 1000 chars in Variables/Watches and when hovering the variable. The value shown is full of \0 chars. Printing the value in debug console works fine.

Code and debug console output:
image

Variables and watches:
image

Hovering will also show about 1000 \0 chars and then truncate (I think the truncation part is OK since you can get the full value in console or by copying value).

Copy value works fine by the way even with 1000+ strings.

@bnSonic
Copy link

bnSonic commented Jan 4, 2025

I have noticed a few glitches though for strings with more than 1000 chars in Variables/Watches and when hovering the variable. The value shown is full of \0 chars. Printing the value in debug console works fine.

Hovering will also show about 1000 \0 chars and then truncate (I think the truncation part is OK since you can get the full value in console or by copying value).

Same Problem here (Mac, Visual Studio Code)
Version: 1.96.2 (Universal)
Commit: fabdb6a30b49f79a7aba0f2ad9df9b399473380f
Date: 2024-12-19T10:22:47.216Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 23.6.0

I've tried to serialize a class containing a List to a json and took me hours to realise, that it's only the inline view (either hovering the cursor over the string variable or using the "watch" tab) that is showing the "/0/0/0/0" string…

A Trace to the console shows the correct string.

Oh dear … Is there ANY workaround or extension available to somehow fix this? I really like it if i can trust a debugger ;)
Thank you :)

@Labraptor
Copy link

Labraptor commented Feb 3, 2025

Same here, very annoying when debugging API reply with JSON, we should have a simple setting for chose the trunk size:

////////Visual Studio Code//////
Version: 1.96.4 (Universal)
Commit: cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
Date: 2025-01-16T00:16:19.038Z (2 wks ago)
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Darwin arm64 23.6.0

///////.NET MAUI Extention//////
1.6.16

//////C# Dev Kit Extention/////
1.15.34

////Maui version///
[maui]
Installation Source: SDK 8.0.200
Manifest Version: 8.0.83/8.0.100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dotnet-debugging Issues around .NET Debugging with console, ASP.NET, or Aspire area-maui bug Something isn't working triaged The issue has been triaged vs-sync Add this label to synchronize the issue to AzDo vs-syncd Linked to AzDO
Projects
None yet
Development

No branches or pull requests

8 participants