- Improved breakpoint code

This commit is contained in:
Felipe Pena 2013-11-12 11:33:51 -02:00
parent fdf26eaa0f
commit af90b6d5c7
5 changed files with 51 additions and 37 deletions

View file

@ -17,7 +17,9 @@
+----------------------------------------------------------------------+
*/
#include <stdio.h>
#include <ctype.h>
#include "zend_alloc.h"
#include "phpdbg_utils.h"
int phpdbg_is_numeric(const char *str) /* {{{ */
@ -46,3 +48,23 @@ int phpdbg_is_addr(const char *str) /* {{{ */
{
return str[0] && str[1] && memcmp(str, "0x", 2) == 0;
} /* }}} */
int phpdbg_is_class_method(const char *str, size_t len, char **class, char **method) /* {{{ */
{
const char *sep = strstr(str, "::");
size_t class_len, method_len;
if (!sep) {
return 0;
}
class_len = sep - str;
method_len = len - ((sep+2) - str);
*class = estrndup(str, class_len);
class[class_len] = 0;
*method = estrndup(sep+2, method_len+1);
return 1;
} /* }}} */