34
34
* The number of message types in the debugger should reflect the
35
35
* debugger versioning.
36
36
*/
37
- JERRY_STATIC_ASSERT (JERRY_DEBUGGER_MESSAGES_OUT_MAX_COUNT == 26
38
- && JERRY_DEBUGGER_MESSAGES_IN_MAX_COUNT == 16
37
+ JERRY_STATIC_ASSERT (JERRY_DEBUGGER_MESSAGES_OUT_MAX_COUNT == 27
38
+ && JERRY_DEBUGGER_MESSAGES_IN_MAX_COUNT == 18
39
39
&& JERRY_DEBUGGER_VERSION == 1 ,
40
40
debugger_version_correlates_to_message_type_count );
41
41
@@ -154,9 +154,9 @@ jerry_debugger_send_eval (const lit_utf8_byte_t *eval_string_p, /**< evaluated s
154
154
JERRY_ASSERT (JERRY_CONTEXT (debugger_flags ) & JERRY_DEBUGGER_CONNECTED );
155
155
JERRY_ASSERT (!(JERRY_CONTEXT (debugger_flags ) & JERRY_DEBUGGER_VM_IGNORE ));
156
156
157
- JERRY_CONTEXT ( debugger_flags ) = ( uint8_t ) ( JERRY_CONTEXT ( debugger_flags ) | JERRY_DEBUGGER_VM_IGNORE );
157
+ JERRY_DEBUGGER_SET_FLAGS ( JERRY_DEBUGGER_VM_IGNORE );
158
158
ecma_value_t result = ecma_op_eval_chars_buffer (eval_string_p , eval_string_size , true, false);
159
- JERRY_CONTEXT ( debugger_flags ) = ( uint8_t ) ( JERRY_CONTEXT ( debugger_flags ) & ~ JERRY_DEBUGGER_VM_IGNORE );
159
+ JERRY_DEBUGGER_CLEAR_FLAGS ( JERRY_DEBUGGER_VM_IGNORE );
160
160
161
161
if (!ECMA_IS_VALUE_ERROR (result ))
162
162
{
@@ -325,8 +325,7 @@ jerry_debugger_process_message (uint8_t *recv_buffer_p, /**< pointer the the rec
325
325
else
326
326
{
327
327
result = true;
328
- JERRY_CONTEXT (debugger_flags ) = (uint8_t ) (JERRY_CONTEXT (debugger_flags )
329
- & ~JERRY_DEBUGGER_CLIENT_SOURCE_MODE );
328
+ JERRY_DEBUGGER_CLEAR_FLAGS (JERRY_DEBUGGER_CLIENT_SOURCE_MODE );
330
329
* resume_exec_p = true;
331
330
}
332
331
@@ -407,7 +406,7 @@ jerry_debugger_process_message (uint8_t *recv_buffer_p, /**< pointer the the rec
407
406
{
408
407
JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t );
409
408
410
- JERRY_CONTEXT ( debugger_flags ) = ( uint8_t ) ( JERRY_CONTEXT ( debugger_flags ) | JERRY_DEBUGGER_VM_STOP );
409
+ JERRY_DEBUGGER_SET_FLAGS ( JERRY_DEBUGGER_VM_STOP );
411
410
JERRY_CONTEXT (debugger_stop_context ) = NULL ;
412
411
* resume_exec_p = false;
413
412
return true;
@@ -417,7 +416,7 @@ jerry_debugger_process_message (uint8_t *recv_buffer_p, /**< pointer the the rec
417
416
{
418
417
JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t );
419
418
420
- JERRY_CONTEXT ( debugger_flags ) = ( uint8_t ) ( JERRY_CONTEXT ( debugger_flags ) & ~ JERRY_DEBUGGER_VM_STOP );
419
+ JERRY_DEBUGGER_CLEAR_FLAGS ( JERRY_DEBUGGER_VM_STOP );
421
420
JERRY_CONTEXT (debugger_stop_context ) = NULL ;
422
421
* resume_exec_p = true;
423
422
return true;
@@ -427,7 +426,7 @@ jerry_debugger_process_message (uint8_t *recv_buffer_p, /**< pointer the the rec
427
426
{
428
427
JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t );
429
428
430
- JERRY_CONTEXT ( debugger_flags ) = ( uint8_t ) ( JERRY_CONTEXT ( debugger_flags ) | JERRY_DEBUGGER_VM_STOP );
429
+ JERRY_DEBUGGER_SET_FLAGS ( JERRY_DEBUGGER_VM_STOP );
431
430
JERRY_CONTEXT (debugger_stop_context ) = NULL ;
432
431
* resume_exec_p = true;
433
432
return true;
@@ -437,7 +436,7 @@ jerry_debugger_process_message (uint8_t *recv_buffer_p, /**< pointer the the rec
437
436
{
438
437
JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t );
439
438
440
- JERRY_CONTEXT ( debugger_flags ) = ( uint8_t ) ( JERRY_CONTEXT ( debugger_flags ) | JERRY_DEBUGGER_VM_STOP );
439
+ JERRY_DEBUGGER_SET_FLAGS ( JERRY_DEBUGGER_VM_STOP );
441
440
JERRY_CONTEXT (debugger_stop_context ) = JERRY_CONTEXT (vm_top_context_p );
442
441
* resume_exec_p = true;
443
442
return true;
@@ -456,20 +455,51 @@ jerry_debugger_process_message (uint8_t *recv_buffer_p, /**< pointer the the rec
456
455
JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_exception_config_t );
457
456
JERRY_DEBUGGER_RECEIVE_BUFFER_AS (jerry_debugger_receive_exception_config_t , exception_config_p );
458
457
459
- uint8_t debugger_flags = JERRY_CONTEXT (debugger_flags );
460
-
461
458
if (exception_config_p -> enable == 0 )
462
459
{
463
- debugger_flags = ( uint8_t ) ( debugger_flags | JERRY_DEBUGGER_VM_IGNORE_EXCEPTION );
460
+ JERRY_DEBUGGER_SET_FLAGS ( JERRY_DEBUGGER_VM_IGNORE_EXCEPTION );
464
461
jerry_port_log (JERRY_LOG_LEVEL_DEBUG , "Stop at exception disabled\n" );
465
462
}
466
463
else
467
464
{
468
- debugger_flags = ( uint8_t ) ( debugger_flags & ~ JERRY_DEBUGGER_VM_IGNORE_EXCEPTION );
465
+ JERRY_DEBUGGER_CLEAR_FLAGS ( JERRY_DEBUGGER_VM_IGNORE_EXCEPTION );
469
466
jerry_port_log (JERRY_LOG_LEVEL_DEBUG , "Stop at exception enabled\n" );
470
467
}
471
468
472
- JERRY_CONTEXT (debugger_flags ) = debugger_flags ;
469
+ return true;
470
+ }
471
+
472
+ case JERRY_DEBUGGER_PARSER_CONFIG :
473
+ {
474
+ JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_parser_config_t );
475
+ JERRY_DEBUGGER_RECEIVE_BUFFER_AS (jerry_debugger_receive_parser_config_t , parser_config_p );
476
+
477
+ if (parser_config_p -> enable_wait != 0 )
478
+ {
479
+ JERRY_DEBUGGER_SET_FLAGS (JERRY_DEBUGGER_PARSER_WAIT );
480
+ jerry_port_log (JERRY_LOG_LEVEL_DEBUG , "Waiting after parsing enabled\n" );
481
+ }
482
+ else
483
+ {
484
+ JERRY_DEBUGGER_CLEAR_FLAGS (JERRY_DEBUGGER_PARSER_WAIT );
485
+ jerry_port_log (JERRY_LOG_LEVEL_DEBUG , "Waiting after parsing disabled\n" );
486
+ }
487
+
488
+ return true;
489
+ }
490
+
491
+ case JERRY_DEBUGGER_PARSER_RESUME :
492
+ {
493
+ JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t );
494
+
495
+ if (!(JERRY_CONTEXT (debugger_flags ) & JERRY_DEBUGGER_PARSER_WAIT_MODE ))
496
+ {
497
+ jerry_port_log (JERRY_LOG_LEVEL_ERROR , "Not in parser wait mode\n" );
498
+ jerry_debugger_close_connection ();
499
+ return false;
500
+ }
501
+
502
+ JERRY_DEBUGGER_CLEAR_FLAGS (JERRY_DEBUGGER_PARSER_WAIT_MODE );
473
503
return true;
474
504
}
475
505
@@ -568,8 +598,7 @@ jerry_debugger_process_message (uint8_t *recv_buffer_p, /**< pointer the the rec
568
598
}
569
599
else
570
600
{
571
- JERRY_CONTEXT (debugger_flags ) = (uint8_t ) (JERRY_CONTEXT (debugger_flags )
572
- & ~JERRY_DEBUGGER_CLIENT_SOURCE_MODE );
601
+ JERRY_DEBUGGER_CLEAR_FLAGS (JERRY_DEBUGGER_CLIENT_SOURCE_MODE );
573
602
* resume_exec_p = true;
574
603
}
575
604
return true;
@@ -586,8 +615,7 @@ jerry_debugger_process_message (uint8_t *recv_buffer_p, /**< pointer the the rec
586
615
587
616
JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t );
588
617
589
- JERRY_CONTEXT (debugger_flags ) = (uint8_t ) (JERRY_CONTEXT (debugger_flags ) & ~JERRY_DEBUGGER_CLIENT_SOURCE_MODE );
590
- JERRY_CONTEXT (debugger_flags ) = (uint8_t ) (JERRY_CONTEXT (debugger_flags ) | JERRY_DEBUGGER_CLIENT_NO_SOURCE );
618
+ JERRY_DEBUGGER_UPDATE_FLAGS (JERRY_DEBUGGER_CLIENT_NO_SOURCE , JERRY_DEBUGGER_CLIENT_SOURCE_MODE );
591
619
592
620
* resume_exec_p = true;
593
621
@@ -605,8 +633,7 @@ jerry_debugger_process_message (uint8_t *recv_buffer_p, /**< pointer the the rec
605
633
606
634
JERRY_DEBUGGER_CHECK_PACKET_SIZE (jerry_debugger_receive_type_t );
607
635
608
- JERRY_CONTEXT (debugger_flags ) = (uint8_t ) (JERRY_CONTEXT (debugger_flags ) & ~JERRY_DEBUGGER_CLIENT_SOURCE_MODE );
609
- JERRY_CONTEXT (debugger_flags ) = (uint8_t ) (JERRY_CONTEXT (debugger_flags ) | JERRY_DEBUGGER_CONTEXT_RESET_MODE );
636
+ JERRY_DEBUGGER_UPDATE_FLAGS (JERRY_DEBUGGER_CONTEXT_RESET_MODE , JERRY_DEBUGGER_CLIENT_SOURCE_MODE );
610
637
611
638
* resume_exec_p = true;
612
639
@@ -652,7 +679,7 @@ jerry_debugger_breakpoint_hit (uint8_t message_type) /**< message type */
652
679
return ;
653
680
}
654
681
655
- JERRY_CONTEXT ( debugger_flags ) = ( uint8_t ) ( JERRY_CONTEXT ( debugger_flags ) | JERRY_DEBUGGER_BREAKPOINT_MODE );
682
+ JERRY_DEBUGGER_SET_FLAGS ( JERRY_DEBUGGER_BREAKPOINT_MODE );
656
683
657
684
jerry_debugger_uint8_data_t * uint8_data = NULL ;
658
685
@@ -667,7 +694,7 @@ jerry_debugger_breakpoint_hit (uint8_t message_type) /**< message type */
667
694
uint8_data -> uint8_size + sizeof (jerry_debugger_uint8_data_t ));
668
695
}
669
696
670
- JERRY_CONTEXT ( debugger_flags ) = ( uint8_t ) ( JERRY_CONTEXT ( debugger_flags ) & ~ JERRY_DEBUGGER_BREAKPOINT_MODE );
697
+ JERRY_DEBUGGER_CLEAR_FLAGS ( JERRY_DEBUGGER_BREAKPOINT_MODE );
671
698
672
699
JERRY_CONTEXT (debugger_message_delay ) = JERRY_DEBUGGER_MESSAGE_FREQUENCY ;
673
700
} /* jerry_debugger_breakpoint_hit */
0 commit comments