Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-30-2007, 12:50 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
Call structure?

Hi,

is there any way to get the call structure without function profiling?
like

PHP Code:
function onCreated()
  {
  
test1();
  }

function 
test1()
  {
  
test2();
  }

function 
test2()
  {
  } 
would be onCreated=>test1=>test2
__________________

Last edited by projectigi; 12-31-2007 at 10:44 AM..
Reply With Quote
  #2  
Old 12-30-2007, 04:19 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
What is the call structure? aka what does it mean? Never heard the term before.
__________________
Reply With Quote
  #3  
Old 12-30-2007, 05:46 PM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
What I think about that is using a global variable...

PHP Code:
function thing()
{
  
stack.add"thing" );
  
test1();
  
stack.deletestack.size() - );
}

function 
test1()
{
  
stack.add"test1" );
  
test2();
  
stack.deletestack.size() - );
}

function 
test2()
{
  
stack.add"test2" );
  echo( 
stack );
  
stack.deletestack.size() - );

I do believe that temp.name returns the name of the function... But I can't verify this right now... But if you'll be using this, I would recommend you try it out.

What you want, however, isn't currently available in Graal, nor do I believe that it will be.
Reply With Quote
  #4  
Old 12-31-2007, 04:47 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by cbkbud View Post
What is the call structure? aka what does it mean? Never heard the term before.
Basically you're finding out what functions are called and the order they're called in.
__________________
Reply With Quote
  #5  
Old 12-31-2007, 05:48 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Inverness View Post
Basically you're finding out what functions are called and the order they're called in.
So, you could get the same result by calling something like

PHP Code:
function storeFunction)
{
  
this.functionsCalled.add);

and then at the end you would have the same result?

EDIT: I realize this isn't what you're asking, I'm just trying to understand this.
__________________
Reply With Quote
  #6  
Old 12-31-2007, 05:54 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by cbkbud View Post
What is the call structure? aka what does it mean? Never heard the term before.
It is probably more accurately named "call stack access"; typically call stacks are used internally in a lot of languages so that a function knows where to send it's return value, however call stack access also means that the programmer can read the order of executed functions (and also sometimes identify where the function was called from).

It's something that Stefan has thought about adding into GScript but hasn't got to yet; it would greatly improve script security if functions could tell where they were being called from.
Reply With Quote
  #7  
Old 01-02-2008, 12:24 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Yes will try to work on that soon.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.