@@ -659,6 +659,7 @@ PHPDBG_COMMAND(run) /* {{{ */
659
659
char * * argv = emalloc (5 * sizeof (char * ));
660
660
int argc = 0 ;
661
661
int i ;
662
+ /* TODO allow proper escaping with \, "" and '' here */
662
663
char * argv_str = strtok (param -> str , " " );
663
664
664
665
while (argv_str ) {
@@ -767,15 +768,19 @@ PHPDBG_COMMAND(ev) /* {{{ */
767
768
PHPDBG_G (flags ) |= PHPDBG_IN_EVAL ;
768
769
zend_try {
769
770
if (zend_eval_stringl (param -> str , param -> len , & retval , "eval()'d code" ) == SUCCESS ) {
770
- phpdbg_xml ("<eval %r>" );
771
- if (PHPDBG_G (flags ) & PHPDBG_WRITE_XML ) {
772
- zval * zvp = & retval ;
773
- phpdbg_xml_var_dump (zvp );
771
+ if (EG (exception )) {
772
+ zend_exception_error (EG (exception ), E_ERROR );
773
+ } else {
774
+ phpdbg_xml ("<eval %r>" );
775
+ if (PHPDBG_G (flags ) & PHPDBG_WRITE_XML ) {
776
+ zval * zvp = & retval ;
777
+ phpdbg_xml_var_dump (zvp );
778
+ }
779
+ zend_print_zval_r (& retval , 0 );
780
+ phpdbg_xml ("</eval>" );
781
+ phpdbg_out ("\n" );
782
+ zval_ptr_dtor (& retval );
774
783
}
775
- zend_print_zval_r (& retval , 0 );
776
- phpdbg_xml ("</eval>" );
777
- phpdbg_out ("\n" );
778
- zval_ptr_dtor (& retval );
779
784
}
780
785
} zend_catch {
781
786
EG (current_execute_data ) = original_execute_data ;
@@ -784,6 +789,7 @@ PHPDBG_COMMAND(ev) /* {{{ */
784
789
EG (vm_stack_end ) = original_stack -> end ;
785
790
EG (vm_stack ) = original_stack ;
786
791
} zend_end_try ();
792
+
787
793
PHPDBG_G (flags ) &= ~PHPDBG_IN_EVAL ;
788
794
789
795
/* switch stepping back on */
@@ -1391,18 +1397,17 @@ void phpdbg_clean(zend_bool full) /* {{{ */
1391
1397
\
1392
1398
switch (phpdbg_interactive(allow_async_unsafe)) { \
1393
1399
zval zv; \
1394
- default: \
1400
+ case PHPDBG_LEAVE: \
1401
+ case PHPDBG_FINISH: \
1402
+ case PHPDBG_UNTIL: \
1403
+ case PHPDBG_NEXT: \
1395
1404
if (exception) { \
1396
1405
Z_OBJ(zv) = exception; \
1397
1406
zend_throw_exception_internal(&zv); \
1398
1407
} \
1399
1408
/* fallthrough */ \
1400
- case PHPDBG_LEAVE : \
1401
- case PHPDBG_FINISH : \
1402
- case PHPDBG_UNTIL : \
1403
- case PHPDBG_NEXT :{ \
1409
+ default : \
1404
1410
goto next ; \
1405
- } \
1406
1411
} \
1407
1412
} while (0 )
1408
1413
@@ -1431,7 +1436,7 @@ void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */
1431
1436
#endif
1432
1437
1433
1438
/* check for uncaught exceptions */
1434
- if (exception && PHPDBG_G (handled_exception ) != exception ) {
1439
+ if (exception && PHPDBG_G (handled_exception ) != exception && !( PHPDBG_G ( flags ) & PHPDBG_IN_EVAL ) ) {
1435
1440
zend_execute_data * prev_ex = execute_data ;
1436
1441
zval zv , rv ;
1437
1442
zend_string * file , * msg ;
@@ -1464,16 +1469,14 @@ void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */
1464
1469
}
1465
1470
ex_is_caught :
1466
1471
1467
- /* allow conditional breakpoints and
1468
- initialization to access the vm uninterrupted */
1469
- if ((PHPDBG_G (flags ) & PHPDBG_IN_COND_BP ) ||
1470
- (PHPDBG_G (flags ) & PHPDBG_IS_INITIALIZING )) {
1472
+ /* allow conditional breakpoints and initialization to access the vm uninterrupted */
1473
+ if (PHPDBG_G (flags ) & (PHPDBG_IN_COND_BP | PHPDBG_IS_INITIALIZING )) {
1471
1474
/* skip possible breakpoints */
1472
1475
goto next ;
1473
1476
}
1474
1477
1475
1478
/* perform seek operation */
1476
- if (PHPDBG_G (flags ) & PHPDBG_SEEK_MASK ) {
1479
+ if (( PHPDBG_G (flags ) & PHPDBG_SEEK_MASK ) && !( PHPDBG_G ( flags ) & PHPDBG_IN_EVAL ) ) {
1477
1480
/* current address */
1478
1481
zend_ulong address = (zend_ulong ) execute_data -> opline ;
1479
1482
0 commit comments