Changeset: 6c55305d59fd for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6c55305d59fd
Modified Files:
        monetdb5/mal/mal_function.c
        monetdb5/mal/mal_function.h
Branch: SciQL-2
Log Message:

debugFunction that exists in default added in SciQL


diffs (53 lines):

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
@@ -466,6 +466,30 @@ cloneFunction(stream *out, Module scope,
  * is returned.
  */
 void
+debugFunction(stream *fd, MalBlkPtr mb, MalStkPtr stk, int flg, int first, int 
size)
+{
+       int i;
+       str ps;
+       InstrPtr p;
+
+       if (mb == NULL) {
+               mnstr_printf(fd, "# function definition missing\n");
+               return;
+       }
+       if ( flg == 0)
+               return;
+       assert(size>=0);
+       assert(first>=0 && first <mb->stop);
+       for (i = first; i < first +size && i < mb->stop; i++){
+               ps = instruction2str(mb, stk, (p=getInstrPtr(mb, i)), flg);
+               if (ps) {
+                       mnstr_printf(fd,"%-40s\t# %s\n",ps, (p->blk && 
p->blk->binding? p->blk->binding:""));
+                       GDKfree(ps);
+               }
+       }
+}
+
+void
 listFunction(stream *fd, MalBlkPtr mb, MalStkPtr stk, int flg, int first, int 
size)
 {
        int i;
@@ -499,6 +523,7 @@ listFunction(stream *fd, MalBlkPtr mb, M
        for (i = first; i < first +size && i < mb->stop; i++)
                printInstruction(fd, mb, stk, getInstrPtr(mb, i), flg);
 }
+
 void printFunction(stream *fd, MalBlkPtr mb, MalStkPtr stk, int flg)
 {
        listFunction(fd,mb,stk,flg,0,mb->stop);
diff --git a/monetdb5/mal/mal_function.h b/monetdb5/mal/mal_function.h
--- a/monetdb5/mal/mal_function.h
+++ b/monetdb5/mal/mal_function.h
@@ -39,6 +39,7 @@ mal_export int getBlockBegin(MalBlkPtr m
 mal_export Lifespan setLifespan(MalBlkPtr mb);
 
 mal_export void printFunction(stream *fd, MalBlkPtr mb, MalStkPtr stk, int 
flg);
+mal_export void debugFunction(stream *fd, MalBlkPtr mb, MalStkPtr stk, int 
flg, int first, int size);
 mal_export void showFlowGraph(MalBlkPtr mb, MalStkPtr stk, str fname);
 
 #include "mal_exception.h"
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to