Changeset: 8602674d1d43 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/8602674d1d43 Modified Files: monetdb5/mal/mal_debugger.c monetdb5/mal/mal_function.c Branch: default Log Message:
Simplify inspection of the history of MAL blocks, The format is L mod.fcn[idx] where idx the optimizer step is. diffs (118 lines): diff --git a/monetdb5/mal/mal_debugger.c b/monetdb5/mal/mal_debugger.c --- a/monetdb5/mal/mal_debugger.c +++ b/monetdb5/mal/mal_debugger.c @@ -1245,7 +1245,6 @@ retryRead: case 'L': case 'l': /* list the current MAL block or module */ { - Symbol fs; int lstng; lstng = LIST_MAL_NAME; @@ -1254,52 +1253,25 @@ retryRead: skipWord(cntxt, b); skipBlanc(cntxt, b); if (*b != 0) { - /* debug the current block */ + /* debug the block context */ MalBlkPtr m = mdbLocateMalBlk(cntxt, mb, b); + mnstr_printf(out, "#Inspect %s\n", b); - if ( m == 0) - m = mb; - if ( m ){ - const char *nme = getFunctionId(mb->stmt[0]); - str s = strstr(b, nme); - if( s ){ - b = s + strlen(nme); - skipBlanc(cntxt,b); - } - } - if (isdigit((unsigned char) *b) || *b == '-' || *b == '+') - goto partial; + if ( m ) + mb = m; - /* inspect another function */ - if( strchr(b,'.') ){ - str modnme = b; - str fcnnme; - fcnnme = strchr(b,'.'); - *fcnnme++ = 0; - b = fcnnme; - skipNonBlanc(cntxt, b); - if ( b) - *b++ = 0; - - fs = findSymbol(cntxt->usermodule, putName(modnme),putName(fcnnme)); - if (fs == 0) { - mnstr_printf(out, "#'%s' not found\n", modnme); - continue; - } - for(; fs; fs = fs->peer) - if( strcmp(fcnnme, fs->name)==0) { - if( lstng == LIST_MAL_NAME) - printFunction(out, fs->def, 0, lstng); - else - debugFunction(out, fs->def, 0, lstng, 0,mb->stop); - } - continue; + skipWord(cntxt, b); + skipBlanc(cntxt, b); + c = strchr(b,'.'); + if( c){ + b = c + 1; + skipWord(cntxt, b); + skipBlanc(cntxt, b); } - if (m){ - if( lstng == LIST_MAL_NAME) - printFunction(out, m, 0, lstng); - else - debugFunction(out, m, 0, lstng, 0,m->stop); + c = strchr(b,']'); + if (c){ + b = c + 1; + goto partial; } } else { /* @@ -1342,13 +1314,15 @@ partial: skipWord(cntxt, b); skipBlanc(cntxt, b); if (*b) { + mnstr_printf(out, "#History of %s\n", b); mdot = mdbLocateMalBlk(cntxt, mb, b); if (mdot != NULL) showMalBlkHistory(out, mdot); else mnstr_printf(out, "#'%s' not found\n", b); - } else + } else{ showMalBlkHistory(out, mb); + } break; } case 'r': /* reset program counter */ diff --git a/monetdb5/mal/mal_function.c b/monetdb5/mal/mal_function.c --- a/monetdb5/mal/mal_function.c +++ b/monetdb5/mal/mal_function.c @@ -413,7 +413,7 @@ debugFunction(stream *fd, MalBlkPtr mb, if (p->token == REMsymbol) mnstr_printf(fd,"%-40s\n",ps); else { - mnstr_printf(fd,"%-40s\t#[%d] ("BUNFMT") %s ",ps, i, getRowCnt(mb,getArg(p,0)), (p->blk? p->blk->binding:"")); + mnstr_printf(fd,"%-40s\t#[%d] %s ",ps, i, (p->blk? p->blk->binding:"")); if( flg & LIST_MAL_FLOW){ for(j =0; j < p->retc; j++) mnstr_printf(fd,"%d ",getArg(p,j)); @@ -422,9 +422,6 @@ debugFunction(stream *fd, MalBlkPtr mb, for(; j < p->argc; j++) mnstr_printf(fd,"%d ",getArg(p,j)); } - // also show type check property - if( p->typechk == TYPE_UNKNOWN) - mnstr_printf(fd," type check needed "); mnstr_printf(fd,"\n"); } GDKfree(ps); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list