Changeset: a2beee2035ba for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a2beee2035ba
Modified Files:
monetdb5/mal/mal_interpreter.mx
Branch: default
Log Message:
Dealt with debugger flow of command
The SQL queries also injected a call to mdb.start(), which
should not overrule debugging flags already set.
Furthermore, now the next command walks over instructions
within the same block. To enter a called MAL function the
step ('s') command shoulde be used. Upon return the
debug mode is reset to what it was before the call
(except for 'x').
diffs (67 lines):
diff --git a/monetdb5/mal/mal_interpreter.mx b/monetdb5/mal/mal_interpreter.mx
--- a/monetdb5/mal/mal_interpreter.mx
+++ b/monetdb5/mal/mal_interpreter.mx
@@ -2026,7 +2026,7 @@
@= functioncall
{ MalStkPtr nstk;
InstrPtr q;
- int ii, arg;
+ int ii, arg, cmdsafe = 0, itracesafe = 0;
stk->pcup = stkpc;
@:safeTarget(@1)@
@@ -2054,18 +2054,21 @@
BBPincref(lhs->val.bval, TRUE);
}
/* show call before entering the function */
- if (cntxt->itrace || mb->trap) {
+ itracesafe = cntxt->itrace;
+ cmdsafe = stk->cmd;
+ if (stk->cmd =='s' || pci->blk->trap) {
lng t = 0;
- if (stk->cmd == 0)
- stk->cmd = cntxt->itrace;
+ stk->cmd = 's';
+
if (oldtimer)
t = GDKusec();
mdbStep(cntxt, pci->blk, nstk, 0);
if (stk->cmd == 'x' || cntxt->mode == FINISHING) {
stk->cmd = 0;
stkpc = mb->stop;
- }
+ cmdsafe = 'x';
+ }
if (oldtimer) {
/* ignore debugger waiting time*/
t = GDKusec() - t;
@@ -2076,9 +2079,26 @@
if (cntxt->flags & memoryFlag)
oldMemory = MT_mallinfo();
}
+ } else {
+ cntxt->itrace = 0;
+ stk->cmd = 'c';
}
- if ( stkpc != mb->stop)
- ret = runMALsequence(cntxt, pci->blk, 1, pci->blk->stop, nstk,
stk, pci);
+ if ( stkpc != mb->stop) {
+ /* reshuffle for profiling */
+ MalBlkPtr safemb = mb;
+ MalStkPtr safestk = stk;
+ mb = pci->blk;
+ stk = nstk;
+ @:beginProfile(stk,1)@
+ ret = runMALsequence(cntxt, pci->blk, 1, pci->blk->stop, nstk,
safestk, pci);
+ @:endProfile(stk,1)@
+ mb = safemb;
+ stk = safestk;
+ }
+ if ( itracesafe) {
+ cntxt->itrace = itracesafe;
+ stk->cmd = cmdsafe;
+ }
GDKfree(nstk);
@:restoreTarget(@1,@3)@
@:exceptionHndlr(@1,@2,@3)@
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list