Update of /cvsroot/monetdb/MonetDB5/src/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11635

Modified Files:
        mal_debugger.mx mal_session.mx 
Log Message:
Make the MAL debugger dump available for direct calls.
Terminate a debugging run with the EOD message.


Index: mal_debugger.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_debugger.mx,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -d -r1.201 -r1.202
--- mal_debugger.mx     15 Aug 2007 11:05:26 -0000      1.201
+++ mal_debugger.mx     16 Aug 2007 07:00:44 -0000      1.202
@@ -473,7 +473,7 @@
 mal_export void mdbCommand(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
p, int pc);
 mal_export int mdbSession(void);
 mal_export void mdbStep(Client cntxt, MalBlkPtr mb, MalStkPtr stk, int pc);
-mal_export void mdbDump(Client cntxt, MalBlkPtr mb, MalStkPtr stk, int pc);
+mal_export void mdbDump(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 mal_export void mdbHelp(stream *f);
 mal_export void printStackElm(stream *f, MalBlkPtr mb, VarPtr n, ValPtr v, int 
index, size_t cnt, int first, int lifespan);
 mal_export void printBATelm(stream *f, int i, size_t cnt, size_t first);
@@ -759,7 +759,7 @@
 {
        str msg;
        msg = call2str(mb, stk, pc, cntxt->flags);
-       stream_printf(cntxt->fdout, "%s at %s.%s[%d]\n", msg, 
+       stream_printf(cntxt->fdout, "#%s at %s.%s[%d]\n", msg, 
                getModuleId(getInstrPtr(mb,0)),
                getFunctionId(getInstrPtr(mb,0)),pc);
        GDKfree(msg);
@@ -1376,10 +1376,12 @@
 }
 
 void 
-mdbDump(Client cntxt, MalBlkPtr mb, MalStkPtr stk, int pc){
-       stream_printf(cntxt->fdout,"!MDB dump of instruction %d\n",pc);
+mdbDump(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci){
+       Client cntxt= MCgetClient();
+       int i= getPC(mb,pci);
+       stream_printf(cntxt->fdout,"!MDB dump of instruction %d\n",i);
        printFunction(cntxt->fdout, mb, LIST_MAL_ALL | LIST_MAL_PROPS);
-       mdbBacktrace(cntxt, stk, pc);
+       mdbBacktrace(cntxt, stk, i);
        printStack(cntxt->fdout,mb,stk,0);
 }
 static int mdbSessionActive;
@@ -1476,6 +1478,7 @@
                /* return from this debugger */
                for (su = stk; su; su = su->up)
                        su->cmd = 0;
+               stream_printf(cntxt->fdout,"mdb>#EOD\n");
                stk->cmd = 'x'; /* will force a graceful termination */
        }
        if( mdbSessionActive== 0) return;

Index: mal_session.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_session.mx,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -r1.137 -r1.138
--- mal_session.mx      2 Jun 2007 21:17:37 -0000       1.137
+++ mal_session.mx      16 Aug 2007 07:00:45 -0000      1.138
@@ -696,6 +696,8 @@
                prg->def->profiler= NULL;
        }
        prg->def->errors = 0;
+       if( c->itrace)
+               stream_printf(c->fdout,"mdb>#EOD\n");
        return msg;
 }
 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to