php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
phpdbg_print.c File Reference
#include "phpdbg.h"
#include "phpdbg_print.h"
#include "phpdbg_utils.h"
#include "phpdbg_prompt.h"
#include "Optimizer/zend_dump.h"

Go to the source code of this file.

Macros

#define PHPDBG_PRINT_COMMAND_D(f, h, a, m, l, s, flags)
 

Functions

 if (phpdbg_safe_class_lookup(param->str, param->len, &ce)==SUCCESS)
 
 if (phpdbg_safe_class_lookup(param->method.class, strlen(param->method.class), &ce)==SUCCESS)
 
 if (func_name[0]=='.')
 
else if (!EG(function_table))
 
 zend_str_tolower_copy (ZSTR_VAL(lcname), func_name, ZSTR_LEN(lcname))
 
 efree (lcname)
 
void phpdbg_print_opcodes_main (void)
 
void phpdbg_print_opcodes_function (const char *function, size_t len)
 
void phpdbg_print_opcodes_method (const char *class, const char *function)
 
void phpdbg_print_opcodes_class (const char *class)
 
void phpdbg_print_opcodes (const char *function)
 
void phpdbg_print_opline (zend_execute_data *execute_data, bool ignore_flags)
 

Variables

const phpdbg_command_t phpdbg_print_commands []
 
 else
 
return SUCCESS
 
zend_functionfbc
 
const char * func_name = param->str
 
size_t func_name_len = param->len
 
zend_stringlcname = zend_string_alloc(func_name_len, 0)
 
 phpdbg_try_access
 

Macro Definition Documentation

◆ PHPDBG_PRINT_COMMAND_D

#define PHPDBG_PRINT_COMMAND_D ( f,
h,
a,
m,
l,
s,
flags )
Value:
char s[4]
Definition cdf.c:77
#define PHPDBG_COMMAND_D_EXP(name, tip, alias, handler, children, args, parent, flags)
Definition phpdbg_cmd.h:158
const phpdbg_command_t phpdbg_prompt_commands[]
$obj a
Definition test.php:84

Definition at line 28 of file phpdbg_print.c.

Function Documentation

◆ efree()

efree ( lcname )

◆ if() [1/4]

else if ( ! EGfunction_table)

Definition at line 200 of file phpdbg_print.c.

◆ if() [2/4]

if ( func_name [0] = = '.')

Definition at line 188 of file phpdbg_print.c.

◆ if() [3/4]

if ( phpdbg_safe_class_lookup(param->method.class, strlen(param->method.class), &ce) = SUCCESS)

Definition at line 156 of file phpdbg_print.c.

◆ if() [4/4]

if ( phpdbg_safe_class_lookup(param->str, param->len, &ce) = SUCCESS)

Definition at line 126 of file phpdbg_print.c.

◆ phpdbg_print_opcodes()

void phpdbg_print_opcodes ( const char * function)

Definition at line 321 of file phpdbg_print.c.

◆ phpdbg_print_opcodes_class()

void phpdbg_print_opcodes_class ( const char * class)

Definition at line 310 of file phpdbg_print.c.

◆ phpdbg_print_opcodes_function()

void phpdbg_print_opcodes_function ( const char * function,
size_t len )

Definition at line 235 of file phpdbg_print.c.

◆ phpdbg_print_opcodes_main()

void phpdbg_print_opcodes_main ( void )

Definition at line 231 of file phpdbg_print.c.

◆ phpdbg_print_opcodes_method()

void phpdbg_print_opcodes_method ( const char * class,
const char * function )

Definition at line 262 of file phpdbg_print.c.

◆ phpdbg_print_opline()

void phpdbg_print_opline ( zend_execute_data * execute_data,
bool ignore_flags )

Definition at line 363 of file phpdbg_print.c.

◆ zend_str_tolower_copy()

zend_str_tolower_copy ( ZSTR_VAL(lcname) ,
func_name ,
ZSTR_LEN(lcname)  )

Variable Documentation

◆ else

else
Initial value:
{
phpdbg_error("The class %s could not be found", param->str)
#define phpdbg_error(strfmt,...)
Definition phpdbg_out.h:43

Definition at line 145 of file phpdbg_print.c.

◆ fbc

Initial value:
{
HashTable *func_table = EG(function_table)
#define EG(v)
struct _zend_array HashTable
Definition zend_types.h:386

Definition at line 183 of file phpdbg_print.c.

◆ func_name

const char* func_name = param->str

Definition at line 184 of file phpdbg_print.c.

◆ func_name_len

size_t func_name_len = param->len

Definition at line 185 of file phpdbg_print.c.

◆ lcname

lcname = zend_string_alloc(func_name_len, 0)

Definition at line 186 of file phpdbg_print.c.

◆ phpdbg_print_commands

const phpdbg_command_t phpdbg_print_commands[]
Initial value:
= {
PHPDBG_PRINT_COMMAND_D(exec, "print out the instructions in the main execution context", 'e', print_exec, NULL, 0, PHPDBG_ASYNC_SAFE),
PHPDBG_PRINT_COMMAND_D(opline, "print out the instruction in the current opline", 'o', print_opline, NULL, 0, PHPDBG_ASYNC_SAFE),
PHPDBG_PRINT_COMMAND_D(class, "print out the instructions in the specified class", 'c', print_class, NULL, "s", PHPDBG_ASYNC_SAFE),
PHPDBG_PRINT_COMMAND_D(method, "print out the instructions in the specified method", 'm', print_method, NULL, "m", PHPDBG_ASYNC_SAFE),
PHPDBG_PRINT_COMMAND_D(func, "print out the instructions in the specified function", 'f', print_func, NULL, "s", PHPDBG_ASYNC_SAFE),
PHPDBG_PRINT_COMMAND_D(stack, "print out the instructions in the current stack", 's', print_stack, NULL, 0, PHPDBG_ASYNC_SAFE),
}
#define NULL
Definition gdcache.h:45
char * exec
Definition phpdbg.h:263
#define PHPDBG_END_COMMAND
Definition phpdbg_cmd.h:171
#define PHPDBG_ASYNC_SAFE
Definition phpdbg_cmd.h:84
#define PHPDBG_PRINT_COMMAND_D(f, h, a, m, l, s, flags)
execute_data func

Definition at line 31 of file phpdbg_print.c.

◆ phpdbg_try_access

phpdbg_try_access
Initial value:
{
if ((fbc = zend_hash_find_ptr(func_table, lcname))) {
phpdbg_notice("%s %s %s (%d ops)",
(fbc->type == ZEND_USER_FUNCTION) ? "User" : "Internal",
(fbc->common.scope) ? "Method" : "Function",
ZSTR_VAL(fbc->common.function_name),
(fbc->type == ZEND_USER_FUNCTION) ? fbc->op_array.last : 0);
phpdbg_print_function_helper(fbc);
} else {
phpdbg_error("The function %s could not be found", func_name);
}
phpdbg_error("Couldn't fetch function %.*s, invalid data source", (int) func_name_len, func_name);
#define phpdbg_catch_access
Definition phpdbg.h:201
#define phpdbg_end_try_access()
Definition phpdbg.h:204
#define phpdbg_notice(strfmt,...)
Definition phpdbg_out.h:44
const char * func_name
zend_string * lcname
size_t func_name_len
#define ZEND_USER_FUNCTION
#define ZSTR_VAL(zstr)
Definition zend_string.h:68
zend_function * fbc

Definition at line 210 of file phpdbg_print.c.

◆ SUCCESS

return SUCCESS

Definition at line 149 of file phpdbg_print.c.