Advertisement

Debugger call-stack

Started by August 26, 2009 10:50 AM
8 comments, last by Carrot 15 years, 3 months ago
Hi, can anyone point me in the direction of an example showing how to build a list of current variables in the call-stack? I need to display (possibly edit) the variables available during the line-callback function as a debugger would. I assume I use GetCallstackFunction, but where to go from there? Thanks, Ciaran.
<a href="http://www.purplenose.com>purplenose.com
I have an example of a simple AngelScript debugger here. I haven't updated it to the most recent version yet and it uses .NET bindings, but it should give you an idea of how you can use AngelScript's debugging API.
Advertisement
/test/test_future/test_debug.cpp
it has a simple example. :) hope it will help u.


Quote: Original post by Carrot
Hi,
can anyone point me in the direction of an example showing how to build a list of current variables in the call-stack?
I need to display (possibly edit) the variables available during the line-callback function as a debugger would.

I assume I use GetCallstackFunction, but where to go from there?
Thanks,
Ciaran.


Though not really recommended as teaching material, you can take a look at the test code that I use: test_debug.

Specifically the function PrintVariables should answer your question.

Regards,
Andreas

PS. I'll try to write the page about debugging in the manual soon. :)

[edit]PPS. dxj beat me to the answer :)[/edit]

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

so nice example.

I have a few questions.

Do you support intellinse system? I tried, not output.

Is that possible we could use your debugger inside our projects? how, I am not so familar with C# projects. :)

Cheers.


Quote: Original post by SiCrane
I have an example of a simple AngelScript debugger here. I haven't updated it to the most recent version yet and it uses .NET bindings, but it should give you an idea of how you can use AngelScript's debugging API.


Thanks everyone for the help. I'll post the snippet of code here when I get it working.
<a href="http://www.purplenose.com>purplenose.com
Advertisement
Quote: Original post by dxj19831029
Do you support intellinse system? I tried, not output.

No, the AngelScript compiler doesn't give enough support to allow using it for code completion and the AngelScript language changes fast enough that maintaining a parallel compiler for code completion is infeasible.

Quote:
Is that possible we could use your debugger inside our projects? how, I am not so familar with C# projects. :)

If you want to use the code, feel free, but I don't provide any support for it. It's best used as a sample to create your own code.
so I have it mostly working to registered types and basic value types, but not fully for script classes.
I now have something like this to iterate through a class property set:

asIObjectType* t = context->GetEngine()->GetObjectTypeById(typeId);if(t->GetFlags() & asOBJ_SCRIPT_OBJECT){	cout << "[Class] " << type << endl;	int numProperties = t->GetPropertyCount();	for(int i=0;i<numProperties; i++)	{		string propName = t->GetPropertyName(i);			}}


I can print the class properties okay, but any ideas on how to get the property values?
I imagine I use GetAddressOfVar or something similar, but for class types.

Thanks again,
Ciaran
<a href="http://www.purplenose.com>purplenose.com
Did you try asIScriptObject::GetPropertyPointer()?
Quote: Original post by SiCrane
Did you try asIScriptObject::GetPropertyPointer()?


Thanks for the hint. I think that function is deprecated now though, and I believe the recommended method is now GetAddressOfProperty.
I'll try that route out.
Cheers.
<a href="http://www.purplenose.com>purplenose.com

This topic is closed to new replies.

Advertisement