summaryrefslogtreecommitdiff
path: root/vm_dump.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-08 19:10:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-08 19:10:36 +0000
commit7991c5e66e5686cdcce002cefb5bafbad0e9fd6c (patch)
tree6667155a3ca42ac1820f235f254984c4919184b6 /vm_dump.c
parent9b139fe5892388653b1c213c633e031c778bd875 (diff)
* vm_dump.c (control_frame_dump): suppresses finished method name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/vm_dump.c b/vm_dump.c
index c6e30fb..5813f6b 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -25,6 +25,7 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
ptrdiff_t dfp = cfp->dfp - th->stack;
char lfp_in_heap = ' ', dfp_in_heap = ' ';
char posbuf[MAX_POSBUF+1];
+ int nopos = 0;
const char *magic, *iseq_name = "-", *selfstr = "-", *biseq_name = "-";
VALUE tmp;
@@ -60,6 +61,7 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
break;
case VM_FRAME_MAGIC_FINISH:
magic = "FINISH";
+ nopos = 1;
break;
case VM_FRAME_MAGIC_CFUNC:
magic = "CFUNC";
@@ -92,7 +94,10 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
selfstr = "";
}
- if (cfp->iseq != 0) {
+ if (nopos) {
+ /* no name */
+ }
+ else if (cfp->iseq != 0) {
if (RUBY_VM_IFUNC_P(cfp->iseq)) {
iseq_name = "<ifunc>";
}
@@ -103,9 +108,7 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
iseq_name = RSTRING_PTR(cfp->iseq->name);
line = vm_get_sourceline(cfp);
if (line) {
- char fn[MAX_POSBUF+1];
- snprintf(fn, MAX_POSBUF, "%s", RSTRING_PTR(cfp->iseq->filename));
- snprintf(posbuf, MAX_POSBUF, "%s:%d", fn, line);
+ snprintf(posbuf, MAX_POSBUF, "%s:%d", RSTRING_PTR(cfp->iseq->filename), line);
}
}
}
@@ -126,12 +129,12 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
fprintf(stderr, "s:%04"PRIdPTRDIFF" b:%04d ", (cfp->sp - th->stack), bp);
fprintf(stderr, lfp_in_heap == ' ' ? "l:%06"PRIdPTRDIFF" " : "l:%06"PRIxPTRDIFF" ", lfp % 10000);
fprintf(stderr, dfp_in_heap == ' ' ? "d:%06"PRIdPTRDIFF" " : "d:%06"PRIxPTRDIFF" ", dfp % 10000);
- fprintf(stderr, "%-6s ", magic);
- if (line) {
- fprintf(stderr, "%s", posbuf);
+ fprintf(stderr, "%-6s", magic);
+ if (line && !nopos) {
+ fprintf(stderr, " %s", posbuf);
}
if (0) {
- fprintf(stderr, " \t");
+ fprintf(stderr, " \t");
fprintf(stderr, "iseq: %-24s ", iseq_name);
fprintf(stderr, "self: %-24s ", selfstr);
fprintf(stderr, "%-1s ", biseq_name);