diff options
| author | Matt Valentine-House <matt@eightbitraptor.com> | 2023-11-24 11:36:55 +0000 |
|---|---|---|
| committer | Matt Valentine-House <matt@eightbitraptor.com> | 2023-11-24 12:54:35 +0000 |
| commit | 406dafbb347cb81f6d256d18ac9fd2908a9cb8ef (patch) | |
| tree | dafcb0d91a4057d17c35b0091a6021e4bcb15bd5 | |
| parent | 1cba1b3992dcc7476a24e00e4207cfd38e37d8d4 (diff) | |
[PRISM] Insert Tracepoint line events on line change
| -rw-r--r-- | prism_compile.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/prism_compile.c b/prism_compile.c index 840f980253..6850c84c04 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -1490,6 +1490,17 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, int lineno = (int)pm_newline_list_line_column(&newline_list, node->location.start).line; NODE dummy_line_node = generate_dummy_line_node(lineno, lineno); + if (node->flags & PM_NODE_FLAG_NEWLINE && + ISEQ_COMPILE_DATA(iseq)->last_line != lineno) { + int event = RUBY_EVENT_LINE; + + ISEQ_COMPILE_DATA(iseq)->last_line = lineno; + if (ISEQ_COVERAGE(iseq) && ISEQ_LINE_COVERAGE(iseq)) { + event |= RUBY_EVENT_COVERAGE_LINE; + } + ADD_TRACE(ret, event); + } + switch (PM_NODE_TYPE(node)) { case PM_ALIAS_GLOBAL_VARIABLE_NODE: { pm_alias_global_variable_node_t *alias_node = (pm_alias_global_variable_node_t *) node; |
