[xdebug-general] Re: xdebug.trace_format - suggestion for new options

From: Mathieu Kooiman <mathieuk[@]gmail.com>
Date: Mon, 27 Aug 2007 07:57:47 +0200

Hi Bill,

I've implemented your second suggestion. It's not very pretty, but it
works ;-). See the attached xt-web.php file. Access like:

xt-web.php?file=trace.1234.xt&format=file,function

It would probably be wise to be make sure xt-web.php is only
accessible to you. Also, realize that the "file" argument cannot have
any paths at this time. Your trace file will have to be in the same
directory as xt-web.php

Mathieu

On 8/27/07, Bill Brachhold <billbrach[@]hotmail.com> wrote:
>
> Mathieu,
>
> What a good idea !! But, it is difficult for me to run from the command
> line as I'm running on a remote linux server and developing on a Windows
> box.
>
> An idea....
>
> How much trouble would it be to add a "xt.ini" file ?? You could define a
> default xdebug trace file name, and also a default output format. That way,
> your program could be run directly from a browser.
>
> The xt.ini file would contain two lines:
>
> filename=any_xdebug_trace_filename.xt
> format=time,memory,function,file
>
>
> Either the above, or allow a browser command line something like:
>
> xt.php?filename=anything.xt?format=time,memory,file,function
>
> Obviously, in your xt.php program, you'd pick up 'filename' and 'format'
> from the $_GET array.
>
> Bill
>
>
> > Date: Sun, 26 Aug 2007 21:08:11 +0200
> > From: mathieuk[@]gmail.com
> > To: billbrach[@]hotmail.com
> > Subject: Re: [xdebug-general] xdebug.trace_format - suggestion for new
> options
>
> >
> > Hi Bill,
> >
> > Xdebug provides a tab-seperated output mode for trace files. To
> > activate this mode set the PHP.ini setting xdebug.trace_format to the
> > value 1. See also:
> http://xdebug.org/docs/all_settings#trace_format
> >
> > I've attached a little PHP parser that will let you show any
> > (actually, 4: time,file,function and memory) of the columns in any
> > order you want them. 2 examples:
> >
> > $ php xt.php output/trace.2043925204.xt file,function
> >
> > /Users/mathieukooiman/Sites/xdebug/test.php:0 ->{main}
> > /Users/mathieukooiman/Sites/xdebug/test.php:3 ->require
> > /Users/mathieukooiman/Sites/xdebug/test.php:7 ->str_split
> > --SNIP--
> >
> > $ php xt.php output/trace.2043925204.xt file,function,memory,time
> > /Users/mathieukooiman/Sites/xdebug/test.php:0 ->{main}
> > 262144 0.000397
> > /Users/mathieukooiman/Sites/xdebug/test.php:3 ->require
> > 262144 0.000752
> > /Users/mathieukooiman/Sites/xdebug/test.php:7 ->str_split
> > 262144 0.000814
> > --SNIP--
> >
> > Hope this helps,
> >
> > Mathieu
> >
> > On 8/26/07, Bill Brachhold <billbrach[@]hotmail.com> wrote:
> > >
> > > Derick,
> > >
> > > When debugging php code, it would be nice to remove the TIME and MEMORY
> > > portion of the output line. Without this info, there is less for the
> > > developer to look through.
> > >
> > > Also, a slight re-arrangement of the data output would make it MUCH
> easier
> > > to read the trace file, particularly when the program being traced goes
> off
> > > to a different file. The advantage of my display format is that it is
> far
> > > easier to see when the code being debugged changes files. See my example
> > > below.
> > >
> > > If I knew anything about C, I'd change it myself but I'm sure I'd make
> more
> > > trouble for myself than solving this !! I could probably figure out the
> > > changes if I knew which of your source files and the approximate area to
> > > look in, to make this change.
> > >
> > > Thanks for a GREAT utility !
> > >
> > > Bill
> > >
> > > (output as it is now )
> > >
> > > TRACE START [2007-08-25 22:00:06]
> > > 0.6469 1950016 -> is_subaction('customers', '')
> > > /var/www/servman/pb_events.php:263
> > > 0.6471 1949992 -> echoloc('0', '5')
> > > /var/www/servman/pb_events.php:270
> > > 0.6472 1949992 -> is_subaction('suppliers', '')
> > > /var/www/servman/pb_events.php:272
> > > 0.6473 1949968 -> echoloc('0', '6')
> > > /var/www/servman/pb_events.php:279
> > > 0.6474 1949968 -> is_subaction('parts', 'add2inv')
> > > /var/www/servman/pb_events.php:281
> > > 0.6474 1949928 -> is_subaction('parts', 'showparts')
> > > /var/www/servman/pb_events.php:288
> > > 0.6475 1949888 -> is_subaction('parts', '')
> > > /var/www/servman/pb_events.php:296
> > > 0.6476 1949872 -> echoloc('0', '7')
> > > /var/www/servman/pb_events.php:303
> > > 0.6477 1949872 -> echoloc('0', '8')
> > > /var/www/servman/pb_events.php:312
> > > 0.6478 1949872 -> is_subaction('invoices', 'print')
> > > /var/www/servman/pb_events.php:314
> > > 0.6479 1949832 -> is_subaction('invoices', 'showinvs')
> > > /var/www/servman/pb_events.php:321
> > > 0.6480 1949784 -> echoloc('0', '9')
> > > /var/www/servman/pb_events.php:329
> > > 0.6481 1949784 -> is_subaction('invoices', 'store')
> > > /var/www/servman/pb_events.php:334
> > > 0.6481 1949744 -> echoloc('0', '10')
> > > /var/www/servman/pb_events.php:343
> > > 0.6482 1949736 -> is_subaction('invoices', '')
> > > /var/www/servman/pb_events.php:345
> > > 0.6483 1949712 -> echoloc('0', '11')
> > > /var/www/servman/pb_events.php:352
> > > 0.6489 1949704 -> is_subaction('helpers', '')
> > > /var/www/servman/pb_events.php:354
> > > 0.6490 1949680 -> echoloc('0', '12')
> > > /var/www/servman/pb_events.php:361
> > > 0.6491 1949672 -> is_subaction('eqtypes', '')
> > > /var/www/servman/pb_events.php:363
> > > 0.6492 1949648 -> is_subaction('payterms', '')
> > > /var/www/servman/pb_events.php:370
> > > 0.6493 1949624 -> is_subaction('paymethods', '')
> > > /var/www/servman/pb_events.php:377
> > > 0.6493 1949592 -> is_subaction('invoicestatus', '')
> > > /var/www/servman/pb_events.php:384
> > > 0.6494 1949552 -> echoloc('0', '13')
> > > /var/www/servman/pb_events.php:391
> > > 0.6495 1949544 -> is_subaction('partstatus', '')
> > > /var/www/servman/pb_events.php:393
> > > 0.6496 1949512 -> echoloc('0', '14')
> > > /var/www/servman/pb_events.php:408
> > > 0.6497 1949504 -> is_subaction('compinfo', '')
> > > /var/www/servman/pb_events.php:410
> > > 0.6498 1949480 -> echoloc('0', '15')
> > > /var/www/servman/pb_events.php:417
> > > 0.6499 1949472 -> xdebug_stop_trace()
> > > /var/www/servman/pb_events.php:418
> > > 0.6499 1949472
> > > TRACE END [2007-08-25 22:00:06]
> > >
> > > (output format that would be easier to read, if just looking to
> debug/follow
> > > code)
> > >
> > > TRACE START [2007-08-25 22:00:06]
> > > /var/www/servman/pb_events.php:263 ->
> > > is_subaction('customers', '')
> > > /var/www/servman/pb_events.php:270 -> echoloc('0', '5')
> > > /var/www/servman/pb_events.php:272 ->
> > > is_subaction('suppliers', '')
> > > /var/www/servman/pb_events.php:279 -> echoloc('0', '6')
> > > /var/www/servman/pb_events.php:281 ->
> is_subaction('parts',
> > > 'add2inv')
> > > /var/www/servman/pb_events.php:288 ->
> is_subaction('parts',
> > > 'showparts')
> > > /var/www/servman/pb_events.php:296 ->
> is_subaction('parts',
> > > '')
> > > /var/www/servman/lib/forms.php:303 -> echoloc('0', '7')
> > > /var/www/servman/lib/forms.php:312 -> echoloc('0', '8')
> > > /var/www/servman/lib/forms.php:314 ->
> > > is_subaction('invoices', 'print')
> > > /var/www/servman/lib/forms.php:321 ->
> > > is_subaction('invoices', 'showinvs')
> > > /var/www/servman/lib/forms.php:329 -> echoloc('0', '9')
> > > /var/www/servman/lib/forms.php:334 ->
> > > is_subaction('invoices', 'store')
> > > /var/www/servman/lib/template.php:343 -> echoloc('0',
> '10')
> > > /var/www/servman/lib/template.php:345 ->
> > > is_subaction('invoices', '')
> > > /var/www/servman/lib/template.php:352 -> echoloc('0',
> '11')
> > > /var/www/servman/lib/template.php:354 ->
> > > is_subaction('helpers', '')
> > > /var/www/servman/lib/template.php:361 -> echoloc('0',
> '12')
> > > /var/www/servman/lib/template.php:363 ->
> > > is_subaction('eqtypes', '')
> > > /var/www/servman/lib/template.php:370 ->
> > > is_subaction('payterms', '')
> > > /var/www/servman/forms.php:377 -> is_subaction('paymethods', '')
> > > /var/www/servman/forms.php:384 -> is_subaction('invoicestatus', '')
> > > /var/www/servman/forms.php:391 -> echoloc('0', '13')
> > > /var/www/servman/lib/sqladmin.php:393 ->
> > > is_subaction('partstatus', '')
> > > /var/www/servman/lib/sqladmin.php:408 -> echoloc('0',
> '14')
> > > /var/www/servman/lib/sqladmin.php:410 ->
> > > is_subaction('compinfo', '')
> > > /var/www/servman/lib/sqladmin:417 -> echoloc('0', '15')
> > > /var/www/servman/pb_events.php:418 ->
> xdebug_stop_trace()
> > > TRACE END [2007-08-25 22:00:06]
> > >
> > >
> > > ________________________________
> > > See what you're getting into…before you go there See it!
>
> ________________________________
> Recharge--play some free games. Win cool prizes too! Play It!

Received on Mon Aug 27 2007 - 07:58:34 BST

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST