Debugging help

Started by
8 comments, last by mattnewport 19 years, 9 months ago
So I'm writing a break out game in a windowed directx app. I have a bug where the wrong block is being erased sometimes, and I'm trying to debug it. I've put in some breakpoints, but when the breakpoint hits, I can't switch back over the the app to see exactly which block got erased, and which one should have. Is there anyway to do this? Do I have to do the network debug thing? Seems to me you shouldn't have to with a windowed app. Thanks much.
moonshot aka Jayson Bailey
Advertisement
If you run the app windowed, make sure it runs at the lowest resolution possible(Probably 640*480).

However, don't let any other window(Visual Studio for instance) overlap your game. Since the application "freezes" during debugging, it doesn't refresh itself anymore. Overlap a window, and you can't see what's on it, because it doesn't draw.

To see your block change, you must at least go through the render loop once, after you updated the block.

Toolmaker

I can see the blocks change, I'm cycling through the render loop plenty of times. I don't really want to have to reduce the size of my app, and the size of my IDE window. That doesn't seem like a logical solution to me. It may work, but I'd rather go through the trouble of network debugging if that's the case. There aren't any other ways? Seems pretty stupid not to be able to see your app when you want to debug it.
moonshot aka Jayson Bailey
If you can afford it, buy a cheap monitor and a second graphics card. Dual monitors make debugging pure bliss. I will never go back.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Dual monitors are good but remote debugging is even better. If you can afford to get a second machine or already have one kicking about then set it up for remote debugging, it's really not very difficult to set up if you're using .NET 2003 (as I remember it wasn't too bad even in VC6) and nothing beats it for debugging DirectX apps.

Game Programming Blog: www.mattnewport.com/blog

Anybody have a good link to setting up remote debugging? I've tried the help, I've found a few tutorials(mostly for ver6 tho).

I'm using Microsoft Visual C++ .NET. I can get the Debug Monitor going on my remote machine. I can't find out how to get the local machine to use the remote machine though.
moonshot aka Jayson Bailey
I got it going following the instructions in the help file. Here's what I do:

1. Share the drive on your development machine (the machine where you're running visual studio) where your .exe is.

2. Use map network drive on the remote machine (where you'll be running your app) to map the shared drive from your development machine to some available drive letter, say Z:

3. On the Properties page for your project select Debugging and enter the working directory as it looks from the remote machine (e.g. Z:\projects\your_project)

4. Under Remote Settings -> Connection choose 'Remote via Pipe' (I don't know if any of the others work, that's the one I always use).

5. Under Remote Machine enter the IP address or network name of the remote machine (get the name from Control Panel -> System -> Computer Name and the IP address by opening up a command prompt and typing ipconfig)

6. Under Remote Command enter the path to your executable as it appears from the remote machine (e.g. Z:\projects\your_project\Debug\your_project.exe)

7. Run MSVCMON.exe on the remote machine

8. Hit F5 on the development machine, you should see an acknowledgement appear in the MSVCMON window on the remote machine and your app will start up. It will take longer than if it was running locally but you should start to see the usual blurb appear in the output window.

Let me know how that works out for you.

Game Programming Blog: www.mattnewport.com/blog

Hmm, well I'm getting somewhere now. I've done as you said, and everything looks correct. I hit F5 to enter debug, and it says the remote machine isn't running msvcmon. Also, I don't have the pipe option, just TCP/IP or DCOM. I've tried both, neither work. In the msvcmon it says it's using TCP/IP, so I assume that's what I should use.
moonshot aka Jayson Bailey
Does msvcmon need to be run from a specific directory?
moonshot aka Jayson Bailey
Msvcmon shouldn't need to be in a particular directory - I just copy it across to it's own directory on the remote machine. I don't know why you don't get the pipe option, I think TCP/IP should work though. You need to install some additional components on the remote machine to use DCOM I think - take a look at the remote debugging help in MSDN. Maybe your firewall is causing problems? Try disabling it temporarily if you have one on both machines. Beyond that I don't know I'm afraid - it's always worked for me.

Game Programming Blog: www.mattnewport.com/blog

This topic is closed to new replies.

Advertisement