void XPCContext::DebugDump(PRInt16 depth) { #ifdef DEBUG depth--; XPC_LOG_ALWAYS(("XPCContext @ %x", this)); XPC_LOG_INDENT(); XPC_LOG_ALWAYS(("mRuntime @ %x", mRuntime)); XPC_LOG_ALWAYS(("mJSContext @ %x", mJSContext)); XPC_LOG_ALWAYS(("mLastResult of %x", mLastResult)); XPC_LOG_ALWAYS(("mPendingResult of %x", mPendingResult)); XPC_LOG_ALWAYS(("mSecurityManager @ %x", mSecurityManager)); XPC_LOG_ALWAYS(("mSecurityManagerFlags of %x", mSecurityManagerFlags)); XPC_LOG_ALWAYS(("mException @ %x", mException)); if(depth && mException) { // XXX show the exception here... } XPC_LOG_ALWAYS(("mCallingLangType of %s", mCallingLangType == LANG_UNKNOWN ? "LANG_UNKNOWN" : mCallingLangType == LANG_JS ? "LANG_JS" : "LANG_NATIVE")); XPC_LOG_OUTDENT(); #endif }
void XPCNativeInterface::DebugDump(PRInt16 depth) { #ifdef DEBUG depth--; XPC_LOG_ALWAYS(("XPCNativeInterface @ %x", this)); XPC_LOG_INDENT(); XPC_LOG_ALWAYS(("name is %s", GetNameString())); XPC_LOG_ALWAYS(("mMemberCount is %d", mMemberCount)); XPC_LOG_ALWAYS(("mInfo @ %x", mInfo.get())); XPC_LOG_OUTDENT(); #endif }
void XPCNativeSet::DebugDump(PRInt16 depth) { #ifdef DEBUG depth--; XPC_LOG_ALWAYS(("XPCNativeSet @ %x", this)); XPC_LOG_INDENT(); XPC_LOG_ALWAYS(("mInterfaceCount of %d", mInterfaceCount)); if (depth) { for (PRUint16 i = 0; i < mInterfaceCount; i++) mInterfaces[i]->DebugDump(depth); } XPC_LOG_ALWAYS(("mMemberCount of %d", mMemberCount)); XPC_LOG_OUTDENT(); #endif }
void XPCWrappedNativeScope::DebugDump(PRInt16 depth) { #ifdef DEBUG depth-- ; XPC_LOG_ALWAYS(("XPCWrappedNativeScope @ %x", this)); XPC_LOG_INDENT(); XPC_LOG_ALWAYS(("mRuntime @ %x", mRuntime)); XPC_LOG_ALWAYS(("mNext @ %x", mNext)); XPC_LOG_ALWAYS(("mComponents @ %x", mComponents)); XPC_LOG_ALWAYS(("mGlobalJSObject @ %x", mGlobalJSObject.get())); XPC_LOG_ALWAYS(("mPrototypeJSObject @ %x", mPrototypeJSObject.get())); XPC_LOG_ALWAYS(("mPrototypeNoHelper @ %x", mPrototypeNoHelper)); XPC_LOG_ALWAYS(("mWrappedNativeMap @ %x with %d wrappers(s)", \ mWrappedNativeMap, \ mWrappedNativeMap ? mWrappedNativeMap->Count() : 0)); // iterate contexts... if (depth && mWrappedNativeMap && mWrappedNativeMap->Count()) { XPC_LOG_INDENT(); mWrappedNativeMap->Enumerate(WrappedNativeMapDumpEnumerator, &depth); XPC_LOG_OUTDENT(); } XPC_LOG_ALWAYS(("mWrappedNativeProtoMap @ %x with %d protos(s)", \ mWrappedNativeProtoMap, \ mWrappedNativeProtoMap ? mWrappedNativeProtoMap->Count() : 0)); // iterate contexts... if (depth && mWrappedNativeProtoMap && mWrappedNativeProtoMap->Count()) { XPC_LOG_INDENT(); mWrappedNativeProtoMap->Enumerate(WrappedNativeProtoMapDumpEnumerator, &depth); XPC_LOG_OUTDENT(); } XPC_LOG_ALWAYS(("mMainThreadWrappedNativeProtoMap @ %x with %d protos(s)", \ mMainThreadWrappedNativeProtoMap, \ mMainThreadWrappedNativeProtoMap ? mMainThreadWrappedNativeProtoMap->Count() : 0)); // iterate contexts... if (depth && mMainThreadWrappedNativeProtoMap && mMainThreadWrappedNativeProtoMap->Count()) { XPC_LOG_INDENT(); mMainThreadWrappedNativeProtoMap->Enumerate(WrappedNativeProtoMapDumpEnumerator, &depth); XPC_LOG_OUTDENT(); } XPC_LOG_OUTDENT(); #endif }
// static void XPCWrappedNativeScope::DebugDumpAllScopes(PRInt16 depth) { #ifdef DEBUG depth-- ; // get scope count. int count = 0; XPCWrappedNativeScope* cur; for (cur = gScopes; cur; cur = cur->mNext) count++ ; XPC_LOG_ALWAYS(("chain of %d XPCWrappedNativeScope(s)", count)); XPC_LOG_INDENT(); XPC_LOG_ALWAYS(("gDyingScopes @ %x", gDyingScopes)); if (depth) for (cur = gScopes; cur; cur = cur->mNext) cur->DebugDump(depth); XPC_LOG_OUTDENT(); #endif }
void XPCWrappedNativeProto::DebugDump(int16_t depth) { #ifdef DEBUG depth-- ; XPC_LOG_ALWAYS(("XPCWrappedNativeProto @ %x", this)); XPC_LOG_INDENT(); XPC_LOG_ALWAYS(("gDEBUG_LiveProtoCount is %d", gDEBUG_LiveProtoCount)); XPC_LOG_ALWAYS(("mScope @ %x", mScope)); XPC_LOG_ALWAYS(("mJSProtoObject @ %x", mJSProtoObject.get())); XPC_LOG_ALWAYS(("mSet @ %x", mSet)); XPC_LOG_ALWAYS(("mSecurityInfo of %x", mSecurityInfo)); XPC_LOG_ALWAYS(("mScriptableInfo @ %x", mScriptableInfo)); if (depth && mScriptableInfo) { XPC_LOG_INDENT(); XPC_LOG_ALWAYS(("mScriptable @ %x", mScriptableInfo->GetCallback())); XPC_LOG_ALWAYS(("mFlags of %x", (uint32_t)mScriptableInfo->GetFlags())); XPC_LOG_ALWAYS(("mJSClass @ %x", mScriptableInfo->GetJSClass())); XPC_LOG_OUTDENT(); } XPC_LOG_OUTDENT(); #endif }
NS_IMETHODIMP nsXPCWrappedJS::DebugDump(PRInt16 depth) { #ifdef DEBUG XPC_LOG_ALWAYS(("nsXPCWrappedJS @ %x with mRefCnt = %d", this, mRefCnt.get())); XPC_LOG_INDENT(); bool isRoot = mRoot == this; XPC_LOG_ALWAYS(("%s wrapper around JSObject @ %x", \ isRoot ? "ROOT":"non-root", mJSObj)); char* name; GetClass()->GetInterfaceInfo()->GetName(&name); XPC_LOG_ALWAYS(("interface name is %s", name)); if (name) nsMemory::Free(name); char * iid = GetClass()->GetIID().ToString(); XPC_LOG_ALWAYS(("IID number is %s", iid ? iid : "invalid")); if (iid) NS_Free(iid); XPC_LOG_ALWAYS(("nsXPCWrappedJSClass @ %x", mClass)); if (!isRoot) XPC_LOG_OUTDENT(); if (mNext) { if (isRoot) { XPC_LOG_ALWAYS(("Additional wrappers for this object...")); XPC_LOG_INDENT(); } mNext->DebugDump(depth); if (isRoot) XPC_LOG_OUTDENT(); } if (isRoot) XPC_LOG_OUTDENT(); #endif return NS_OK; }
void XPCJSRuntime::DebugDump(PRInt16 depth) { #ifdef DEBUG depth--; XPC_LOG_ALWAYS(("XPCJSRuntime @ %x", this)); XPC_LOG_INDENT(); XPC_LOG_ALWAYS(("mXPConnect @ %x", mXPConnect)); XPC_LOG_ALWAYS(("mJSRuntime @ %x", mJSRuntime)); XPC_LOG_ALWAYS(("mMapLock @ %x", mMapLock)); XPC_LOG_ALWAYS(("mJSRuntimeService @ %x", mJSRuntimeService)); XPC_LOG_ALWAYS(("mWrappedJSToReleaseArray @ %x with %d wrappers(s)", \ &mWrappedJSToReleaseArray, mWrappedJSToReleaseArray.Count())); XPC_LOG_ALWAYS(("mContextMap @ %x with %d context(s)", \ mContextMap, mContextMap ? mContextMap->Count() : 0)); // iterate contexts... if(depth && mContextMap && mContextMap->Count()) { XPC_LOG_INDENT(); mContextMap->Enumerate(ContextMapDumpEnumerator, &depth); XPC_LOG_OUTDENT(); } XPC_LOG_ALWAYS(("mWrappedJSClassMap @ %x with %d wrapperclasses(s)", \ mWrappedJSClassMap, mWrappedJSClassMap ? \ mWrappedJSClassMap->Count() : 0)); // iterate wrappersclasses... if(depth && mWrappedJSClassMap && mWrappedJSClassMap->Count()) { XPC_LOG_INDENT(); mWrappedJSClassMap->Enumerate(WrappedJSClassMapDumpEnumerator, &depth); XPC_LOG_OUTDENT(); } XPC_LOG_ALWAYS(("mWrappedJSMap @ %x with %d wrappers(s)", \ mWrappedJSMap, mWrappedJSMap ? \ mWrappedJSMap->Count() : 0)); // iterate wrappers... if(depth && mWrappedJSMap && mWrappedJSMap->Count()) { XPC_LOG_INDENT(); mWrappedJSMap->Enumerate(WrappedJSMapDumpEnumerator, &depth); XPC_LOG_OUTDENT(); } XPC_LOG_ALWAYS(("mIID2NativeInterfaceMap @ %x with %d interface(s)", \ mIID2NativeInterfaceMap, mIID2NativeInterfaceMap ? \ mIID2NativeInterfaceMap->Count() : 0)); XPC_LOG_ALWAYS(("mClassInfo2NativeSetMap @ %x with %d sets(s)", \ mClassInfo2NativeSetMap, mClassInfo2NativeSetMap ? \ mClassInfo2NativeSetMap->Count() : 0)); XPC_LOG_ALWAYS(("mThisTranslatorMap @ %x with %d translator(s)", \ mThisTranslatorMap, mThisTranslatorMap ? \ mThisTranslatorMap->Count() : 0)); XPC_LOG_ALWAYS(("mNativeSetMap @ %x with %d sets(s)", \ mNativeSetMap, mNativeSetMap ? \ mNativeSetMap->Count() : 0)); // iterate sets... if(depth && mNativeSetMap && mNativeSetMap->Count()) { XPC_LOG_INDENT(); mNativeSetMap->Enumerate(NativeSetDumpEnumerator, &depth); XPC_LOG_OUTDENT(); } XPC_LOG_OUTDENT(); #endif }
void XPCJSRuntime::DebugDump(PRInt16 depth) { #ifdef DEBUG depth--; XPC_LOG_ALWAYS(("XPCJSRuntime @ %x", this)); XPC_LOG_INDENT(); XPC_LOG_ALWAYS(("mXPConnect @ %x", mXPConnect)); XPC_LOG_ALWAYS(("mJSRuntime @ %x", mJSRuntime)); XPC_LOG_ALWAYS(("mMapLock @ %x", mMapLock)); XPC_LOG_ALWAYS(("mWrappedJSToReleaseArray @ %x with %d wrappers(s)", \ &mWrappedJSToReleaseArray, mWrappedJSToReleaseArray.Length())); int cxCount = 0; JSContext* iter = nsnull; while(JS_ContextIterator(mJSRuntime, &iter)) ++cxCount; XPC_LOG_ALWAYS(("%d JS context(s)", cxCount)); iter = nsnull; while(JS_ContextIterator(mJSRuntime, &iter)) { XPCContext *xpc = XPCContext::GetXPCContext(iter); XPC_LOG_INDENT(); xpc->DebugDump(depth); XPC_LOG_OUTDENT(); } XPC_LOG_ALWAYS(("mWrappedJSClassMap @ %x with %d wrapperclasses(s)", \ mWrappedJSClassMap, mWrappedJSClassMap ? \ mWrappedJSClassMap->Count() : 0)); // iterate wrappersclasses... if(depth && mWrappedJSClassMap && mWrappedJSClassMap->Count()) { XPC_LOG_INDENT(); mWrappedJSClassMap->Enumerate(WrappedJSClassMapDumpEnumerator, &depth); XPC_LOG_OUTDENT(); } XPC_LOG_ALWAYS(("mWrappedJSMap @ %x with %d wrappers(s)", \ mWrappedJSMap, mWrappedJSMap ? \ mWrappedJSMap->Count() : 0)); // iterate wrappers... if(depth && mWrappedJSMap && mWrappedJSMap->Count()) { XPC_LOG_INDENT(); mWrappedJSMap->Enumerate(WrappedJSMapDumpEnumerator, &depth); XPC_LOG_OUTDENT(); } XPC_LOG_ALWAYS(("mIID2NativeInterfaceMap @ %x with %d interface(s)", \ mIID2NativeInterfaceMap, mIID2NativeInterfaceMap ? \ mIID2NativeInterfaceMap->Count() : 0)); XPC_LOG_ALWAYS(("mClassInfo2NativeSetMap @ %x with %d sets(s)", \ mClassInfo2NativeSetMap, mClassInfo2NativeSetMap ? \ mClassInfo2NativeSetMap->Count() : 0)); XPC_LOG_ALWAYS(("mThisTranslatorMap @ %x with %d translator(s)", \ mThisTranslatorMap, mThisTranslatorMap ? \ mThisTranslatorMap->Count() : 0)); XPC_LOG_ALWAYS(("mNativeSetMap @ %x with %d sets(s)", \ mNativeSetMap, mNativeSetMap ? \ mNativeSetMap->Count() : 0)); // iterate sets... if(depth && mNativeSetMap && mNativeSetMap->Count()) { XPC_LOG_INDENT(); mNativeSetMap->Enumerate(NativeSetDumpEnumerator, &depth); XPC_LOG_OUTDENT(); } XPC_LOG_OUTDENT(); #endif }