Skip to content

Commit 39e28eb

Browse files
authored
Merge pull request #31 from equivalence1/ruby-attach-to-process
Need wrapper function to call `rb_string_eval_protect` on mac
2 parents cedb500 + 5c4ae6e commit 39e28eb

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ext/attach/attach.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,16 @@ __catch_line_event(rb_event_flag_t evflag, VALUE data, VALUE self, ID mid, VALUE
2626
}
2727

2828
int
29-
start_attach()
29+
debase_start_attach()
3030
{
3131
if (rb_during_gc())
3232
return 1;
3333
rb_add_event_hook(__catch_line_event, RUBY_EVENT_LINE, (VALUE) NULL);
3434
return 0;
3535
}
36+
37+
void
38+
debase_rb_eval(const char *string_to_eval)
39+
{
40+
rb_eval_string_protect(string_to_eval, NULL);
41+
}

ext/attach/attach.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <ruby.h>
55
#include <ruby/debug.h>
66

7-
int start_attach();
7+
int debase_start_attach();
8+
void debase_rb_eval();
89

910
#endif //__ATTACH_H__

0 commit comments

Comments
 (0)