• Welcome to Valhalla Legends Archive.
 

Debugging fullscreen applications with WinDbg

Started by CupHead, December 15, 2003, 11:49 AM

Previous topic - Next topic

CupHead

WinDbg doesn't seem to like full screen applications much.  I was attempting to debug Starcraft with a breakpoint (when Starcraft froze), but found it impossible to return to normal resolution and open the WinDbg window.  My only recourse was to F5 blindly until it ran, and when it did freeze, I had to kill WinDbg which in turn killed Starcraft.  Does anyone know of a way to get back to WinDbg when a full screen application has broken or is my only chance going to involve installing SoftIce?

Skywing

Quote from: CupHead on December 15, 2003, 11:49 AM
WinDbg doesn't seem to like full screen applications much.  I was attempting to debug Starcraft with a breakpoint (when Starcraft froze), but found it impossible to return to normal resolution and open the WinDbg window.  My only recourse was to F5 blindly until it ran, and when it did freeze, I had to kill WinDbg which in turn killed Starcraft.  Does anyone know of a way to get back to WinDbg when a full screen application has broken or is my only chance going to involve installing SoftIce?
Run WinDbg and Starcraft on different NT desktops; you can switch desktops even when Starcraft has it's "stuck".

Adron has a nice desktop-switching tool that you can use to do this fairly easily; I modified it to show up in the alt+tab window so that it would be possible to switch desktops with the keyboard alone.  Perhaps he might send his program to you.

Alternatively, you can run DirectDraw programs in a Terminal Services session, provided the session is at the resolution and color depth the program wants ahead of time.  Note that this isn't so practical in Win2K, but Terminal Server in Win2003 handles DirectDraw much better (still obviously slower than running it directly with your regular video driver, but at least you don't have to wait minutes for it to redraw).  So, you could try opening a 640x480 session at 256 color to localhost and run Starcraft there.

Also note that with Win2003, an admin can debug programs running in a different session, so you wouldn't need to setup a dbgsrv like you would with Win2K.

Kp

I'd used Adron's program for a while, and found it to be annoying that it kept losing the "Run program" text (you'll see what I mean if you use it).  As such, I set out to develop a replacement; I don't think I finished, but it is usable in its current state (albeit not as full featured as planned).  If you want to try it out, I can upload it to vL.com.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

CupHead

Sounds good, let me know where you upload it to.

Adron

It lost the Run program text? Did you ever mention this to me before?

Since Skywing has modified my program, it'd be better if you got his improved version if you want to test that, Cuphead.

iago

I suppose you have some reason for not using Softice?
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Kp

Quote from: Adron on December 16, 2003, 02:32 AM
It lost the Run program text? Did you ever mention this to me before?

No, I didn't.  I figured you were done with the project and wouldn't want to resurrect it, since some of the other members seem to take that approach to old code. *grin*  I know exactly why it happens though, because I ran into the same issue working on my own program.  When switching to the new desktop, the existing window can't be moved there - it has to be destroyed and recreated.  So unless the program caches what was in the run program box, that won't appear in the new window on the second desktop.  My quickfix for this is just to save the results of a GetWindowTextW into an intermediary buffer (which starts off being blank at program init) and have the new edit box created with the text of that buffer, rather than a fixed null string.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

CupHead

iago: Not sure if SoftIce works on Win2k3.

Kp/Skywing/Adron: Someone upload their program please?

Skywing

Quote from: Adron on December 16, 2003, 02:32 AM
It lost the Run program text? Did you ever mention this to me before?

Since Skywing has modified my program, it'd be better if you got his improved version if you want to test that, Cuphead.
I think I just removed the 'hide-from-alttab' window style so that you could switch to it and use esc to close it (and thus switch desktops).

UserLoser.

What about running the game in window mode?  I know Diablo's II Game.exe has a -w command line argument which puts it in a window instead of fullscreen

Skywing

Quote from: UserLoser. on December 16, 2003, 10:40 AM
What about running the game in window mode?  I know Diablo's II Game.exe has a -w command line argument which puts it in a window instead of fullscreen
Starcraft has no built-in windowed mode.

UserLoser.

Quote from: Skywing on December 16, 2003, 10:41 AM
Starcraft has no built-in windowed mode.

Isn't it very possible to create a small program to do that to any window?

Kp

Quote from: UserLoser. on December 16, 2003, 11:00 AM
Quote from: Skywing on December 16, 2003, 10:41 AMStarcraft has no built-in windowed mode.
Isn't it very possible to create a small program to do that to any window?

It's theoretically possible.  EvilCheese was working on it before he vanished.  To my knowledge, he hadn't shared any prototypes though, so his work is lost if he doesn't come back.

CupHead: posted to my directory.  This program comes with no documentation and no warranty.  Enjoy. :P
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Adron

Quote from: Kp on December 16, 2003, 07:13 AM
No, I didn't.  I figured you were done with the project and wouldn't want to resurrect it, since some of the other members seem to take that approach to old code. *grin*

Hehe... Well, considering the simplicity of the fix required, I might had actually gone ahead and fixed it right away. But I'm sure you learned stuff while rewriting it, so it was probably not wasted time. I might go download your version and try it, for inspiration  ;)

I just didn't use the run box enough I suppose, started a cmd or something on a new desktop and that was it.