Makefile.am:

  local flag in ndbapi to set -O2 since problems occur with -O3
pc.hpp, Emulator.hpp, Emulator.cpp, ErrorReporter.cpp:
  USE_EMULATED_JAM -> !NO_EMULATED_JAM
ErrorReporter.hpp:
  removed NDEBUG and removed THREAD_ASSERT
Dbdict.cpp:
  NDB_DEBUG -> VM_TRACE
configure.in:
  cleaned up ndb CXX flags and added optional flag possibility
parent 947abbab
...@@ -1614,19 +1614,15 @@ then ...@@ -1614,19 +1614,15 @@ then
# Medium debug. # Medium debug.
CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DDBUG_ON -DSAFE_MUTEX $CFLAGS" CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DDBUG_ON -DSAFE_MUTEX $CFLAGS"
CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS" CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS"
#NDB_DEFS="-DNDB_RELEASE -DUSE_EMULATED_JAM -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
NDB_DEFS="-DNDB_DEBUG -DUSE_EMULATED_JAM -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
elif test "$with_debug" = "full" elif test "$with_debug" = "full"
then then
# Full debug. Very slow in some cases # Full debug. Very slow in some cases
CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS" CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS"
CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS"
NDB_DEFS="-DNDB_DEBUG -DUSE_EMULATED_JAM -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
else else
# Optimized version. No debug # Optimized version. No debug
CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS" CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS"
CXXFLAGS="$OPTIMIZE_CXXFLAGS -DDBUG_OFF $CXXFLAGS" CXXFLAGS="$OPTIMIZE_CXXFLAGS -DDBUG_OFF $CXXFLAGS"
NDB_DEFS="-DNDB_RELEASE -DUSE_EMULATED_JAM -DNDEBUG"
fi fi
# Force static compilation to avoid linking problems/get more speed # Force static compilation to avoid linking problems/get more speed
...@@ -2863,7 +2859,19 @@ if test X"$have_ndbcluster" = Xyes ...@@ -2863,7 +2859,19 @@ if test X"$have_ndbcluster" = Xyes
then then
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster" MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster"
CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS)" if test "$with_debug" = "yes"
then
# Medium debug.
NDB_DEFS="-DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS) \$(NDB_CXXFLAGS_LOC) \$(NDB_CXXFLAGS_DEBUG_LOC)"
elif test "$with_debug" = "full"
then
NDB_DEFS="-DVM_TRACE -DERROR_INSERT -DARRAY_GUARD"
CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS) \$(NDB_CXXFLAGS_LOC) \$(NDB_CXXFLAGS_DEBUG_LOC)"
else
NDB_DEFS="-DNDEBUG"
CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS) \$(NDB_CXXFLAGS_LOC) \$(NDB_CXXFLAGS_RELEASE_LOC)"
fi
fi fi
AC_SUBST([NDB_DEFS]) AC_SUBST([NDB_DEFS])
......
...@@ -111,7 +111,7 @@ Dbdict::execDUMP_STATE_ORD(Signal* signal) ...@@ -111,7 +111,7 @@ Dbdict::execDUMP_STATE_ORD(Signal* signal)
{ {
jamEntry(); jamEntry();
#ifdef NDB_DEBUG #ifdef VM_TRACE
if(signal->theData[0] == 1222){ if(signal->theData[0] == 1222){
const Uint32 tab = signal->theData[1]; const Uint32 tab = signal->theData[1];
PrepDropTabReq* req = (PrepDropTabReq*)signal->getDataPtr(); PrepDropTabReq* req = (PrepDropTabReq*)signal->getDataPtr();
......
...@@ -40,8 +40,8 @@ const char* errorType[] = { ...@@ -40,8 +40,8 @@ const char* errorType[] = {
static int WriteMessage(ErrorCategory thrdType, int thrdMessageID, static int WriteMessage(ErrorCategory thrdType, int thrdMessageID,
const char* thrdProblemData, const char* thrdProblemData,
const char* thrdObjRef, const char* thrdObjRef,
Uint32 thrdTheEmulatedJamIndex = 0, Uint32 thrdTheEmulatedJamIndex,
Uint8 thrdTheEmulatedJam[] = 0); Uint8 thrdTheEmulatedJam[]);
static void dumpJam(FILE* jamStream, static void dumpJam(FILE* jamStream,
Uint32 thrdTheEmulatedJamIndex, Uint32 thrdTheEmulatedJamIndex,
...@@ -157,21 +157,18 @@ ErrorReporter::handleAssert(const char* message, const char* file, int line) ...@@ -157,21 +157,18 @@ ErrorReporter::handleAssert(const char* message, const char* file, int line)
{ {
char refMessage[100]; char refMessage[100];
#ifdef USE_EMULATED_JAM #ifdef NO_EMULATED_JAM
snprintf(refMessage, 100, "file: %s lineNo: %d",
file, line);
#else
const Uint32 blockNumber = theEmulatedJamBlockNumber; const Uint32 blockNumber = theEmulatedJamBlockNumber;
const char *blockName = getBlockName(blockNumber); const char *blockName = getBlockName(blockNumber);
snprintf(refMessage, 100, "%s line: %d (block: %s)", snprintf(refMessage, 100, "%s line: %d (block: %s)",
file, line, blockName); file, line, blockName);
#endif
WriteMessage(assert, ERR_ERROR_PRGERR, message, refMessage, WriteMessage(assert, ERR_ERROR_PRGERR, message, refMessage,
theEmulatedJamIndex, theEmulatedJam); theEmulatedJamIndex, theEmulatedJam);
#else
snprintf(refMessage, 100, "file: %s lineNo: %d",
file, line);
WriteMessage(assert, ERR_ERROR_PRGERR, message, refMessage);
#endif
NdbShutdown(NST_ErrorHandler); NdbShutdown(NST_ErrorHandler);
} }
...@@ -199,12 +196,8 @@ ErrorReporter::handleError(ErrorCategory type, int messageID, ...@@ -199,12 +196,8 @@ ErrorReporter::handleError(ErrorCategory type, int messageID,
// The value for type is not always set correctly in the calling function. // The value for type is not always set correctly in the calling function.
// So, to correct this, we set it set it to the value corresponding to // So, to correct this, we set it set it to the value corresponding to
// the function that is called. // the function that is called.
#ifdef USE_EMULATED_JAM
WriteMessage(type, messageID, problemData, WriteMessage(type, messageID, problemData,
objRef, theEmulatedJamIndex, theEmulatedJam); objRef, theEmulatedJamIndex, theEmulatedJam);
#else
WriteMessage(type, messageID, problemData, objRef);
#endif
if(messageID == ERR_ERROR_INSERT){ if(messageID == ERR_ERROR_INSERT){
NdbShutdown(NST_ErrorInsert); NdbShutdown(NST_ErrorInsert);
} else { } else {
...@@ -212,9 +205,6 @@ ErrorReporter::handleError(ErrorCategory type, int messageID, ...@@ -212,9 +205,6 @@ ErrorReporter::handleError(ErrorCategory type, int messageID,
} }
} }
// This is the function to write the error-message,
// when the USE_EMULATED_JAM-flag is set
// during compilation.
int int
WriteMessage(ErrorCategory thrdType, int thrdMessageID, WriteMessage(ErrorCategory thrdType, int thrdMessageID,
const char* thrdProblemData, const char* thrdObjRef, const char* thrdProblemData, const char* thrdObjRef,
...@@ -302,9 +292,7 @@ WriteMessage(ErrorCategory thrdType, int thrdMessageID, ...@@ -302,9 +292,7 @@ WriteMessage(ErrorCategory thrdType, int thrdMessageID,
// ...and "dump the jam" there. // ...and "dump the jam" there.
// ErrorReporter::dumpJam(jamStream); // ErrorReporter::dumpJam(jamStream);
if(thrdTheEmulatedJam != 0){ if(thrdTheEmulatedJam != 0){
#ifdef USE_EMULATED_JAM
dumpJam(jamStream, thrdTheEmulatedJamIndex, thrdTheEmulatedJam); dumpJam(jamStream, thrdTheEmulatedJamIndex, thrdTheEmulatedJam);
#endif
} }
/* Dont print the jobBuffers until a way to copy them, /* Dont print the jobBuffers until a way to copy them,
...@@ -325,7 +313,7 @@ void ...@@ -325,7 +313,7 @@ void
dumpJam(FILE *jamStream, dumpJam(FILE *jamStream,
Uint32 thrdTheEmulatedJamIndex, Uint32 thrdTheEmulatedJamIndex,
Uint8 thrdTheEmulatedJam[]) { Uint8 thrdTheEmulatedJam[]) {
#ifdef USE_EMULATED_JAM #ifndef NO_EMULATED_JAM
// print header // print header
const int maxaddr = 8; const int maxaddr = 8;
fprintf(jamStream, "JAM CONTENTS up->down left->right ?=not block entry\n"); fprintf(jamStream, "JAM CONTENTS up->down left->right ?=not block entry\n");
...@@ -392,5 +380,5 @@ dumpJam(FILE *jamStream, ...@@ -392,5 +380,5 @@ dumpJam(FILE *jamStream,
} }
fprintf(jamStream, "\n"); fprintf(jamStream, "\n");
fflush(jamStream); fflush(jamStream);
#endif // USE_EMULATED_JAM #endif // ifndef NO_EMULATED_JAM
} }
...@@ -37,21 +37,13 @@ ...@@ -37,21 +37,13 @@
ErrorReporter::handleThreadAssert(message, __FILE__, __LINE__); } ErrorReporter::handleThreadAssert(message, __FILE__, __LINE__); }
#ifdef NDEBUG #ifdef NDEBUG
#define NDB_ASSERT(trueToContinue, message) #define NDB_ASSERT(trueToContinue, message)
#define THREAD_ASSERT(trueToContinue, message)
#else #else
#define NDB_ASSERT(trueToContinue, message) \ #define NDB_ASSERT(trueToContinue, message) \
if ( !(trueToContinue) ) { \ if ( !(trueToContinue) ) { \
ErrorReporter::handleAssert(message, __FILE__, __LINE__); } ErrorReporter::handleAssert(message, __FILE__, __LINE__); }
#define THREAD_ASSERT(trueToContinue, message) \
if ( !(trueToContinue) ) { \
ErrorReporter::handleThreadAssert(message, __FILE__, __LINE__); }
#endif #endif
// Description: // Description:
// This macro is used to report programming errors. // This macro is used to report programming errors.
// Parameters: // Parameters:
......
...@@ -43,11 +43,11 @@ extern "C" { ...@@ -43,11 +43,11 @@ extern "C" {
* Declare the global variables * Declare the global variables
*/ */
#ifdef USE_EMULATED_JAM #ifndef NO_EMULATED_JAM
Uint8 theEmulatedJam[EMULATED_JAM_SIZE * 4]; Uint8 theEmulatedJam[EMULATED_JAM_SIZE * 4];
Uint32 theEmulatedJamIndex = 0; Uint32 theEmulatedJamIndex = 0;
Uint32 theEmulatedJamBlockNumber = 0; Uint32 theEmulatedJamBlockNumber = 0;
#endif // USE_EMULATED_JAM #endif
GlobalData globalData; GlobalData globalData;
......
...@@ -36,15 +36,18 @@ extern struct GlobalData globalData; ...@@ -36,15 +36,18 @@ extern struct GlobalData globalData;
extern class SignalLoggerManager globalSignalLoggers; extern class SignalLoggerManager globalSignalLoggers;
#endif #endif
#ifdef USE_EMULATED_JAM #ifndef NO_EMULATED_JAM
#define EMULATED_JAM_SIZE 1024 #define EMULATED_JAM_SIZE 1024
#define JAM_MASK ((EMULATED_JAM_SIZE * 4) - 1) #define JAM_MASK ((EMULATED_JAM_SIZE * 4) - 1)
extern Uint8 theEmulatedJam[]; extern Uint8 theEmulatedJam[];
extern Uint32 theEmulatedJamIndex; extern Uint32 theEmulatedJamIndex;
// last block entry, used in dumpJam() if jam contains no block entries // last block entry, used in dumpJam() if jam contains no block entries
extern Uint32 theEmulatedJamBlockNumber; extern Uint32 theEmulatedJamBlockNumber;
#endif // USE_EMULATED_JAM #else
const Uint8 theEmulatedJam[]=0;
const Uint32 theEmulatedJamIndex=0;
#endif
struct EmulatorData { struct EmulatorData {
class Configuration * theConfiguration; class Configuration * theConfiguration;
......
...@@ -22,8 +22,14 @@ ...@@ -22,8 +22,14 @@
#include <NdbOut.hpp> #include <NdbOut.hpp>
#include <ndb_limits.h> #include <ndb_limits.h>
#ifdef USE_EMULATED_JAM #ifdef NO_EMULATED_JAM
#define jam()
#define jamLine(line)
#define jamEntry()
#define jamEntryLine(line)
#else
#ifdef NDB_WIN32 #ifdef NDB_WIN32
#define jam() { \ #define jam() { \
...@@ -72,11 +78,6 @@ ...@@ -72,11 +78,6 @@
#endif #endif
#else
#define jam()
#define jamLine(line)
#define jamEntry()
#define jamEntryLine(line)
#endif #endif
#ifndef NDB_OPT #ifndef NDB_OPT
#define ptrCheck(ptr, limit, rec) if (ptr.i < (limit)) ptr.p = &rec[ptr.i]; else ptr.p = NULL #define ptrCheck(ptr, limit, rec) if (ptr.i < (limit)) ptr.p = &rec[ptr.i]; else ptr.p = NULL
...@@ -184,7 +185,7 @@ ...@@ -184,7 +185,7 @@
* *
* NOTE these may only be used within blocks * NOTE these may only be used within blocks
*/ */
#if defined VM_TRACE || defined NDB_DEBUG #if defined VM_TRACE
#define ndbassert(check) \ #define ndbassert(check) \
if((check)){ \ if((check)){ \
} else { \ } else { \
......
...@@ -41,6 +41,9 @@ libndbapi_la_SOURCES = \ ...@@ -41,6 +41,9 @@ libndbapi_la_SOURCES = \
INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmapi INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmapi
# Ndbapi cannot handle -O3
NDB_CXXFLAGS_RELEASE_LOC = -O2
include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/common.mk.am
include $(top_srcdir)/ndb/config/type_ndbapi.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment