Re: [Ctool-users] retrieving the name of the current function from a Statement
Brought to you by:
flisakow
From: Shaun F. <fli...@so...> - 2006-06-18 16:54:29
|
If you're calling a callback for each function, you can set the name inside it (to a global), then you'll have it for each statement you do from within it. Take a look at the atFuncDef() method in the call-graph example: exampes/cgraph/cgraph.cpp Shawn On Jun 18, 2006, at 6:13 AM, cto...@kh... wrote: > Dear all, > > First, thanks for all the good work on ctool, i'm hoping to start > building some useful > tools around it.. > > I'm currently working on a simple control-flow aware function call > graph. > I can easily get a list of all control flow statements by calling > findStemnt() with a callback. > > In the callback, I'd like to know what function the statement is > part of. > Unfortunately I haven't been able to find that.. > > Although I can find the name of the executing function in the > TransUnit's syms SymTbl I don't see how to differentiate it from > any of the other > functions visible at the same level in the table. > > in the first level of the SymTbl i do see the __FUNCTION__ and > __PRETTY_FUNCTION__ > symbols which seem like good candidates but neither is defined. > > Any help is appreciated! > > thanks, > nessim > ps. i'm using cpp-3.3.5 and cpp-4.0 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > The Borg assimilated my cat...He doesn't act any differently. > unknown > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > _______________________________________________ > Ctool-users mailing list > Cto...@li... > https://lists.sourceforge.net/lists/listinfo/ctool-users > |