/* static */ wxString wxDbgHelpDLL::DumpSymbol(wxPSYMBOL_INFO pSym, void *pVariable) { wxString s; wxSYMBOL_INFO symDeref = *pSym; switch ( DereferenceSymbol(&symDeref, &pVariable) ) { default: // Suppress gcc warnings about unhandled enum values, don't assert // to avoid problems during fatal crash generation. break; case SYMBOL_TAG_UDT: // show UDT recursively s = DumpUDT(&symDeref, pVariable); break; case SYMBOL_TAG_BASE_TYPE: // variable of simple type, show directly BasicType bt = GetBasicType(&symDeref); if ( bt ) { s = DumpBaseType(bt, pSym->Size, pVariable); } break; } return s; }
/* static */ wxString wxDbgHelpDLL::DumpSymbol(PSYMBOL_INFO pSym, void *pVariable) { wxString s; SYMBOL_INFO symDeref = *pSym; switch ( DereferenceSymbol(&symDeref, &pVariable) ) { case SYMBOL_TAG_UDT: // show UDT recursively s = DumpUDT(&symDeref, pVariable); break; case SYMBOL_TAG_BASE_TYPE: // variable of simple type, show directly BasicType bt = GetBasicType(&symDeref); if ( bt ) { s = DumpBaseType(bt, pSym->Size, pVariable); } break; } return s; }
wxString wxDbgHelpDLL::DumpField(PSYMBOL_INFO pSym, void *pVariable, unsigned level) { wxString s; // avoid infinite recursion if ( level > 100 ) { return s; } SymbolTag tag = SYMBOL_TAG_NULL; if ( !DoGetTypeInfo(pSym, TI_GET_SYMTAG, &tag) ) { return s; } switch ( tag ) { case SYMBOL_TAG_UDT: case SYMBOL_TAG_BASE_CLASS: s = DumpUDT(pSym, pVariable, level); break; case SYMBOL_TAG_DATA: if ( !pVariable ) { s = _T("NULL"); } else // valid location { wxDbgHelpDLL::DataKind kind; if ( !DoGetTypeInfo(pSym, TI_GET_DATAKIND, &kind) || kind != DATA_MEMBER ) { // maybe it's a static member? we're not interested in them... break; } // get the offset of the child member, relative to its parent DWORD ofs = 0; if ( !DoGetTypeInfo(pSym, TI_GET_OFFSET, &ofs) ) break; pVariable = (void *)((DWORD_PTR)pVariable + ofs); // now pass to the type representing the type of this member SYMBOL_INFO sym = *pSym; if ( !DoGetTypeInfo(pSym, TI_GET_TYPEID, &sym.TypeIndex) ) break; ULONG64 size; DoGetTypeInfo(&sym, TI_GET_LENGTH, &size); switch ( DereferenceSymbol(&sym, &pVariable) ) { case SYMBOL_TAG_BASE_TYPE: { BasicType bt = GetBasicType(&sym); if ( bt ) { s = DumpBaseType(bt, size, pVariable); } } break; case SYMBOL_TAG_UDT: case SYMBOL_TAG_BASE_CLASS: s = DumpUDT(&sym, pVariable, level); break; } } if ( !s.empty() ) { s = GetSymbolName(pSym) + _T(" = ") + s; } break; } if ( !s.empty() ) { s = wxString(_T('\t'), level + 1) + s + _T('\n'); } return s; }