mirror of
https://github.com/php/php-src.git
synced 2024-11-23 09:54:15 +08:00
* Fix debugger+interactive mode bug
* Recognize whether an extension is with debug information or not
This commit is contained in:
parent
1245356128
commit
2493f68018
@ -300,6 +300,7 @@ zend_op_array *compile_string(zval *source_string CLS_DC)
|
||||
source_string = &tmp;
|
||||
|
||||
init_op_array(op_array, INITIAL_OP_ARRAY_SIZE);
|
||||
op_array->type = ZEND_EVAL_CODE;
|
||||
save_lexical_state(&original_lex_state CLS_CC);
|
||||
if (prepare_string_for_scanning(source_string CLS_CC)==FAILURE) {
|
||||
destroy_op_array(op_array);
|
||||
|
@ -498,6 +498,7 @@ int zendlex(znode *zendlval CLS_DC);
|
||||
#define ZEND_INTERNAL_FUNCTION 1
|
||||
#define ZEND_USER_FUNCTION 2
|
||||
#define ZEND_OVERLOADED_FUNCTION 3
|
||||
#define ZEND_EVAL_CODE 4
|
||||
|
||||
#define ZEND_INTERNAL_CLASS 1
|
||||
#define ZEND_USER_CLASS 2
|
||||
|
@ -435,8 +435,9 @@ void execute_new_code(CLS_D)
|
||||
ELS_FETCH();
|
||||
|
||||
if (!EG(interactive)
|
||||
|| CG(active_op_array)->backpatch_count>0) {
|
||||
|
||||
|| CG(active_op_array)->backpatch_count>0
|
||||
|| CG(active_op_array)->function_name
|
||||
|| CG(active_op_array)->type!=ZEND_USER_FUNCTION) {
|
||||
return;
|
||||
}
|
||||
CG(active_op_array)->start_op_number = CG(active_op_array)->last_executed_op_number;
|
||||
|
@ -83,6 +83,13 @@ int zend_load_extension(char *path)
|
||||
(ZTS_V?"is":"isn't"));
|
||||
DL_UNLOAD(handle);
|
||||
return FAILURE;
|
||||
} else if (ZEND_DEBUG_V!=extension_version_info->debug) {
|
||||
zend_printf("Cannot load %s - it %s debug information, whereas Zend %s\n",
|
||||
new_extension->name,
|
||||
(extension_version_info->debug?"contains":"does not contain"),
|
||||
(ZEND_DEBUG_V?"does":"does not"));
|
||||
DL_UNLOAD(handle);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
if (new_extension->startup) {
|
||||
|
@ -25,6 +25,7 @@ typedef struct {
|
||||
int zend_extension_api_no;
|
||||
char *required_zend_version;
|
||||
unsigned char thread_safe;
|
||||
unsigned char debug;
|
||||
} zend_extension_version_info;
|
||||
|
||||
|
||||
@ -73,9 +74,15 @@ ZEND_API int zend_get_resource_handle();
|
||||
#define ZTS_V 0
|
||||
#endif
|
||||
|
||||
#ifdef ZEND_DEBUG
|
||||
#define ZEND_DEBUG_V 1
|
||||
#else
|
||||
#define ZEND_DEBUG_V 0
|
||||
#endif
|
||||
|
||||
|
||||
#define ZEND_EXTENSION() \
|
||||
ZEND_EXT_API zend_extension_version_info extension_version_info = { ZEND_EXTENSION_API_NO, "0.80A", ZTS_V }
|
||||
ZEND_EXT_API zend_extension_version_info extension_version_info = { ZEND_EXTENSION_API_NO, "0.80A", ZTS_V, ZEND_DEBUG_V }
|
||||
|
||||
#define STANDARD_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1
|
||||
|
||||
|
@ -271,7 +271,7 @@ int pass_two(zend_op_array *op_array)
|
||||
{
|
||||
CLS_FETCH();
|
||||
|
||||
if (op_array->type != ZEND_USER_FUNCTION) {
|
||||
if (op_array->type!=ZEND_USER_FUNCTION && op_array->type!=ZEND_EVAL_CODE) {
|
||||
return 0;
|
||||
}
|
||||
if (CG(extended_info)) {
|
||||
|
Loading…
Reference in New Issue
Block a user