@@ -878,37 +878,6 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
878878 {
879879 case RUBY_EVENT_LINE :
880880 {
881- if (CTX_FL_TEST (debug_context , CTX_FL_CATCHING ))
882- {
883- debug_frame_t * top_frame = get_top_frame (debug_context );
884-
885- if (top_frame != NULL )
886- {
887- rb_control_frame_t * cfp = top_frame -> info .runtime .cfp ;
888- VALUE hit_count ;
889- int c_hit_count ;
890- rb_iseq_t * iseq = cfp -> iseq ;
891-
892- if (iseq != NULL ) {
893- /* restore the proper catch table */
894- iseq -> catch_table_size = debug_context -> catch_table .old_catch_table_size ;
895- iseq -> catch_table = debug_context -> catch_table .old_catch_table ;
896- }
897-
898- /* send catchpoint notification */
899- c_hit_count = FIX2INT (rb_hash_aref (rdebug_catchpoints , debug_context -> catch_table .mod_name )) + 1 ;
900- hit_count = INT2FIX (c_hit_count );
901- rb_hash_aset (rdebug_catchpoints , debug_context -> catch_table .mod_name , hit_count );
902- debug_context -> stop_reason = CTX_STOP_CATCHPOINT ;
903- rb_funcall (context , idAtCatchpoint , 1 , debug_context -> catch_table .errinfo );
904- if (self && binding == Qnil )
905- binding = create_binding (self );
906- save_top_binding (debug_context , binding );
907- call_at_line (context , debug_context , rb_str_new2 (top_frame -> file ), INT2FIX (top_frame -> line ));
908- }
909-
910- break ;
911- }
912881 if (debug_context -> stack_size == 0 ||
913882 get_top_frame (debug_context )-> info .runtime .block_iseq != thread -> cfp -> block_iseq ||
914883 get_top_frame (debug_context )-> info .runtime .cfp -> iseq != thread -> cfp -> iseq )
@@ -1029,13 +998,6 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
1029998 VALUE expn_class , aclass ;
1030999 int i ;
10311000
1032- if (CTX_FL_TEST (debug_context , CTX_FL_CATCHING )) {
1033- /* we're re-raising exception after processing line event,
1034- now allow the next exception to be caught, don't setup catchers */
1035- CTX_FL_UNSET (debug_context , CTX_FL_CATCHING );
1036- break ;
1037- }
1038-
10391001 if (debug == Qtrue ) {
10401002 fprintf (stderr , "stack_size %d\n" , debug_context -> stack_size );
10411003 for (i = 0 ; i < debug_context -> stack_size ; i ++ ) {
@@ -1094,25 +1056,20 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
10941056 if (hit_count != Qnil )
10951057 {
10961058 debug_frame_t * top_frame = get_top_frame (debug_context );
1097- rb_control_frame_t * cfp = top_frame -> info . runtime . cfp ;
1098- rb_iseq_t * iseq = cfp -> iseq ;
1059+ VALUE hit_count ;
1060+ int c_hit_count ;
10991061
1100- debug_context -> catch_table .mod_name = mod_name ;
1101- debug_context -> catch_table .errinfo = rb_errinfo ();
1102- CTX_FL_SET (debug_context , CTX_FL_CATCHING );
1103- if (iseq != NULL ) {
1104-
1105- /* save the current catch table */
1106- debug_context -> catch_table .old_catch_table_size = iseq -> catch_table_size ;
1107- debug_context -> catch_table .old_catch_table = iseq -> catch_table ;
1108-
1109-
1110- /* create a new catch table to catch this exception, and put it in the current iseq */
1111- iseq -> catch_table_size = 1 ;
1112- iseq -> catch_table =
1113- create_catch_table (debug_context , top_frame -> info .runtime .last_pc - cfp -> iseq -> iseq_encoded - insn_len (BIN (trace )));
1114- break ;
1115- }
1062+ /* send catchpoint notification */
1063+ hit_count = rb_hash_aref (rdebug_catchpoints , mod_name );
1064+ c_hit_count = (hit_count != Qnil ? FIX2INT (hit_count ) : 0 ) + 1 ;
1065+ hit_count = INT2FIX (c_hit_count );
1066+ rb_hash_aset (rdebug_catchpoints , mod_name , hit_count );
1067+ debug_context -> stop_reason = CTX_STOP_CATCHPOINT ;
1068+ rb_funcall (context , idAtCatchpoint , 1 , rb_errinfo ());
1069+ if (self && binding == Qnil )
1070+ binding = create_binding (self );
1071+ save_top_binding (debug_context , binding );
1072+ call_at_line (context , debug_context , rb_str_new2 (top_frame -> file ), INT2FIX (top_frame -> line ));
11161073 }
11171074 }
11181075
0 commit comments