Debugger and values passed by reference

Started by
3 comments, last by virious 11 years, 11 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!
Advertisement
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

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