tracking the code execution

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
uki
Forum Newbie
Posts: 6
Joined: Thu Sep 07, 2006 12:50 pm

tracking the code execution

Post by uki »

Hi
I'm currently working on big crm (PHP) application. My boos want me to improve functionality. After 2 days of nothing I'm desperated :(. I'm wondering if ther is a tool(or application) that let me to track which method after which is executing from start to result on screen.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Any basic debugger should be able to provide that, if I understand your question correctly.

Many of us use Xdebug around here.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

If you have an idea you can track method calls with Mocks but if you already have the complex system built this will be dfificult to tailor in now.

Xdebug is very nice. If you have the ability to install extensions this is well worthwhile. It's useful for other things such as looking for areas which consume memory too.
uki
Forum Newbie
Posts: 6
Joined: Thu Sep 07, 2006 12:50 pm

Post by uki »

What I intend to get is something like this:

I want to know exactly what methods and after what (or from which interior) are executed.
Let's assume I have $App->Run()
And method Run execute $someObject->initialize() , and inside initialize() is other called $this->setVars(),
at the end inside $App->Run() $this->Display() is executed and we se the generated site in webbrowser.
So I want to be able to trace the path of execution in some nice way for example a raport formated for example:

$App->Run()
$someObject->initialize()
$this->setVars()
$this->Display()

Is this debbuger (mentioned in previous posts) able to do sth like this????
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Yes, Xdebug produces the information you wish.

"sth"? something - For your information: We don't care for aolSpeak here. This isn't a texting service.
uki
Forum Newbie
Posts: 6
Joined: Thu Sep 07, 2006 12:50 pm

Post by uki »

Well I have installed Xdebug installation was successful i've got all additional info running phpinfo();.
I have also insert this to my php.ini
[debbugger]
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=46019
xdebug.remote_handler=gdb
xdebug.profiler_enable=true
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir=/var/www/profilersDir
xdebug.remote_autostart=true
xdebug.auto_trace=true
xdebug.trace_output_dir = /tmp/tmp2

When I made error in script I get info from stacktrace and table with info so I know that Xdebug is working properly.
What is bothering me is that I dont know how to turn on profiler to dispalay info about functions.

How to get this done?? And where I'm suppose to use xdebug_start_profiling() (I've tried inside script but it said that undefined function)

Is there any application that support this??
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You've got the profiler enabled, it's writing files to the profiler_output_dir location on every page request.
uki
Forum Newbie
Posts: 6
Joined: Thu Sep 07, 2006 12:50 pm

Post by uki »

Well you are right I forgot set up the rights for writing that why i didint se the result in directory. But what to do if I want to print result on screen immediately.

Or How to get this data displayed in a good format (in table??)

I found that KcacheGrid will retrive it well but is there other tool because I'm not going to install KDE just for one tool.
Last edited by uki on Fri Sep 08, 2006 6:12 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It doesn't work that way.

You'll need a tool to process the profiler information such as KCacheGrind or WinCacheGrind.
Post Reply