VS2015 Debugger is not expanding variables - c++

When I debug a c++ application, I am unable to see the value of the variable
If you see below,
std::string s = "a";
The debugger only shows the value as {...}, even if I extend the value.
What I have tried
Deleted the symbol cache, (Tools > Options ... > Debugging > Symbols.
Unchecked "Use Managed Compatibility mode"
Checked "Use Managed Compatibility Mode"
Unchecked "Use Native Compatibility Mode"
Checked "Use Native Compatibility Mode"
I have tried to export the settings from the working environment and then import them into the other one, with no luck.
Any suggestions? ...
I get the same issue with std::vector<std::string> ... or any other type, I cannot expand the data.
Edit: Added a picture of what it is supposed to look like ...
Edit 2: I have tried to export the settings from the working environment and then import them into the other one, with no luck.

To fix the issue I un-installed VS2015 completely, (including all the updates and other "vs2015" tools that were installed over the months.
I then ran ccleaner a couple of times to remove dead registry settings left behind, (not sure if that helped, but it doesn't hurt).
I than re-ran the install, it picked up that update 3 was needed.
A couple of things were not removed as I didn't need to re-register and enter my credentials.
But it seems it wasn't the problem as the re-install did the trick.
Also:
Unchecked "Use Managed Compatibility mode"
Unchecked "Use Native Compatibility Mode"

Related

Visual studio 2019 Custom colors overridden

I have just upgrade from VS2017 to VS2019 and I have my own colors on classes, enums etc. that I would like to be the same in VS2019. I export all my settings, install all the same extension (for example Viasfora, SemanticColorizer) from VS2017 in VS2019, and then import my settings from VS2017.
I open a .cs file and I see my colortheme and 1sec later the colors change to some standard colors.
I have tried the unchecking the "Use enhanced colors for C# and Basic" under options.
And here´s the kicker, the "code preview side-window" shows the right colors...
Anyone got an idea of what this is and how to solve it?
Regards
Ok, from what I have learned so far is that there are more parameters for color customizations in VS19 and there is some name changes that stops the import.
What I did was installing VS theme editor(VS19ThemeEditor)
Changed a bunch off settings in there.
Then I added SemanticColorizer and ViasFora, then went to Tools-->options-->Enviroment-->Font and colors. Changed alot of things there.
And for fun added ClaudiaIDE
TL;DR
You cant export from VS17 to VS19 and expect colors to be the same, you need to edit them again.

Visual Studio 2015: Visualization of std::vector doesn't show information in debug

I installed a new update of visual studio 2015 and have now the version 14.0.25424.00 with update 3.
After installing the update the visualization of std::vectors while debugging changed. Usually when I debugged a program I could see the size and the items of a std::vector.
After the update I only can see the raw view of the std::vector.
Here is the code which I used to for this example:
int main()
{
int a = 1;
std::vector<int> vecOfInt;
vecOfInt.push_back(1);
vecOfInt.push_back(2);
vecOfInt.push_back(3);
return 0;
}
I think that maybe during the update some settings in visual studio changed but I can't find out what is different...
Does anyone has an idea what I could try to fix this besides reinstalling visual studio?
EDIT:
Here the requested debug settings:
Had the same problem. Repairing the update fixed it.
Go to Control Panel\All Control Panel Items\Programs and Features -> View Installed Updates -> Right click on Visual Studio Update 3 -> Change -> Repair
I debug it in my two VS2015 machines Enterprise and community 14.0.25424.00 version.
I found that the option "Use Native Compatibility Mode" will impact the std::vector size in the local or Watch window. If I disable it, it works well in my side.
Maybe you could reset your VS settings and debug it again.
TOOLS->Import and Export Settings Wizard->Reset all settings->select “No, just reset settings, overwriting my current settings”->Choose a Default Collection of settings.
I had the same issue. Win7 x64, VS2015 Update3 (ver 14.0.25431.01).
I tried repair Update 3 as described in WinterMute's answer (incl. reboot) - it didn't help.
I tried reset my setting in VS as described in Jack's answer:
TOOLS->Import and Export Settings Wizard->Reset all settings->select “No, just reset settings, overwriting my current settings”-> I chose a "General" collection. (+ restart VS)
It helped. And I noticed 1 change in Options > Debugging > General: Use Managed Compatibility Mode is unchecked now. (I have also Use Native Compatibility Mode unchecked but it was before too).
Both std::vector and std::stack are shown nice in debug mode.
I have to disable "Show raw structure of objects in variables Window" in Visual Studio, under
Debug > Options > Debugging > General

VSCode "go to definition" not working

I installed Visual Studio Code 1.1 with the C/C++ extension,
opened my C++ project and tried to use "Go to definition" in vain.
The "Go to definition" is not working at all.
Example, go to definition of a class member:
int i = m_myVar;
(I opened a simpler project with one file and it was working for this one)
In the end, what I want is good indexation of my big project, is there a way to install Intellisense?
I had a the same issue: F12 and Ctrl + Click and Right Click "Go To Definition" wasn't working.
The fix for me was:
Go to Extensions
Click "Disable All Installed Extensions"
Close and Reopen VS Code
Back to Extensions and "Enable All Extensions"
Essentially enable/disable all extensions fixed the issue.
I recently came across this same issue and after trying all of the suggested solutions I could find with no success, I found this article:
https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc
Basically my project grew too large and VS code was no longer able to track all files, which messed up the "go to definition" functionality.
After following the steps on the link to increase the maximum number of files to be tracked, the issue was resolved.
The correction is pretty simple (tested on Ubuntu 18.04):
Add this line:
fs.inotify.max_user_watches=524288
to the end of the file /etc/sysctl.conf
After saving, run the following command:
sudo sysctl -p
Hopefully this will be useful to someone else, this has been bothering me for the last few days.
I had a similar problem except with Python and google searches for solutions kept bringing me back to this post so I figured I'd post my solution here in the hopes that it might help other people.
I was working on a remote cluster through VScode Remote and was getting similar errors to the original question(all 'go to ___' functionality was unavailable and was even getting a 'too large to track' error) and I thought I had to increase the number of watches, which didn't end up helping.
All I needed to do was install a python interpreter on the remote VScode server. This fixed my problem.
I believe vscode 1.1 (well, 1.1.1 actually) + the C++ extension (cpptools) is as much Intellisense as we can get for now.
You should load your big project with the "open folder" function to make vscode know about the other files.
https://blogs.msdn.microsoft.com/vcblog/2016/03/31/cc-extension-for-visual-studio-code/ warns about letting the indexing finish first (red icon in lower right corner during indexing) and mentions the current limitations on the source code parsing.
It wasn't working on my laptop as well after installing a few VSCode extensions. I decided to close and re-open VSCode with administrator permission and suddenly it sorted out.
I have been trying to fix this for a long time. In the end, what worked for me was simply reinstalling VSCode, then installing the latest C/C++ extension (v0.18.1). Then, in your .vscode/c_cpp_properties.json file, under includePath, add your include folder which has all your header files.
I tried the methods mentioned in this thread none of them seemed to work for me. A simple solution that worked for me is that I closed the current workspace and created a new workspace, added the folders which I required(same as the old workspace), and saved the new workspace. Waited for a couple of minutes to index and IntelliSense is able to find definitions now.
I am using VSCode 1.52.1 on Ubuntu 20.04.
In my case, for whatever reason,c_cpp_properties.json has become set to Disabled in ~/.config/Code/User/settings.json.
Manually changing it to Enabled solved the problem.
Fixed mine by UNCHECKING C_Cpp > Default > Limit Symbols To Included Headers
Your mileage may vary. Good luck!
Have you saved your workspace? Or did you just open a folder with File->Open Folder? This question already has many answers, but none of them address this case, which was my issue.
The question is not specific enough for me to know if you are having the exact same symptoms as my case.
If:
You have not saved your workspace. vscode doesn't say "(workspace)" at the top of the window.
None of the goto functions are working, but instead report: "No ___ found for ____"
The tag parser database icon in the bottom right is always there but only reports "Parsing open files", rather than telling you how many files have been parsed.
Then:
Try saving your workspace.
If you have multiple versions of a language on your PC, specify the exact language you are using in the VScode(in my case, I am using Python, so I must specify the version to the python Interpreter in VS Code)
If you could not do it whatsoever, then uninstall all the other versions that you don't use and then if you go to VS Code, it will ask the version to be used, and you would have only one version, so when you select the version, the "Go To Definition" will be activated.
I was having a similar issue with java on Ubuntu 20.04 using OpenJDK version 11 (openjdk-11-jdk in apt). At first I didn't have the JRE installed, so I installed it and it still didn't work.
Afterwards, I went to the CTRL + SHIFT + P menu and then to Java: Configure Java Runtime, there I saw in the Java Tooling Runtime tab that /usr/lib/jvm/java-11-openjdk-amd64 was selected, changed it to /usr/lib/jvm/java-1.11.0-openjdk-amd64 just to see if it would work, and after a restart it did. I'm not sure why this is, but I hope it may help somone else.
For python ensure your code analysis settings are correct. In my case the languageServer was accidentally set to 'None'. Reverting it to 'default' or 'pylance' did the trick.
Just to inform if none of above works then
In my case i was using Kite extension in my VS code, I just disabled it and it worked. I think kite extension is blocking this feature.
OS: Linux Ubuntu 22.04
if you encountered with following error:
"The .NET Core SDK cannot be located. .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on the path."
Normally Vscode remains unable to locate .Net sdk. need to set path manually.
sudo ln -s /snap/dotnet-sdk/current/dotnet /usr/local/bin/dotnet
restart omnisharp & restart vscode
No need to do anything. Just close and re-open. It will work.
I also faced similar problem. In my mac os cmnd + 'click' is used to 'go to definition' then it suddenly stoped working. If that is the case then please follow these steps:
restart vs code
restart pc
uninstall all extensions and reinstall again followed by a pc restart.
I had a similar issue with the extension C/C++ installed. I solved it by downloading an older version of the extension and upgrading to the last version. Somehow it solved the problem...

How do I use the qml profiler in qt 5.3.0?

I cannot seem to start the built-in profiler, I have tried a number of settings and it still wont run. I get this message;
I have enabled qml debugging under 'Build Steps' like so;
I have also enabled it under 'Debugger Settings' (and followed the pre-requisites).
I have restarted, rebuilt, cleaned and re-ran qmake. I would appreciate any help.
Check Projects->(Whatever target)->Run settings and make sure the QML checkbox is set next to the debugger languages. Report back if this fixes your problem.

VC++ Winforms auto generated project won't debug VS2010: "This Project is out of Date"

On VS 2010 C++ Express I am getting an error and my solution won't compile.
Here's what happens:
I open Visual Studio. (Obviously)
I click on "New Project" on the "Welcome" page.
I select "Windows Forms Application," name it, and click "OK."
I click on the debug button.
It says "The project is out of date."
I don't do anything else. No saving, no waiting. I wrote down what I did exactly when I did it. I've repeated this many times, and it still won't work.
Am I forgetting to add another file to my solution to help it compile? I didn't change the time, like others have said might affect it. It is on my harddrive, so it's a fresh project.
Other Questions that Haven't Helped Me:
This question: Nothing in it applied to me.
This question: All answers said a file was missing, but how could that be when it was just autogenerated two minutes ago? BTW: This is my first solution since I installed a week or so ago; I've just been repeating this process a few times. The only setting that have changed are the toolbar icons that I customised to my preferences.
This question: Everything is too complex for my skill level; I am used to some of the C/C++ syntax, but not as much with Visual Studio VC++.net.
The default VS settings are not entirely compatible with your desired one-click-does-all usage. C++ programmers normally favor building the program explicitly. Use Build + Build or press the shortcut keys for that command.
You can change that. Use Tools + Options, Projects and Solutions, Build and Run. Note the "On Run, when projects are out of date" setting. Change it to "Always build". The one below that is best changed to "Do not launch".