本文整理汇总了C++中PHPDBG_G函数的典型用法代码示例。如果您正苦于以下问题:C++ PHPDBG_G函数的具体用法?C++ PHPDBG_G怎么用?C++ PHPDBG_G使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PHPDBG_G函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: SigIoWatcherThread
VOID
SigIoWatcherThread(VOID *p)
{
zend_uchar sig;
struct win32_sigio_watcher_data *swd = (struct win32_sigio_watcher_data *)p;
#ifdef ZTS
void ***tsrm_ls = swd->tsrm_ls;
#endif
top:
(void)phpdbg_consume_bytes(swd->fd, &sig, 1, -1 TSRMLS_CC);
if (3 == sig) {
/* XXX completely not sure it is done right here */
if (PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE) {
if (raise(sig)) {
goto top;
}
}
if (PHPDBG_G(flags) & PHPDBG_IS_SIGNALED) {
phpdbg_set_sigsafe_mem(&sig TSRMLS_CC);
zend_try {
phpdbg_force_interruption(TSRMLS_C);
} zend_end_try();
phpdbg_clear_sigsafe_mem(TSRMLS_C);
goto end;
}
if (!(PHPDBG_G(flags) & PHPDBG_IS_INTERACTIVE)) {
PHPDBG_G(flags) |= PHPDBG_IS_SIGNALED;
}
end:
/* XXX set signaled flag to the caller thread, question is - whether it's needed */
ExitThread(sig);
} else {
开发者ID:Frgituser,项目名称:php-src,代码行数:35,代码来源:phpdbg_sigio_win32.c
示例2: phpdbg_output_pager
static int phpdbg_output_pager(int sock, const char *ptr, int len) {
int count = 0, bytes = 0;
const char *p = ptr, *endp = ptr + len;
while ((p = memchr(p, '\n', endp - p))) {
count++;
p++;
if (count % PHPDBG_G(lines) == 0) {
bytes += write(sock, ptr + bytes, (p - ptr) - bytes);
if (memchr(p, '\n', endp - p)) {
char buf[PHPDBG_MAX_CMD];
zend_quiet_write(sock, ZEND_STRL("\r---Type <return> to continue or q <return> to quit---"));
phpdbg_consume_stdin_line(buf);
if (*buf == 'q') {
break;
}
write(sock, "\r", 1);
} else break;
}
}
if (bytes && count % PHPDBG_G(lines) != 0) {
bytes += write(sock, ptr + bytes, len - bytes);
} else if (!bytes) {
bytes += write(sock, ptr, len);
}
return bytes;
}
开发者ID:PeeHaa,项目名称:php-src,代码行数:29,代码来源:phpdbg_io.c
示例3: phpdbg_mixed_write
PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len) {
if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) {
return phpdbg_send_bytes(sock, ptr, len);
}
if ((PHPDBG_G(flags) & PHPDBG_HAS_PAGINATION)
&& !(PHPDBG_G(flags) & PHPDBG_WRITE_XML)
&& PHPDBG_G(io)[PHPDBG_STDOUT].fd == sock
&& PHPDBG_G(lines) > 0) {
return phpdbg_output_pager(sock, ptr, len);
}
return write(sock, ptr, len);
}
开发者ID:PeeHaa,项目名称:php-src,代码行数:14,代码来源:phpdbg_io.c
示例4: phpdbg_eol_global_update
int phpdbg_eol_global_update(char *name)
{
if (0 == memcmp(name, "CRLF", 4) || 0 == memcmp(name, "crlf", 4) || 0 == memcmp(name, "DOS", 3) || 0 == memcmp(name, "dos", 3)) {
PHPDBG_G(eol) = PHPDBG_EOL_CRLF;
} else if (0 == memcmp(name, "LF", 2) || 0 == memcmp(name, "lf", 2) || 0 == memcmp(name, "UNIX", 4) || 0 == memcmp(name, "unix", 4)) {
PHPDBG_G(eol) = PHPDBG_EOL_LF;
} else if (0 == memcmp(name, "CR", 2) || 0 == memcmp(name, "cr", 2) || 0 == memcmp(name, "MAC", 3) || 0 == memcmp(name, "mac", 3)) {
PHPDBG_G(eol) = PHPDBG_EOL_CR;
} else {
return FAILURE;
}
return SUCCESS;
}
开发者ID:bishopb,项目名称:php-src,代码行数:15,代码来源:phpdbg_eol.c
示例5: phpdbg_mixed_read
PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo) {
if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) {
return phpdbg_consume_bytes(sock, ptr, len, tmo);
}
return read(sock, ptr, len);
}
开发者ID:erikjwaxx,项目名称:php-src,代码行数:7,代码来源:phpdbg_io.c
示例6: phpdbg_mixed_write
PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len) {
if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) {
return phpdbg_send_bytes(sock, ptr, len);
}
return write(sock, ptr, len);
}
开发者ID:erikjwaxx,项目名称:php-src,代码行数:7,代码来源:phpdbg_io.c
示例7: phpdbg_consume_stdin_line
/* is easy to generalize ... but not needed for now */
PHPDBG_API int phpdbg_consume_stdin_line(char *buf) {
int bytes = PHPDBG_G(input_buflen), len = 0;
if (PHPDBG_G(input_buflen)) {
memcpy(buf, PHPDBG_G(input_buffer), bytes);
}
PHPDBG_G(last_was_newline) = 1;
do {
int i;
if (bytes <= 0) {
continue;
}
for (i = len; i < len + bytes; i++) {
if (buf[i] == '\x03') {
if (i != len + bytes - 1) {
memmove(buf + i, buf + i + 1, len + bytes - i - 1);
}
len--;
i--;
continue;
}
if (buf[i] == '\n') {
PHPDBG_G(input_buflen) = len + bytes - 1 - i;
if (PHPDBG_G(input_buflen)) {
memcpy(PHPDBG_G(input_buffer), buf + i + 1, PHPDBG_G(input_buflen));
}
if (i != PHPDBG_MAX_CMD - 1) {
buf[i + 1] = 0;
}
return i;
}
}
len += bytes;
} while ((bytes = phpdbg_mixed_read(PHPDBG_G(io)[PHPDBG_STDIN].fd, buf + len, PHPDBG_MAX_CMD - len, -1)) > 0);
if (bytes <= 0) {
PHPDBG_G(flags) |= PHPDBG_IS_QUITTING | PHPDBG_IS_DISCONNECTED;
zend_bailout();
return 0;
}
return bytes;
}
开发者ID:erikjwaxx,项目名称:php-src,代码行数:48,代码来源:phpdbg_io.c
示例8: zend_mm_mem_alloc
static void* zend_mm_mem_alloc(zend_mm_storage *storage, size_t size, size_t alignment) {
if (EXPECTED(size == PHPDBG_SIGSAFE_MEM_SIZE && !PHPDBG_G(sigsafe_mem).allocated)) {
PHPDBG_G(sigsafe_mem).allocated = 1;
return PHPDBG_G(sigsafe_mem).mem;
}
write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("Tried to allocate more than " EXP_STR(PHPDBG_SIGSAFE_MEM_SIZE) " bytes from stack memory in signal handler ... bailing out of signal handler\n"));
if (*EG(bailout)) {
LONGJMP(*EG(bailout), FAILURE);
}
write(PHPDBG_G(io)[PHPDBG_STDERR].fd, ZEND_STRL("Bailed out without a bailout address in signal handler!\n"));
return NULL;
}
开发者ID:3F,项目名称:php-src,代码行数:17,代码来源:phpdbg_sigsafe.c
示例9: phpdbg_init_lexer
void phpdbg_init_lexer (phpdbg_param_t *stack, char *input) {
PHPDBG_G(parser_stack) = stack;
YYSETCONDITION(INITIAL);
LEX(text) = YYCURSOR = (unsigned char *) input;
LEX(len) = strlen(input);
}
开发者ID:Sobak,项目名称:php-src,代码行数:8,代码来源:phpdbg_lexer.c
示例10: phpdbg_print_opline_ex
void phpdbg_print_opline_ex(zend_execute_data *execute_data, HashTable *vars, zend_bool ignore_flags) /* {{{ */
{
/* force out a line while stepping so the user knows what is happening */
if (ignore_flags ||
(!(PHPDBG_G(flags) & PHPDBG_IS_QUIET) ||
(PHPDBG_G(flags) & PHPDBG_IS_STEPPING) ||
(PHPDBG_G(oplog)))) {
zend_op *opline = (zend_op *) execute_data->opline;
char *decode = phpdbg_decode_opline(&execute_data->func->op_array, opline, vars);
if (ignore_flags || (!(PHPDBG_G(flags) & PHPDBG_IS_QUIET) || (PHPDBG_G(flags) & PHPDBG_IS_STEPPING))) {
/* output line info */
phpdbg_notice("opline", "line=\"%u\" opline=\"%p\" opcode=\"%s\" op=\"%s\" file=\"%s\"", "L%-5u %16p %-30s %s %s",
opline->lineno,
opline,
phpdbg_decode_opcode(opline->opcode),
decode,
execute_data->func->op_array.filename ? execute_data->func->op_array.filename->val : "unknown");
}
if (!ignore_flags && PHPDBG_G(oplog)) {
phpdbg_log_ex(fileno(PHPDBG_G(oplog)), "L%-5u %16p %-30s %s %s",
opline->lineno,
opline,
phpdbg_decode_opcode(opline->opcode),
decode,
execute_data->func->op_array.filename ? execute_data->func->op_array.filename->val : "unknown");
}
if (decode) {
free(decode);
}
}
} /* }}} */
开发者ID:lllito,项目名称:php-src,代码行数:35,代码来源:phpdbg_opcode.c
示例11: PHP_FUNCTION
/* {{{ proto void phpdbg_clear(void)
instructs phpdbg to clear breakpoints */
static PHP_FUNCTION(phpdbg_clear)
{
zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE]);
zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM]);
zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_FUNCTION_OPLINE]);
zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD_OPLINE]);
zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_OPLINE]);
zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE]);
zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD]);
zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_COND]);
} /* }}} */
开发者ID:Acidburn0zzz,项目名称:php-src,代码行数:13,代码来源:phpdbg.c
示例12: phpdbg_remove_watch_collision
static void phpdbg_remove_watch_collision(phpdbg_watchpoint_t *watch) {
phpdbg_watch_collision *cur;
if ((cur = zend_hash_index_find_ptr(&PHPDBG_G(watch_collisions), (zend_ulong) Z_COUNTED_P(watch->addr.zv)))) {
if (cur->refs && !--cur->refs) {
phpdbg_delete_watchpoints_recursive(watch);
}
zend_hash_del(&cur->watches, watch->str);
zend_hash_del(&cur->implicit_watches, watch->str);
if (zend_hash_num_elements(&cur->watches) > 0) {
cur->watch = Z_PTR_P(zend_hash_get_current_data_ex(&cur->watches, NULL));
} else if (zend_hash_num_elements(&cur->implicit_watches) > 0) {
cur->watch = Z_PTR_P(zend_hash_get_current_data_ex(&cur->implicit_watches, NULL));
} else {
phpdbg_deactivate_watchpoint(cur->watch);
phpdbg_remove_watchpoint(cur->watch);
zend_hash_index_del(&PHPDBG_G(watch_collisions), (zend_ulong) Z_COUNTED_P(watch->addr.zv));
}
}
}
开发者ID:MessyHack,项目名称:php-src,代码行数:22,代码来源:phpdbg_watch.c
示例13: phpdbg_mixed_read
PHPDBG_API int phpdbg_mixed_read(int sock, char *ptr, int len, int tmo) {
int ret;
if (PHPDBG_G(flags) & PHPDBG_IS_REMOTE) {
return phpdbg_consume_bytes(sock, ptr, len, tmo);
}
do {
ret = read(sock, ptr, len);
} while (ret == -1 && errno == EINTR);
return ret;
}
开发者ID:PeeHaa,项目名称:php-src,代码行数:13,代码来源:phpdbg_io.c
示例14: phpdbg_set_sigsafe_mem
void phpdbg_set_sigsafe_mem(char *buffer) {
phpdbg_signal_safe_mem *mem = &PHPDBG_G(sigsafe_mem);
const zend_mm_handlers phpdbg_handlers = {
zend_mm_mem_alloc,
zend_mm_mem_free,
NULL,
NULL,
};
mem->mem = buffer;
mem->allocated = 0;
mem->heap = zend_mm_startup_ex(&phpdbg_handlers, NULL, 0);
mem->old_heap = zend_mm_set_heap(mem->heap);
}
开发者ID:3F,项目名称:php-src,代码行数:16,代码来源:phpdbg_sigsafe.c
示例15: phpdbg_btree_find_closest
static phpdbg_watchpoint_t *phpdbg_check_for_watchpoint(void *addr) {
phpdbg_watchpoint_t *watch;
phpdbg_btree_result *result = phpdbg_btree_find_closest(&PHPDBG_G(watchpoint_tree), (zend_ulong)phpdbg_get_page_boundary(addr) + phpdbg_pagesize - 1);
if (result == NULL) {
return NULL;
}
watch = result->ptr;
/* check if that addr is in a mprotect()'ed memory area */
if ((char *) phpdbg_get_page_boundary(watch->addr.ptr) > (char *) addr || (char *) phpdbg_get_page_boundary(watch->addr.ptr) + phpdbg_get_total_page_size(watch->addr.ptr, watch->size) < (char *) addr) {
/* failure */
return NULL;
}
return watch;
}
开发者ID:MessyHack,项目名称:php-src,代码行数:18,代码来源:phpdbg_watch.c
示例16: ZEND_ASSERT
static phpdbg_watchpoint_t *phpdbg_get_refcount_watch(phpdbg_watchpoint_t *parent) {
zend_refcounted *ref;
phpdbg_btree_result *res;
if (parent->type == WATCH_ON_HASHTABLE) {
parent = parent->parent;
if (!parent) {
return NULL;
}
}
ZEND_ASSERT(parent->type == WATCH_ON_ZVAL);
ref = Z_COUNTED_P(parent->addr.zv);
res = phpdbg_btree_find(&PHPDBG_G(watchpoint_tree), (zend_ulong) ref);
if (res) {
return res->ptr;
}
return NULL;
}
开发者ID:MessyHack,项目名称:php-src,代码行数:20,代码来源:phpdbg_watch.c
示例17: phpdbg_remove_watchpoint
static inline void phpdbg_remove_watchpoint(phpdbg_watchpoint_t *watch) {
phpdbg_btree_delete(&PHPDBG_G(watchpoint_tree), (zend_ulong) watch->addr.ptr);
}
开发者ID:MessyHack,项目名称:php-src,代码行数:3,代码来源:phpdbg_watch.c
示例18: phpdbg_create_listenable_socket
PHPDBG_API int phpdbg_create_listenable_socket(const char *addr, unsigned short port, struct addrinfo *addr_res) {
int sock = -1, rc;
int reuse = 1;
struct in6_addr serveraddr;
struct addrinfo hints, *res = NULL;
char port_buf[8];
int8_t any_addr = *addr == '*';
do {
memset(&hints, 0, sizeof hints);
if (any_addr) {
hints.ai_flags = AI_PASSIVE;
} else {
hints.ai_flags = AI_NUMERICSERV;
}
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
rc = inet_pton(AF_INET, addr, &serveraddr);
if (1 == rc) {
hints.ai_family = AF_INET;
if (!any_addr) {
hints.ai_flags |= AI_NUMERICHOST;
}
} else {
rc = inet_pton(AF_INET6, addr, &serveraddr);
if (1 == rc) {
hints.ai_family = AF_INET6;
if (!any_addr) {
hints.ai_flags |= AI_NUMERICHOST;
}
} else {
/* XXX get host by name ??? */
}
}
snprintf(port_buf, 7, "%u", port);
if (!any_addr) {
rc = getaddrinfo(addr, port_buf, &hints, &res);
} else {
rc = getaddrinfo(NULL, port_buf, &hints, &res);
}
if (0 != rc) {
#ifndef PHP_WIN32
if (rc == EAI_SYSTEM) {
char buf[128];
int wrote;
wrote = snprintf(buf, 128, "Could not translate address '%s'", addr);
buf[wrote] = '\0';
write(PHPDBG_G(io)[PHPDBG_STDERR].fd, buf, strlen(buf));
return sock;
} else {
#endif
char buf[256];
int wrote;
wrote = snprintf(buf, 256, "Host '%s' not found. %s", addr, estrdup(gai_strerror(rc)));
buf[wrote] = '\0';
write(PHPDBG_G(io)[PHPDBG_STDERR].fd, buf, strlen(buf));
return sock;
#ifndef PHP_WIN32
}
#endif
return sock;
}
if((sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol)) == -1) {
char buf[128];
int wrote;
wrote = sprintf(buf, "Unable to create socket");
buf[wrote] = '\0';
write(PHPDBG_G(io)[PHPDBG_STDERR].fd, buf, strlen(buf));
return sock;
}
if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char*) &reuse, sizeof(reuse)) == -1) {
phpdbg_close_socket(sock);
return sock;
}
} while (0);
*addr_res = *res;
return sock;
}
开发者ID:erikjwaxx,项目名称:php-src,代码行数:93,代码来源:phpdbg_io.c
示例19: phpdbg_print_opline_ex
void phpdbg_print_opline_ex(zend_execute_data *execute_data, zend_bool ignore_flags) /* {{{ */
{
/* force out a line while stepping so the user knows what is happening */
if (ignore_flags ||
(!(PHPDBG_G(flags) & PHPDBG_IS_QUIET) ||
(PHPDBG_G(flags) & PHPDBG_IS_STEPPING) ||
(PHPDBG_G(oplog)))) {
zend_op *opline = (zend_op *) execute_data->opline;
char *decode = phpdbg_decode_opline(&execute_data->func->op_array, opline);
if (ignore_flags || (!(PHPDBG_G(flags) & PHPDBG_IS_QUIET) || (PHPDBG_G(flags) & PHPDBG_IS_STEPPING))) {
/* output line info */
phpdbg_notice("opline", "line=\"%u\" opline=\"%p\" op=\"%s\" file=\"%s\"", "L%-5u %16p %s %s",
opline->lineno,
opline,
decode,
execute_data->func->op_array.filename ? ZSTR_VAL(execute_data->func->op_array.filename) : "unknown");
}
if (!ignore_flags && PHPDBG_G(oplog)) {
phpdbg_log_ex(fileno(PHPDBG_G(oplog)), "L%-5u %16p %s %s\n",
opline->lineno,
opline,
decode,
execute_data->func->op_array.filename ? ZSTR_VAL(execute_data->func->op_array.filename) : "unknown");
}
efree(decode);
}
if (PHPDBG_G(oplog_list)) {
phpdbg_oplog_entry *cur = zend_arena_alloc(&PHPDBG_G(oplog_arena), sizeof(phpdbg_oplog_entry));
zend_op_array *op_array = &execute_data->func->op_array;
cur->op = (zend_op *) execute_data->opline;
cur->opcodes = op_array->opcodes;
cur->filename = op_array->filename;
cur->scope = op_array->scope;
cur->function_name = op_array->function_name;
cur->next = NULL;
PHPDBG_G(oplog_cur)->next = cur;
PHPDBG_G(oplog_cur) = cur;
}
} /* }}} */
开发者ID:AxiosCros,项目名称:php-src,代码行数:44,代码来源:phpdbg_opcode.c
示例20: PHPDBG_COMMAND_HELP_D
PHPDBG_COMMAND_HELP_D(aliases, "show alias list", 'a', phpdbg_do_help_aliases),
PHPDBG_COMMAND_HELP_D(options, "command line options", 0, NULL),
PHPDBG_COMMAND_HELP_D(overview, "help overview", 0, NULL),
PHPDBG_COMMAND_HELP_D(phpdbginit, "phpdbginit file format", 0, NULL),
PHPDBG_COMMAND_HELP_D(syntax, "syntax overview", 0, NULL),
PHPDBG_END_COMMAND
}; /* }}} */
/* {{{ pretty_print. Formatting escapes and wrapping text in a string before printing it. */
void pretty_print(char *text TSRMLS_DC)
{
char *new, *p, *q;
const char *prompt_escape = phpdbg_get_prompt(TSRMLS_C);
unsigned int prompt_escape_len = strlen(prompt_escape);
unsigned int prompt_len = strlen(PHPDBG_G(prompt)[0]);
const char *bold_on_escape = PHPDBG_G(flags) & PHPDBG_IS_COLOURED ? "\033[1m" : "";
const char *bold_off_escape = PHPDBG_G(flags) & PHPDBG_IS_COLOURED ? "\033[0m" : "";
unsigned int bold_escape_len = strlen(bold_on_escape);
unsigned int term_width = phpdbg_get_terminal_width(TSRMLS_C);
unsigned int size = 0;
int in_bold = 0;
char *last_new_blank = NULL; /* position in new buffer of last blank char */
unsigned int last_blank_count = 0; /* printable char offset of last blank char */
unsigned int line_count = 0; /* number printable chars on current line */
/* First pass calculates a safe size for the pretty print version */
开发者ID:Acidburn0zzz,项目名称:php-src,代码行数:31,代码来源:phpdbg_help.c
注:本文中的PHPDBG_G函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论