Debuggin the source code.

Debuggin the source code.

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
pin_
Posts: 49
Joined: 22 Jul 2006, 16:12

Debuggin the source code.

Post by pin_ »

I'm trying to debug the code with VS 2005.
Each time I start debugging the game breaks in the first menu.
Her's the breaking place:
file isctype.c

[source]
#if defined (_DEBUG)
extern "C" int __cdecl _chvalidator(
int c,
int mask
)
{
_ASSERTE((unsigned)(c + 1) <= 256); // breaking point
return _chvalidator_l(NULL, c, mask);
}
[/source]

Anyone know what's going on?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

That's a libc source file.

Grab a backtrace at that position so we know where & which libc function is being called from spring code.
pin_
Posts: 49
Joined: 22 Jul 2006, 16:12

Post by pin_ »

Call Stack:

> msvcr80d.dll!_chvalidator(int c=274, int mask=263) Line 56 + 0x2a bytes C++
msvcr80d.dll!isalnum(int c=274) Line 237 + 0xe bytes C++
debug.exe!CglList::KeyPress(int k=274) Line 155 + 0xc bytes C++
debug.exe!CPreGame::KeyPressed(unsigned short k=274, bool isRepeat=false) Line 121 C++
debug.exe!SpringApp::Run(int argc=1, char * * argv=0x01f65f08) Line 717 + 0x1e bytes C++
debug.exe!Run(int argc=1, char * * argv=0x01f65f08) Line 903 + 0x10 bytes C++
debug.exe!WinMain(HINSTANCE__ * hInstanceIn=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f2c, int nCmdShow=1) Line 954 + 0x16 bytes C++
debug.exe!__tmainCRTStartup() Line 578 + 0x35 bytes C
debug.exe!WinMainCRTStartup() Line 403 C
kernel32.dll!7c816fd7()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]

what tags do I use do display source code?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

fixed; update & try again
pin_
Posts: 49
Joined: 22 Jul 2006, 16:12

Post by pin_ »

Tobi wrote:fixed; update & try again
u mean download the source/springvs8libs again?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Umm, I assumed you checked out SVN, ie. it's fixed in SVN. So if you used the source package you can either wait for the 0.73 source package or check out SVN after all...

or temporarily fix it yourself:

Code: Select all

Index: rts/Rendering/GL/glList.cpp
===================================================================
--- rts/Rendering/GL/glList.cpp (revision 2265)
+++ rts/Rendering/GL/glList.cpp (revision 2266)
@@ -152,7 +152,7 @@
        if (k == SDLK_BACKSPACE) {
                query = query.substr(0, query.length() - 1);
                Filter(true);
-       } else if ((k & 0xFF) != k) {
+       } else if ((k & ~0xFF) != 0) {
                // This prevents isalnum from asserting on msvc debug crt
                // We don't actually need to process the key tho;)
        } else if (isalnum(k)) {
pin_
Posts: 49
Joined: 22 Jul 2006, 16:12

Post by pin_ »

Updated by hand, thx.
Post Reply

Return to “Engine”