mihai brehar - xdebug

19
Mihai Brehar http://www.mihaibrehar.ro/blog/

Upload: mihai-brehar

Post on 01-Sep-2014

1.298 views

Category:

Technology


2 download

DESCRIPTION

Prezentare Xdebug la PHP GeekMeet #2 Cluj, 25 aprilie 2009

TRANSCRIPT

Page 1: Mihai Brehar - Xdebug

Mihai Breharhttp://www.mihaibrehar.ro/blog/

Page 2: Mihai Brehar - Xdebug

If you write code, you’re writing bugs —it’s a simple fact of life (Marco Tabini)

Page 3: Mihai Brehar - Xdebug

1)That can’t happen

2)That doesn’t happen on my machine

3)That shouldn’t happen

4)Why does that happen?

5)Oh, I see

6)How did that ever work?

The 6 stages of debugging:

Page 4: Mihai Brehar - Xdebug

Fatal error: Call to undefined method Dog::sfsd() in /home/mihai/public_html/xdebug/class.Dog.php on line 15

Page 5: Mihai Brehar - Xdebug

echo $var;

die(„checkpoint1”);

print_r($array);

$var_dump($array);

error_log(„checkpoint2”);

debug_print_backtrace();

Page 6: Mihai Brehar - Xdebug

Xdebug http://xdebug.org/

APD http://www.php.net/manual/en/book.apd.php

DBG http://www.php-debugger.com/dbg/

Zend Studio http://www.zend.com/en/products/studio/

Page 7: Mihai Brehar - Xdebug

Lansat acum ~6 aniAutor: Derick Rethans

Page 8: Mihai Brehar - Xdebug

Ce oferă Xdebug?●stack traces

●profiling

●code coverage analisys

●interactive debugging

●protectie pentru recursivitate

infinita

Page 9: Mihai Brehar - Xdebug

Fatal error: Call to undefined method Dog::sfsd() in /home/mihai/public_html/xdebug/class.Dog.php on line 15

Page 10: Mihai Brehar - Xdebug

Stack trace

Page 11: Mihai Brehar - Xdebug

xdebug.collect_params=4

Page 12: Mihai Brehar - Xdebug

xdebug.dump.GET = *

Page 13: Mihai Brehar - Xdebug

xdebug.show_local_vars = 1

Page 14: Mihai Brehar - Xdebug

Overload var_dump

Page 15: Mihai Brehar - Xdebug

Profilerxdebug.profiler_enable=1xdebug.profiler_output_dir=/tmp

Page 16: Mihai Brehar - Xdebug

Integrarea cu Eclipse

Q: Does God control everything that

happens in my life?

A: He could, if he used the debugger, but

it's tedious to step through all those

variables.

Page 17: Mihai Brehar - Xdebug
Page 18: Mihai Brehar - Xdebug
Page 19: Mihai Brehar - Xdebug

Mul umesc!ț

întrebări?

--

Mihai Breharhttp://www.mihaibrehar.ro/blog/