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 visualizers do not follow typedefs #1026

Open
Trass3r opened this issue Aug 5, 2020 · 4 comments
Open

natvis visualizers do not follow typedefs #1026

Trass3r opened this issue Aug 5, 2020 · 4 comments

Comments

@Trass3r
Copy link
Contributor

Trass3r commented Aug 5, 2020

See microsoft/vscode-cpptools#3038

The typename retrieved from var-create here could be a typedef.
If the type name can't be matched it should try the actual type retrieved via whatis:

`whatis MyType
<-1539-interpreter-exec console "whatis MyType"
->~"type = std::vector<int, std::allocator<int> >\n"

I guess it could be implemented in https://github.com/microsoft/MIEngine/blob/master/src/MIDebugEngine/Natvis.Impl/Natvis.cs#L929 with something like await _debugger.ConsoleCmdAsync("whatis " + variable.TypeName, allowWhileRunning: true); @pieandcakes ?
Or it could always be resolved during var-create or an additional property added to IVariableInformation.

Trass3r added a commit to Trass3r/MIEngine that referenced this issue Aug 6, 2020
Trass3r added a commit to Trass3r/MIEngine that referenced this issue Aug 6, 2020
@pieandcakes
Copy link
Collaborator

@WardenGnaw Can you check this for @Trass3r

@Trass3r
Copy link
Contributor Author

Trass3r commented Jan 20, 2021

I think the problem was that whatis only strips 1 typedef level and things get more complicated with pointers/references.
And ptype/mt prints a lot of internal details when structs are involved.
https://sourceware.org/gdb/current/onlinedocs/gdb/Symbols.html

@Trass3r
Copy link
Contributor Author

Trass3r commented Jul 7, 2021

It also seems to strip default template arguments:

+ptype/mt std::unique_ptr<int, std::default_delete<int> >
type = std::unique_ptr<int>

And there is no MI version of these commands: https://sourceware.org/bugzilla/show_bug.cgi?id=8143

Trass3r added a commit to Trass3r/MIEngine that referenced this issue Jul 7, 2021
@seppeon
Copy link

seppeon commented Oct 22, 2021

Ohhhhh thanks for looking into this!

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

3 participants