Advertisement

Debugger and values passed by reference

Started by May 24, 2012 10:54 AM
3 comments, last by virious 12 years, 6 months ago
Hello, I am using asrun sample project in debug mode.

My script file:

void testRef( int &in ref )
{
int localVar = ref;
}

int main()
{
int valForRef = 5;
testRef( valForRef );
return 0;
}


I'm stepping 3 times, so in debug console I can see:
test.as:3; void testRef(int&in)

The result after typing command "p ref" to print the value:
[dbg]> p ref
6697168


It prints out the pointer instead of the actual value (5 in this test scenario).

This test was performed on the latest revision of the AngelScript, with slight modification with the GetFunctionIdByDecl() call in main.cpp which is no longer available in the AngelScript interface.

Thanks in advance!
Thanks. I'll have this fixed.

Are you using the debugger add-on in GRACE2 engine? Or did you implement your own debugger?

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

Advertisement
I have my own debugger, I just tried to reproduce this behaviour on not modified code, so I used your debugger and asrun sample, just to be sure.
I have fixed this in revision 1316. I modified GetAddressOfVar() to dereference the pointer for reference parameters.

Regards,
Andreas

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

Thank you! :).

This topic is closed to new replies.

Advertisement