Skip to main content
gamedev.net
🔒 Locked

Debugging Ability in my Script Engine ..

Started by silvermace Aug 9, 2002 at 3:07 AM 1 replies 150+ views
Original Post
silvermace
silvermace
i would like to be able to add debugging facilities to the engine code, the catch is, want the actual engine''s code to break according to break points in the script. any ideas how to raise a break point in MSCV from the code, or any idea how else i could do this ?? thanx. / silvermace
SabreMan
SabreMan
quote:
Original post by silvermace
i would like to be able to add debugging facilities to the engine code, the catch is, want the actual engine's code to break according to break points in the script.

How you would achieve that depends on how your script engine works. If you have written your engine like most others, then you will be reading opcodes and despatching them to the engine within a loop? If you provide a breakpoint opcode, you can insert that into your script's icode and have the engine take a rest from despatching opcodes, whilst remembering current state. Providing functions to access the engine's internal state would allow you to build an interactive environment around your engine - very useful for debugging both the engine and scripts.
quote:

any ideas how to raise a break point in MSCV from the code, or any idea how else i could do this ??

You can raise a user breakpoint using interrupt 3:

    
#include <iostream>

int main()
{
std::cout << "Before breakpoint\n";

__asm
{
int 3;
}

std::cout << "After breakpoint\n";
}


But I don't think that is what you are after, since you want a source level debugger, right?

[edited by - SabreMan on August 9, 2002 4:59:14 AM]
silvermace
silvermace
thanx, unfortunatly, my script-engine is quite unorthodox and strange, but you post helped alot, thanx
i have yet to try the "int 3" thing, what exactly does it do??

thanx.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.