hlsl debugging in vs13 graphics diagnostics - visual-studio-2013

I am trying to debug a shader in visual studio 2013 (via graphics diagnostics engine) but I am having the following message...
This graphics diagnostics engine failed to build shader trace and therefore it is unable to debug shader.
When I configured the setting the configuration setting was set to "Debug". And the command line I used is as follows :
fxc /Zi /Od /Fo"Skin.fxo" /fx"_5_0" /nologo

I declared an array which was used by the shader code.. However the array was overflowing and since it was built outside visual so it didnot give any error message.

Related

Debugging inline assembly in C++ code in Visual Studio 2022 is broken

We are having issues with debugging inline assembly code in Visual Studio 2022 Community. It worked fine in previous versions, such as 2017, 2019. Even though the optimizations are disabled, debuggable assembly is set to Yes, support just my code debugging is set to No, Debug Information format is set to Program Database /Zi, Basic Runtime Checks are set to Default...
...the debugger incorrectly shows the current line, when stepping over an inline assembly code. It can be clearly seen when Debug Window Disassembly is shown - instructions are not detected properly to align to the source code. Thus when debugging without disassembly, debugger shows incorrect lines, and - breakpoints do not work as they are not detected at proper instructions.
I was wondering if anyone has a hint for any other options that we could try to switch to get this working. We've been fighting this a few months, and Microsoft Support requires you to pay 149 Eur just to file a bug.
adding debug windows modules and output:

On Visual Studio 2019, how to debug pure C++ and CLI C++ in a C++ Debug program?

I want to debug a C++ MFC/CLI program developped on Visual Studio 2019.
Until now, I can debug C++ native (MFC) code.
DebugType in Debug panel is set to Auto.
All breakpoints in C++/CLI modules are flagged as inactive (a red circle with an interrogation character in a yellow triangle).
After having changed DebugType from Auto to 'Mixed (.Net Framework), Visual Studio, when starting a debug session, is displaying following warning box.
But my build is in DEBUG mode !
What is happening ?
What must I do to debug pure C++ AND CLI C++ code ?
PS: I have also tried to debug in only C++/CLI code, but Visual Studio 2019 is displaying same message !
On Visual Studio 2019, how to debug pure C++ and CLI C++ in a C++
Debug program?
Since I do not have your project and cannot troubleshoot the issue quickly unless you provide a sample.
You can try the following suggestions:
Suggestions
1) try to reset all settings by Tools-->Import and Export Settings-->Reset All Settings
2) disable any third party extensions under Extensions-->Manage Extensions in case one of them causes the behavior.
3) check Use Managed Compatibility Mode option, Enable .NET Framework source stepping option and Suppress JIT optimization on module load (Managed only) option under Tools-->Options-->Debugging-->General.
4) close VS, delete .vs hidden folder, Debug folder from the solution folder and also Debug folder in the project folder. Then restart your project to test again.
I'm putting this here because it might help someone in the future, and because it's completely nuts.
I've followed all instructions I could find, including the ones on this question, reinstalled VS twice, with different versions, and nothing.
What solved for me was to simply delete the lines of code and write them again.
Yes.
I know.

Visual Studio 2017 claims I am debugging a release build of my C++/CLI project

