phpdbg_writeln("Will print the instructions for the global function my_function");
phpdbg_writeln("\t%sprint opline", PROMPT);
phpdbg_writeln("Will print the instruction for the current opline");
+ phpdbg_writeln("\t%sprint exec", PROMPT);
+ phpdbg_writeln("Will print the instruction for the execution context");
phpdbg_writeln(EMPTY);
phpdbg_writeln("Specific printers loaded are show below:");
phpdbg_notice("Commands");
phpdbg_writeln(
"\t#%d-%d %s() %s",
op_array->line_start, op_array->line_end,
- method->common.function_name,
+ method->common.function_name ? method->common.function_name : "{main}",
op_array->filename ? op_array->filename : "unknown");
}
}
}
+PHPDBG_PRINT(exec) /* {{{ */
+{
+ if (PHPDBG_G(exec)) {
+ if (!PHPDBG_G(ops)) {
+ phpdbg_compile(TSRMLS_C);
+ }
+
+ if (PHPDBG_G(ops)) {
+ phpdbg_notice(
+ "Context %s", PHPDBG_G(exec));
+
+ phpdbg_print_function_helper((zend_function*) PHPDBG_G(ops) TSRMLS_CC);
+ }
+ } else {
+ phpdbg_error("No execution context set");
+ }
+
+ return SUCCESS;
+} /* }}} */
+
PHPDBG_PRINT(class) /* {{{ */
{
zend_class_entry **ce;
/**
* Printer Forward Declarations
*/
+PHPDBG_PRINT(exec);
PHPDBG_PRINT(opline);
PHPDBG_PRINT(class);
PHPDBG_PRINT(method);
* Commands
*/
static const phpdbg_command_t phpdbg_print_commands[] = {
+ PHPDBG_PRINT_D(exec, "print execution context instructions", 'e'),
PHPDBG_PRINT_D(opline, "print the current opline information", 'o'),
PHPDBG_PRINT_D(class, "print out the instructions in the specified class", 'c'),
PHPDBG_PRINT_D(method, "print out the instructions in the specified method", 'm'),
return SUCCESS;
} /* }}} */
-static inline int phpdbg_compile(TSRMLS_D) /* {{{ */
+int phpdbg_compile(TSRMLS_D) /* {{{ */
{
zend_file_handle fh;
void phpdbg_welcome(zend_bool cleaning TSRMLS_DC);
int phpdbg_interactive(TSRMLS_D);
void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags TSRMLS_DC);
+int phpdbg_compile(TSRMLS_D);
void phpdbg_clean(zend_bool full TSRMLS_DC);
#if PHP_VERSION_ID >= 50500