*****************************************************************************/
SCMODump::SCMODump()
{
- _out = stdout;
+ _out = stderr;
_fileOpen = false;
#ifdef PEGASUS_OS_ZOS
return true;
}
-void SCMODump::dumpSCMOInstance(SCMOInstance& testInst) const
+void SCMODump::dumpSCMOInstance(SCMOInstance& testInst, Boolean inclMemHdr)const
{
SCMBInstance_Main* insthdr = testInst.inst.hdr;
char* instbase = testInst.inst.base;
fprintf(_out,"\n\nDump of SCMOInstance\n");
- // The magic number for SCMO class
- fprintf(_out,"\nheader.magic=%08X",insthdr->header.magic);
- // Total size of the instance memory block( # bytes )
- fprintf(_out,"\nheader.totalSize=%llu",insthdr->header.totalSize);
+
+ if (inclMemHdr)
+ {
+ _dumpSCMBMgmt_Header(insthdr->header,instbase);
+ }
+
// The reference counter for this c++ class
fprintf(_out,"\nrefCount=%i",insthdr->refCount.get());
fprintf(_out,"\ntheClass: %p",insthdr->theClass.ptr);
}
-void SCMODump::dumpSCMOClass(SCMOClass& testCls) const
+void SCMODump::_dumpSCMBMgmt_Header(SCMBMgmt_Header& header,char* base) const
+{
+ fprintf(_out,"\nThe Management Header:");
+ // The magic number
+ fprintf(_out,"\n magic=%08X",header.magic);
+ // Total size of the memory block( # bytes )
+ fprintf(_out,"\n totalSize=%llu",header.totalSize);
+ // Free bytes in the block
+ fprintf(_out,"\n freeBytes=%llu",header.freeBytes);
+ // Index to the start of the free space in this SCMB memory block.
+ fprintf(_out,"\n startOfFreeSpace=%llu",header.startOfFreeSpace);
+ // Number of external references in this instance.
+ fprintf(_out,"\n numberExtRef=%u",header.numberExtRef);
+ // Size of external reference index array;
+ fprintf(_out,"\n sizeExtRefIndexArray=%u",header.sizeExtRefIndexArray);
+
+ if (header.numberExtRef > 0)
+ {
+ fprintf(_out,"\n extRefIndexArray=[");
+ Uint64* extRefIndexArray =
+ (Uint64*)&(base[header.extRefIndexArray.start]);
+
+ for (Uint32 i = 0; i < header.numberExtRef;)
+ {
+ fprintf(_out,"%llu",extRefIndexArray[i]);
+ i++;
+ if (i != header.numberExtRef)
+ {
+ fprintf(_out,", ");
+ }
+ }
+ fprintf(_out,"\n");
+ }
+ else
+ {
+ fprintf(_out,"\n extRefIndexArray=[NO INDEX]\n");
+ }
+}
+
+void SCMODump::dumpSCMOClass(SCMOClass& testCls, Boolean inclMemHdr) const
{
SCMBClass_Main* clshdr = testCls.cls.hdr;
char* clsbase = testCls.cls.base;
fprintf(_out,"\n\nDump of SCMOClass\n");
- // The magic number for SCMO class
- fprintf(_out,"\nheader.magic=%08X",clshdr->header.magic);
- // Total size of the instance memory block( # bytes )
- fprintf(_out,"\nheader.totalSize=%llu",clshdr->header.totalSize);
+
+ if (inclMemHdr)
+ {
+ _dumpSCMBMgmt_Header(clshdr->header,clsbase);
+ }
+
// The reference counter for this c++ class
fprintf(_out,"\nrefCount=%i",clshdr->refCount.get());
fprintf(_out,"\n\nThe Flags:");
SCMODump(const char *filename);
// Methods for SCMOClass only
void hexDumpSCMOClass(SCMOClass& testCls) const;
- void dumpSCMOClass(SCMOClass& testCls) const;
+ void dumpSCMOClass(SCMOClass& testCls,Boolean inclMemHdr = true) const;
void dumpSCMOClassQualifiers(SCMOClass& testCls) const;
void dumpKeyPropertyMask(SCMOClass& testCls) const;
void dumpClassProperties(SCMOClass& testCls) const;
void dumpClassKeyBindingNodeArray(SCMOClass& testCls) const;
// Methods for SCMOInstance only
- void dumpSCMOInstance(SCMOInstance& testInst) const;
+ void dumpSCMOInstance(
+ SCMOInstance& testInst,
+ Boolean inclMemHdr = true) const;
void dumpSCMOInstanceKeyBindings(
SCMOInstance& testInst,
Boolean verbose = false) const ;
const SCMBClassProperty& prop,
char* clsbase) const;
- void _hexDump(char* buffer,Uint64 length) const;
+ void _dumpSCMBMgmt_Header(SCMBMgmt_Header& header,char* base) const;
+
+ void _hexDump(char* buffer,Uint64 length) const;
- Boolean _fileOpen;
- FILE *_out;
- String _filename;
+ Boolean _fileOpen;
+ FILE *_out;
+ String _filename;
};
PEGASUS_NAMESPACE_END
(const char*)nameSpace.getString().getCString());
}
+void structureSizes()
+{
+ cout << endl << "Sizes of structures:" << endl;
+ cout << "=====================" << endl << endl;
+ cout << "SCMBUnion : " << sizeof(SCMBUnion) << endl;
+ cout << "SCMBDataPtr : " << sizeof(SCMBDataPtr) << endl;
+ cout << "SCMBValue : " << sizeof(SCMBValue) << endl;
+ cout << "SCMBKeyBindingValue : " << sizeof(SCMBKeyBindingValue) << endl;
+ cout << "SCMBUserKeyBindingElement : "
+ << sizeof(SCMBUserKeyBindingElement) << endl;
+ cout << "SCMBQualifier : " << sizeof(SCMBQualifier) << endl;
+ cout << "SCMBMgmt_Header : " << sizeof(SCMBMgmt_Header) << endl;
+ cout << "SCMBClassProperty : " << sizeof(SCMBClassProperty) << endl;
+ cout << "SCMBClassPropertySet_Header : "
+ << sizeof(SCMBClassPropertySet_Header) << endl;
+ cout << "SCMBClassPropertyNode : " << sizeof(SCMBClassPropertyNode) << endl;
+ cout << "SCMBKeyBindingNode : " << sizeof(SCMBKeyBindingNode) << endl;
+ cout << "SCMBKeyBindingSet_Header : "
+ << sizeof(SCMBKeyBindingSet_Header) << endl;
+ cout << "SCMBClass_Main : " << sizeof(SCMBClass_Main) << endl;
+ cout << "SCMBInstance_Main : " << sizeof(SCMBInstance_Main) << endl;
+}
+
void CIMClassToSCMOClass()
{
CIMClass theCIMClass;
const char TestCSMOClassLog[]="TestSCMOClass.log";
SCMODump dump(&(TestCSMOClassLog[0]));
- dump.dumpSCMOClass(theSCMOClass);
+ // Do not dump the volatile data.
+ dump.dumpSCMOClass(theSCMOClass,false);
String masterFile (getenv("PEGASUS_ROOT"));
masterFile.append(MASTERCLASS);
PEGASUS_TEST_ASSERT(SCMO_TESTClass2_Inst.getPropertyCount()==3);
VCOUT << endl << "Done." << endl;
- // dump.dumpSCMOInstance(SCMO_TESTClass2_Inst);
-
}
try
{
+ if (verbose)
+ {
+ structureSizes();
+ }
+
CIMClassToSCMOClass();
// init the cache.