vm_backtrace.c: ignore ifunc frames
* vm_backtrace.c (rb_profile_frames): ignore ifunc frames as it did before. [ruby-core:72409] [Bug #11851] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8ec531ba9c
commit
cc52f511b1
@ -1,3 +1,8 @@
|
|||||||
|
Mon Dec 21 10:18:46 2015 Kazuki Yamaguchi <k@rhe.jp>
|
||||||
|
|
||||||
|
* vm_backtrace.c (rb_profile_frames): ignore ifunc frames as it
|
||||||
|
did before. [ruby-core:72409] [Bug #11851]
|
||||||
|
|
||||||
Mon Dec 21 09:33:17 2015 Karol Bucek <kares@users.noreply.github.com>
|
Mon Dec 21 09:33:17 2015 Karol Bucek <kares@users.noreply.github.com>
|
||||||
|
|
||||||
* ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLSocket): fix
|
* ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLSocket): fix
|
||||||
|
@ -102,4 +102,21 @@ class TestProfileFrames < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_ifunc_frame
|
||||||
|
bug11851 = '[ruby-core:72409] [Bug #11851]'
|
||||||
|
assert_ruby_status([], <<~'end;', bug11851) # do
|
||||||
|
require '-test-/debug'
|
||||||
|
class A
|
||||||
|
include Bug::Debug
|
||||||
|
def x
|
||||||
|
profile_frames(0, 10)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
def a
|
||||||
|
[A.new].each(&:x)
|
||||||
|
end
|
||||||
|
a
|
||||||
|
end;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -1248,25 +1248,25 @@ rb_profile_frames(int start, int limit, VALUE *buff, int *lines)
|
|||||||
int i;
|
int i;
|
||||||
rb_thread_t *th = GET_THREAD();
|
rb_thread_t *th = GET_THREAD();
|
||||||
rb_control_frame_t *cfp = th->cfp, *end_cfp = RUBY_VM_END_CONTROL_FRAME(th);
|
rb_control_frame_t *cfp = th->cfp, *end_cfp = RUBY_VM_END_CONTROL_FRAME(th);
|
||||||
|
const rb_callable_method_entry_t *cme;
|
||||||
|
|
||||||
for (i=0; i<limit && cfp != end_cfp;) {
|
for (i=0; i<limit && cfp != end_cfp;) {
|
||||||
const rb_callable_method_entry_t *cme = rb_vm_frame_method_entry(cfp);
|
if (cfp->iseq && cfp->pc) {
|
||||||
|
|
||||||
if ((cme && cme->def->type == VM_METHOD_TYPE_ISEQ) || (cfp->iseq && cfp->pc)) {
|
|
||||||
if (start > 0) {
|
if (start > 0) {
|
||||||
start--;
|
start--;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* record frame info */
|
/* record frame info */
|
||||||
if (cme) {
|
cme = rb_vm_frame_method_entry(cfp);
|
||||||
|
if (cme && cme->def->type == VM_METHOD_TYPE_ISEQ) {
|
||||||
buff[i] = (VALUE)cme;
|
buff[i] = (VALUE)cme;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
buff[i] = (VALUE)cfp->iseq;
|
buff[i] = (VALUE)cfp->iseq;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfp->iseq && lines) lines[i] = calc_lineno(cfp->iseq, cfp->pc);
|
if (lines) lines[i] = calc_lineno(cfp->iseq, cfp->pc);
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user