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

Debugger doesn't show correct information for array initialized with runtime length #585

Closed
YXuewei opened this issue Mar 23, 2017 · 9 comments

Comments

@YXuewei
Copy link

YXuewei commented Mar 23, 2017

I ran into a problem that if I declare an array with know length such as
int array[5];
the debug works perfectly, however, if I initialize an array with length only know at run time for example
int n = someinput; int array[n]
the debug doesn't show correct information for this array, it shows length of 0, and can't inspect the element. Please see pic below
qq 20170323113416
I'm absolutely, completely, definitely sure image[] and input[] by the time is already initialized correctly.

@pieandcakes
Copy link
Contributor

pieandcakes commented Mar 28, 2017

@YXuewei What OS are you running on and if you are using gdb, do you have gdb's pretty-printing enabled?

@YXuewei
Copy link
Author

YXuewei commented Mar 30, 2017

@pieandcakes I'm using windows, and I do turned pretty-printing on. I write a sample code to demonstrate what it looks like.
25ebd9eea82c4c5a1f31154ff5ddc866
511d170097f556b5593ece93d9232dd7
The First one is my lauch.jason setting. I use gdb-pyrhon27.exe so that I can use pretty-pritting. And the second pic is what it is like when I inspect values. Form debugger console you can see that I use command -exec -enable-pretty-printing to enable pretty-printing and it shows it have been done.

@pieandcakes
Copy link
Contributor

@YXuewei The visualization of the variables through pretty printing is provided by gdb's community. If you want, you can search and see if there is another option to help visualize the array. We also support .natvis visualization using a .natvis visualizer file but you would also need to create one from scratch. It seems like gdb is returning different information for each case, which we have no control over.

@YXuewei
Copy link
Author

YXuewei commented Mar 31, 2017

@pieandcakes Is that possible to let VSCode to use GDB in WSL? If it is what we going to have in Windows Creator update I will save me sometime for getting a *nix or some money on macOS.

@YXuewei
Copy link
Author

YXuewei commented Mar 31, 2017

@pieandcakes It is the same if I use LLDB, see screen shoots below. I tried this with a MacBook Pro.
screen shot 2017-03-31 at 10 19 46 pm

@pieandcakes
Copy link
Contributor

@YXuewei We also enabled python formatting for lldb recently. I don't know if the behavior is the same. You can enable "logging": { "engineLogging": true } and see what we send gdb/lldb and what we get back. I suspect we are getting different data back for each case.

@YXuewei
Copy link
Author

YXuewei commented Apr 1, 2017

@pieandcakes No it doesn't work, it didn't bring any difference without the command when inspecting. It should be a way in LLDB to enable something like pretty printing in GDB. There is no reason that gdb can do it but LLDB can not. Otherwise how does Xcode be able to view object contains or dynamic array?

@pieandcakes
Copy link
Contributor

pieandcakes commented Apr 3, 2017

@YXuewei Unfortunately LLDB the pretty printing is compiled in and not able to be disabled. I don't know if Xcode provides additional pretty printing configurations but you can look at the documentation here: http://lldb.llvm.org/varformats.html

The ones included in our package are located at:
~/.vscode/extensions/ms-vscode.cpptools-0.10.5/debugAdapters\lldb\lib\python2.7\site-packages\lldb\formatters

@WardenGnaw
Copy link
Member

Closing issue with no recent updates.

If this issue is still occuring, please open a new issue.

asialasr pushed a commit to asialasr/vscode-cpptools that referenced this issue Mar 12, 2021
The MIEngine was still compiling against incredibly ancient packages. This switches it over to something recent - the packages that came out at the same time as .NET Core 1.0 RTW.

The primary IL level difference of this change is to increment the reference assembly version of the following in the non-'Desktop' configurations.

    System.Xml.XmlSerializer
    System.IO.FileSystem
    System.Net.Http
    System.IO.FileSystem.Primitives

In addition, this changes:
* The Desktop configuration to stop dropping a bunch of facade assemblies that it doesn�'t seem like it actually needed.
* Stops having the IOS launcher need to partially depend on facade assemblies. To do this I added an MIEngine definition of RemoteCertificateValidationCallback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants