[xdebug-dev] xdebug xdebug/xdebug.c - Added Mikko's patch to allow a specific message to be passed with

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Thu, 26 Mar 2009 13:40:14 +0100

Date: Thu Mar 26 13:40:14 CET 2009
User: Derick Rethans
Directory: xdebug

Log Message:
[0.25]
- Added Mikko's patch to allow a specific message to be passed with
  xdebug_print_function_stack().

Modified files:
           xdebug/xdebug.c (version: 1.443)

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.442
retrieving revision 1.443
diff -u -r1.442 -r1.443
--- xdebug/xdebug.c:1.442 Thu Mar 05 13:38:52 2009 GMT
+++ xdebug/xdebug.c Thu Mar 26 11:40:14 2009 GMT
@@ -2623,15 +2623,25 @@
         add_next_index_string(return_value, name, 1);
 }
 
-/* {{{ proto array xdebug_print_declared_vars()
+/* {{{ proto array xdebug_print_function_stack([string message])
    Displays a stack trace */
 PHP_FUNCTION(xdebug_print_function_stack)
 {
+ char *message = NULL;
+ int message_len;
         function_stack_entry *i;
         char *tmp;
-
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &message, &message_len) == FAILURE) {
+ return;
+ }
+
         i = xdebug_get_stack_frame(0 TSRMLS_CC);
- tmp = get_printable_stack(PG(html_errors), "Xdebug", "user triggered", i->filename, i->lineno TSRMLS_CC);
+ if (message) {
+ tmp = get_printable_stack(PG(html_errors), "Xdebug", message, i->filename, i->lineno TSRMLS_CC);
+ } else {
+ tmp = get_printable_stack(PG(html_errors), "Xdebug", "user triggered", i->filename, i->lineno TSRMLS_CC);
+ }
         php_printf("%s", tmp);
         xdfree(tmp);
 }
Received on Thu Mar 26 2009 - 13:49:30 GMT

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