mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
- Improved breakpoint code
This commit is contained in:
parent
fdf26eaa0f
commit
af90b6d5c7
5 changed files with 51 additions and 37 deletions
|
@ -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;
|
||||
} /* }}} */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue