[xdebug-dev] xdebug xdebug/xdebug.c xdebug/tests/bug00003.phpt - Implemented FR #156: it's impossible to know the time taken by the last func

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Fri, 30 Dec 2005 16:54:24 +0100

Date: Fri Dec 30 16:54:24 CET 2005
User: Derick Rethans
Directory: xdebug

Log Message:
[0.25]
- Implemented FR #156: it's impossible to know the time taken by the last func
  call in xdebug trace mode 0.
- Fixed MSVC compile error for xdebug_get_declared_vars().

Modified files:
           xdebug/xdebug.c (version: 1.286)
           xdebug/tests/bug00003.phpt (version: 1.12)

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.285
retrieving revision 1.286
diff -u -r1.285 -r1.286
--- xdebug/xdebug.c:1.285 Fri Dec 30 14:33:31 2005 GMT
+++ xdebug/xdebug.c Fri Dec 30 14:54:24 2005 GMT
@@ -1875,12 +1875,13 @@
 {
         xdebug_llist_element *le;
         int j;
+ function_stack_entry *i;
 
         array_init(return_value);
         le = XDEBUG_LLIST_TAIL(XG(stack));
         le = XDEBUG_LLIST_PREV(le);
-
- function_stack_entry *i = XDEBUG_LLIST_VALP(le);
+ i = XDEBUG_LLIST_VALP(le);
+
         /* Add declared vars */
         if (i->used_vars) {
                 xdebug_hash_apply(i->used_vars, (void *) return_value, attach_used_var_names);
@@ -2211,10 +2212,19 @@
 
 void xdebug_stop_trace(TSRMLS_D)
 {
- char *str_time;
+ char *str_time;
+ double u_time;
 
         XG(do_trace) = 0;
         if (XG(trace_file)) {
+ u_time = xdebug_get_utime();
+ fprintf(XG(trace_file), "%10.4f ", u_time - XG(start_time));
+#if MEMORY_LIMIT
+ fprintf(XG(trace_file), "%10u", AG(allocated_memory));
+#else
+ fprintf(XG(trace_file), "%10u", 0);
+#endif
+ fprintf(XG(trace_file), "\n");
                 str_time = xdebug_get_time();
                 fprintf(XG(trace_file), "TRACE END [%s]\n\n", str_time);
                 fclose(XG(trace_file));

[FILE: /xdebug/tests/bug00003.phpt]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- xdebug/tests/bug00003.phpt:1.11 Fri Dec 30 13:52:37 2005 GMT
+++ xdebug/tests/bug00003.phpt Fri Dec 30 14:54:24 2005 GMT
@@ -23,6 +23,7 @@
 --EXPECTF--
 
 TRACE START [%d-%d-%d %d:%d:%d]
- %f %d -> strftime('%b %l %Y %H:%M:%S', 1061728888) /%s/bug00003.php:3
- %f %d -> xdebug_stop_trace() /%s/bug00003.php:4
+ %f%w%d -> strftime('%b %l %Y %H:%M:%S', 1061728888) /%s/bug00003.php:3
+ %f%w%d -> xdebug_stop_trace() /%s/bug00003.php:4
+ %f%w%d
 TRACE END [%d-%d-%d %d:%d:%d]
Received on Fri Dec 30 2005 - 16:54:28 GMT

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST