Followers 0

# DX11 Debugging (managed) DX11

## 11 posts in this topic

Learning DX11 through SharpDX, but the process is made rather painful by the fact that Visual Express appearently does not support unmanaged debugging.

Are there any workarounds, 3rd party tools, hacks etc. that anyone knows of to get around this, or am I just out of luck unless I bite the bullet and throw down \$ for a full version of VS?
0

##### Share on other sites
[quote name='laztrezort' timestamp='1345004365' post='4969724']
Visual Express appearently does not support unmanaged debugging.
[/quote]

Not sure what you mean by this. I've had no problem setting breakpoints, stepping through code, evaluating memory, callstacks, etc... What problems are you encountering?

Also, which language and version of Visual Studio Express are using - VS 2008, 2010, or 2012? If you can provide more information about the problems you're facing, I'm sure we can find a solution.
0

##### Share on other sites
Sorry, to clarify I'm using Visual C# Express 2010 - which does not have the "unmanaged debugging/native code debugging" option available. This means that even if I set the debug mode (using DXcpl.exe) or the Debug flag in the device creation, exceptions (thrown from the unmanaged layer) are not providing useful debug information.
0

##### Share on other sites
Hey Shane,

I [url="http://msdn.microsoft.com/en-us/library/tdw0c6sf.aspx"]see what you mean[/url] about not supporting mixed mode debugging. With the DX debug mode enabled, are you still seeing debug output in the output console? what do the exceptions look like that you're receiving?

Also, you may try installing Visual C++ 2010 Express edition. Having both on your machine may give you more options. When an exception is thrown, you may just try attaching with the Visual C++ Native debugger if you can.

And if all else fails, there is [url="http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx"]WinDBG[/url]. It's a difficult, somewhat cumbersome tool to learn to use (especially with managed code as it requires using the SOS extension), but is by far the most powerful debugger in the world. It is in fact the only good way to view the garbage collected heap for your application while running.
1

##### Share on other sites
The debug output from Direct3D goes through the system-wide debugging interface, so you can pick it up using the [url="http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx"]DebugView[/url] application. Just be sure to create your D3D11 device with the Debug create flag.

[quote]And if all else fails, there is WinDBG. It's a difficult, somewhat cumbersome tool to learn to use (especially with managed code as it requires using the SOS extension), but is by far the most powerful debugger in the world. It is in fact the only good way to view the garbage collected heap for your application while running.[/quote]

Using WinDbg here is overkill, and claiming that it's the "only good way to view the garbage collected heap" is a little ridiculous; there are plenty of excellent tools available that can visualize the GC heap in a much more intuitive fashion than WinDbg. Edited by Mike.Popoloski
0

##### Share on other sites
[quote name='JWalsh' timestamp='1345007211' post='4969735']
With the DX debug mode enabled, are you still seeing debug output in the output console? what do the exceptions look like that you're receiving?
[/quote]

The only information it gives it an "HRESULT" value, "DXGI_ERROR_INVALID_CALL: Message Unknown", the rest of the exception data is default or unset. Output also gives no information. I get the stack trace up to the first managed call that produced the exception, of course.

Thanks Mike & JWalsh, I'll try these out and see what I can make work.
1

##### Share on other sites
[quote name='Mike.Popoloski' timestamp='1345007515' post='4969736']
Using WinDbg here is overkill, and claiming that it's the "only good way to view the garbage collected heap" is a little ridiculous;
[/quote]

You don't really know if it's overkill. At this point we don't know what exactly he's trying to do. DebugView works great if he's just wanting to see the Debug messages, but if he wants to set breakpoints, step, make changes to memory, etc... he's back to needing a debugger.

My aim was to point out the WinDBG is better at debugging certain problems than Visual Studio (and other tools). It's all about using the right tool for the job. If you're not particularly fond of WinDBG's !DumpHeap or !EEHeap commands, that's cool. You're entitled to think my opinion is ridiculous.

But I say that WinDBG is the only good way because WinDBG has tons of support for working with the heap. Being able to see how much memory is in each generation, where the pages start and end, being able to see how many objects of each type are in the heap (and where), and cross-reference them to see how much memory is being used by each and in total. Additionally, you can evaluate the class table for each type, etc... Heck, you can even investigate the LOH. And that's not to speak of any of WinDBG's other great commands. !Analyze, DumpStack, EEStack, DO, GCRoot, etc... I never feel more in control of the run-time and what it's up to than when using WinDBG. If you know of another tools that gives you that, I'm more than happy to change my perspective.

[quote name='Mike.Popoloski' timestamp='1345007515' post='4969736']
there are plenty of excellent tools available that can visualize the GC heap in a much more intuitive fashion than WinDbg.
[/quote]

I honestly haven't ever seen one, but would love some recommendations. I'm always interested in learning about new tools. Mark's tools are fantastic.
1

##### Share on other sites
For now, as I'm just learning the API by trial-and-error, all I'm interested in is seeing the debug information. Tried out DebugView - works great for what I need.

Thanks again for the quick replies.
0

##### Share on other sites
[quote name='JWalsh' timestamp='1345009286' post='4969743']
[quote name='Mike.Popoloski' timestamp='1345007515' post='4969736']
Using WinDbg here is overkill, and claiming that it's the "only good way to view the garbage collected heap" is a little ridiculous;
[/quote]

You don't really know if it's overkill. At this point we don't know what exactly he's trying to do. DebugView works great if he's just wanting to see the Debug messages, but if he wants to set breakpoints, step, make changes to memory, etc... he's back to needing a debugger.

My aim was to point out the WinDBG is better at debugging certain problems than Visual Studio (and other tools). It's all about using the right tool for the job. If you're not particularly fond of WinDBG's !DumpHeap or !EEHeap commands, that's cool. You're entitled to think my opinion is ridiculous.

But I say that WinDBG is the only good way because WinDBG has tons of support for working with the heap. Being able to see how much memory is in each generation, where the pages start and end, being able to see how many objects of each type are in the heap (and where), and cross-reference them to see how much memory is being used by each and in total. Additionally, you can evaluate the class table for each type, etc... Heck, you can even investigate the LOH. And that's not to speak of any of WinDBG's other great commands. !Analyze, DumpStack, EEStack, DO, GCRoot, etc... I never feel more in control of the run-time and what it's up to than when using WinDBG. If you know of another tools that gives you that, I'm more than happy to change my perspective.

[quote name='Mike.Popoloski' timestamp='1345007515' post='4969736']
there are plenty of excellent tools available that can visualize the GC heap in a much more intuitive fashion than WinDbg.
[/quote]

I honestly haven't ever seen one, but would love some recommendations. I'm always interested in learning about new tools. Mark's tools are fantastic.
[/quote]

What is this, an advertisement for WinDbg? I know what it does, I don't need you to start throwing random commands at me. I'm glad you get some weird orgasmic glow when using it, but that doesn't mean you should go around claiming it's the *only* tool that's any good. Some people choose tools based on more than the "feel" it gives you.

Suggesting that a beginner who is just trying to learn D3D11 and wants debug spew to drop the Visual Studio debugger in favor of WinDbg is, as I said before, ridiculous. I'm not sure why you think that using DebugView precludes the ability to set breakpoints and step through in Visual Studio, but that's patently wrong.

As for other tools, the CLR memory profiler gives you a comprehensive overview of the GC heap, but to be honest most of that information is rarely ever useful. The primary reason I've found to view the GC heap is tracking down object leaks and their associated retention graphs, and for that the ANTS or jetBrains memory profilers are far more valuable by providing a targeted view without all that extra useless information. If you haven't used any of them, it might be worth it to give them a try.
-5

##### Share on other sites
[quote name='Mike.Popoloski' timestamp='1345046739' post='4969865']<br />What is this, an advertisement for WinDbg? I know what it does, I don't need you to start throwing random commands at me.<br />[/quote]

No. It's not an advertisement. It was my validation for why I think WinDbg is the best tool for doing low-level debugging of .NET. It was no more an advertisement than your mentioning ANTS or dotTrace. The commands weren't for you, I wrongly assumed you were an expert at WinDbg and didn't need them. The commands are for any readers who want to research why WinDbg is so powerful.

[quote name='Mike.Popoloski' timestamp='1345046739' post='4969865']<br />I'm glad you get some weird orgasmic glow when using it...<br />[/quote]

