Changeset: 4106c35a59cd for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4106c35a59cd
Modified Files:
clients/Tests/exports.stable.out
monetdb5/mal/CMakeLists.txt
monetdb5/mal/mal.c
monetdb5/mal/mal.h
monetdb5/mal/mal_client.c
monetdb5/mal/mal_client.h
monetdb5/mal/mal_dataflow.c
monetdb5/mal/mal_embedded.c
monetdb5/mal/mal_interpreter.c
monetdb5/mal/mal_interpreter.h
monetdb5/mal/mal_private.h
monetdb5/mal/mal_scenario.c
monetdb5/mal/mal_session.c
monetdb5/modules/kernel/bat5.c
monetdb5/modules/mal/mdb.c
monetdb5/optimizer/opt_evaluate.c
sql/backends/monet5/sql_execute.c
sql/backends/monet5/sql_optimizer.c
sql/backends/monet5/sql_scenario.c
sql/server/sql_mvc.h
sql/server/sql_parser.y
sql/server/sql_scan.c
tools/monetdbe/monetdbe.c
Branch: simplify_scenario
Log Message:
removed mal_debugger code
diffs (truncated from 1297 to 300 lines):
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -828,7 +828,7 @@ const char *bindidxRef;
const char *blockRef;
const char *bstreamRef;
const char *calcRef;
-str callMAL(Client cntxt, MalBlkPtr mb, MalStkPtr *glb, ValPtr argv[], char
debug);
+str callMAL(Client cntxt, MalBlkPtr mb, MalStkPtr *glb, ValPtr argv[]);
const char *capiRef;
str chkDeclarations(MalBlkPtr mb);
str chkFlow(MalBlkPtr mb);
diff --git a/monetdb5/mal/CMakeLists.txt b/monetdb5/mal/CMakeLists.txt
--- a/monetdb5/mal/CMakeLists.txt
+++ b/monetdb5/mal/CMakeLists.txt
@@ -36,7 +36,6 @@ target_sources(mal
mal_authorize.c
mal_builder.c mal_builder.h
mal_client.c
- mal_debugger.c mal_debugger.h
mal_exception.c
mal_function.c mal_function.h
mal_import.c
diff --git a/monetdb5/mal/mal.c b/monetdb5/mal/mal.c
--- a/monetdb5/mal/mal.c
+++ b/monetdb5/mal/mal.c
@@ -165,21 +165,12 @@ mal_init(char *modules[], bool embedded,
if (!MCinit())
return -1;
-#ifndef NDEBUG
- if (!mdbInit()) {
- mal_client_reset();
- return -1;
- }
-#endif
initNamespace();
initParser();
err = malBootstrap(modules, embedded, initpasswd);
if (err != MAL_SUCCEED) {
mal_client_reset();
-#ifndef NDEBUG
- mdbExit();
-#endif
TRC_CRITICAL(MAL_SERVER, "%s\n", err);
freeException(err);
return -1;
@@ -225,9 +216,6 @@ void mal_reset(void)
mal_runtime_reset();
mal_module_reset();
mal_atom_reset();
-#ifndef NDEBUG
- mdbExit();
-#endif
memset((char*)monet_cwd, 0, sizeof(monet_cwd));
memset((char*)monet_characteristics,0, sizeof(monet_characteristics));
diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h
--- a/monetdb5/mal/mal.h
+++ b/monetdb5/mal/mal.h
@@ -218,7 +218,6 @@ typedef struct MALSTK {
* for use in profiling instructions.
*/
struct timeval clock; /* time this stack was created */
- char cmd; /* debugger and runtime
communication */
char status; /* srunning 'R' suspended 'S', quiting
'Q' */
int pcup; /* saved pc upon a recursive
all */
oid tag; /* unique invocation call tag */
diff --git a/monetdb5/mal/mal_client.c b/monetdb5/mal/mal_client.c
--- a/monetdb5/mal/mal_client.c
+++ b/monetdb5/mal/mal_client.c
@@ -273,7 +273,6 @@ MCinitClientRecord(Client c, oid user, b
ATOMIC_SET(&c->qryctx.datasize, 0);
c->qryctx.maxmem = 0;
c->maxmem = 0;
- c->itrace = 0;
c->errbuf = 0;
prompt = PROMPT1;
@@ -587,7 +586,6 @@ MCsuspendClient(int id)
{
if (id < 0 || id >= MAL_MAXCLIENTS)
throw(INVCRED, "mal.clients", INVCRED_WRONG_ID);
- mal_clients[id].itrace = 'S';
return MAL_SUCCEED;
}
@@ -596,7 +594,6 @@ MCawakeClient(int id)
{
if (id < 0 || id >= MAL_MAXCLIENTS)
throw(INVCRED, "mal.clients", INVCRED_WRONG_ID);
- mal_clients[id].itrace = 0;
return MAL_SUCCEED;
}
diff --git a/monetdb5/mal/mal_client.h b/monetdb5/mal/mal_client.h
--- a/monetdb5/mal/mal_client.h
+++ b/monetdb5/mal/mal_client.h
@@ -58,9 +58,7 @@ typedef struct CLIENT {
*/
str scenario; /* scenario management references */
str oldscenario;
- void *state[SCENARIO_PROPERTIES], *oldstate[SCENARIO_PROPERTIES];
MALfcn phase[SCENARIO_PROPERTIES], oldphase[SCENARIO_PROPERTIES];
- char itrace; /* trace execution using interactive mdb */
/* if set to 'S' it will put
the process to sleep */
bit sqlprofiler; /* control off-line sql
performance monitoring */
/*
diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c
--- a/monetdb5/mal/mal_dataflow.c
+++ b/monetdb5/mal/mal_dataflow.c
@@ -812,15 +812,10 @@ runMALdataflow(Client cntxt, MalBlkPtr m
bit *ret;
int i;
- /* in debugging mode we should not start multiple threads */
if (stk == NULL)
throw(MAL, "dataflow", "runMALdataflow(): Called with stk ==
NULL");
ret = getArgReference_bit(stk,getInstrPtr(mb,startpc),0);
*ret = FALSE;
- if (stk->cmd) {
- *ret = TRUE;
- return MAL_SUCCEED;
- }
assert(stoppc > startpc);
diff --git a/monetdb5/mal/mal_embedded.c b/monetdb5/mal/mal_embedded.c
--- a/monetdb5/mal/mal_embedded.c
+++ b/monetdb5/mal/mal_embedded.c
@@ -89,12 +89,6 @@ malEmbeddedBoot(int workerlimit, int mem
if (!MCinit())
throw(MAL, "malEmbeddedBoot", "MAL debugger failed to start");
-#ifndef NDEBUG
- if (!mdbInit()) {
- mal_client_reset();
- throw(MAL, "malEmbeddedBoot", "MAL debugger failed to start");
- }
-#endif
// monet_memory = MT_npages() * MT_pagesize();
initNamespace();
initParser();
@@ -194,9 +188,6 @@ malEmbeddedReset(void) //remove extra mo
mal_runtime_reset();
mal_module_reset();
mal_atom_reset();
-#ifndef NDEBUG
- mdbExit();
-#endif
memset((char*)monet_cwd, 0, sizeof(monet_cwd));
memset((char*)monet_characteristics,0, sizeof(monet_characteristics));
diff --git a/monetdb5/mal/mal_interpreter.c b/monetdb5/mal/mal_interpreter.c
--- a/monetdb5/mal/mal_interpreter.c
+++ b/monetdb5/mal/mal_interpreter.c
@@ -17,7 +17,6 @@
#include "mal_interpreter.h"
#include "mal_resource.h"
#include "mal_listing.h"
-#include "mal_debugger.h" /* for mdbStep() */
#include "mal_type.h"
#include "mal_private.h"
#include "mal_internal.h"
@@ -330,7 +329,6 @@ runMAL(Client cntxt, MalBlkPtr mb, MalBl
if (stk == 0)
throw(MAL, "mal.interpreter", MAL_STACK_FAIL);
stk->blk = mb;
- stk->cmd = cntxt->itrace; /* set debug mode */
/*safeguardStack*/
if( env){
stk->stkdepth = stk->stksize + env->stkdepth;
@@ -348,13 +346,8 @@ runMAL(Client cntxt, MalBlkPtr mb, MalBl
* been observed due the small size of the function).
*/
}
- if (stk->cmd && env && stk->cmd != 'f')
- stk->cmd = env->cmd;
ret = runMALsequence(cntxt, mb, 1, 0, stk, env, 0);
- /* pass the new debug mode to the caller */
- if (stk->cmd && env && stk->cmd != 'f')
- env->cmd = stk->cmd;
if (!stk->keepAlive && garbageControl(getInstrPtr(mb, 0)))
garbageCollector(cntxt, mb, stk, env != stk);
if (stk && stk != env)
@@ -384,7 +377,6 @@ reenterMAL(Client cntxt, MalBlkPtr mb, i
keepAlive = stk->keepAlive;
ret = runMALsequence(cntxt, mb, startpc, stoppc, stk, 0, 0);
- /* pass the new debug mode to the caller */
if (keepAlive == 0 && garbageControl(getInstrPtr(mb, 0)))
garbageCollector(cntxt, mb, stk, stk != 0);
return ret;
@@ -399,7 +391,7 @@ reenterMAL(Client cntxt, MalBlkPtr mb, i
* The call does not return values, they are ignored.
*/
str
-callMAL(Client cntxt, MalBlkPtr mb, MalStkPtr *env, ValPtr argv[], char debug)
+callMAL(Client cntxt, MalBlkPtr mb, MalStkPtr *env, ValPtr argv[])
{
MalStkPtr stk = NULL;
str ret = MAL_SUCCEED;
@@ -439,7 +431,6 @@ callMAL(Client cntxt, MalBlkPtr mb, MalS
if (lhs->vtype == TYPE_bat)
BBPretain(lhs->val.bval);
}
- stk->cmd = debug;
ret = runMALsequence(cntxt, mb, 1, 0, stk, 0, 0);
break;
case PATcall:
@@ -539,28 +530,6 @@ runMALsequence(Client cntxt, MalBlkPtr m
ret= createException(MAL, "mal.interpreter",
"prematurely stopped client");
break;
}
-#ifndef NDEBUG
- if (cntxt->itrace || stk->status) {
- if (stk->status == 'p'){
- // execution is paused
- while (stk->status == 'p')
- MT_sleep_ms(50);
- continue;
- }
- if (stk->status == 'q')
- stk->cmd = 'x';
-
- if (stk->cmd == 0)
- stk->cmd = cntxt->itrace;
- mdbStep(cntxt, mb, stk, stkpc);
- if (stk->cmd == 'x' ) {
- stk->cmd = 0;
- stkpc = mb->stop;
- ret= createException(MAL, "mal.interpreter",
"prematurely stopped client");
- break;
- }
- }
-#endif
//Ensure we spread system resources over multiple users as well.
runtimeProfileBegin(cntxt, mb, stk, pci, &runtimeProfile);
@@ -816,7 +785,6 @@ runMALsequence(Client cntxt, MalBlkPtr m
if( mb->stop <= 1)
continue;
runtimeProfileExit(cntxt, mb, stk, pci, &runtimeProfile);
- /* check for strong debugging after each MAL statement */
/* when we find a timeout situation, then the result is already
known
* and assigned, the backup version is not removed*/
if (ret== MAL_SUCCEED) {
@@ -884,23 +852,6 @@ runMALsequence(Client cntxt, MalBlkPtr m
if (ret != MAL_SUCCEED) {
str msg = 0;
-#ifndef NDEBUG
- if (stk->cmd) {
- mnstr_printf(cntxt->fdout, "!ERROR: %s\n", ret);
- stk->cmd = '\n'; /* in debugging go to step
mode */
- mdbStep(cntxt, mb, stk, stkpc);
- if (stk->cmd == 'x' || stk->cmd == 'q' ) {
- stkpc = mb->stop;
- continue;
- }
- if (stk->cmd == 'r') {
- stk->cmd = 'n';
- stkpc = startpc;
- exceptionVar = -1;
- continue;
- }
- }
-#endif
/* Detect any exception received from the
implementation. */
/* The first identifier is an optional exception name */
if (strstr(ret, "!skip-to-end")) {
@@ -947,16 +898,6 @@ runMALsequence(Client cntxt, MalBlkPtr m
}
/* position yourself at the catch instruction for
further decisions */
/* skipToCatch(exceptionVar,@2,@3) */
-#ifndef NDEBUG
- if (stk->cmd == 'C') {
- stk->cmd = 'n';
- mdbStep(cntxt, mb, stk, stkpc);
- if (stk->cmd == 'x' ) {
- stkpc = mb->stop;
- continue;
- }
- }
-#endif
/* skip to catch block or end */
for (; stkpc < mb->stop; stkpc++) {
InstrPtr l = getInstrPtr(mb, stkpc);
@@ -1134,16 +1075,6 @@ runMALsequence(Client cntxt, MalBlkPtr m
ret = createException(MAL, nme, "%s",
stk->stk[getDestVar(pci)].val.sval);
}
/* skipToCatch(exceptionVar, @2, stk) */
-#ifndef NDEBUG
- if (stk->cmd == 'C') {
- stk->cmd = 'n';
- mdbStep(cntxt, mb, stk, stkpc);
- if (stk->cmd == 'x' ) {
- stkpc = mb->stop;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]