Page 1 of 1

Step by Step Instructions for Debugging Minetest in Windows

PostPosted: Thu Feb 07, 2013 03:40
by Neuromancer
I'm creating step by step documentation on how to debug Minetest on Windows.

Steps:
-Get Minetest to compile on windows. See my thread for instructions: http://forum.minetest.net/viewtopic.php?id=4665
-be sure to use debug mode (select Debug not Release in the dropdown on the top of the screen)
* One important thing we did there was create a directory something similar to C:\Users\x\Documents\Projects\Minetest44
This directory will be called DIR hereafter.
-to start debuging, right click the minetest project>Debug>Start New Instance
-Initially you will probably get the error:
"Unable To Locate Componenent" saying "This application has failed to start
because zlibwapi.dll was not found. Re-installing the application may fix this problem"
-To fix this copy the following .dlls to DIR\minetest\bin\Debug:
-DIR\libvorbis-1.3.3\win32\VS2008\Win32\Debug\libvorbisfile.dll
& libvorbis.dll
DIR\libogg-1.3.0\win32\VS2008\Win32\Debug\libogg.dll
DIR\irrlicht-1.7.2\bin\Win32-VisualStudio\irrlicht.dll
DIR\zlib125dll\dll32\zlibwapi.dll
-you will get a bunch of "Cannot open file of texture errors"
I see the textures in the below folder
C:\Users\x\Documents\Projects\Minetest44\minetest\games\minimal\mods\default\textures
but the minetest executable is moved from bin to bin\debug, so I wonder if that caused a problem.

-open main.cpp and put a breakpoint on line 79.
Settings main_settings;
-start hitting f11 to step into the code
-after a few times it will go into jmutex.cpp (this is a cross platform treading library)
-keep hitting f11.
-you will get the error: "there is no source code available for the current location."
-just set breakpoints one line down from this and hit f5 to continue past this

PostPosted: Thu Feb 07, 2013 08:01
by Jordach
Neuromancer wrote:I'm creating step by step documentation on how to debug Minetest on Windows.

Steps:
-Get Minetest to compile on windows. See my thread for instructions: http://forum.minetest.net/viewtopic.php?id=4665
-you will probably get the error:
"Unable To Locate Componenent" saying "This application has failed to start
because zilibwapi.dll was not found. Re-installing the application may fix this problem"
-This isn't the best fix, but it does work:
-copy the following .dlls to c:\windows\System32
-C:\Users\x\Documents\Projects\Minetest44\libvorbis-1.3.3\win32\VS2008\Win32\Debug\libvorbisfile.dll
& libvorbis.dll
C:\Users\x\Documents\Projects\Minetest44\libogg-1.3.0\win32\VS2008\Win32\Debug\libogg.dll
C:\Users\x\Documents\Projects\Minetest44\irrlicht-1.7.2\bin\Win32-VisualStudio\irrlicht.dll
C:\Users\x\Documents\Projects\Minetest44\zlib125dll\dll32\zlibwapi.dll

I realize this is not the ideal solution. Does anyone have any better options than dumping the .dlls into System32 folder?
Drop them into minetest/bin. Silly neuromancer.

PostPosted: Thu Feb 07, 2013 11:40
by rarkenin
What about actual debugging, using a program such as gdb or OllyDBG?

Especially, where can I get debugging symbols?