in reply to Re: Auto-generating annoted call trees
in thread Auto-generating annoted call trees
It is hard to do a purely static analysis of a perl program to determine the functions and call trees. eval can dynamically create functions, there is polymorphism, and what about closures?
Intuitively, that sort of static analysis seems to me to be equivalent to the halting problem in the general case -- you'd have to determine the depth of recursive call chains, handle mutually recursive functions, and so on. Not that a general solution is necessarily required... but don't spend months on a problem that's known to be impossible to solve. :-)
As for capturing the call stack at runtime, that's probably next to impossible to do completely as well -- you'd have to test every configuration of the program -- but again, it's something for which a partial solution would be great. To ensure that you're not leaving anything out, you might want to mess around with Devel::Cover or something of the sort.
Be sure to post what you end up with! If nothing else, it sounds like a good debugging tool.
--
F
o
x
t
r
o
t
U
n
i
f
o
r
m
Found a typo in this node? /msg me
% man 3 strfry
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Auto-generating annoted call trees
by Ytrew (Pilgrim) on Sep 14, 2004 at 15:46 UTC |