Visual Studio 2022 Profiler not properly expanding stack traces - profiling

I am migrating a Visual Studio C++ project from VS 2017 to 2022. Everything went fine, until I tried to use the Performance Profiler. It hit a frustrating issue where it's collapsing pretty obvious call graphs into single report lines, despite all attempts to fix. This worked fine with 2017.
For example there is this call:
This is a thin wrapper around another call that does the "real work", and you can see this in the profiling results:
But that inner Read() call does not show up in the profile, nor any of the stuff it calls.
I have "Enable Just My Code" turned off. This code is actually "my code", it's linked through a DLL. Debug information is turned on in the DLL build (/Zi) and link.
How can I get VS 2022 to expand stack traces properly? Again this all works flawlessly in VS 2017.

Related

Visual Studio clears command line arguments when begins to run

In my solution, I have a Visual C++ project which uses
Platform Toolset = Visual Studio 2013 (v120)
which I am opening in Visual Studio 2019.
If I edit the Project Properties > Configuration Properties > Debugging > Command arguments to something , and do OK it goes well, as if I open this dialog again is everything OK.
But when I run the application, the Command Arguments got cleared, for the specified configuration, as the same odd behavior happens both in Release and Debug Configurations. This way I can not use VS interface to parameterize the command input.
The moment I hit the Play button, the parameterization has disappeared: 🙁
Help, please.
UPDATE:
It seems to be an extension causing the strange behavior. I disabled every extension I could, and the behavior is not happening now. When I have time, I will try to cherry pick what extension is annoying me and give more updates.
UPDATE 2:
I just enabled extensions by blocks of a few alphabetically and ended up with all of them being enabled, and seen VS is just behaving well. I am believing the fact of disabling some extension has put things back on track.
I just uninstalled an extension named "Smart Command Line Arguments" and now things seem to work fine.
May be I was using wrongly, I don't know.
Now I will be continuing my work, and if I don't find any problems, I will accept my present answer.
It happened to me today again. I did some disk cleaning some days ago, I may have touched something in Visual Studio 2019.
Now, I was getting the same problem. This time, after seeing VS having several times this bad behavior, I tried to change the command line arguments, DID NOT start debugging, then I restarted VS, started Debugging again and now it seems to do what is supposed, not to clear my command line arguments customization.
UPDATE: this is happening again. It happens when it is not the first time I click "Start Debugging" after starting Visual Studio. So this implies I will have to restart VS almost every time I want to start debugging, for not getting the command line arguments cleared. ☹

How can I disable the debug console from showing the file address in my code?

I created a simple program for training purposes in Visual Studio Community Edition 2017 and I'm not having an issue running the program itself but it is showing me the file address for the process its running in the middle of the code in the Debug Console. I'm not sure how to disable this from showing.
I've tried searching Google but honestly I'm not sure how to easily phrase my question so no results really helped.
The program runs perfectly fine with no errors. This is a visual issue
Highlighted area is what I want to get rid of.
You can do it with:
Tools->Options->Debugging->Automatically close the console
Here is a corresponding fragment from the Visual Studio documentation:
Automatically close the console when debugging stops:
Tells Visual Studio to close the console at the end of a debugging session.

Visual Studio 2015 hangs when compiling and linking projects

I recently made the change to Visual Studio 2015 from Visual Studio 2012 as my compiler for my c++ projects. After making this change I have noticed that visual studio will frequently hang in the build process.
This never occurred with Visual Studio 2012. The hangups are at random points and do not occur at the same build points in my projects.
When I ran VS in administrator mode and got all of the cl.exe's and link.exe's to appear as command prompts I was able to see when they hung. And there were no errors thrown or anything.
The only way I have successfully worked around this issue is by setting Visual Studio's build process to only process one project at a time and use only one compilation simultaneously. However I cant maintain this as my build time is somewhere around 3-4 hours (Yes, this is a HUGE project).
I think this is a duplicate of Visual Studio 2015 Win64 hangs during solution build. I posted an answer there. In short, there may be a patch that resolves the issue:
https://www.microsoft.com/en-us/download/details.aspx?id=51161

Visual Studio 2015 -- CPU Usage Profiling Not Working?

I recently upgraded from Visual Studio 2013 Community to Visual Studio 2015 Community.
I've heavily relied on the "CPU Usage" Tool that can be found by doing the following:
Click "Debug"
Click "Start Diagnostic Tools without Debugging"
Click "CPU Usage" Check box
Click "Start" button
When the program is complete, it is supposed to show you the functions and the time spent in each. What I get instead is just the name of my executable that I can keep expanding instead of seeing the function names -- It doesn't know the names of the functions.
This worked fine on Visual Studio 2013... I would be able to see the function names and everything worked. I tried creating a new "test" solution/project to see whether this works and I get the same results: No function names.
Does this work for anybody? I also installed VS2015 on a fresh development box and still have no results. This seems like Microsoft shipped with a Visual Studio bug.
Note: I'm writing a C++ console application. I've tried this on debug and release builds and ensured that I'm building with debug information.
It's in the Visual Studio 2015 Update 1 release notes, so I suspect it was broken in the initial release:
Profile your CPU Usage while debugging
Now, you can get a detailed per-function profile of your CPU Usage while you are debugging. You can turn CPU Profiling on and off while debugging and view the results when you are in a break state, which allows you to view a per-function breakdown of CPU Usage of code that executed between breakpoints and during steps. (To use this functionality, open the Diagnostic Tools window (Debug -> Diagnostic Tools), switch to the CPU tab, and then click the "CPU Profiling" button.)
I have also noticed this, but if you use that little search box (top right corner of the results area) and try typing in either the name of the function you're looking for or part of the name and it will expand everything (there's usually a lot to expand) and highlight the function you're looking for. Its the only way I've been able to profile specific functions.

Visual Studio 2013: native C++ single-step debugging (F10) slow

I am using Visual Studio Premium 2013 Update 2 on a freshly installed (fast) machine with Windows 8.1 Update. Everything is running smoothly, only one thing bugs me:
Problem
When I debug a native C++ project (debug build) by going from line to line with F10 ("step over") it takes 1-2 seconds to go to the next line when I press the F10 key.
What I tried
I looked at several other questions related to slow debugging and made sure that neither of the following is not the reason in my case:
Everything is local (app and all data), no network shares involved
Disabling the Microsoft symbol server did not help
I only have a single breakpoint
Using the menu/toolbar instead of the keyboard does not make any difference
In the default configuration "edit and continue" is enabled, but apparently not for native code:
When I disabled "edit and continue" completely, F10 stepping became much faster (0.5-1 s). The speed is tolerable now. I had to restart Visual Studio after I changed the configuration to this: