[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to track down a function

Andreas Secret

1/28/2008 10:19:00 AM

I have a very large program with a lot of dependencies (objects,
functions that are linked togheter) and there is one particular function
that I want to strace troughout the program. (i.e find out every call it
makes(including its dependencies)), anyone have a good tips here?

It's too large to track by eye unfortunately
--
Posted via http://www.ruby-....

1 Answer

Robert Klemme

1/28/2008 12:14:00 PM

0

2008/1/28, Andreas Secret <rapide@online.no>:
> I have a very large program with a lot of dependencies (objects,
> functions that are linked togheter) and there is one particular function
> that I want to strace troughout the program. (i.e find out every call it
> makes(including its dependencies)), anyone have a good tips here?

You can use set_trace_func to trace execution and build up a data
structure that reflects the call graph. However, you need to be aware
that this will only yield actual method calls and not provide
information about all places where this method can be invoked. This
is next to impossible in a dynamic language like Ruby.

Kind regards

robert

--
use.inject do |as, often| as.you_can - without end