39 pos += (
sizeof(
" ")-1);
51 switch (param->
type) {
63 return "function opline";
65 return "method opline";
67 return "file or file opline";
78 switch (param->
type) {
98 switch (param->
type) {
132 *pointer = strdup(
"unknown");
200 switch (param->
type) {
268 return (l->
len == r->
len) &&
272 return (l->
num == r->
num);
279 size_t lengths[2] = {
282 if (lengths[0] == lengths[1]) {
298 size_t lengths[2] = {
300 if (lengths[0] == lengths[1]) {
305 if (lengths[0] == lengths[1]) {
327 if (param && param->
type) {
328 switch (param->
type) {
389 switch (remove->
type) {
475 const char *
arg = command->
args;
487 phpdbg_error(
"The command \"%s\" expected no arguments",
488 phpdbg_command_name(command,
buffer));
505#define verify_arg(e, a, t) if (!(a)) { \
507 phpdbg_error("The command \"%s\" expected %s and got nothing at parameter "ZEND_ULONG_FMT, \
508 phpdbg_command_name(command, buffer), \
513} else if ((a)->type != (t)) { \
514 phpdbg_error("The command \"%s\" expected %s and got %s at parameter "ZEND_ULONG_FMT, \
515 phpdbg_command_name(command, buffer), \
517 phpdbg_get_param_type((a)), \
561 if ((received < least)) {
563 phpdbg_command_name(command,
buffer),
581 while (command && command->
name && command->
handler) {
584 if (command->
alias && (
name->len == 1)) {
586 matched[matches] = command;
595 matched[matches] = command;
616 phpdbg_error(
"The command \"%s %s\" could not be found", parent->name,
name->str);
623 (*top) = (*top)->next;
625 command = matched[0];
633 while (it < matches) {
635 list =
emalloc(matched[it]->name_len + 1 + (it + 1 < matches ?
sizeof(
", ") - 1 : 0));
637 list =
erealloc(list, (
pos + matched[it]->name_len) + 1 + (it + 1 < matches ?
sizeof(
", ") - 1 : 0));
639 memcpy(&list[
pos], matched[it]->
name, matched[it]->name_len);
641 if ((it + 1) < matches) {
642 memcpy(&list[
pos],
", ",
sizeof(
", ") - 1);
643 pos += (
sizeof(
", ") - 1);
667static int phpdbg_internal_stack_execute(
phpdbg_param_t *stack,
bool allow_async_unsafe) {
678 if (!allow_async_unsafe) {
679 phpdbg_error(
"run command is disallowed during hard interrupt");
686 if (!allow_async_unsafe) {
687 phpdbg_error(
"sh command is disallowed during hard interrupt");
736 if ((
result = phpdbg_internal_stack_execute(
top, allow_async_unsafe)) !=
SUCCESS) {
740 }
while ((
top =
top->next));
750 if (buffered ==
NULL) {
751#ifdef HAVE_PHPDBG_READLINE
788 while (isspace(*trimmed))
823 if ((
buf[1] ==
'\n' || (
buf[1] ==
'\r' &&
buf[2] ==
'\n')) && (
buf[0] ==
'y' ||
buf[0] ==
'n')) {
829 phpdbg_out(
"Please enter either y (yes) or n (no): ");
fprintf($stream, string $format, mixed ... $values)
zend_ffi_ctype_name_buf buf
hash(string $algo, string $data, bool $binary=false, array $options=[])
unsigned const char * pos
struct @234323133100145062121301312242002332057146367313 io[PHPDBG_IO_FDS]
#define PHPDBG_IS_RUNNING
#define PHPDBG_IS_QUITTING
#define PHPDBG_IS_STOPPING
PHPDBG_API const char * phpdbg_get_param_type(const phpdbg_param_t *param)
PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, bool allow_async_unsafe)
#define verify_arg(e, a, t)
PHPDBG_API void phpdbg_copy_param(const phpdbg_param_t *src, phpdbg_param_t *dest)
PHPDBG_API void phpdbg_param_debug(const phpdbg_param_t *param, const char *msg)
PHPDBG_API bool phpdbg_match_param(const phpdbg_param_t *l, const phpdbg_param_t *r)
PHPDBG_API zend_ulong phpdbg_hash_param(const phpdbg_param_t *param)
PHPDBG_API char * phpdbg_read_input(const char *buffered)
PHPDBG_API void phpdbg_destroy_input(char **input)
PHPDBG_API void phpdbg_stack_separate(phpdbg_param_t *param)
PHPDBG_API char * phpdbg_param_tostring(const phpdbg_param_t *param, char **pointer)
PHPDBG_API void phpdbg_stack_push(phpdbg_param_t *stack, phpdbg_param_t *param)
PHPDBG_API const phpdbg_command_t * phpdbg_stack_resolve(const phpdbg_command_t *commands, const phpdbg_command_t *parent, phpdbg_param_t **top)
PHPDBG_API int phpdbg_ask_user_permission(const char *question)
PHPDBG_API void phpdbg_clear_param(phpdbg_param_t *param)
PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack)
PHPDBG_API void phpdbg_stack_free(phpdbg_param_t *stack)
struct _phpdbg_param phpdbg_param_t
struct _phpdbg_command_t phpdbg_command_t
#define PHPDBG_ASYNC_SAFE
#define PHPDBG_COMMAND_HANDLER(name)
PHPDBG_API int phpdbg_consume_stdin_line(char *buf)
PHPDBG_API void phpdbg_free_err_buf(void)
PHPDBG_API void phpdbg_activate_err_buf(bool active)
#define phpdbg_error(strfmt,...)
#define phpdbg_out(fmt,...)
#define phpdbg_write(strfmt,...)
const phpdbg_command_t phpdbg_prompt_commands[]
PHPDBG_API const char * phpdbg_get_prompt(void)
readline(?string $prompt=null)
const phpdbg_command_t * subs
phpdbg_command_handler_t handler
const phpdbg_command_t * parent
struct _phpdbg_param::@330020305320302230147242007301032363271275050165 file
struct _phpdbg_param::@004226021353141374347100337026301377067143131166 method
#define ZEND_EXTERN_MODULE_GLOBALS(module_name)
#define estrndup(s, length)
#define erealloc(ptr, size)
#define strncasecmp(s1, s2, n)
#define ZEND_IGNORE_VALUE(x)
ZEND_DLIMPORT int isatty(int fd)
ZEND_API zend_ulong ZEND_FASTCALL zend_hash_func(const char *str, size_t len)
fbc internal_function handler(call, ret)