#include <ndb_global.h>#include <BaseString.hpp>#include "DebuggerNames.hpp"#include <BlockNumbers.h>#include <GlobalSignalNumbers.h>#include <signaldata/SignalDataPrint.hpp>Include dependency graph for DebuggerNames.cpp:

Go to the source code of this file.
Functions | |
| static int | initSignalNames (const char *dst[], const GsnName src[], unsigned short len) |
| static int | initSignalPrinters (SignalDataPrintFunction dst[], const NameFunctionPair src[]) |
| static int | initBlockNames (const char *dst[], const BlockName src[], unsigned len) |
| const char * | getSignalName (unsigned short gsn, const char *defVal) |
| unsigned short | getGsn (const char *signalName) |
| const char * | getBlockName (unsigned short blockNo, const char *ret) |
| unsigned short | getBlockNo (const char *blockName) |
| SignalDataPrintFunction | findPrintFunction (unsigned short gsn) |
Variables | |
| static const char * | localSignalNames [MAX_GSN+1] |
| static SignalDataPrintFunction | localPrintFunctions [MAX_GSN+1] |
| static const char * | localBlockNames [NO_OF_BLOCKS] |
| static const int | xxx_DUMMY_SIGNAL_NAMES_xxx |
| static const int | xxx_DUMMY_PRINT_FUNCTIONS_xxx |
| static const int | xxx_DUMMY_BLOCK_NAMES_xxx |
| SignalDataPrintFunction findPrintFunction | ( | unsigned short | gsn | ) |
Definition at line 150 of file DebuggerNames.cpp.
References localPrintFunctions, and MAX_GSN.
00150 { 00151 if(gsn > 0 && gsn <= MAX_GSN) 00152 return localPrintFunctions[gsn]; 00153 return 0; 00154 }
| const char* getBlockName | ( | unsigned short | blockNo, | |
| const char * | ret | |||
| ) |
Definition at line 130 of file DebuggerNames.cpp.
References buf, localBlockNames, MAX_BLOCK_NO, MIN_BLOCK_NO, and BaseString::snprintf().
00130 { 00131 if(blockNo >= MIN_BLOCK_NO && blockNo <= MAX_BLOCK_NO) 00132 return localBlockNames[blockNo-MIN_BLOCK_NO]; 00133 if (ret == 0) { 00134 static char buf[20]; 00135 BaseString::snprintf(buf, sizeof(buf), "BLOCK#%d", (int)blockNo); 00136 return buf; 00137 } 00138 return ret; 00139 }
Here is the call graph for this function:

| unsigned short getBlockNo | ( | const char * | blockName | ) |
getBlockNo
NOTES: Very slow
RETURNS: BlockNo or 0 if none found
Definition at line 142 of file DebuggerNames.cpp.
References localBlockNames, MIN_BLOCK_NO, NO_OF_BLOCKS, and strcmp().
Referenced by MgmtSrvr::getBlockNumber(), and SignalLoggerManager::log().
00142 { 00143 for(int i = 0; i<NO_OF_BLOCKS; i++) 00144 if(localBlockNames[i] != 0 && strcmp(localBlockNames[i], blockName) == 0) 00145 return i + MIN_BLOCK_NO; 00146 return 0; 00147 }
Here is the call graph for this function:

Here is the caller graph for this function:

| unsigned short getGsn | ( | const char * | signalName | ) |
getGsn
NOTES: Very slow
RETURNS: Gsn or 0 if none found
Definition at line 125 of file DebuggerNames.cpp.
| const char* getSignalName | ( | unsigned short | gsn, | |
| const char * | defVal | |||
| ) |
Definition at line 118 of file DebuggerNames.cpp.
References localSignalNames, and MAX_GSN.
00118 { 00119 if(gsn > 0 && gsn <= MAX_GSN) 00120 return (localSignalNames[gsn] ? localSignalNames[gsn] : defVal); 00121 return defVal; 00122 }
| static int initBlockNames | ( | const char * | dst[], | |
| const BlockName | src[], | |||
| unsigned | len | |||
| ) | [static] |
Definition at line 81 of file DebuggerNames.cpp.
References exit, index(), MIN_BLOCK_NO, BlockName::name, name, and NO_OF_BLOCKS.
00083 { 00084 unsigned i; 00085 for(i = 0; i<NO_OF_BLOCKS; i++) 00086 dst[i] = 0; 00087 00088 for(i = 0; i<len; i++){ 00089 const int index = src[i].number - MIN_BLOCK_NO; 00090 if(index < 0 && index >= NO_OF_BLOCKS || dst[index] != 0){ 00091 fprintf(stderr, 00092 "Invalid block name definition: %d %s\n", 00093 src[i].number, src[i].name); 00094 exit(0); 00095 } 00096 dst[index] = src[i].name; 00097 } 00098 return 0; 00099 }
Here is the call graph for this function:

| static int initSignalNames | ( | const char * | dst[], | |
| const GsnName | src[], | |||
| unsigned short | len | |||
| ) | [static] |
Definition at line 32 of file DebuggerNames.cpp.
References exit, MAX_GSN, GsnName::name, name, and strcmp().
00032 { 00033 unsigned i; 00034 for(i = 0; i<=MAX_GSN; i++) 00035 dst[i] = 0; 00036 00037 for(i = 0; i<len; i++){ 00038 unsigned short gsn = src[i].gsn; 00039 const char * name = src[i].name; 00040 00041 if(dst[gsn] != 0 && name != 0){ 00042 if(strcmp(dst[gsn], name) != 0){ 00043 fprintf(stderr, 00044 "Multiple definition of signal name for gsn: %d (%s, %s)\n", 00045 gsn, dst[gsn], name); 00046 exit(0); 00047 } 00048 } 00049 dst[gsn] = name; 00050 } 00051 return 0; 00052 }
Here is the call graph for this function:

| static int initSignalPrinters | ( | SignalDataPrintFunction | dst[], | |
| const NameFunctionPair | src[] | |||
| ) | [static] |
Definition at line 56 of file DebuggerNames.cpp.
References exit, function, NameFunctionPair::gsn, and MAX_GSN.
00057 { 00058 unsigned i; 00059 for(i = 0; i<=MAX_GSN; i++) 00060 dst[i] = 0; 00061 00062 unsigned short gsn; 00063 for(i = 0; (gsn = src[i].gsn) > 0; i++){ 00064 SignalDataPrintFunction fun = src[i].function; 00065 00066 if(dst[gsn] != 0 && fun != 0){ 00067 if(dst[gsn] != fun){ 00068 fprintf(stderr, 00069 "Multiple definition of signal print function for gsn: %d\n", 00070 gsn); 00071 exit(0); 00072 } 00073 } 00074 dst[gsn] = fun; 00075 } 00076 return 0; 00077 }
const char* localBlockNames[NO_OF_BLOCKS] [static] |
SignalDataPrintFunction localPrintFunctions[MAX_GSN+1] [static] |
const char* localSignalNames[MAX_GSN+1] [static] |
const int xxx_DUMMY_BLOCK_NAMES_xxx [static] |
Initial value:
Definition at line 113 of file DebuggerNames.cpp.
const int xxx_DUMMY_PRINT_FUNCTIONS_xxx [static] |
Initial value:
Definition at line 109 of file DebuggerNames.cpp.
const int xxx_DUMMY_SIGNAL_NAMES_xxx [static] |
Initial value:
Run static initializerDefinition at line 105 of file DebuggerNames.cpp.
1.4.7

