点击网页跟踪php代码的工具,Ytrace是一个PHP代码调试跟踪工具

àì夳堔傛蜴生んèń 2023-01-13 12:59 190阅读 0赞

This is a web ui for ytrace, see also ytrace_chrome_extension.

Why

I need to take over some project. To understand the code logic, I have to debug the code(many code is dirty but run:-)). I can use var_dump/die(this is inefficient) or the powerful debug tool XDebug(but traces and remote debugging still not so convenient).

So, I create this tool, make traces combined with step-through debugging. Hope it useful for you.

feature

step through debugging

break point

jump to any executed source code line

step back through your step history

49209ee1fd2ec381d2606e6d834bdeac.png

47a160030eb85e3841c48731c990988d.png

4301005572e22a9fab22bde693091027.png

Install

git clone this project

composer install

in project root dir, run php -S localhost:8088

By default, ytrace_gui will detect ytrace.output_dir from ini_get. If need, you can edit index.php, change //define(‘YTRACE_OUTPUT_DIR’, ‘/tmp/ytrace/‘);

Wiki

Home Page: List all traced files, click on one of the items in the list to open source page.

Clear Traces: delete all traced files.

Refresh: update list.

List field explanation:

Sapi: cli, fpm-fcgi etc

Method: http method in fpm-fcgi

Uri: http request uri in fpm-fcgi

File: file name

Size: file size

Time: created time

Source Page: show detail of traced files.

source code show in left side, traced value show in right side.

only assignment and function call will be traced

++, —, +=, /=, -=, *=, %= etc, shows the values before these operators execute

PHP 7 cannot show internal function parameters name (parameter name cannot be found will be showed as $…)

executed line will be highlight in green, dark green means current execute

click highlighted line number, can jump current execute to it

ctrl+click line number, can set/clear a breakpoint (breakpoint will be highlight in red line number)

execute operation:

step into: same with gdb

step back: execute back through your step history

step over: same with gdb

step out: same with gdb

continue: same with gdb, execute to next breakpoint

reset: reset execute to first entry

shortcut:

ctrl+o: open 10 latest traced file popup list

ctrl+p: open traced source file popup list, only available in source page

ctrl+r: open current source file function/method popup list, only available in source page

ctrl+b: open breakpoints popup list, only available in source page

发表评论

表情:
评论列表 (有 0 条评论,190人围观)

还没有评论,来说两句吧...

相关阅读

    相关 Jstack堆栈跟踪工具

    > jstack是java虚拟机自带的一种堆栈跟踪工具。 功能 jstack用于生成java虚拟机当前时刻的线程快照。线程快照是当前java虚拟机内每一条线程正在执行的

    相关 PHP代码调试

    PHP语言没有多线程、同步等概念,大多由函数和类组成,数据类型和语法比较简单,利用其丰富的内置函数就可以实现大部分的调试功能。因此,PHP代码比较容易理解,也很容易调试。 p