diff options
author | unknown <autotest@mc01.ndb.mysql.com> | 2004-06-03 13:15:54 +0200 |
---|---|---|
committer | unknown <autotest@mc01.ndb.mysql.com> | 2004-06-03 13:15:54 +0200 |
commit | 13047f4521ee1152cb2785291e17b51b1b92a2c1 (patch) | |
tree | 9ba0e38f11145ccb9a700c819fcb6eb07511602e /ndb/src | |
parent | 34e5cca1b7e32edf12b985bebe4a6228b524292b (diff) | |
download | mariadb-git-13047f4521ee1152cb2785291e17b51b1b92a2c1.tar.gz |
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
configure.in:
cleaned up ndb CXX flags and added optional flag possibility
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
NDB_DEBUG -> VM_TRACE
ndb/src/kernel/error/ErrorReporter.cpp:
USE_EMULATED_JAM -> !NO_EMULATED_JAM
ndb/src/kernel/error/ErrorReporter.hpp:
removed NDEBUG and removed THREAD_ASSERT
ndb/src/kernel/vm/Emulator.cpp:
USE_EMULATED_JAM -> !NO_EMULATED_JAM
ndb/src/kernel/vm/Emulator.hpp:
USE_EMULATED_JAM -> !NO_EMULATED_JAM
ndb/src/kernel/vm/pc.hpp:
USE_EMULATED_JAM -> !NO_EMULATED_JAM
ndb/src/ndbapi/Makefile.am:
local flag in ndbapi to set -O2 since problems occur with -O3
Diffstat (limited to 'ndb/src')
-rw-r--r-- | ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 2 | ||||
-rw-r--r-- | ndb/src/kernel/error/ErrorReporter.cpp | 30 | ||||
-rw-r--r-- | ndb/src/kernel/error/ErrorReporter.hpp | 10 | ||||
-rw-r--r-- | ndb/src/kernel/vm/Emulator.cpp | 10 | ||||
-rw-r--r-- | ndb/src/kernel/vm/Emulator.hpp | 19 | ||||
-rw-r--r-- | ndb/src/kernel/vm/pc.hpp | 15 | ||||
-rw-r--r-- | ndb/src/ndbapi/Makefile.am | 3 |
7 files changed, 38 insertions, 51 deletions
diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 084f41e4166..2ef9e721e22 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -111,7 +111,7 @@ Dbdict::execDUMP_STATE_ORD(Signal* signal) { jamEntry(); -#ifdef NDB_DEBUG +#ifdef VM_TRACE if(signal->theData[0] == 1222){ const Uint32 tab = signal->theData[1]; PrepDropTabReq* req = (PrepDropTabReq*)signal->getDataPtr(); diff --git a/ndb/src/kernel/error/ErrorReporter.cpp b/ndb/src/kernel/error/ErrorReporter.cpp index 56627cba46f..20a9dd8a993 100644 --- a/ndb/src/kernel/error/ErrorReporter.cpp +++ b/ndb/src/kernel/error/ErrorReporter.cpp @@ -40,8 +40,8 @@ const char* errorType[] = { static int WriteMessage(ErrorCategory thrdType, int thrdMessageID, const char* thrdProblemData, const char* thrdObjRef, - Uint32 thrdTheEmulatedJamIndex = 0, - Uint8 thrdTheEmulatedJam[] = 0); + Uint32 thrdTheEmulatedJamIndex, + Uint8 thrdTheEmulatedJam[]); static void dumpJam(FILE* jamStream, Uint32 thrdTheEmulatedJamIndex, @@ -157,21 +157,18 @@ ErrorReporter::handleAssert(const char* message, const char* file, int line) { 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 char *blockName = getBlockName(blockNumber); snprintf(refMessage, 100, "%s line: %d (block: %s)", file, line, blockName); - +#endif WriteMessage(assert, ERR_ERROR_PRGERR, message, refMessage, theEmulatedJamIndex, theEmulatedJam); -#else - snprintf(refMessage, 100, "file: %s lineNo: %d", - file, line); - - WriteMessage(assert, ERR_ERROR_PRGERR, message, refMessage); -#endif NdbShutdown(NST_ErrorHandler); } @@ -199,12 +196,8 @@ ErrorReporter::handleError(ErrorCategory type, int messageID, // 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 // the function that is called. -#ifdef USE_EMULATED_JAM WriteMessage(type, messageID, problemData, objRef, theEmulatedJamIndex, theEmulatedJam); -#else - WriteMessage(type, messageID, problemData, objRef); -#endif if(messageID == ERR_ERROR_INSERT){ NdbShutdown(NST_ErrorInsert); } else { @@ -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 WriteMessage(ErrorCategory thrdType, int thrdMessageID, const char* thrdProblemData, const char* thrdObjRef, @@ -302,9 +292,7 @@ WriteMessage(ErrorCategory thrdType, int thrdMessageID, // ...and "dump the jam" there. // ErrorReporter::dumpJam(jamStream); if(thrdTheEmulatedJam != 0){ -#ifdef USE_EMULATED_JAM dumpJam(jamStream, thrdTheEmulatedJamIndex, thrdTheEmulatedJam); -#endif } /* Dont print the jobBuffers until a way to copy them, @@ -325,7 +313,7 @@ void dumpJam(FILE *jamStream, Uint32 thrdTheEmulatedJamIndex, Uint8 thrdTheEmulatedJam[]) { -#ifdef USE_EMULATED_JAM +#ifndef NO_EMULATED_JAM // print header const int maxaddr = 8; fprintf(jamStream, "JAM CONTENTS up->down left->right ?=not block entry\n"); @@ -392,5 +380,5 @@ dumpJam(FILE *jamStream, } fprintf(jamStream, "\n"); fflush(jamStream); -#endif // USE_EMULATED_JAM +#endif // ifndef NO_EMULATED_JAM } diff --git a/ndb/src/kernel/error/ErrorReporter.hpp b/ndb/src/kernel/error/ErrorReporter.hpp index 20340a9602f..b43b30f1873 100644 --- a/ndb/src/kernel/error/ErrorReporter.hpp +++ b/ndb/src/kernel/error/ErrorReporter.hpp @@ -37,21 +37,13 @@ ErrorReporter::handleThreadAssert(message, __FILE__, __LINE__); } #ifdef NDEBUG - #define NDB_ASSERT(trueToContinue, message) -#define THREAD_ASSERT(trueToContinue, message) - #else - #define NDB_ASSERT(trueToContinue, message) \ if ( !(trueToContinue) ) { \ ErrorReporter::handleAssert(message, __FILE__, __LINE__); } - -#define THREAD_ASSERT(trueToContinue, message) \ - if ( !(trueToContinue) ) { \ - ErrorReporter::handleThreadAssert(message, __FILE__, __LINE__); } - #endif + // Description: // This macro is used to report programming errors. // Parameters: diff --git a/ndb/src/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp index 0d6d3f55acb..b615e41eb65 100644 --- a/ndb/src/kernel/vm/Emulator.cpp +++ b/ndb/src/kernel/vm/Emulator.cpp @@ -43,11 +43,11 @@ extern "C" { * Declare the global variables */ -#ifdef USE_EMULATED_JAM - Uint8 theEmulatedJam[EMULATED_JAM_SIZE * 4]; - Uint32 theEmulatedJamIndex = 0; - Uint32 theEmulatedJamBlockNumber = 0; -#endif // USE_EMULATED_JAM +#ifndef NO_EMULATED_JAM +Uint8 theEmulatedJam[EMULATED_JAM_SIZE * 4]; +Uint32 theEmulatedJamIndex = 0; +Uint32 theEmulatedJamBlockNumber = 0; +#endif GlobalData globalData; diff --git a/ndb/src/kernel/vm/Emulator.hpp b/ndb/src/kernel/vm/Emulator.hpp index ba533eb873d..8c4504b9ba7 100644 --- a/ndb/src/kernel/vm/Emulator.hpp +++ b/ndb/src/kernel/vm/Emulator.hpp @@ -36,15 +36,18 @@ extern struct GlobalData globalData; extern class SignalLoggerManager globalSignalLoggers; #endif -#ifdef USE_EMULATED_JAM -#define EMULATED_JAM_SIZE 1024 -#define JAM_MASK ((EMULATED_JAM_SIZE * 4) - 1) +#ifndef NO_EMULATED_JAM + #define EMULATED_JAM_SIZE 1024 + #define JAM_MASK ((EMULATED_JAM_SIZE * 4) - 1) -extern Uint8 theEmulatedJam[]; -extern Uint32 theEmulatedJamIndex; -// last block entry, used in dumpJam() if jam contains no block entries -extern Uint32 theEmulatedJamBlockNumber; -#endif // USE_EMULATED_JAM + extern Uint8 theEmulatedJam[]; + extern Uint32 theEmulatedJamIndex; + // last block entry, used in dumpJam() if jam contains no block entries + extern Uint32 theEmulatedJamBlockNumber; +#else + const Uint8 theEmulatedJam[]=0; + const Uint32 theEmulatedJamIndex=0; +#endif struct EmulatorData { class Configuration * theConfiguration; diff --git a/ndb/src/kernel/vm/pc.hpp b/ndb/src/kernel/vm/pc.hpp index 849799a47f3..bc74adfc8f6 100644 --- a/ndb/src/kernel/vm/pc.hpp +++ b/ndb/src/kernel/vm/pc.hpp @@ -22,8 +22,14 @@ #include <NdbOut.hpp> #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 #define jam() { \ @@ -72,11 +78,6 @@ #endif -#else -#define jam() -#define jamLine(line) -#define jamEntry() -#define jamEntryLine(line) #endif #ifndef NDB_OPT #define ptrCheck(ptr, limit, rec) if (ptr.i < (limit)) ptr.p = &rec[ptr.i]; else ptr.p = NULL @@ -184,7 +185,7 @@ * * NOTE these may only be used within blocks */ -#if defined VM_TRACE || defined NDB_DEBUG +#if defined VM_TRACE #define ndbassert(check) \ if((check)){ \ } else { \ diff --git a/ndb/src/ndbapi/Makefile.am b/ndb/src/ndbapi/Makefile.am index 9e2c97db3b5..79f5ce5fdf0 100644 --- a/ndb/src/ndbapi/Makefile.am +++ b/ndb/src/ndbapi/Makefile.am @@ -41,6 +41,9 @@ libndbapi_la_SOURCES = \ 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/type_ndbapi.mk.am |