It amazes me how, in spite of how small the industry is, people still feel like it makes sense to treat others with disrespect. Rather than being a douche, why not say "interesting... you seem to feel this tool is very powerful, and you work closely with some of the original .NET developers, perhaps there's something I may be missing." But instead, you jump right to "that's ridiculous". I guess your perspective changes with age and experience. /sigh
0

##### Share on other sites
[quote name='JWalsh' timestamp='1345054937' post='4969894']
[quote name='Mike.Popoloski' timestamp='1345046739' post='4969865']<br />What is this, an advertisement for WinDbg? I know what it does, I don't need you to start throwing random commands at me.<br />[/quote]

No. It's not an advertisement. It was my validation for why I think WinDbg is the best tool for doing low-level debugging of .NET. It was no more an advertisement than your mentioning ANTS or dotTrace. The commands weren't for you, I wrongly assumed you were an expert at WinDbg and didn't need them. The commands are for any readers who want to research why WinDbg is so powerful.

[quote name='Mike.Popoloski' timestamp='1345046739' post='4969865']<br />I'm glad you get some weird orgasmic glow when using it...<br />[/quote]

It amazes me how, in spite of how small the industry is, people still feel like it makes sense to treat others with disrespect. Rather than being a douche, why not say "interesting... you seem to feel this tool is very powerful, and you work closely with some of the original .NET developers, perhaps there's something I may be missing." But instead, you jump right to "that's ridiculous". I guess your perspective changes with age and experience. /sigh
[/quote]

Wow, you certainly took that the wrong way. I'm sorry I didn't immediately defer to your obvious experience and blatant name-dropping. I thought we were trying to help the OP here, but it seems you were more interested in showing how advanced you are and how many cool connections you have. It amazes me how, in spite of how small the industry is, people still feel like it makes sense to treat others with disrespect. The OP was a beginner who wanted a specific thing (to see D3D debug spew) and you went off on a tangent to satisfy your own ego. I guess your perspective changes with age and experience. /sigh
-6

##### Share on other sites
Well it seems this thread has taken an unfortunate turn. [img]http://public.gamedev.net//public/style_emoticons/default/unsure.png[/img] Seeing as the OP has had his question answered, I think it's time to close this one up.
1

##### Share on other sites
This topic is now closed to further replies.
Followers 0

• ### Similar Content

• By YixunLiu
Hi,
I have a surface mesh and I want to use a cone to cut a hole on the surface mesh.
Anybody know a fast method to calculate the intersected boundary of these two geometries?

Thanks.

YL

• By hiya83
Hi, I tried searching for this but either I failed or couldn't find anything. I know there's D11/D12 interop and there are extensions for GL/D11 (though not very efficient). I was wondering if there's any Vulkan/D11 or Vulkan/D12 interop?
Thanks!

• Hi Guys,
I am just wondering if it is possible to acquire the address of the backbuffer if an API (based on DX11) only exposes the 'device' and 'context' pointers?
Any advice would be greatly appreciated

• bool InitDirect3D::Init() { if (!D3DApp::Init()) { return false; } //Additional Initialization //Disable Alt+Enter Fullscreen Toggle shortkey IDXGIFactory* factory; CreateDXGIFactory(__uuidof(IDXGIFactory), reinterpret_cast<void**>(&factory)); factory->MakeWindowAssociation(mhWindow, DXGI_MWA_NO_WINDOW_CHANGES); factory->Release(); return true; }
As stated on the title and displayed on the code above, regardless of it Alt+Enter still takes effect...
I recall something from the book during the swapChain creation, where in order to create it one has to use the same factory used to create the ID3D11Device, therefore I tested and indeed using that same factory indeed it work.
How is that one particular factory related to my window and how come the MakeWindowAssociation won't take effect with a newly created factory?
Also what's even the point of being able to create this Factories if they won't work,?(except from that one associated with the ID3D11Device)
• By ProfL
Can anyone recommend a wrapper for Direct3D 11 that is similarly simple to use as SFML? I don't need all the image formats etc. BUT I want a simple way to open a window, allocate a texture, buffer, shader.

• 12
• 28
• 14
• 11
• 34