🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
AngelScript 1.10.0 FINAL (2004/11/02)
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.
I've added test cases for all conversions so this should never happen again.
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. :)
Good point. I hadn't tested the fix with release build.
Here's a fix that works:
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.
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.
from the online documentation:
GetReturnValue
oops?
GetReturnValue
int GetStackData(asDWORD *data,int count);
oops?
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.
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.
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?
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.
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.
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.
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
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
Popular Topics
Advertisement