From df9d4a5b0cbda637f2ad17124b36db9062538f0c Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 14 Nov 2017 12:58:36 +0000 Subject: remove `trace` instruction. [Feature #14104] * tool/instruction.rb: create `trace_` prefix instructions. * compile.c (ADD_TRACE): do not add `trace` instructions but add TRACE link elements. TRACE elements will be unified with a next instruction as instruction information. * vm_trace.c (update_global_event_hook): modify all ISeqs when hooks are enabled. * iseq.c (rb_iseq_trace_set): added to toggle `trace_` instructions. * vm_insnhelper.c (vm_trace): added. This function is a body of `trace_` prefix instructions. * vm_insnhelper.h (JUMP): save PC to a control frame. * insns.def (trace): removed. * vm_exec.h (INSN_ENTRY_SIG): add debug output (disabled). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_backtrace.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'vm_backtrace.c') diff --git a/vm_backtrace.c b/vm_backtrace.c index fa9295daab..0418b6c4d0 100644 --- a/vm_backtrace.c +++ b/vm_backtrace.c @@ -40,7 +40,14 @@ int rb_vm_get_sourceline(const rb_control_frame_t *cfp) { if (VM_FRAME_RUBYFRAME_P(cfp) && cfp->iseq) { - return calc_lineno(cfp->iseq, cfp->pc); + const rb_iseq_t *iseq = cfp->iseq; + int line = calc_lineno(iseq, cfp->pc); + if (line != 0) { + return line; + } + else { + return FIX2INT(rb_iseq_first_lineno(iseq)); + } } else { return 0; -- cgit v1.2.3