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

Natvis and WinDbg Preview #1

Open
andre2007 opened this issue May 25, 2021 · 6 comments
Open

Natvis and WinDbg Preview #1

andre2007 opened this issue May 25, 2021 · 6 comments

Comments

@andre2007
Copy link

Is the Natvis script usable with WinDbg Preview (Windows 10 microsoft store)?

I tried to load the script during a debugging session and hit the script execute button but do not see any visual effect (e.g. representation of string arrays in the locals view).

@WebFreak001
Copy link
Member

the Natvis documentation is very sparse and only written for VS. I have developed and debugged it with VS so I can't really tell you how it's going to perform in other debuggers. Try to see if you can find some error log, in VS when it fails to parse something the entire natvis file refuses to load.

@andre2007
Copy link
Author

I checked the logs, there is only one interesting error message in the log:

GetLineByInlineContextWide failed. Symbols are not loaded or no source information available.

I started debugging for the executable, loaded the source code of the file. Then loaded thr Natvis script and executed it.

But I am now unsure whether I have to set additional Debugging paths in the settings window. Source paths to the project, druntime and Phobos are set, but maybe the error is related to the Symbol paths which I haven't set so far.

@WebFreak001
Copy link
Member

In VS you just have to drop the natvis into the project folder and it auto loads, in vscode you have to set it as "visualizer path" (and only a single one is supported)

Loading it should be all that is needed to be done.

Also did you compile your executable with the -gc flag using LDC? DMD has removed it and the native D debug information is incompatible with Natvis syntax and thus broken.

@andre2007
Copy link
Author

You are right, I was using dmd. I now tried ldc with the mentioned arguments and it seems to work.

After executing the script the graphical representation of e.g. a string array in the "Locals" view changed. I can now immediately see that there are 2 elements within the string array.

What I wonder, the actual string content is still not displayed. Only in the raw view I can see the number representation of the char (0x61 for the letter A).

@WebFreak001
Copy link
Member

can you attach a screenshot and information you can find about the type?

@andre2007
Copy link
Author

20210527_094959.jpg

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