Adapted opline_num breakpoints to master branch

This commit is contained in:
Bob Weinand 2013-12-07 15:35:35 +01:00
commit 50db4919ce
47 changed files with 4454 additions and 642 deletions

View file

@ -19,6 +19,7 @@
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include "zend.h"
#include "php.h"
#include "spprintf.h"
@ -100,6 +101,9 @@ PHPDBG_API int phpdbg_is_class_method(const char *str, size_t len, char **class,
{
char *sep = NULL;
if (strstr(str, "#") != NULL)
return 0;
if (strstr(str, " ") != NULL)
return 0;
@ -242,6 +246,33 @@ PHPDBG_API int phpdbg_print(int type TSRMLS_DC, FILE *fp, const char *format, ..
return rc;
} /* }}} */
PHPDBG_API int phpdbg_rlog(FILE *fp, const char *fmt, ...) { /* {{{ */
int rc = 0;
va_list args;
struct timeval tp;
va_start(args, fmt);
if (gettimeofday(&tp, NULL) == SUCCESS) {
char friendly[100];
char *format = NULL, *buffer = NULL;
strftime(friendly, 100, "%a %b %d %T.%%04d %Y", localtime(&tp.tv_sec));
asprintf(
&buffer, friendly, tp.tv_usec/1000);
asprintf(
&format, "[%s]: %s\n", buffer, fmt);
rc = vfprintf(
fp, format, args);
free(format);
free(buffer);
}
va_end(args);
return rc;
} /* }}} */
PHPDBG_API const phpdbg_color_t *phpdbg_get_color(const char *name, size_t name_length TSRMLS_DC) /* {{{ */
{
const phpdbg_color_t *color = colors;
@ -299,7 +330,7 @@ PHPDBG_API void phpdbg_set_prompt(const char *prompt TSRMLS_DC) /* {{{ */
} /* }}} */
PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D) /* {{{ */
{
{
/* find cached prompt */
if (PHPDBG_G(prompt)[1]) {
return PHPDBG_G(prompt)[1];