From 8bcf7fc40266faa09cf8b6cebb2d96c1bb8d51ee Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 22 May 2012 08:31:38 +0000 Subject: * vm_core.h: add a data type rb_location_t to store iseq location information. rb_location_t#filename, filepath, name and line_no was moved from rb_iseq_t. rb_location_t#basename is a new field which is similar to `name' field without any decoration. `name' field contains some decoration such as `block in foo'. `basename' only contains `foo'. rb_iseq_t contains memory object of rb_location_t. * iseq.c: setup rb_location_t for each rb_iseq_t memory objects. * compile.c, proc.c, vm.c, vm_dump.c, vm_eval.c, vm_insnhelper.c, vm_method.c: support about it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_dump.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vm_dump.c') diff --git a/vm_dump.c b/vm_dump.c index 2ace3a5..133499c 100644 --- a/vm_dump.c +++ b/vm_dump.c @@ -38,7 +38,7 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp) VALUE tmp; if (cfp->block_iseq != 0 && BUILTIN_TYPE(cfp->block_iseq) != T_NODE) { - biseq_name = ""; /* RSTRING(cfp->block_iseq->name)->ptr; */ + biseq_name = ""; /* RSTRING(cfp->block_iseq->location.name)->ptr; */ } if (lfp < 0 || (size_t)lfp > th->stack_size) { @@ -110,10 +110,10 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp) } else { pc = cfp->pc - cfp->iseq->iseq_encoded; - iseq_name = RSTRING_PTR(cfp->iseq->name); + iseq_name = RSTRING_PTR(cfp->iseq->location.name); line = rb_vm_get_sourceline(cfp); if (line) { - snprintf(posbuf, MAX_POSBUF, "%s:%d", RSTRING_PTR(cfp->iseq->filename), line); + snprintf(posbuf, MAX_POSBUF, "%s:%d", RSTRING_PTR(cfp->iseq->location.filename), line); } } } @@ -271,7 +271,7 @@ vm_stack_dump_each(rb_thread_t *th, rb_control_frame_t *cfp) else { argc = iseq->argc; local_size = iseq->local_size; - name = RSTRING_PTR(iseq->name); + name = RSTRING_PTR(iseq->location.name); } /* stack trace header */ -- cgit v1.1