diff options
author | Koichi Sasada <ko1@atdot.net> | 2021-09-30 16:58:46 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2021-10-21 16:17:39 +0900 |
commit | c7550537f11dcf6450a9d3df3af3fa1f4fe05b15 (patch) | |
tree | 9b73c5b1be4e42f0aaf92e64b9c6041777666251 /internal | |
parent | 3b16d07e457264d7c171f8d1fcfaddb0dad90f57 (diff) |
`RubyVM.keep_script_lines`
`RubyVM.keep_script_lines` enables to keep script lines
for each ISeq and AST. This feature is for debugger/REPL
support.
```ruby
RubyVM.keep_script_lines = true
RubyVM::keep_script_lines = true
eval("def foo = nil\ndef bar = nil")
pp RubyVM::InstructionSequence.of(method(:foo)).script_lines
```
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4913
Diffstat (limited to 'internal')
-rw-r--r-- | internal/compile.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/compile.h b/internal/compile.h index 932dce2744..d32c2233c9 100644 --- a/internal/compile.h +++ b/internal/compile.h @@ -25,6 +25,7 @@ st_index_t rb_iseq_cdhash_hash(VALUE a); /* iseq.c */ int rb_vm_insn_addr2insn(const void *); int rb_vm_insn_decode(const VALUE encoded); +extern bool ruby_vm_keep_script_lines; MJIT_SYMBOL_EXPORT_BEGIN /* iseq.c (export) */ |