Skip to content

Commit a13efa2

Browse files
committed
1 parent eb2a6ca commit a13efa2

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

ext/ruby_debug/extconf.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
$CFLAGS << ' -DRUBY_VERSION_1_9_1'
1717
end
1818

19+
if RUBY_REVISION >= 26959 # rb_iseq_compile_with_option was added an argument filepath
20+
$CFLAGS << ' -DRB_ISEQ_COMPILE_6ARGS'
21+
end
22+
1923
dir_config("ruby")
2024
if !Ruby_core_source::create_makefile_with_core(hdrs, "ruby_debug")
2125
STDERR.print("Makefile creation failed\n")

ext/ruby_debug/ruby_debug.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <insns_info.inc>
1010
#include "ruby_debug.h"
1111

12-
#define DEBUG_VERSION "0.11.29"
12+
#define DEBUG_VERSION "0.11.30.pre"
1313

1414
#define FRAME_N(n) (&debug_context->frames[debug_context->stack_size-(n)-1])
1515
#define GET_FRAME (FRAME_N(check_frame_number(debug_context, frame)))
@@ -21,7 +21,12 @@
2121
#define STACK_SIZE_INCREMENT 128
2222

2323
RUBY_EXTERN int rb_vm_get_sourceline(const rb_control_frame_t *cfp); /* from vm.c */
24-
RUBY_EXTERN VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE line, VALUE opt); /* from iseq.c */
24+
/* from iseq.c */
25+
#ifdef RB_ISEQ_COMPILE_6ARGS
26+
RUBY_EXTERN VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE filepath, VALUE line, VALUE opt);
27+
#else
28+
RUBY_EXTERN VALUE rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE line, VALUE opt);
29+
#endif
2530

2631
typedef struct {
2732
st_table *tbl;
@@ -680,8 +685,13 @@ create_catch_table(debug_context_t *debug_context, unsigned long cont)
680685
GET_THREAD()->parse_in_eval++;
681686
GET_THREAD()->mild_compile_error++;
682687
/* compiling with option Qfalse (no options) prevents debug hook calls during this catch routine */
688+
#ifdef RB_ISEQ_COMPILE_6ARGS
689+
catch_table->iseq = rb_iseq_compile_with_option(
690+
rb_str_new_cstr("begin\nend"), rb_str_new_cstr("(exception catcher)"), Qnil, INT2FIX(1), Qfalse);
691+
#else
683692
catch_table->iseq = rb_iseq_compile_with_option(
684693
rb_str_new_cstr("begin\nend"), rb_str_new_cstr("(exception catcher)"), INT2FIX(1), Qfalse);
694+
#endif
685695
GET_THREAD()->mild_compile_error--;
686696
GET_THREAD()->parse_in_eval--;
687697

0 commit comments

Comments
 (0)