After updating from Visual Studio 2013 to Visual Studio 2017, if I try to start a debug session of my C++/CLI project (.vcxproj project file) Visual Studio stops and displays a dialog which says:
You are debugging a Release build of Foo.exe. Using Just My Code with Release builds using compiler optimizations results in a degraded debugging experience (e.g. breakpoints will not be hit).
I can then either stop debugging or continue with the debug session, either with "Just My Code" turned on or off.
The project is clearly built with Debug information and without any optimization whatsoever. Consequently, the old Visual Studio 2013 did not show any warning.
Both this SO question and this SO question deal with the same warning emitted by Visual Studio 2015, but after reading through the suggestions and hints offered there I have to say that none of them seems a convincing solution to my problem. Specifically, I was able to get rid of the warning by enabling the Visual Studio option "Suppress JIT optimization on module load (Managed only)", but I think this is only treating a symptom, not fixing the actual cause of the problem.
What do I have to do to make Visual Studio 2017 detect that my C++/CLI project is a debug build so that it no longer displays the annoying (and actually misleading) warning?
Environment:
Visual Studio 2017 Version 15.5.2
Visual Studio option "Just My Code" is enabled
Visual Studio option "Suppress JIT optimization on module load (Managed only)" is disabled
Project is a native project (.vcxproj project file) built with CLR support (compiler option /CLR), debug information (linker option /DEBUG), and no optimizations (compiler option /Od)
The solution to my problem is that the project needs to be built with the project setting "Debuggable Assembly" set to "Yes" (linker option /ASSEMBLYDEBUG). By default this linker option is unset and apparently defaults to /ASSEMBLYDEBUG:DISABLE. Cf. Microsoft's documentation of the linker option.
Setting /ASSEMBLYDEBUG is the same as writing
[assembly:Debuggable(true, true)];
in code. According to the MSDN documentation of this DebuggableAttribute constructor, this code tells the debugger to set
isJITTrackingEnabled = true
isJITOptimizerDisabled = true
So the initial workaround I mentioned in the question, where I enabled the Visual Studio option "Suppress JIT optimization on module load (Managed only)", wasn't too far off the track. But I believe that knowing what I'm doing and setting a fine-grained, project-specific linker setting is preferrable to having no clue and randomly making a change to a global Visual Studio setting.

debugging cuda files in visual studio

i have a cpp function (function.cpp") which i "mex"-ed. then i open the function.cpp file in visual studio and attach visual studio to a running matlab process.
when i call the function in matlab i am able to set breakpoints in the function.cpp file and step through it observing the variables.
The debugging process breaks down when i change the function to a cuda file (function.cu). Following the process described above i am still able to stop within function.cu but i cannot see any variables. when i try to "watch" a variable it says "Error symbol .. not found"
i have nsight installed in visual studio. question: how can i observe my variables in the file function.cu in the debug mode as i do for the function.cpp file. Is this possible ?
Note that the function.cu is not in a project. it is just a standalone file with cpp code of a function (say somefunction(){}). for debugging purpose i am opening it up in visual studio. i am compiling the function.cu file in matlab using "nvmex -g wrapper.cu" the wrapper.cu is a matlab mexfunction wrapper which makes calls to somefunction() written inside function.cu
You're using the VS debugger which is a host debugger, so it doesn't know how to debug device programs. To debug device code in Windows you should look at Parallel Nsight Visual Studio Edition.
You can search the docs for a guide to attaching to a running process, for the current release (2.2) the specific page is here.
You attached VS in, but stopped in function 'main'. Looks like you are still hitting the CPU code. When you follow Tom's suggestion to attach the debugger, have you choosed "NVIDIA GPU Debugger" in the Transport dropdown?
To debug any cuda-code you'll need a gpu on which no desktop environment/server is running. For windows that means, that you need a second gpu. I'm not to 100% sure if it has to be a nvida gpu, too. Than you will be able to bedubg your code.
Under linux you're able to debug with only one gpu because you can shut down the x-server and debug with cuda-gdb per command line.
Further informations will give you the cuda-gdb manual

Why can I not enable breakpoints in Visual Studio 2005?

I have seen that sometimes breakpoints cannot be enabled in Visual Studio, they appear as empty circles, with a warning sign when enabled. This icon change is all the information VS gives.
Particularly I'm suffering that in a Windows CE 6.0 project where I cannot enable any breakpoint in any of the sub-projects or in the OS design. The target platform in this project is a Vortex x86 embedded board, I use KITL for remote debugging.
How can I retrieve more information about what is happening?
Is it not possible to use breakpoints in my case?
The hollow circles with the yellow warning sign are OK. The breakpoint should instantiate once the module that holds that breakpoint loads.This of course happens in a debug image only.
Are you running/compiling a debuggable version of your projects - I seem to remeber if there were no symbols loaded then this was the casE?

Resources