VOGONS


First post, by llm

User metadata
Rank Newbie
Rank
Newbie

i've got a fresh/clean (debug - not release)VS2010 x86 build of dosbox-svn, SDL 1.2.15 and debug-/heavy-debug-option active, core=normal

when i try to debug the DOS_Execute function and try to step in VS2010 with F10,F11 F5 and others the keys do not work
and the mouse hangs sometimes, is dosbox-debug too harsh catching key/mouse-events or something?
option to disable this behavior?

Reply 3 of 8, by rainwarrior

User metadata
Rank Newbie
Rank
Newbie

It happens to me too in VS2017, basically with any breakpoint my system drops to about 1/3 fps and most keypresses / clicks / mouse movement will be dropped. Kinda just have to rapidly tap SHIFT+F5 until it manages to resume. (Actually did a little bit of debugging like this, but it was extremely frustrating and afterwards I switched to "printf debugging" instead.)

Seems to happen in GDB to with MinGW/MSYS to a lesser extent, but after the initial "slideshow" moment after hitting a breakpoint if I switch some windows around it seems to recover and I can step normally in GDB, so at least that's usable.

Has this been a problem for a long time? Does it affect other platforms or only windows?

Reply 4 of 8, by Jamiras

User metadata
Rank Newbie
Rank
Newbie

For what its worth, it appears to be caused by the DirectInput code in the SDL library. Commenting out these lines fixes the issue (but causes other issues since the inputs aren't being processed):

	/* Initialize DirectInput */
if ( DX5_DInputInit(this) < 0 ) {
return(-1);
}

Related discussion that seems to support my observation: https://stackoverflow.com/questions/17886883/ … while-debugging

I don't know if it's fixed in a newer version of SDL, or if there's a non-breaking change/configuration that could be applied to work around the issue.

Reply 6 of 8, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

Setting SDL_VIDEODRIVER=windib works for gdb for debugging DOSBox as long as it is not interfering with the feature you plan to debug on. I have been exclusively using gdb for debugging for years. My VS experience has been fading and I think the last version I used was VS2003 and thereafter never bothered for any new version of VS anymore. DOSBox was the reason back then that made me look into GCC seriously, a path that I have never looked back since then, even after Microsoft has eventually released Visual Studio for free.

Reply 7 of 8, by pmcmorris

User metadata
Rank Newbie
Rank
Newbie

I can confirm that this fixes the issue for VS debugging. Open Solution Properties (All Configurations) -> Debugging -> Environment -> Edit ...
Then add the line: sdl_videodriver=windib

I'd would be good if someone could update the build VS build instructions to make this more visible: https://www.dosbox.com/wiki/Building_DOSBox_w … h_Visual_Studio
I would but I don't have any permissions for the wiki. Also, the build steps for pdcurses is missing for VS. It turned out to be pretty easy but would be nice to add too.

Reply 8 of 8, by rainwarrior

User metadata
Rank Newbie
Rank
Newbie

I think the wiki has been locked for a while. When I revised that page I couldn't find a usable version of pdcurses, so it'd be nice to have some instruction there.

Ultimately though after writing that guide I installed MinGW and built it with that, and had a much easier time than trying to do it with Visual Studio.