Advertisement

AngelScript 1.10.0 FINAL (2004/11/02)

Started by November 02, 2004 03:42 PM
44 comments, last by jetro 20 years ago
Thanks, I had already fixed those cases, but I forgot to show the fixes here.

I've added test cases for all conversions so this should never happen again.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Um.. hopefully your fixes are better, since I found out that the ones I presented above aren't probably correct after all - at least my usage case doesn't work with Release builds currently. :)
--Jetro Lauha - tonic - http://jet.ro
Advertisement
Good point. I hadn't tested the fix with release build.

Here's a fix that works:

	case BC_dTOi:		{			int i = int(*(double*)(l_sp++));			*l_sp = i;		}		l_bc += BCS_dTOui;		break;	case BC_dTOui:		{			asUINT u = asDWORD(*(double*)(l_sp++));			*l_sp = u;		}		l_bc += BCS_dTOui;		break;	case BC_dTOf:		{			float f = float(*(double*)(l_sp++));			*(float*)l_sp = f;		}		l_bc += BCS_dTOf;		break;	case BC_iTOd:		{			double d = double(int(*l_sp--));			*(double*)l_sp = d;		}		l_bc += BCS_iTOd;		break;	case BC_uiTOd:		{			double d = double(*l_sp--);			*(double*)l_sp = d;		}		l_bc += BCS_uiTOd;		break;	case BC_fTOd:		{			double d = double(*(float*)(l_sp--));			*(double*)l_sp = d;		}		l_bc += BCS_fTOd;		break;


This teaches us that we can't rely on when the ++ and -- operators will be evaluated. If we need them to be exactly as we want them then the expressions must to be broken up.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

from the online documentation:

GetReturnValue
int GetStackData(asDWORD *data,int count);


oops?
Dan Royer, OwnerMarginally Clever Games
Oops!

At first I didn't see what you meant. I thought you were wondering about the parameters, but then I saw the difference in function names. [wink]

I'll have that fixed for the next release.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Is there any way we could get the VC++ style Debug Trace associated with the MS IDE for AngelScript...I think VC++ would support this anyhow with a 3rd party plugin. any Ideas?
Jayanth.KRaptor Entertainment Pvt. Ltd.http://www.raptorentertainment.com---------------------------------------------------------Why Mr. Anderson? Why? ...Why keep fighting? Do you think you're fighting for something - for more than your survival? Can you tell me what it is? Do you even know? Is it freedom, or truth, perhaps peace, could it be for love? Illusions Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence without meaning or purpose.
Advertisement
I'm not sure I understand what you mean. Would you mind explaining?

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Is there any way in which we could emulate a Debug Build in VC with the AS code, like breakpoints and call stack viewing, possibly integrated into VC itself, pushing it closer to C++ code compatibility! Just your thoughts and suggestions on this subject.
Jayanth.KRaptor Entertainment Pvt. Ltd.http://www.raptorentertainment.com---------------------------------------------------------Why Mr. Anderson? Why? ...Why keep fighting? Do you think you're fighting for something - for more than your survival? Can you tell me what it is? Do you even know? Is it freedom, or truth, perhaps peace, could it be for love? Illusions Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence without meaning or purpose.
With a few changes it would be possible to query the call stack. Setting break points would also be possible. But this would be with function calls to the context, i.e. the application would have to do this.

Integration into the MSVC++ debugger would be a completely different matter though. I don't know how to do this, or even if it's possible.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

No function calls to the context are necesary for the debug, but the oposite, function calls from the context to the client application.

That is what i have implemented here, and i asked you if you want this to be integrated in the current AS or in the new AS2, the debug hook

in bc_Line step, there is a:

if(debug_hook)
status = debug_hook(linenumber, state, whatever, ....)
if(status == _Suspend)
jmp bc_Suspsend

so if the client application implements a function with the correct declaration ( scriptEngine->SetDebugHook(debug_hookFunc); ) it will recive callbacks every line of execution with the line number and all the parameters that it will need

in the client application:

uint debug_hookFunc(int linenumber, uint state, whatever, ....) {
........
application specific code

if(breakpointsMap.find(linenumber)) {
execution line is on some breakpoint, do what you need
........
application specific code

return state_Suspsend;

}
........
application specific code

return state_continue;
}

this way the debugger can be created very easy, externally and will not affect the as engine, because in release it will compiled without the bc_line opcode

Lioric

This topic is closed to new replies.

Advertisement