Ndbdカーネルブロックのメンバを表示する
提供:MySQL Practice Wiki
各ブロックのメンバ変数の現在値を簡単にgdbで表示するには、次にようにglobalEmulatorData.theSimBlockListを参照すれば良い。
(gdb) set print pretty on
(gdb) set print array on
(gdb) set print element 4000
(gdb) set height 4000
(gdb) set width 40000
(gdb) print {Dbdict} globalEmulatorData.theSimBlockList.theList[6]
各カーネルブロックがtheListの何番目の要素か?ということについては、src/kernel/SimBlockList.cppで次のように定義されている。バージョンが上がった場合にはリストの番号も変わるのでSimBlockList::load()を参照されたい。
void
SimBlockList::load(EmulatorData& data){
noOfBlocks = NO_OF_BLOCKS;
theList = new SimulatedBlock * [noOfBlocks];
Dbdict* dbdict = 0;
Dbdih* dbdih = 0;
Pgman* pg = 0;
Lgman* lg = 0;
Tsman* ts = 0;
Block_context ctx(*data.theConfiguration, *data.m_mem_manager);
SimulatedBlock * fs = 0;
{
Uint32 dl;
const ndb_mgm_configuration_iterator * p =
ctx.m_config.getOwnConfigIterator();
if(p && !ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &dl) && dl){
fs = NEW_BLOCK(VoidFs)(ctx);
} else {
fs = NEW_BLOCK(Ndbfs)(ctx);
}
}
theList[0] = pg = NEW_BLOCK(Pgman)(ctx);
theList[1] = lg = NEW_BLOCK(Lgman)(ctx);
theList[2] = ts = NEW_BLOCK(Tsman)(ctx, pg, lg);
theList[3] = NEW_BLOCK(Dbacc)(ctx);
theList[4] = NEW_BLOCK(Cmvmi)(ctx);
theList[5] = fs;
theList[6] = dbdict = NEW_BLOCK(Dbdict)(ctx);
theList[7] = dbdih = NEW_BLOCK(Dbdih)(ctx);
theList[8] = NEW_BLOCK(Dblqh)(ctx);
theList[9] = NEW_BLOCK(Dbtc)(ctx);
theList[10] = NEW_BLOCK(Dbtup)(ctx, pg);
theList[11] = NEW_BLOCK(Ndbcntr)(ctx);
theList[12] = NEW_BLOCK(Qmgr)(ctx);
theList[13] = NEW_BLOCK(Trix)(ctx);
theList[14] = NEW_BLOCK(Backup)(ctx);
theList[15] = NEW_BLOCK(DbUtil)(ctx);
theList[16] = NEW_BLOCK(Suma)(ctx);
theList[17] = NEW_BLOCK(Dbtux)(ctx);
theList[18] = NEW_BLOCK(Restore)(ctx);
assert(NO_OF_BLOCKS == 19);
}