1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2008-11-08 19:10:36 +00:00
parent 9b139fe589
commit 7991c5e66e
2 changed files with 15 additions and 8 deletions

View file

@ -1,3 +1,7 @@
Sun Nov 9 04:10:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* vm_dump.c (control_frame_dump): suppresses finished method name.
Sun Nov 9 00:30:52 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* thread_pthread.c (thread_timer): checks working flags again.

View file

@ -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);