Ghidra is a software reverse engineering (SRE) framework
GT-2823 Initial commit with symbol types and tests for PDB Universal.
ghizard0e4b725c3791
diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/SymbolParser.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/SymbolParser.javaindex 31216626d2..8373866ca4 100644--- a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/SymbolParser.java+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/SymbolParser.java@@ -328,624 +328,624 @@ public class SymbolParser {AbstractMsSymbol symbol = null;switch (symbolTypeId) {-// // 0x0000 block-// case CompileFlagsMsSymbol.PDB_ID:-// symbol = new CompileFlagsMsSymbol(pdb, reader);-//// System.out.println(symbol);-//// System.out.flush();-// break;-// case Register16MsSymbol.PDB_ID:-// symbol = new Register16MsSymbol(pdb, reader);-// break;-// case Constant16MsSymbol.PDB_ID:-// symbol = new Constant16MsSymbol(pdb, reader);-// break;-// case UserDefinedType16MsSymbol.PDB_ID:-// symbol = new UserDefinedType16MsSymbol(pdb, reader);-// break;-// case StartSearchMsSymbol.PDB_ID:-// symbol = new StartSearchMsSymbol(pdb, reader);-// break;-// case EndMsSymbol.PDB_ID:-// symbol = new EndMsSymbol(pdb, reader);-// break;-// case SkipMsSymbol.PDB_ID:-// symbol = new SkipMsSymbol(pdb, reader);-// break;-// case CvReservedMsSymbol.PDB_ID:-// symbol = new CvReservedMsSymbol(pdb, reader);-// break;-// case ObjectNameStMsSymbol.PDB_ID:-// symbol = new ObjectNameStMsSymbol(pdb, reader);-// break;-// case EndArgumentsListMsSymbol.PDB_ID:-// symbol = new EndArgumentsListMsSymbol(pdb, reader);-// break;-// case CobolUserDefinedType16MsSymbol.PDB_ID:-// symbol = new CobolUserDefinedType16MsSymbol(pdb, reader);-// break;-// case ManyRegisterVariable16MsSymbol.PDB_ID:-// symbol = new ManyRegisterVariable16MsSymbol(pdb, reader);-// break;-// case ReturnDescriptionMsSymbol.PDB_ID:-// symbol = new ReturnDescriptionMsSymbol(pdb, reader);-// break;-// case EntryThisMsSymbol.PDB_ID:-// symbol = new EntryThisMsSymbol(pdb, reader);-// break;-//-// // 0x0100 block-// case BasePointerRelative16MsSymbol.PDB_ID:-// symbol = new BasePointerRelative16MsSymbol(pdb, reader);-// break;-// case LocalData16MsSymbol.PDB_ID:-// symbol = new LocalData16MsSymbol(pdb, reader);-// break;-// case GlobalData16MsSymbol.PDB_ID:-// symbol = new GlobalData16MsSymbol(pdb, reader);-// break;-// case Public16MsSymbol.PDB_ID:-// symbol = new Public16MsSymbol(pdb, reader);-// break;-// case LocalProcedureStart16MsSymbol.PDB_ID:-// symbol = new LocalProcedureStart16MsSymbol(pdb, reader);-// break;-// case GlobalProcedureStart16MsSymbol.PDB_ID:-// symbol = new GlobalProcedureStart16MsSymbol(pdb, reader);-// break;-// case Thunk16MsSymbol.PDB_ID:-// symbol = new Thunk16MsSymbol(pdb, reader);-// break;-// case Block16MsSymbol.PDB_ID:-// symbol = new Block16MsSymbol(pdb, reader);-// break;-// case With16MsSymbol.PDB_ID:-// symbol = new With16MsSymbol(pdb, reader);-// break;-// case Label16MsSymbol.PDB_ID:-// symbol = new Label16MsSymbol(pdb, reader);-// break;-// case ChangeExecutionModel16MsSymbol.PDB_ID:-// symbol = new ChangeExecutionModel16MsSymbol(pdb, reader);-// break;-// case VirtualFunctionTable16MsSymbol.PDB_ID:-// symbol = new VirtualFunctionTable16MsSymbol(pdb, reader);-// break;-// case RegisterRelativeAddress16MsSymbol.PDB_ID:-// symbol = new RegisterRelativeAddress16MsSymbol(pdb, reader);-// break;-//-// // 0x0200 block-// case BasePointerRelative3216MsSymbol.PDB_ID:-// symbol = new BasePointerRelative3216MsSymbol(pdb, reader);-// break;-// case LocalData3216MsSymbol.PDB_ID:-// symbol = new LocalData3216MsSymbol(pdb, reader);-// break;-// case GlobalData3216MsSymbol.PDB_ID:-// symbol = new GlobalData3216MsSymbol(pdb, reader);-// break;-// case Public3216MsSymbol.PDB_ID:-// symbol = new Public3216MsSymbol(pdb, reader);-// break;-// case LocalProcedureStart3216MsSymbol.PDB_ID:-// symbol = new LocalProcedureStart3216MsSymbol(pdb, reader);-// break;-// case GlobalProcedureStart3216MsSymbol.PDB_ID:-// symbol = new GlobalProcedureStart3216MsSymbol(pdb, reader);-// break;-// case Thunk32StMsSymbol.PDB_ID:-// symbol = new Thunk32StMsSymbol(pdb, reader);-// break;-// case Block32StMsSymbol.PDB_ID:-// symbol = new Block32StMsSymbol(pdb, reader);-// break;-// case With32StMsSymbol.PDB_ID:-// symbol = new With32StMsSymbol(pdb, reader);-// break;-// case Label32StMsSymbol.PDB_ID:-// symbol = new Label32StMsSymbol(pdb, reader);-// break;-// case ChangeExecutionModel32MsSymbol.PDB_ID:-// symbol = new ChangeExecutionModel32MsSymbol(pdb, reader);-// break;-// case VirtualFunctionTable3216MsSymbol.PDB_ID:-// symbol = new VirtualFunctionTable3216MsSymbol(pdb, reader);-// break;-// case RegisterRelativeAddress3216MsSymbol.PDB_ID:-// symbol = new RegisterRelativeAddress3216MsSymbol(pdb, reader);-// break;-// case LocalThreadStorage3216MsSymbol.PDB_ID:-// symbol = new LocalThreadStorage3216MsSymbol(pdb, reader);-// break;-// case GlobalThreadStorage3216MsSymbol.PDB_ID:-// symbol = new GlobalThreadStorage3216MsSymbol(pdb, reader);-// break;-// case StaticLinkForMipsExceptionHandlingMsSymbol.PDB_ID:-// symbol = new StaticLinkForMipsExceptionHandlingMsSymbol(pdb, reader);-// break;-//-// // 0x0300 block-// case LocalProcedureStartMips16MsSymbol.PDB_ID:-// symbol = new LocalProcedureStartMips16MsSymbol(pdb, reader);-// break;-// case GlobalProcedureStartMips16MsSymbol.PDB_ID:-// symbol = new GlobalProcedureStartMips16MsSymbol(pdb, reader);-// break;-//-// // 0x0400 block-// case ProcedureReferenceStMsSymbol.PDB_ID:-// symbol = new ProcedureReferenceStMsSymbol(pdb, reader);-// break;-// case DataReferenceStMsSymbol.PDB_ID:-// symbol = new DataReferenceStMsSymbol(pdb, reader);-// break;-// case AlignMsSymbol.PDB_ID:-// symbol = new AlignMsSymbol(pdb, reader);-// break;-// case LocalProcedureReferenceStMsSymbol.PDB_ID:-// symbol = new LocalProcedureReferenceStMsSymbol(pdb, reader);-// break;-// case OemDefinedMsSymbol.PDB_ID:-// symbol = new OemDefinedMsSymbol(pdb, reader);-// break;-//-// // 0x1000 block-// case RegisterStMsSymbol.PDB_ID:-// symbol = new RegisterStMsSymbol(pdb, reader);-// break;-// case ConstantStMsSymbol.PDB_ID:-// symbol = new ConstantStMsSymbol(pdb, reader);-// break;-// case UserDefinedTypeStMsSymbol.PDB_ID:-// symbol = new UserDefinedTypeStMsSymbol(pdb, reader);-// break;-// case CobolUserDefinedTypeStMsSymbol.PDB_ID:-// symbol = new CobolUserDefinedTypeStMsSymbol(pdb, reader);-// break;-// case ManyRegisterVariableStMsSymbol.PDB_ID:-// symbol = new ManyRegisterVariableStMsSymbol(pdb, reader);-// break;-// case BasePointerRelative32StMsSymbol.PDB_ID:-// symbol = new BasePointerRelative32StMsSymbol(pdb, reader);-// break;-// case LocalData32StMsSymbol.PDB_ID:-// symbol = new LocalData32StMsSymbol(pdb, reader);-// break;-// case GlobalData32StMsSymbol.PDB_ID:-// symbol = new GlobalData32StMsSymbol(pdb, reader);-// break;-// case Public32StMsSymbol.PDB_ID:-// symbol = new Public32StMsSymbol(pdb, reader);-// break;-// case LocalProcedureStart32StMsSymbol.PDB_ID:-// symbol = new LocalProcedureStart32StMsSymbol(pdb, reader);-// break;-// case GlobalProcedureStart32StMsSymbol.PDB_ID:-// symbol = new GlobalProcedureStart32StMsSymbol(pdb, reader);-// break;-// case VirtualFunctionTable32MsSymbol.PDB_ID:-// symbol = new VirtualFunctionTable32MsSymbol(pdb, reader);-// break;-// case RegisterRelativeAddress32StMsSymbol.PDB_ID:-// symbol = new RegisterRelativeAddress32StMsSymbol(pdb, reader);-// break;-// case LocalThreadStorage32StMsSymbol.PDB_ID:-// symbol = new LocalThreadStorage32StMsSymbol(pdb, reader);-// break;-// case GlobalThreadStorage32StMsSymbol.PDB_ID:-// symbol = new GlobalThreadStorage32StMsSymbol(pdb, reader);-// break;-// case LocalProcedureStartMipsStMsSymbol.PDB_ID:-// symbol = new LocalProcedureStartMipsStMsSymbol(pdb, reader);-// break;-// case GlobalProcedureStartMipsStMsSymbol.PDB_ID:-// symbol = new GlobalProcedureStartMipsStMsSymbol(pdb, reader);-// break;-// case ExtraFrameAndProcedureInformationMsSymbol.PDB_ID:-// symbol = new ExtraFrameAndProcedureInformationMsSymbol(pdb, reader);-// break;-// case Compile2StMsSymbol.PDB_ID:-// symbol = new Compile2StMsSymbol(pdb, reader);-// break;-// case ManyRegisterVariable2StMsSymbol.PDB_ID:-// symbol = new ManyRegisterVariable2StMsSymbol(pdb, reader);-// break;-// case LocalProcedureStartIa64StMsSymbol.PDB_ID:-// symbol = new LocalProcedureStartIa64StMsSymbol(pdb, reader);-// break;-// case GlobalProcedureStartIa64StMsSymbol.PDB_ID:-// symbol = new GlobalProcedureStartIa64StMsSymbol(pdb, reader);-// break;-// case LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldStMsSymbol.PDB_ID:-// symbol = new LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldStMsSymbol(pdb,-// reader);-// break;-// case LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldStMsSymbol.PDB_ID:-// symbol = new LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldStMsSymbol(-// pdb, reader);-// break;-// case AnnotationMsSymbol.PDB_ID:-// symbol = new AnnotationMsSymbol(pdb, reader);-// break;-// case GlobalManagedProcedureStMsSymbol.PDB_ID:-// symbol = new GlobalManagedProcedureStMsSymbol(pdb, reader);-// break;-// case LocalManagedProcedureStMsSymbol.PDB_ID:-// symbol = new LocalManagedProcedureStMsSymbol(pdb, reader);-// break;-// case Reserved1MsSymbol.PDB_ID:-// symbol = new Reserved1MsSymbol(pdb, reader);-// break;-// case Reserved2MsSymbol.PDB_ID:-// symbol = new Reserved2MsSymbol(pdb, reader);-// break;-// case Reserved3MsSymbol.PDB_ID:-// symbol = new Reserved3MsSymbol(pdb, reader);-// break;-// case Reserved4MsSymbol.PDB_ID:-// symbol = new Reserved4MsSymbol(pdb, reader);-// break;-// case LocalManagedDataStMsSymbol.PDB_ID:-// symbol = new LocalManagedDataStMsSymbol(pdb, reader);-// break;-// case GlobalManagedDataStMsSymbol.PDB_ID:-// symbol = new GlobalManagedDataStMsSymbol(pdb, reader);-// break;-// case ManagedLocalOrParameterRelativeToVirtualFramePointerStMsSymbol.PDB_ID:-// symbol =-// new ManagedLocalOrParameterRelativeToVirtualFramePointerStMsSymbol(pdb, reader);-// break;-// case ManagedLocalOrParameterStoredInRegisterStMsSymbol.PDB_ID:-// symbol = new ManagedLocalOrParameterStoredInRegisterStMsSymbol(pdb, reader);-// break;-// case ManagedSymbolWithSlotIndexFieldStMsSymbol.PDB_ID:-// symbol = new ManagedSymbolWithSlotIndexFieldStMsSymbol(pdb, reader);-// break;-// case ManagedLocalOrParameterStoredInManyRegisterStMsSymbol.PDB_ID:-// symbol = new ManagedLocalOrParameterStoredInManyRegisterStMsSymbol(pdb, reader);-// break;-// case ManagedLocalOrParameterRelativeToAlternateFramePointerStMsSymbol.PDB_ID:-// symbol = new ManagedLocalOrParameterRelativeToAlternateFramePointerStMsSymbol(pdb,-// reader);-// break;-// case ManagedLocalOrParameterStoredInManyRegister2StMsSymbol.PDB_ID:-// symbol = new ManagedLocalOrParameterStoredInManyRegister2StMsSymbol(pdb, reader);-// break;-// case IndexForTypeReferencedByNameFromMetadataMsSymbol.PDB_ID:-// symbol = new IndexForTypeReferencedByNameFromMetadataMsSymbol(pdb, reader);-// break;-// case UsingNamespaceStMsSymbol.PDB_ID:-// symbol = new UsingNamespaceStMsSymbol(pdb, reader);-// break;-//-// // 0x1100 block-// case ObjectNameMsSymbol.PDB_ID:-// symbol = new ObjectNameMsSymbol(pdb, reader);-// break;-// case Thunk32MsSymbol.PDB_ID:-// symbol = new Thunk32MsSymbol(pdb, reader);-// break;-// case Block32MsSymbol.PDB_ID:-// symbol = new Block32MsSymbol(pdb, reader);-// break;-// case With32MsSymbol.PDB_ID:-// symbol = new With32MsSymbol(pdb, reader);-// break;-// case Label32MsSymbol.PDB_ID:-// symbol = new Label32MsSymbol(pdb, reader);-// break;+ // 0x0000 block+ case CompileFlagsMsSymbol.PDB_ID:+ symbol = new CompileFlagsMsSymbol(pdb, reader);+// System.out.println(symbol);+// System.out.flush();+ break;+ case Register16MsSymbol.PDB_ID:+ symbol = new Register16MsSymbol(pdb, reader);+ break;+ case Constant16MsSymbol.PDB_ID:+ symbol = new Constant16MsSymbol(pdb, reader);+ break;+ case UserDefinedType16MsSymbol.PDB_ID:+ symbol = new UserDefinedType16MsSymbol(pdb, reader);+ break;+ case StartSearchMsSymbol.PDB_ID:+ symbol = new StartSearchMsSymbol(pdb, reader);+ break;+ case EndMsSymbol.PDB_ID:+ symbol = new EndMsSymbol(pdb, reader);+ break;+ case SkipMsSymbol.PDB_ID:+ symbol = new SkipMsSymbol(pdb, reader);+ break;+ case CvReservedMsSymbol.PDB_ID:+ symbol = new CvReservedMsSymbol(pdb, reader);+ break;+ case ObjectNameStMsSymbol.PDB_ID:+ symbol = new ObjectNameStMsSymbol(pdb, reader);+ break;+ case EndArgumentsListMsSymbol.PDB_ID:+ symbol = new EndArgumentsListMsSymbol(pdb, reader);+ break;+ case CobolUserDefinedType16MsSymbol.PDB_ID:+ symbol = new CobolUserDefinedType16MsSymbol(pdb, reader);+ break;+ case ManyRegisterVariable16MsSymbol.PDB_ID:+ symbol = new ManyRegisterVariable16MsSymbol(pdb, reader);+ break;+ case ReturnDescriptionMsSymbol.PDB_ID:+ symbol = new ReturnDescriptionMsSymbol(pdb, reader);+ break;+ case EntryThisMsSymbol.PDB_ID:+ symbol = new EntryThisMsSymbol(pdb, reader);+ break;++ // 0x0100 block+ case BasePointerRelative16MsSymbol.PDB_ID:+ symbol = new BasePointerRelative16MsSymbol(pdb, reader);+ break;+ case LocalData16MsSymbol.PDB_ID:+ symbol = new LocalData16MsSymbol(pdb, reader);+ break;+ case GlobalData16MsSymbol.PDB_ID:+ symbol = new GlobalData16MsSymbol(pdb, reader);+ break;+ case Public16MsSymbol.PDB_ID:+ symbol = new Public16MsSymbol(pdb, reader);+ break;+ case LocalProcedureStart16MsSymbol.PDB_ID:+ symbol = new LocalProcedureStart16MsSymbol(pdb, reader);+ break;+ case GlobalProcedureStart16MsSymbol.PDB_ID:+ symbol = new GlobalProcedureStart16MsSymbol(pdb, reader);+ break;+ case Thunk16MsSymbol.PDB_ID:+ symbol = new Thunk16MsSymbol(pdb, reader);+ break;+ case Block16MsSymbol.PDB_ID:+ symbol = new Block16MsSymbol(pdb, reader);+ break;+ case With16MsSymbol.PDB_ID:+ symbol = new With16MsSymbol(pdb, reader);+ break;+ case Label16MsSymbol.PDB_ID:+ symbol = new Label16MsSymbol(pdb, reader);+ break;+ case ChangeExecutionModel16MsSymbol.PDB_ID:+ symbol = new ChangeExecutionModel16MsSymbol(pdb, reader);+ break;+ case VirtualFunctionTable16MsSymbol.PDB_ID:+ symbol = new VirtualFunctionTable16MsSymbol(pdb, reader);+ break;+ case RegisterRelativeAddress16MsSymbol.PDB_ID:+ symbol = new RegisterRelativeAddress16MsSymbol(pdb, reader);+ break;++ // 0x0200 block+ case BasePointerRelative3216MsSymbol.PDB_ID:+ symbol = new BasePointerRelative3216MsSymbol(pdb, reader);+ break;+ case LocalData3216MsSymbol.PDB_ID:+ symbol = new LocalData3216MsSymbol(pdb, reader);+ break;+ case GlobalData3216MsSymbol.PDB_ID:+ symbol = new GlobalData3216MsSymbol(pdb, reader);+ break;+ case Public3216MsSymbol.PDB_ID:+ symbol = new Public3216MsSymbol(pdb, reader);+ break;+ case LocalProcedureStart3216MsSymbol.PDB_ID:+ symbol = new LocalProcedureStart3216MsSymbol(pdb, reader);+ break;+ case GlobalProcedureStart3216MsSymbol.PDB_ID:+ symbol = new GlobalProcedureStart3216MsSymbol(pdb, reader);+ break;+ case Thunk32StMsSymbol.PDB_ID:+ symbol = new Thunk32StMsSymbol(pdb, reader);+ break;+ case Block32StMsSymbol.PDB_ID:+ symbol = new Block32StMsSymbol(pdb, reader);+ break;+ case With32StMsSymbol.PDB_ID:+ symbol = new With32StMsSymbol(pdb, reader);+ break;+ case Label32StMsSymbol.PDB_ID:+ symbol = new Label32StMsSymbol(pdb, reader);+ break;+ case ChangeExecutionModel32MsSymbol.PDB_ID:+ symbol = new ChangeExecutionModel32MsSymbol(pdb, reader);+ break;+ case VirtualFunctionTable3216MsSymbol.PDB_ID:+ symbol = new VirtualFunctionTable3216MsSymbol(pdb, reader);+ break;+ case RegisterRelativeAddress3216MsSymbol.PDB_ID:+ symbol = new RegisterRelativeAddress3216MsSymbol(pdb, reader);+ break;+ case LocalThreadStorage3216MsSymbol.PDB_ID:+ symbol = new LocalThreadStorage3216MsSymbol(pdb, reader);+ break;+ case GlobalThreadStorage3216MsSymbol.PDB_ID:+ symbol = new GlobalThreadStorage3216MsSymbol(pdb, reader);+ break;+ case StaticLinkForMipsExceptionHandlingMsSymbol.PDB_ID:+ symbol = new StaticLinkForMipsExceptionHandlingMsSymbol(pdb, reader);+ break;++ // 0x0300 block+ case LocalProcedureStartMips16MsSymbol.PDB_ID:+ symbol = new LocalProcedureStartMips16MsSymbol(pdb, reader);+ break;+ case GlobalProcedureStartMips16MsSymbol.PDB_ID:+ symbol = new GlobalProcedureStartMips16MsSymbol(pdb, reader);+ break;++ // 0x0400 block+ case ProcedureReferenceStMsSymbol.PDB_ID:+ symbol = new ProcedureReferenceStMsSymbol(pdb, reader);+ break;+ case DataReferenceStMsSymbol.PDB_ID:+ symbol = new DataReferenceStMsSymbol(pdb, reader);+ break;+ case AlignMsSymbol.PDB_ID:+ symbol = new AlignMsSymbol(pdb, reader);+ break;+ case LocalProcedureReferenceStMsSymbol.PDB_ID:+ symbol = new LocalProcedureReferenceStMsSymbol(pdb, reader);+ break;+ case OemDefinedMsSymbol.PDB_ID:+ symbol = new OemDefinedMsSymbol(pdb, reader);+ break;++ // 0x1000 block+ case RegisterStMsSymbol.PDB_ID:+ symbol = new RegisterStMsSymbol(pdb, reader);+ break;+ case ConstantStMsSymbol.PDB_ID:+ symbol = new ConstantStMsSymbol(pdb, reader);+ break;+ case UserDefinedTypeStMsSymbol.PDB_ID:+ symbol = new UserDefinedTypeStMsSymbol(pdb, reader);+ break;+ case CobolUserDefinedTypeStMsSymbol.PDB_ID:+ symbol = new CobolUserDefinedTypeStMsSymbol(pdb, reader);+ break;+ case ManyRegisterVariableStMsSymbol.PDB_ID:+ symbol = new ManyRegisterVariableStMsSymbol(pdb, reader);+ break;+ case BasePointerRelative32StMsSymbol.PDB_ID:+ symbol = new BasePointerRelative32StMsSymbol(pdb, reader);+ break;+ case LocalData32StMsSymbol.PDB_ID:+ symbol = new LocalData32StMsSymbol(pdb, reader);+ break;+ case GlobalData32StMsSymbol.PDB_ID:+ symbol = new GlobalData32StMsSymbol(pdb, reader);+ break;+ case Public32StMsSymbol.PDB_ID:+ symbol = new Public32StMsSymbol(pdb, reader);+ break;+ case LocalProcedureStart32StMsSymbol.PDB_ID:+ symbol = new LocalProcedureStart32StMsSymbol(pdb, reader);+ break;+ case GlobalProcedureStart32StMsSymbol.PDB_ID:+ symbol = new GlobalProcedureStart32StMsSymbol(pdb, reader);+ break;+ case VirtualFunctionTable32MsSymbol.PDB_ID:+ symbol = new VirtualFunctionTable32MsSymbol(pdb, reader);+ break;+ case RegisterRelativeAddress32StMsSymbol.PDB_ID:+ symbol = new RegisterRelativeAddress32StMsSymbol(pdb, reader);+ break;+ case LocalThreadStorage32StMsSymbol.PDB_ID:+ symbol = new LocalThreadStorage32StMsSymbol(pdb, reader);+ break;+ case GlobalThreadStorage32StMsSymbol.PDB_ID:+ symbol = new GlobalThreadStorage32StMsSymbol(pdb, reader);+ break;+ case LocalProcedureStartMipsStMsSymbol.PDB_ID:+ symbol = new LocalProcedureStartMipsStMsSymbol(pdb, reader);+ break;+ case GlobalProcedureStartMipsStMsSymbol.PDB_ID:+ symbol = new GlobalProcedureStartMipsStMsSymbol(pdb, reader);+ break;+ case ExtraFrameAndProcedureInformationMsSymbol.PDB_ID:+ symbol = new ExtraFrameAndProcedureInformationMsSymbol(pdb, reader);+ break;+ case Compile2StMsSymbol.PDB_ID:+ symbol = new Compile2StMsSymbol(pdb, reader);+ break;+ case ManyRegisterVariable2StMsSymbol.PDB_ID:+ symbol = new ManyRegisterVariable2StMsSymbol(pdb, reader);+ break;+ case LocalProcedureStartIa64StMsSymbol.PDB_ID:+ symbol = new LocalProcedureStartIa64StMsSymbol(pdb, reader);+ break;+ case GlobalProcedureStartIa64StMsSymbol.PDB_ID:+ symbol = new GlobalProcedureStartIa64StMsSymbol(pdb, reader);+ break;+ case LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldStMsSymbol.PDB_ID:+ symbol = new LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldStMsSymbol(pdb,+ reader);+ break;+ case LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldStMsSymbol.PDB_ID:+ symbol = new LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldStMsSymbol(+ pdb, reader);+ break;+ case AnnotationMsSymbol.PDB_ID:+ symbol = new AnnotationMsSymbol(pdb, reader);+ break;+ case GlobalManagedProcedureStMsSymbol.PDB_ID:+ symbol = new GlobalManagedProcedureStMsSymbol(pdb, reader);+ break;+ case LocalManagedProcedureStMsSymbol.PDB_ID:+ symbol = new LocalManagedProcedureStMsSymbol(pdb, reader);+ break;+ case Reserved1MsSymbol.PDB_ID:+ symbol = new Reserved1MsSymbol(pdb, reader);+ break;+ case Reserved2MsSymbol.PDB_ID:+ symbol = new Reserved2MsSymbol(pdb, reader);+ break;+ case Reserved3MsSymbol.PDB_ID:+ symbol = new Reserved3MsSymbol(pdb, reader);+ break;+ case Reserved4MsSymbol.PDB_ID:+ symbol = new Reserved4MsSymbol(pdb, reader);+ break;+ case LocalManagedDataStMsSymbol.PDB_ID:+ symbol = new LocalManagedDataStMsSymbol(pdb, reader);+ break;+ case GlobalManagedDataStMsSymbol.PDB_ID:+ symbol = new GlobalManagedDataStMsSymbol(pdb, reader);+ break;+ case ManagedLocalOrParameterRelativeToVirtualFramePointerStMsSymbol.PDB_ID:+ symbol =+ new ManagedLocalOrParameterRelativeToVirtualFramePointerStMsSymbol(pdb, reader);+ break;+ case ManagedLocalOrParameterStoredInRegisterStMsSymbol.PDB_ID:+ symbol = new ManagedLocalOrParameterStoredInRegisterStMsSymbol(pdb, reader);+ break;+ case ManagedSymbolWithSlotIndexFieldStMsSymbol.PDB_ID:+ symbol = new ManagedSymbolWithSlotIndexFieldStMsSymbol(pdb, reader);+ break;+ case ManagedLocalOrParameterStoredInManyRegisterStMsSymbol.PDB_ID:+ symbol = new ManagedLocalOrParameterStoredInManyRegisterStMsSymbol(pdb, reader);+ break;+ case ManagedLocalOrParameterRelativeToAlternateFramePointerStMsSymbol.PDB_ID:+ symbol = new ManagedLocalOrParameterRelativeToAlternateFramePointerStMsSymbol(pdb,+ reader);+ break;+ case ManagedLocalOrParameterStoredInManyRegister2StMsSymbol.PDB_ID:+ symbol = new ManagedLocalOrParameterStoredInManyRegister2StMsSymbol(pdb, reader);+ break;+ case IndexForTypeReferencedByNameFromMetadataMsSymbol.PDB_ID:+ symbol = new IndexForTypeReferencedByNameFromMetadataMsSymbol(pdb, reader);+ break;+ case UsingNamespaceStMsSymbol.PDB_ID:+ symbol = new UsingNamespaceStMsSymbol(pdb, reader);+ break;++ // 0x1100 block+ case ObjectNameMsSymbol.PDB_ID:+ symbol = new ObjectNameMsSymbol(pdb, reader);+ break;+ case Thunk32MsSymbol.PDB_ID:+ symbol = new Thunk32MsSymbol(pdb, reader);+ break;+ case Block32MsSymbol.PDB_ID:+ symbol = new Block32MsSymbol(pdb, reader);+ break;+ case With32MsSymbol.PDB_ID:+ symbol = new With32MsSymbol(pdb, reader);+ break;+ case Label32MsSymbol.PDB_ID:+ symbol = new Label32MsSymbol(pdb, reader);+ break;case RegisterMsSymbol.PDB_ID:symbol = new RegisterMsSymbol(pdb, reader);break;-// case ConstantMsSymbol.PDB_ID:-// symbol = new ConstantMsSymbol(pdb, reader);-// break;-// case UserDefinedTypeMsSymbol.PDB_ID:-// symbol = new UserDefinedTypeMsSymbol(pdb, reader);-// break;-// case CobolUserDefinedTypeMsSymbol.PDB_ID:-// symbol = new CobolUserDefinedTypeMsSymbol(pdb, reader);-// break;-// case ManyRegisterVariableMsSymbol.PDB_ID:-// symbol = new ManyRegisterVariableMsSymbol(pdb, reader);-// break;-// case BasePointerRelative32MsSymbol.PDB_ID:-// symbol = new BasePointerRelative32MsSymbol(pdb, reader);-// break;-// case LocalData32MsSymbol.PDB_ID:-// symbol = new LocalData32MsSymbol(pdb, reader);-// break;-// case GlobalData32MsSymbol.PDB_ID:-// symbol = new GlobalData32MsSymbol(pdb, reader);-// break;-// case Public32MsSymbol.PDB_ID:-// symbol = new Public32MsSymbol(pdb, reader);-// break;-// case LocalProcedureStart32MsSymbol.PDB_ID:-// symbol = new LocalProcedureStart32MsSymbol(pdb, reader);-// break;-// case GlobalProcedureStart32MsSymbol.PDB_ID:-// symbol = new GlobalProcedureStart32MsSymbol(pdb, reader);-// break;-// case RegisterRelativeAddress32MsSymbol.PDB_ID:-// symbol = new RegisterRelativeAddress32MsSymbol(pdb, reader);-// break;-// case LocalThreadStorage32MsSymbol.PDB_ID:-// symbol = new LocalThreadStorage32MsSymbol(pdb, reader);-// break;-// case GlobalThreadStorage32MsSymbol.PDB_ID:-// symbol = new GlobalThreadStorage32MsSymbol(pdb, reader);-// break;-// case LocalProcedureStartMipsMsSymbol.PDB_ID:-// symbol = new LocalProcedureStartMipsMsSymbol(pdb, reader);-// break;-// case GlobalProcedureStartMipsMsSymbol.PDB_ID:-// symbol = new GlobalProcedureStartMipsMsSymbol(pdb, reader);-// break;-// case Compile2MsSymbol.PDB_ID:-// symbol = new Compile2MsSymbol(pdb, reader);-// break;-// case ManyRegisterVariable2MsSymbol.PDB_ID:-// symbol = new ManyRegisterVariable2MsSymbol(pdb, reader);-// break;-// case LocalProcedureStartIa64MsSymbol.PDB_ID:-// symbol = new LocalProcedureStartIa64MsSymbol(pdb, reader);-// break;-// case GlobalProcedureStartIa64MsSymbol.PDB_ID:-// symbol = new GlobalProcedureStartIa64MsSymbol(pdb, reader);-// break;-// case LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol.PDB_ID:-// symbol =-// new LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol(pdb, reader);-// break;-// case LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol.PDB_ID:-// symbol = new LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol(pdb,-// reader);-// break;-// case LocalManagedDataMsSymbol.PDB_ID:-// symbol = new LocalManagedDataMsSymbol(pdb, reader);-// break;-// case GlobalManagedDataMsSymbol.PDB_ID:-// symbol = new GlobalManagedDataMsSymbol(pdb, reader);-// break;-// case ManagedLocalOrParameterRelativeToVirtualFramePointerMsSymbol.PDB_ID:-// symbol =-// new ManagedLocalOrParameterRelativeToVirtualFramePointerMsSymbol(pdb, reader);-// break;-// case ManagedLocalOrParameterStoredInRegisterMsSymbol.PDB_ID:-// symbol = new ManagedLocalOrParameterStoredInRegisterMsSymbol(pdb, reader);-// break;-// case ManagedSymbolWithSlotIndexFieldMsSymbol.PDB_ID:-// symbol = new ManagedSymbolWithSlotIndexFieldMsSymbol(pdb, reader);-// break;-// case ManagedLocalOrParameterStoredInManyRegisterMsSymbol.PDB_ID:-// symbol = new ManagedLocalOrParameterStoredInManyRegisterMsSymbol(pdb, reader);-// break;-// case ManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol.PDB_ID:-// symbol =-// new ManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol(pdb, reader);-// break;-// case ManagedLocalOrParameterStoredInManyRegister2MsSymbol.PDB_ID:-// symbol = new ManagedLocalOrParameterStoredInManyRegister2MsSymbol(pdb, reader);-// break;-// case UsingNamespaceMsSymbol.PDB_ID:-// symbol = new UsingNamespaceMsSymbol(pdb, reader);-// break;-// case ProcedureReferenceMsSymbol.PDB_ID:-// symbol = new ProcedureReferenceMsSymbol(pdb, reader);-// break;-// case DataReferenceMsSymbol.PDB_ID:-// symbol = new DataReferenceMsSymbol(pdb, reader);-// break;-// case LocalProcedureReferenceMsSymbol.PDB_ID:-// symbol = new LocalProcedureReferenceMsSymbol(pdb, reader);-// break;-// case AnnotationReferenceMsSymbol.PDB_ID:-// symbol = new AnnotationReferenceMsSymbol(pdb, reader);-// break;-// case TokenReferenceToManagedProcedureMsSymbol.PDB_ID:-// symbol = new TokenReferenceToManagedProcedureMsSymbol(pdb, reader);-// break;-// case GlobalManagedProcedureMsSymbol.PDB_ID:-// symbol = new GlobalManagedProcedureMsSymbol(pdb, reader);-// break;-// case LocalManagedProcedureMsSymbol.PDB_ID:-// symbol = new LocalManagedProcedureMsSymbol(pdb, reader);-// break;-// case TrampolineMsSymbol.PDB_ID:-// symbol = new TrampolineMsSymbol(pdb, reader);-// break;-// case ManagedConstantMsSymbol.PDB_ID:-// symbol = new ManagedConstantMsSymbol(pdb, reader);-// break;-// case AttributedLocalOrParameterRelativeToVirtualFramePointerMsSymbol.PDB_ID:-// symbol = new AttributedLocalOrParameterRelativeToVirtualFramePointerMsSymbol(pdb,-// reader);-// break;-// case AttributedLocalOrParameterStoredInRegisterMsSymbol.PDB_ID:-// symbol = new AttributedLocalOrParameterStoredInRegisterMsSymbol(pdb, reader);-// break;-// case AttributedLocalOrParameterRelativeToAlternateFramePointerMsSymbol.PDB_ID:-// symbol = new AttributedLocalOrParameterRelativeToAlternateFramePointerMsSymbol(pdb,-// reader);-// break;-// case AttributedLocalOrParameterStoredInManyRegisterMsSymbol.PDB_ID:-// symbol = new AttributedLocalOrParameterStoredInManyRegisterMsSymbol(pdb, reader);-// break;-// case SeparatedCodeFromCompilerSupportMsSymbol.PDB_ID:-// symbol = new SeparatedCodeFromCompilerSupportMsSymbol(pdb, reader);-// break;-// case LocalSymbolInOptimizedCode2005MsSymbol.PDB_ID:-// symbol = new LocalSymbolInOptimizedCode2005MsSymbol(pdb, reader);-// break;-// case DefinedSingleAddressRange2005MsSymbol.PDB_ID:-// symbol = new DefinedSingleAddressRange2005MsSymbol(pdb, reader);-// break;-// case DefinedMultipleAddressRanges2005MsSymbol.PDB_ID:-// symbol = new DefinedMultipleAddressRanges2005MsSymbol(pdb, reader);-// break;-// case PeCoffSectionMsSymbol.PDB_ID:-// symbol = new PeCoffSectionMsSymbol(pdb, reader);-// break;-// case PeCoffGroupMsSymbol.PDB_ID:-// symbol = new PeCoffGroupMsSymbol(pdb, reader);-// break;-// case ExportMsSymbol.PDB_ID:-// symbol = new ExportMsSymbol(pdb, reader);-// break;-// case IndirectCallSiteInfoMsSymbol.PDB_ID:-// symbol = new IndirectCallSiteInfoMsSymbol(pdb, reader);-// break;-// case FrameSecurityCookieMsSymbol.PDB_ID:-// symbol = new FrameSecurityCookieMsSymbol(pdb, reader);-// break;-// case DiscardedByLinkMsSymbol.PDB_ID:-// symbol = new DiscardedByLinkMsSymbol(pdb, reader);-// break;-// case Compile3MsSymbol.PDB_ID:-// symbol = new Compile3MsSymbol(pdb, reader);-// break;-// case EnvironmentBlockMsSymbol.PDB_ID:-// symbol = new EnvironmentBlockMsSymbol(pdb, reader);-// break;-// case LocalSymbolInOptimizedCodeMsSymbol.PDB_ID:-// symbol = new LocalSymbolInOptimizedCodeMsSymbol(pdb, reader);-// break;-// case DefinedSingleAddressRangeMsSymbol.PDB_ID:-// symbol = new DefinedSingleAddressRangeMsSymbol(pdb, reader);-// break;-// case DefinedSingleAddressRangeForSubfieldMsSymbol.PDB_ID:-// symbol = new DefinedSingleAddressRangeForSubfieldMsSymbol(pdb, reader);-// break;-// case DefinedSingleAddressRangeForEnregisteredSymbolMsSymbol.PDB_ID:-// symbol = new DefinedSingleAddressRangeForEnregisteredSymbolMsSymbol(pdb, reader);-// break;-// case DefinedSingleAddressRangeForFramePointerRelativeMsSymbol.PDB_ID:-// symbol = new DefinedSingleAddressRangeForFramePointerRelativeMsSymbol(pdb, reader);-// break;-// case DefinedSingleAddressRangeForEnregisteredFieldOfSymbolMsSymbol.PDB_ID:-// symbol =-// new DefinedSingleAddressRangeForEnregisteredFieldOfSymbolMsSymbol(pdb, reader);-// break;-// case DefinedSingleAddressRangeForFramePointerRelativeFullScopeMsSymbol.PDB_ID:-// symbol = new DefinedSingleAddressRangeForFramePointerRelativeFullScopeMsSymbol(pdb,-// reader);-// break;-// case DefinedSingleAddressRangeForEnregisteredSymbolRelativeMsSymbol.PDB_ID:-// symbol =-// new DefinedSingleAddressRangeForEnregisteredSymbolRelativeMsSymbol(pdb, reader);-// break;-// case LocalProcedure32IdMsSymbol.PDB_ID:-// symbol = new LocalProcedure32IdMsSymbol(pdb, reader);-// break;-// case GlobalProcedure32IdMsSymbol.PDB_ID:-// symbol = new GlobalProcedure32IdMsSymbol(pdb, reader);-// break;-// case LocalProcedureMipsIdMsSymbol.PDB_ID:-// symbol = new LocalProcedureMipsIdMsSymbol(pdb, reader);-// break;-// case GlobalProcedureMipsIdMsSymbol.PDB_ID:-// symbol = new GlobalProcedureMipsIdMsSymbol(pdb, reader);-// break;-// case LocalProcedureIa64IdMsSymbol.PDB_ID:-// symbol = new LocalProcedureIa64IdMsSymbol(pdb, reader);-// break;-// case GlobalProcedureIa64IdMsSymbol.PDB_ID:-// symbol = new GlobalProcedureIa64IdMsSymbol(pdb, reader);-// break;-// case BuildInformationMsSymbol.PDB_ID:-// symbol = new BuildInformationMsSymbol(pdb, reader);-// break;-// case InlinedFunctionCallsiteMsSymbol.PDB_ID:-// symbol = new InlinedFunctionCallsiteMsSymbol(pdb, reader);-// break;-// case InlinedFunctionEndMsSymbol.PDB_ID:-// symbol = new InlinedFunctionEndMsSymbol(pdb, reader);-// break;-// case ProcedureIdEndMsSymbol.PDB_ID:-// symbol = new ProcedureIdEndMsSymbol(pdb, reader);-// break;-// case DefinedAddressRangeHighLevelShaderLanguageMsSymbol.PDB_ID:-// symbol = new DefinedAddressRangeHighLevelShaderLanguageMsSymbol(pdb, reader);-// break;-// case GlobalDataHighLevelShaderLanguageMsSymbol.PDB_ID:-// symbol = new GlobalDataHighLevelShaderLanguageMsSymbol(pdb, reader);-// break;-// case LocalDataHighLevelShaderLanguageMsSymbol.PDB_ID:-// symbol = new LocalDataHighLevelShaderLanguageMsSymbol(pdb, reader);-// break;-// case FileStaticMsSymbol.PDB_ID:-// symbol = new FileStaticMsSymbol(pdb, reader);-// break;-// case LocalDeferredProcedureCallGroupSharedMsSymbol.PDB_ID:-// symbol = new LocalDeferredProcedureCallGroupSharedMsSymbol(pdb, reader);-// break;-// case LocalProcedureStart32DeferredProcedureCallMsSymbol.PDB_ID:-// symbol = new LocalProcedureStart32DeferredProcedureCallMsSymbol(pdb, reader);-// break;-// case LocalProcedure32DeferredProcedureCallIdMsSymbol.PDB_ID:-// symbol = new LocalProcedure32DeferredProcedureCallIdMsSymbol(pdb, reader);-// break;-// case DefinedAddressRangeDeferredProcedureCallPointerTagMsSymbol.PDB_ID:-// symbol =-// new DefinedAddressRangeDeferredProcedureCallPointerTagMsSymbol(pdb, reader);-// break;-// case DeferredProcedureCallPointerTagToSymbolRecordMapMsSymbol.PDB_ID:-// symbol = new DeferredProcedureCallPointerTagToSymbolRecordMapMsSymbol(pdb, reader);-// break;-// case ArmSwitchTableMsSymbol.PDB_ID:-// symbol = new ArmSwitchTableMsSymbol(pdb, reader);-// break;-// case CalleesMsSymbol.PDB_ID:-// symbol = new CalleesMsSymbol(pdb, reader);-// break;-// case CallersMsSymbol.PDB_ID:-// symbol = new CallersMsSymbol(pdb, reader);-// break;-// case ProfileGuidedOptimizationDataMsSymbol.PDB_ID:-// symbol = new ProfileGuidedOptimizationDataMsSymbol(pdb, reader);-// break;-// case InlinedFunctionCallsiteExtendedMsSymbol.PDB_ID:-// symbol = new InlinedFunctionCallsiteExtendedMsSymbol(pdb, reader);-// break;-// case HeapAllocationSiteMsSymbol.PDB_ID:-// symbol = new HeapAllocationSiteMsSymbol(pdb, reader);-// break;-// case ModuleTypeReferenceMsSymbol.PDB_ID:-// symbol = new ModuleTypeReferenceMsSymbol(pdb, reader);-// break;-// case MiniPdbReferenceMsSymbol.PDB_ID:-// symbol = new MiniPdbReferenceMsSymbol(pdb, reader);-// break;-// case MapToMiniPdbMsSymbol.PDB_ID:-// symbol = new MapToMiniPdbMsSymbol(pdb, reader);-// break;-// case GlobalDataHighLevelShaderLanguage32MsSymbol.PDB_ID:-// symbol = new GlobalDataHighLevelShaderLanguage32MsSymbol(pdb, reader);-// break;-// case LocalDataHighLevelShaderLanguage32MsSymbol.PDB_ID:-// symbol = new LocalDataHighLevelShaderLanguage32MsSymbol(pdb, reader);-// break;-// case GlobalDataHighLevelShaderLanguage32ExtendedMsSymbol.PDB_ID:-// symbol = new GlobalDataHighLevelShaderLanguage32ExtendedMsSymbol(pdb, reader);-// break;-// case LocalDataHighLevelShaderLanguage32ExtendedMsSymbol.PDB_ID:-// symbol = new LocalDataHighLevelShaderLanguage32ExtendedMsSymbol(pdb, reader);-// break;-//-// // These should never happen (unless we missed something-// // or MSFT has added new in a version we do not handle.-// // We have recently seen 1167 and 1168, which implies that 1166 must exist.-// case UnknownX1166MsSymbol.PDB_ID:-// symbol = new UnknownX1166MsSymbol(pdb, reader);-// break;-// case UnknownX1167MsSymbol.PDB_ID:-// symbol = new UnknownX1167MsSymbol(pdb, reader);-// break;-// case UnknownX1168MsSymbol.PDB_ID:-// symbol = new UnknownX1168MsSymbol(pdb, reader);-// break;+ case ConstantMsSymbol.PDB_ID:+ symbol = new ConstantMsSymbol(pdb, reader);+ break;+ case UserDefinedTypeMsSymbol.PDB_ID:+ symbol = new UserDefinedTypeMsSymbol(pdb, reader);+ break;+ case CobolUserDefinedTypeMsSymbol.PDB_ID:+ symbol = new CobolUserDefinedTypeMsSymbol(pdb, reader);+ break;+ case ManyRegisterVariableMsSymbol.PDB_ID:+ symbol = new ManyRegisterVariableMsSymbol(pdb, reader);+ break;+ case BasePointerRelative32MsSymbol.PDB_ID:+ symbol = new BasePointerRelative32MsSymbol(pdb, reader);+ break;+ case LocalData32MsSymbol.PDB_ID:+ symbol = new LocalData32MsSymbol(pdb, reader);+ break;+ case GlobalData32MsSymbol.PDB_ID:+ symbol = new GlobalData32MsSymbol(pdb, reader);+ break;+ case Public32MsSymbol.PDB_ID:+ symbol = new Public32MsSymbol(pdb, reader);+ break;+ case LocalProcedureStart32MsSymbol.PDB_ID:+ symbol = new LocalProcedureStart32MsSymbol(pdb, reader);+ break;+ case GlobalProcedureStart32MsSymbol.PDB_ID:+ symbol = new GlobalProcedureStart32MsSymbol(pdb, reader);+ break;+ case RegisterRelativeAddress32MsSymbol.PDB_ID:+ symbol = new RegisterRelativeAddress32MsSymbol(pdb, reader);+ break;+ case LocalThreadStorage32MsSymbol.PDB_ID:+ symbol = new LocalThreadStorage32MsSymbol(pdb, reader);+ break;+ case GlobalThreadStorage32MsSymbol.PDB_ID:+ symbol = new GlobalThreadStorage32MsSymbol(pdb, reader);+ break;+ case LocalProcedureStartMipsMsSymbol.PDB_ID:+ symbol = new LocalProcedureStartMipsMsSymbol(pdb, reader);+ break;+ case GlobalProcedureStartMipsMsSymbol.PDB_ID:+ symbol = new GlobalProcedureStartMipsMsSymbol(pdb, reader);+ break;+ case Compile2MsSymbol.PDB_ID:+ symbol = new Compile2MsSymbol(pdb, reader);+ break;+ case ManyRegisterVariable2MsSymbol.PDB_ID:+ symbol = new ManyRegisterVariable2MsSymbol(pdb, reader);+ break;+ case LocalProcedureStartIa64MsSymbol.PDB_ID:+ symbol = new LocalProcedureStartIa64MsSymbol(pdb, reader);+ break;+ case GlobalProcedureStartIa64MsSymbol.PDB_ID:+ symbol = new GlobalProcedureStartIa64MsSymbol(pdb, reader);+ break;+ case LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol.PDB_ID:+ symbol =+ new LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol(pdb, reader);+ break;+ case LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol.PDB_ID:+ symbol = new LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol(pdb,+ reader);+ break;+ case LocalManagedDataMsSymbol.PDB_ID:+ symbol = new LocalManagedDataMsSymbol(pdb, reader);+ break;+ case GlobalManagedDataMsSymbol.PDB_ID:+ symbol = new GlobalManagedDataMsSymbol(pdb, reader);+ break;+ case ManagedLocalOrParameterRelativeToVirtualFramePointerMsSymbol.PDB_ID:+ symbol =+ new ManagedLocalOrParameterRelativeToVirtualFramePointerMsSymbol(pdb, reader);+ break;+ case ManagedLocalOrParameterStoredInRegisterMsSymbol.PDB_ID:+ symbol = new ManagedLocalOrParameterStoredInRegisterMsSymbol(pdb, reader);+ break;+ case ManagedSymbolWithSlotIndexFieldMsSymbol.PDB_ID:+ symbol = new ManagedSymbolWithSlotIndexFieldMsSymbol(pdb, reader);+ break;+ case ManagedLocalOrParameterStoredInManyRegisterMsSymbol.PDB_ID:+ symbol = new ManagedLocalOrParameterStoredInManyRegisterMsSymbol(pdb, reader);+ break;+ case ManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol.PDB_ID:+ symbol =+ new ManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol(pdb, reader);+ break;+ case ManagedLocalOrParameterStoredInManyRegister2MsSymbol.PDB_ID:+ symbol = new ManagedLocalOrParameterStoredInManyRegister2MsSymbol(pdb, reader);+ break;+ case UsingNamespaceMsSymbol.PDB_ID:+ symbol = new UsingNamespaceMsSymbol(pdb, reader);+ break;+ case ProcedureReferenceMsSymbol.PDB_ID:+ symbol = new ProcedureReferenceMsSymbol(pdb, reader);+ break;+ case DataReferenceMsSymbol.PDB_ID:+ symbol = new DataReferenceMsSymbol(pdb, reader);+ break;+ case LocalProcedureReferenceMsSymbol.PDB_ID:+ symbol = new LocalProcedureReferenceMsSymbol(pdb, reader);+ break;+ case AnnotationReferenceMsSymbol.PDB_ID:+ symbol = new AnnotationReferenceMsSymbol(pdb, reader);+ break;+ case TokenReferenceToManagedProcedureMsSymbol.PDB_ID:+ symbol = new TokenReferenceToManagedProcedureMsSymbol(pdb, reader);+ break;+ case GlobalManagedProcedureMsSymbol.PDB_ID:+ symbol = new GlobalManagedProcedureMsSymbol(pdb, reader);+ break;+ case LocalManagedProcedureMsSymbol.PDB_ID:+ symbol = new LocalManagedProcedureMsSymbol(pdb, reader);+ break;+ case TrampolineMsSymbol.PDB_ID:+ symbol = new TrampolineMsSymbol(pdb, reader);+ break;+ case ManagedConstantMsSymbol.PDB_ID:+ symbol = new ManagedConstantMsSymbol(pdb, reader);+ break;+ case AttributedLocalOrParameterRelativeToVirtualFramePointerMsSymbol.PDB_ID:+ symbol = new AttributedLocalOrParameterRelativeToVirtualFramePointerMsSymbol(pdb,+ reader);+ break;+ case AttributedLocalOrParameterStoredInRegisterMsSymbol.PDB_ID:+ symbol = new AttributedLocalOrParameterStoredInRegisterMsSymbol(pdb, reader);+ break;+ case AttributedLocalOrParameterRelativeToAlternateFramePointerMsSymbol.PDB_ID:+ symbol = new AttributedLocalOrParameterRelativeToAlternateFramePointerMsSymbol(pdb,+ reader);+ break;+ case AttributedLocalOrParameterStoredInManyRegisterMsSymbol.PDB_ID:+ symbol = new AttributedLocalOrParameterStoredInManyRegisterMsSymbol(pdb, reader);+ break;+ case SeparatedCodeFromCompilerSupportMsSymbol.PDB_ID:+ symbol = new SeparatedCodeFromCompilerSupportMsSymbol(pdb, reader);+ break;+ case LocalSymbolInOptimizedCode2005MsSymbol.PDB_ID:+ symbol = new LocalSymbolInOptimizedCode2005MsSymbol(pdb, reader);+ break;+ case DefinedSingleAddressRange2005MsSymbol.PDB_ID:+ symbol = new DefinedSingleAddressRange2005MsSymbol(pdb, reader);+ break;+ case DefinedMultipleAddressRanges2005MsSymbol.PDB_ID:+ symbol = new DefinedMultipleAddressRanges2005MsSymbol(pdb, reader);+ break;+ case PeCoffSectionMsSymbol.PDB_ID:+ symbol = new PeCoffSectionMsSymbol(pdb, reader);+ break;+ case PeCoffGroupMsSymbol.PDB_ID:+ symbol = new PeCoffGroupMsSymbol(pdb, reader);+ break;+ case ExportMsSymbol.PDB_ID:+ symbol = new ExportMsSymbol(pdb, reader);+ break;+ case IndirectCallSiteInfoMsSymbol.PDB_ID:+ symbol = new IndirectCallSiteInfoMsSymbol(pdb, reader);+ break;+ case FrameSecurityCookieMsSymbol.PDB_ID:+ symbol = new FrameSecurityCookieMsSymbol(pdb, reader);+ break;+ case DiscardedByLinkMsSymbol.PDB_ID:+ symbol = new DiscardedByLinkMsSymbol(pdb, reader);+ break;+ case Compile3MsSymbol.PDB_ID:+ symbol = new Compile3MsSymbol(pdb, reader);+ break;+ case EnvironmentBlockMsSymbol.PDB_ID:+ symbol = new EnvironmentBlockMsSymbol(pdb, reader);+ break;+ case LocalSymbolInOptimizedCodeMsSymbol.PDB_ID:+ symbol = new LocalSymbolInOptimizedCodeMsSymbol(pdb, reader);+ break;+ case DefinedSingleAddressRangeMsSymbol.PDB_ID:+ symbol = new DefinedSingleAddressRangeMsSymbol(pdb, reader);+ break;+ case DefinedSingleAddressRangeForSubfieldMsSymbol.PDB_ID:+ symbol = new DefinedSingleAddressRangeForSubfieldMsSymbol(pdb, reader);+ break;+ case DefinedSingleAddressRangeForEnregisteredSymbolMsSymbol.PDB_ID:+ symbol = new DefinedSingleAddressRangeForEnregisteredSymbolMsSymbol(pdb, reader);+ break;+ case DefinedSingleAddressRangeForFramePointerRelativeMsSymbol.PDB_ID:+ symbol = new DefinedSingleAddressRangeForFramePointerRelativeMsSymbol(pdb, reader);+ break;+ case DefinedSingleAddressRangeForEnregisteredFieldOfSymbolMsSymbol.PDB_ID:+ symbol =+ new DefinedSingleAddressRangeForEnregisteredFieldOfSymbolMsSymbol(pdb, reader);+ break;+ case DefinedSingleAddressRangeForFramePointerRelativeFullScopeMsSymbol.PDB_ID:+ symbol = new DefinedSingleAddressRangeForFramePointerRelativeFullScopeMsSymbol(pdb,+ reader);+ break;+ case DefinedSingleAddressRangeForEnregisteredSymbolRelativeMsSymbol.PDB_ID:+ symbol =+ new DefinedSingleAddressRangeForEnregisteredSymbolRelativeMsSymbol(pdb, reader);+ break;+ case LocalProcedure32IdMsSymbol.PDB_ID:+ symbol = new LocalProcedure32IdMsSymbol(pdb, reader);+ break;+ case GlobalProcedure32IdMsSymbol.PDB_ID:+ symbol = new GlobalProcedure32IdMsSymbol(pdb, reader);+ break;+ case LocalProcedureMipsIdMsSymbol.PDB_ID:+ symbol = new LocalProcedureMipsIdMsSymbol(pdb, reader);+ break;+ case GlobalProcedureMipsIdMsSymbol.PDB_ID:+ symbol = new GlobalProcedureMipsIdMsSymbol(pdb, reader);+ break;+ case LocalProcedureIa64IdMsSymbol.PDB_ID:+ symbol = new LocalProcedureIa64IdMsSymbol(pdb, reader);+ break;+ case GlobalProcedureIa64IdMsSymbol.PDB_ID:+ symbol = new GlobalProcedureIa64IdMsSymbol(pdb, reader);+ break;+ case BuildInformationMsSymbol.PDB_ID:+ symbol = new BuildInformationMsSymbol(pdb, reader);+ break;+ case InlinedFunctionCallsiteMsSymbol.PDB_ID:+ symbol = new InlinedFunctionCallsiteMsSymbol(pdb, reader);+ break;+ case InlinedFunctionEndMsSymbol.PDB_ID:+ symbol = new InlinedFunctionEndMsSymbol(pdb, reader);+ break;+ case ProcedureIdEndMsSymbol.PDB_ID:+ symbol = new ProcedureIdEndMsSymbol(pdb, reader);+ break;+ case DefinedAddressRangeHighLevelShaderLanguageMsSymbol.PDB_ID:+ symbol = new DefinedAddressRangeHighLevelShaderLanguageMsSymbol(pdb, reader);+ break;+ case GlobalDataHighLevelShaderLanguageMsSymbol.PDB_ID:+ symbol = new GlobalDataHighLevelShaderLanguageMsSymbol(pdb, reader);+ break;+ case LocalDataHighLevelShaderLanguageMsSymbol.PDB_ID:+ symbol = new LocalDataHighLevelShaderLanguageMsSymbol(pdb, reader);+ break;+ case FileStaticMsSymbol.PDB_ID:+ symbol = new FileStaticMsSymbol(pdb, reader);+ break;+ case LocalDeferredProcedureCallGroupSharedMsSymbol.PDB_ID:+ symbol = new LocalDeferredProcedureCallGroupSharedMsSymbol(pdb, reader);+ break;+ case LocalProcedureStart32DeferredProcedureCallMsSymbol.PDB_ID:+ symbol = new LocalProcedureStart32DeferredProcedureCallMsSymbol(pdb, reader);+ break;+ case LocalProcedure32DeferredProcedureCallIdMsSymbol.PDB_ID:+ symbol = new LocalProcedure32DeferredProcedureCallIdMsSymbol(pdb, reader);+ break;+ case DefinedAddressRangeDeferredProcedureCallPointerTagMsSymbol.PDB_ID:+ symbol =+ new DefinedAddressRangeDeferredProcedureCallPointerTagMsSymbol(pdb, reader);+ break;+ case DeferredProcedureCallPointerTagToSymbolRecordMapMsSymbol.PDB_ID:+ symbol = new DeferredProcedureCallPointerTagToSymbolRecordMapMsSymbol(pdb, reader);+ break;+ case ArmSwitchTableMsSymbol.PDB_ID:+ symbol = new ArmSwitchTableMsSymbol(pdb, reader);+ break;+ case CalleesMsSymbol.PDB_ID:+ symbol = new CalleesMsSymbol(pdb, reader);+ break;+ case CallersMsSymbol.PDB_ID:+ symbol = new CallersMsSymbol(pdb, reader);+ break;+ case ProfileGuidedOptimizationDataMsSymbol.PDB_ID:+ symbol = new ProfileGuidedOptimizationDataMsSymbol(pdb, reader);+ break;+ case InlinedFunctionCallsiteExtendedMsSymbol.PDB_ID:+ symbol = new InlinedFunctionCallsiteExtendedMsSymbol(pdb, reader);+ break;+ case HeapAllocationSiteMsSymbol.PDB_ID:+ symbol = new HeapAllocationSiteMsSymbol(pdb, reader);+ break;+ case ModuleTypeReferenceMsSymbol.PDB_ID:+ symbol = new ModuleTypeReferenceMsSymbol(pdb, reader);+ break;+ case MiniPdbReferenceMsSymbol.PDB_ID:+ symbol = new MiniPdbReferenceMsSymbol(pdb, reader);+ break;+ case MapToMiniPdbMsSymbol.PDB_ID:+ symbol = new MapToMiniPdbMsSymbol(pdb, reader);+ break;+ case GlobalDataHighLevelShaderLanguage32MsSymbol.PDB_ID:+ symbol = new GlobalDataHighLevelShaderLanguage32MsSymbol(pdb, reader);+ break;+ case LocalDataHighLevelShaderLanguage32MsSymbol.PDB_ID:+ symbol = new LocalDataHighLevelShaderLanguage32MsSymbol(pdb, reader);+ break;+ case GlobalDataHighLevelShaderLanguage32ExtendedMsSymbol.PDB_ID:+ symbol = new GlobalDataHighLevelShaderLanguage32ExtendedMsSymbol(pdb, reader);+ break;+ case LocalDataHighLevelShaderLanguage32ExtendedMsSymbol.PDB_ID:+ symbol = new LocalDataHighLevelShaderLanguage32ExtendedMsSymbol(pdb, reader);+ break;++ // These should never happen (unless we missed something+ // or MSFT has added new in a version we do not handle.+ // We have recently seen 1167 and 1168, which implies that 1166 must exist.+ case UnknownX1166MsSymbol.PDB_ID:+ symbol = new UnknownX1166MsSymbol(pdb, reader);+ break;+ case UnknownX1167MsSymbol.PDB_ID:+ symbol = new UnknownX1167MsSymbol(pdb, reader);+ break;+ case UnknownX1168MsSymbol.PDB_ID:+ symbol = new UnknownX1168MsSymbol(pdb, reader);+ break;default://System.out.println(String.format("Unknown symbolType: %04x", symbolType));//System.out.println(reader.dump(0x200));diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractBasePointerRelativeMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractBasePointerRelativeMsSymbol.javanew file mode 100644index 0000000000..620460cec3--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractBasePointerRelativeMsSymbol.java@@ -0,0 +1,64 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Base Pointer Relative symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractBasePointerRelativeMsSymbol extends AbstractMsSymbol {++ protected AbstractOffset offset;+ protected AbstractTypeIndex typeIndex;+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractBasePointerRelativeMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ offset.parse(reader);+ typeIndex.parse(reader);+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex.get()));+ pdb.popDependencyStack();+ name.parse(reader);+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: [%08X], Type: %s, %s", getSymbolTypeName(), offset.get(),+ pdb.getTypeRecord(typeIndex.get()), name));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #offset}, {@link #typeIndex}, and {@link #name}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractBlockMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractBlockMsSymbol.javanew file mode 100644index 0000000000..f93df6ba60--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractBlockMsSymbol.java@@ -0,0 +1,118 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Block symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractBlockMsSymbol extends AbstractMsSymbol {++ protected long parentPointer;+ protected long endPointer;+ protected AbstractOffset length;+ protected AbstractOffset offset;+ protected int segment;+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractBlockMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ create();+ parentPointer = reader.parseUnsignedIntVal();+ endPointer = reader.parseUnsignedIntVal();+ length.parse(reader);+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ name.parse(reader);+ reader.align4();+ }++ /**+ * Returns the parent pointer.+ * @return Parent pointer.+ */+ public long getParentPointer() {+ return parentPointer;+ }++ /**+ * Returns the end pointer.+ * @return End pointer.+ */+ public long getEndPointer() {+ return endPointer;+ }++ /**+ * Returns the length.+ * @return Length.+ */+ public long getLength() {+ return length.get();+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public long getOffset() {+ return offset.get();+ }++ /**+ * Returns the segment.+ * @return Segment.+ */+ public int getSegment() {+ return segment;+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return name.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(String.format(": [%04X:%08X], Length: %08X, %s\n", segment, offset.get(),+ length.get(), name.get()));+ builder.append(String.format(" Parent: %08X, End: %08X\n", parentPointer, endPointer));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #length}, {@link #offset}, and {@link #name}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractChangeExecutionModelMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractChangeExecutionModelMsSymbol.javanew file mode 100644index 0000000000..e18767b251--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractChangeExecutionModelMsSymbol.java@@ -0,0 +1,172 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.HashMap;+import java.util.Map;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractOffset;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Change Execution Model symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractChangeExecutionModelMsSymbol extends AbstractMsSymbol {++ public enum Model {++ TABLE("DATA", 0x00),+ JUMPTABLE("JUMPTABLE", 0x01),+ DATAPAD("DATAPAD", 0x02),+ NATIVE("NATIVE", 0x20),+ COBOL("COBOL", 0x21),+ CODEPAD("CODEPAD", 0x22),+ CODE("CODE", 0x23),+ SQL("SQL", 0x30),+ PCODE("PCODE", 0x40),+ PCODE32MACINTOSH("PCODE for the Mac", 0x41),+ PCODE32MACINTOSH_NATIVE_ENTRY_POINT("PCODE for the Mac (Native Entry Point)", 0x42),+ JAVAINT("JAVAINT", 0x50),+ UNKNOWN("UNKNOWN MODEL", 0Xff);++ private static final Map<Integer, Model> BY_VALUE = new HashMap<>();+ static {+ for (Model val : values()) {+ BY_VALUE.put(val.value, val);+ }+ }++ public final String label;+ public final int value;++ @Override+ public String toString() {+ return label;+ }++ public static Model fromValue(int val) {+ return BY_VALUE.getOrDefault(val, UNKNOWN);+ }++ private Model(String label, int value) {+ this.label = label;+ this.value = value;+ }+ }++ //==============================================================================================+ protected AbstractOffset offset;+ protected int segment;+ protected int modelVal;+ protected Model model;+ // For pcode:+ protected long offsetToPcodeFunctionTable;+ protected long offsetToSegmentPcodeInformation;+ // For cobol:+ protected int subtype; // subtype (API: values are missing)+ protected int flag;++ //==============================================================================================+ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public AbstractChangeExecutionModelMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ modelVal = reader.parseUnsignedShortVal();+ model = Model.fromValue(modelVal);+ parseSpecifics(reader);+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s:\n segment, offset = %04X:%08X, model = ",+ getSymbolTypeName(), segment, offset.get()));+ if (emitAdditionalModelCases(builder)) {+ return;+ }+ builder.append(model);+ if (model == Model.COBOL) {+ builder.append("\n");+ switch (subtype) {+ case 0x00:+ builder.append(" don't stop until next execution model\n");+ break;+ case 0x01:+ builder.append(" inter-segment perform - treat as single call instruction\n");+ break;+ case 0x02:+ builder.append(" false call - step into even with F10\n");+ break;+ case 0x03:+ builder.append(+ String.format(" call to EXTCALL - step into %d call levels\n", flag));+ break;+ default:+ builder.append(String.format(" UNKNOWN COBOL CONTROL 0x%04X\n", subtype));+ break;+ }+ }+ else if (model == Model.PCODE) {+ builder.append("\n");+ builder.append(String.format(+ "offsetToPcodeFunctionTable = %08X, offsetToSegmentPcodeInformation = %08X\n",+ offsetToPcodeFunctionTable, offsetToSegmentPcodeInformation));+ }+ else if (model == Model.UNKNOWN) {+ builder.append(String.format(" = %04X\n", modelVal));+ }+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #offset}.+ */+ protected abstract void create();++ /**+ * Parses some specific values for this version of symbol.+ * <P>+ * Implementing class must, in the appropriate order pertinent to itself, parse+ * {@link #subtype} and {@link #flag} if+ * {@link #model}=={@link #AbstractChangeExecutionModelMsSymbol.Model.COBOL} or+ * {@link #offsetToPcodeFunctionTable} and {@link #offsetToSegmentPcodeInformation} if+ * {@link #model}=={@link #AbstractChangeExecutionModelMsSymbol.Model.PCODE}.+ * @param reader {@link PdbByteReader} from which to parse the information.+ * @throws PdbException Upon not enough data left to parse.+ */+ protected abstract void parseSpecifics(PdbByteReader reader) throws PdbException;++ /**+ * Emits additional model cases for the parser.+ * @param builder {@link StringBuilder} to which the information is emitted.+ * @return True if found a known case.+ */+ protected abstract boolean emitAdditionalModelCases(StringBuilder builder);++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractCobolUserDefinedTypeMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractCobolUserDefinedTypeMsSymbol.javanew file mode 100644index 0000000000..a1338fdf8d--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractCobolUserDefinedTypeMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Cobol User Defined Type symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractCobolUserDefinedTypeMsSymbol extends AbstractMsSymbol {++ protected AbstractUserDefinedTypeSymbolInternals internals;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractCobolUserDefinedTypeMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ internals.parse(reader);+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ internals.emit(builder);+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #internals}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractCompile2MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractCompile2MsSymbol.javanew file mode 100644index 0000000000..31f988e978--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractCompile2MsSymbol.java@@ -0,0 +1,323 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.ArrayList;+import java.util.List;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Compile 2 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractCompile2MsSymbol extends AbstractMsSymbol {++ protected LanguageName language;+ protected boolean compiledForEditAndContinue;+ protected boolean notCompiledWithDebugInfo;+ protected boolean compiledWithLinkTimeCodeGeneration;+ protected boolean compiledWithBzalignNoDataAlign;+ protected boolean managedCodeDataPresent;+ protected boolean compiledWithGsBufferSecurityChecks;+ protected boolean compiledWithHotPatch;+ // Converted from (.NET IL) Common Intermediate Language Module+ protected boolean convertedWithCvtcil;+ protected boolean microsoftIntermediateLanguageNetModule;+ protected int processorIndex;+ protected ProcessorName processor;+ protected int frontEndMajorVersionNumber;+ protected int frontEndMinorVersionNumber;+ protected int frontEndBuildVersionNumber;+ protected int backEndMajorVersionNumber;+ protected int backEndMinorVersionNumber;+ protected int backEndBuildVersionNumber;+ protected AbstractString compilerVersionString;+ protected List<AbstractString> stringList = new ArrayList<>();++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractCompile2MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ create();+ processFlags(reader.parseUnsignedIntVal());+ processorIndex = reader.parseUnsignedShortVal();+ processor = new ProcessorName(processorIndex);+ frontEndMajorVersionNumber = reader.parseUnsignedShortVal();+ frontEndMinorVersionNumber = reader.parseUnsignedShortVal();+ frontEndBuildVersionNumber = reader.parseUnsignedShortVal();+ backEndMajorVersionNumber = reader.parseUnsignedShortVal();+ backEndMinorVersionNumber = reader.parseUnsignedShortVal();+ backEndBuildVersionNumber = reader.parseUnsignedShortVal();+ //TODO: This might be a set of null-terminated strings... look at real data.+ compilerVersionString.parse(reader);+ while (reader.hasMore()) {+ AbstractString string = new StringUtf8Nt();+ string.parse(reader);+ if (string.get().length() == 0) {+ break;+ }+ stringList.add(string);+ }+ reader.align4();++ // Very important: Store target machine information. It is used elsewhere, including+ // in RegisterName.+ pdb.setTargetProcessorIndexNumber(processorIndex);+ }++ /**+ * Returns the language used.+ * @return Language.+ */+ public String getLanguage() {+ return language.toString();+ }++ /**+ * Tells whether the target was compiled for "Edit and Continue."+ * @return True if it was compiled for "Edit and Continue."+ */+ public boolean isCompiledForEditAndContinue() {+ return compiledForEditAndContinue;+ }++ /**+ * Tells whether the target was not compiled with debug information.+ * @return True if it was not compiled with debug information.+ */+ public boolean isNotCompiledWithDebugInfo() {+ return notCompiledWithDebugInfo;+ }++ /**+ * Tells whether the target was compiled with link-time code generation.+ * @return True if it was compiled with link-time code generation.+ */+ public boolean isCompiledWithLinkTimeCodeGeneration() {+ return compiledWithLinkTimeCodeGeneration;+ }++ /**+ * Tells whether the target was compiled with Bzalign.+ * @return True if compiled with Bzalign.+ */+ public boolean isCompiledWithBzalignNoDataAlign() {+ return compiledWithBzalignNoDataAlign;+ }++ /**+ * Tells whether the target has managed code and/or data present.+ * @return True if has managed code/data present.+ */+ public boolean isManagedCodeDataPresent() {+ return managedCodeDataPresent;+ }++ /**+ * Tells whether the target was compiled with /GS buffer security checks.+ * @return True if it was compiled with /GS buffer security checks.+ */+ public boolean isCompiledWithGsBufferSecurityChecks() {+ return compiledWithGsBufferSecurityChecks;+ }++ /**+ * Tells whether the target was compiled with /hotpatch.+ * @return True if it was compiled with /hotpatch.+ */+ public boolean isCompiledWithHotPatch() {+ return compiledWithHotPatch;+ }++ /**+ * Tells whether the target was converted with CVTCIL.+ * @return True if was converted with CVTCIL.+ */+ public boolean isConvertedWithCvtcil() {+ return convertedWithCvtcil;+ }++ /**+ * Tells whether the target is a Microsoft Intermediate Language netmodule.+ * @return True if it is a Microsoft Intermediate Language netmodule.+ */+ public boolean isMicrosoftIntermediateLanguageNetModule() {+ return microsoftIntermediateLanguageNetModule;+ }++ /**+ * Returns the processor index.+ * @return Processor index.+ */+ public int getProcessorIndex() {+ return processorIndex;+ }++ /**+ * Returns the processor name.+ * @return Processor name.+ */+ public String getProcessorName() {+ return processor.toString();+ }++ /**+ * Returns the front end major version number.+ * @return Front end major version number.+ */+ public int getFrontEndMajorVersionNumber() {+ return frontEndMajorVersionNumber;+ }++ /**+ * Returns the front end minor version number.+ * @return Front end minor version number.+ */+ public int getFrontEndMinorVersionNumber() {+ return frontEndMinorVersionNumber;+ }++ /**+ * Returns the front end build version number.+ * @return Front end build version number.+ */+ public int getFrontEndBuildVersionNumber() {+ return frontEndBuildVersionNumber;+ }++ /**+ * Returns the back end major version number.+ * @return Back end major version number.+ */+ public int getBackEndMajorVersionNumber() {+ return backEndMajorVersionNumber;+ }++ /**+ * Returns the back end minor version number.+ * @return Back end minor version number.+ */+ public int getBackEndMinorVersionNumber() {+ return backEndMinorVersionNumber;+ }++ /**+ * Returns the back end build version number.+ * @return Back end build version number.+ */+ public int getBackEndBuildVersionNumber() {+ return backEndBuildVersionNumber;+ }++ /**+ * Returns the compiler version string.+ * @return Compiler version string.+ */+ public String getCompilerVersionString() {+ return compilerVersionString.get();+ }++ /**+ * Returns the {@link List}<{@link AbstractString}> of additional strings.+ * @return List of additional strings.+ */+ public List<AbstractString> getStringList() {+ return stringList;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(":\n Language: ");+ builder.append(language.toString());+ builder.append("\n Target Processor: ");+ builder.append(processor.toString());++ builder.append(+ "\n Compiled for edit and continue: " + (compiledForEditAndContinue ? "yes" : "no"));+ builder.append(+ "\n Compiled withoug debugging info: " + (notCompiledWithDebugInfo ? "yes" : "no"));+ builder.append(+ "\n Compiled with LTCG: " + (compiledWithLinkTimeCodeGeneration ? "yes" : "no"));+ builder.append(+ "\n Compiled with /bzalign: " + (compiledWithBzalignNoDataAlign ? "yes" : "no"));+ builder.append("\n Managed code present: " + (managedCodeDataPresent ? "yes" : "no"));+ builder.append(+ "\n Compiled with /GS: " + (compiledWithGsBufferSecurityChecks ? "yes" : "no"));+ builder.append("\n Compiled with /hotpatch: " + (compiledWithHotPatch ? "yes" : "no"));+ builder.append("\n Converted by CVTCIL: " + (convertedWithCvtcil ? "yes" : "no"));+ builder.append("\n Microsoft Intermediate Language Module: " ++ (microsoftIntermediateLanguageNetModule ? "yes" : "no"));++ builder.append(String.format("\n Frontend Version: Major = %d, Minor = %d, Build = %d",+ frontEndMajorVersionNumber, frontEndMinorVersionNumber, frontEndBuildVersionNumber));+ builder.append(String.format("\n Backend Version: Major = %d, Minor = %d, Build = %d",+ backEndMajorVersionNumber, backEndMinorVersionNumber, backEndBuildVersionNumber));+ builder.append("\n Version String:" + compilerVersionString.get());+ if ((stringList.size() & 0x0001) == 0x0001) {+ return; // Some sort of problem that we are not dealing with.+ }+ builder.append("\nCommand block: \n");+ for (int i = 0; i < stringList.size(); i += 2) {+ builder.append(+ String.format(" %s = '%s'\n", stringList.get(i), stringList.get(i + 1)));+ }+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #compilerVersionString}.+ */+ protected abstract void create();++ /**+ * Internal method that breaks out the flag values from the aggregate integral type.+ * @param flagsIn {@code long} containing unsigned int value.+ */+ protected void processFlags(long flagsIn) {+ language = new LanguageName((int) (flagsIn & 0xff));+ flagsIn >>= 8;++ compiledForEditAndContinue = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ notCompiledWithDebugInfo = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ compiledWithLinkTimeCodeGeneration = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ compiledWithBzalignNoDataAlign = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ managedCodeDataPresent = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ compiledWithGsBufferSecurityChecks = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ compiledWithHotPatch = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ convertedWithCvtcil = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ microsoftIntermediateLanguageNetModule = ((flagsIn & 0x0001) == 0x0001);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractConstantMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractConstantMsSymbol.javanew file mode 100644index 0000000000..ddb0414465--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractConstantMsSymbol.java@@ -0,0 +1,90 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Constant symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractConstantMsSymbol extends AbstractMsSymbol {++ protected AbstractTypeIndex typeIndex;+ protected int value;+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractConstantMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ create();+ typeIndex.parse(reader);+ value = reader.parseUnsignedShortVal();+ name.parse(reader);+ }++ /**+ * Returns the type index.+ * @return Type index.+ */+ public long getTypeIndex() {+ return typeIndex.get();+ }++ /**+ * Returns the value.+ * @return Value.+ */+ public int getValue() {+ return value;+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return name.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(": Type: ");+ builder.append(pdb.getTypeRecord(typeIndex.get()).toString());+ builder.append(", Value: ");+ builder.append(value);+ builder.append(", ");+ builder.append(name);+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #typeIndex} and {@link #name}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDataHighLevelShaderLanguageMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDataHighLevelShaderLanguageMsSymbol.javanew file mode 100644index 0000000000..37aa9ee5cd--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDataHighLevelShaderLanguageMsSymbol.java@@ -0,0 +1,92 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of High Level Shader Language symbol.+ * <P>+ * Note: we have guessed that HLSL means High Level Shader Language.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractDataHighLevelShaderLanguageMsSymbol extends AbstractMsSymbol {++ protected AbstractDataHighLevelShaderLanguageSymbolInternals internals;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractDataHighLevelShaderLanguageMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ internals.parse(reader);+ }++ /**+ * Returns the data offset.+ * @return Data offset.+ */+ public long getDataOffset() {+ return internals.getDataOffset();+ }++ /**+ * Returns the register type.+ * @return Register type.+ */+ public String getRegisterType() {+ return internals.getRegisterType();+ }++ /**+ * Returns the type index.+ * @return Type index.+ */+ public int getTypeIndex() {+ return internals.getTypeIndex();+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return internals.getName();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ internals.emit(builder);+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #internals}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDataHighLevelShaderLanguageSymbolInternals.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDataHighLevelShaderLanguageSymbolInternals.javanew file mode 100644index 0000000000..4e5b2614f9--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDataHighLevelShaderLanguageSymbolInternals.java@@ -0,0 +1,82 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Internals of the High Level Shader Language symbol.+ * <P>+ * Note: we have guessed that HLSL means High Level Shader Language.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractDataHighLevelShaderLanguageSymbolInternals+ extends AbstractSymbolInternals {++ protected static final String regTypeHLSL[] = { "TEMP", "INPUT", "OUTPUT", "INDEXABLE_TEMP",+ "IMMEDIATE32", "IMMEDIATE64", "SAMPLER", "RESOURCE", "CONSTANT_BUFFER",+ "IMMEDIATE_CONSTANT_BUFFER", "LABEL", "INPUT_PRIMITIVEID", "OUTPUT_DEPTH", "NULL",+ "RASTERIZER", "OUTPUT_COVERAGE_MASK", "STREAM", "FUNCTION_BODY", "FUNCTION_TABLE",+ "INTERFACE", "FUNCTION_INPUT", "FUNCTION_OUTPUT", "OUTPUT_CONTROL_POINT_ID",+ "INPUT_FORK_INSTANCE_ID", "INPUT_JOIN_INSTANCE_ID", "INPUT_CONTROL_POINT",+ "OUTPUT_CONTROL_POINT", "INPUT_PATCH_CONSTANT", "INPUT_DOMAIN_POINT", "THIS_POINTER",+ "UNORDERED_ACCESS_VIEW", "THREAD_GROUP_SHARED_MEMORY", "INPUT_THREAD_ID",+ "INPUT_THREAD_GROUP_ID", "INPUT_THREAD_ID_IN_GROUP", "INPUT_COVERAGE_MASK",+ "INPUT_THREAD_ID_IN_GROUP_FLATTENED", "INPUT_GS_INSTANCE_ID", "OUTPUT_DEPTH_GREATER_EQUAL",+ "OUTPUT_DEPTH_LESS_EQUAL", "CYCLE_COUNTER" };++ //==============================================================================================+ protected int typeIndex;+ protected long dataOffset;+ protected int registerType;+ protected AbstractString name;++ //==============================================================================================+ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public AbstractDataHighLevelShaderLanguageSymbolInternals(AbstractPdb pdb) {+ super(pdb);+ }++ public long getDataOffset() {+ return dataOffset;+ }++ public String getRegisterType() {+ if (registerType >= 0 && registerType < regTypeHLSL.length) {+ return regTypeHLSL[registerType];+ }+ return "INVALID_REG";+ }++ public int getTypeIndex() {+ return typeIndex;+ }++ public String getName() {+ return name.get();+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDataMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDataMsSymbol.javanew file mode 100644index 0000000000..1c2171b57f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDataMsSymbol.java@@ -0,0 +1,89 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractDataMsSymbol extends AbstractMsSymbol {++ protected AbstractDataSymbolInternals internals;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractDataMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ create();+ internals.parse(reader);+ }++ /**+ * Returns the type index.+ * @return Type index.+ */+ public int getTypeIndex() {+ return internals.getTypeIndex();+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public long getOffset() {+ return internals.getOffset();+ }++ /**+ * Returns the segment.+ * @return Segment.+ */+ public int getSegment() {+ return internals.getSegment();+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return internals.getName();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ internals.emit(builder);+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #internals}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDataReferenceMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDataReferenceMsSymbol.javanew file mode 100644index 0000000000..eef2c5c3cf--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDataReferenceMsSymbol.java@@ -0,0 +1,41 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Data Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractDataReferenceMsSymbol extends AbstractReferenceMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractDataReferenceMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDataSymbolInternals.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDataSymbolInternals.javanew file mode 100644index 0000000000..c7d511b212--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDataSymbolInternals.java@@ -0,0 +1,90 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Internals of Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractDataSymbolInternals extends AbstractSymbolInternals {++ protected AbstractTypeIndex typeIndex;+ protected AbstractOffset offset;+ protected int segment;+ protected AbstractString name;++ private boolean emitToken;++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param emitToken Indicates whether typeIndex field is a token or default+ * typeIndex.+ */+ public AbstractDataSymbolInternals(AbstractPdb pdb, boolean emitToken) {+ super(pdb);+ this.emitToken = emitToken;+ }++ /**+ * Returns the type index.+ * @return Type index.+ */+ public int getTypeIndex() {+ return typeIndex.get();+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public long getOffset() {+ return offset.get();+ }++ /**+ * Returns the segment.+ * @return Segment.+ */+ public int getSegment() {+ return segment;+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return name.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ if (emitToken) {+ builder.append(String.format(": [%04X:%08X], Token: %08X, %s", segment, offset.get(),+ typeIndex.get(), name));+ }+ else {+ builder.append(String.format(": [%04X:%08X], Type: %s, %s", segment, offset.get(),+ pdb.getTypeRecord(typeIndex.get()).toString(), name));+ }+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDefinedAddressRangeWithRegisterDimensionalityMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDefinedAddressRangeWithRegisterDimensionalityMsSymbol.javanew file mode 100644index 0000000000..624731c830--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDefinedAddressRangeWithRegisterDimensionalityMsSymbol.java@@ -0,0 +1,139 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.HashMap;+import java.util.Map;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Defined Address Range With Register Dimensionality+ * symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractDefinedAddressRangeWithRegisterDimensionalityMsSymbol+ extends AbstractDefinedSingleAddressRangeMsSymbol {++ public enum MemorySpace {++ INVALID("INVALID MEMORY SPACE", -1),+ DATA("DATA", 0),+ SAMPLER("SAMPLER", 1),+ RESOURCE("RESOURCE", 2),+ READWRITERESOURCE("RWRESOURCE", 3);++ private static final Map<Integer, MemorySpace> BY_VALUE = new HashMap<>();+ static {+ for (MemorySpace val : values()) {+ BY_VALUE.put(val.value, val);+ }+ }++ public final String label;+ public final int value;++ @Override+ public String toString() {+ return label;+ }++ public static MemorySpace fromValue(int val) {+ return BY_VALUE.getOrDefault(val, INVALID);+ }++ private MemorySpace(String label, int value) {+ this.label = label;+ this.value = value;+ }+ }++ //==============================================================================================+ protected int registerType;+ protected RegisterName registerName;+ protected int registerIndices;+ protected boolean isSpilledUserDefinedTypeMember;+ protected MemorySpace memorySpace;+ protected int offsetInParent;+ protected int sizeInParent;+ protected int[] multidimensionalOffsetOfVariableLocationInRegister;++ //==============================================================================================+ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public AbstractDefinedAddressRangeWithRegisterDimensionalityMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ protected void parseRangeAndGaps(PdbByteReader reader) throws PdbException {+ // Number of records:+ // recordLength (getLimit()):+ // minus unsigned short record type field: 2 bytes+ // minus unsigned short register dimensionality: 2 bytes+ // minus unsigned short bit-fields: 2 bytes+ // minus unsigned short offsetInParent: 2 bytes+ // minus unsigned short sizeInParent: 2 bytes+ // minus registerIndices * (unsigned long dimensionality: 4 bytes) : 0, 4, or 8.+ int numRangeAndGapsBytes = (reader.getLimit() - 10 - (registerIndices * 4));+ PdbByteReader rangeAndGapsReader = reader.getSubPdbByteReader(numRangeAndGapsBytes);+ super.parseRangeAndGaps(rangeAndGapsReader);+ multidimensionalOffsetOfVariableLocationInRegister = new int[registerIndices];+ for (int i = 0; i < registerIndices; i++) {+ multidimensionalOffsetOfVariableLocationInRegister[i] = reader.parseInt();+ }+ }++ @Override+ protected void parseInitialData(PdbByteReader reader) throws PdbException {+ registerType = reader.parseUnsignedShortVal();+ registerName = new RegisterName(pdb, registerType);+ int fields = reader.parseUnsignedShortVal();+ registerIndices = fields & 0x0003;+ fields >>= 2;+ isSpilledUserDefinedTypeMember = ((fields & 0x0001) == 0x0001);+ fields >>= 1;+ memorySpace = MemorySpace.fromValue(fields & 0x000f);+ offsetInParent = reader.parseUnsignedShortVal();+ sizeInParent = reader.parseUnsignedShortVal();+ }++ @Override+ protected void emitInitialData(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(String.format(": %s, RegisterIndices = %d, ", registerName.toString(),+ registerIndices));+ builder.append(memorySpace);+ }++ @Override+ protected void emitFinalData(StringBuilder builder) {+ for (int i = 0; i < registerIndices; i++) {+ builder.append(+ String.format(" %d", multidimensionalOffsetOfVariableLocationInRegister[i]));+ }+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDefinedSingleAddressRangeMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDefinedSingleAddressRangeMsSymbol.javanew file mode 100644index 0000000000..5309dc2271--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractDefinedSingleAddressRangeMsSymbol.java@@ -0,0 +1,124 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.ArrayList;+import java.util.List;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Defined Singled Address Range symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractDefinedSingleAddressRangeMsSymbol extends AbstractMsSymbol {++ protected AddressRange addressRange;+ protected List<AddressGap> addressGapList = new ArrayList<>();++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public AbstractDefinedSingleAddressRangeMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ parseInitialData(reader);+ parseRangeAndGaps(reader);+ }++ /**+ * Returns the {@link AddressRange} address range.+ * @return Address range.+ */+ public AddressRange getAddressRange() {+ return addressRange;+ }++ /**+ * Returns a {@link List} of {@link AddressGap} gaps.+ * @return Gaps.+ */+ public List<AddressGap> getAddressGapList() {+ return addressGapList;+ }++ @Override+ public void emit(StringBuilder builder) {+ emitInitialData(builder);+ emitRangeAndGaps(builder);+ emitFinalData(builder);+ }++ /**+ * Internal abstract method for deserializing first chunk of data.+ * <P>+ * Implementing class must, in the appropriate order pertinent to itself, parse+ * data specific and pertinent to itself and which come before range and gaps data+ * parsed with {@link #parseRangeAndGaps(PdbByteReader)}.+ * @param reader {@link PdbByteReader} from which this data is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ protected abstract void parseInitialData(PdbByteReader reader) throws PdbException;++ /**+ * Outputs the initial chunk of data into a {@link StringBuilder}.+ * @param builder {@link StringBuilder} into which to output the data.+ */+ protected abstract void emitInitialData(StringBuilder builder);++ /**+ * Outputs the final chunk of data into a {@link StringBuilder}.+ * @param builder {@link StringBuilder} into which to output the data.+ */+ protected abstract void emitFinalData(StringBuilder builder);++ /**+ * Internal method for parsing Range and Gaps.+ * @param reader {@link PdbByteReader} from which this data is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ protected void parseRangeAndGaps(PdbByteReader reader) throws PdbException {+ addressRange = new AddressRange(reader);+ while (reader.hasMore()) {+ AddressGap gap = new AddressGap(reader);+ addressGapList.add(gap);+ }+ }++ /**+ * Outputs the Range and Gaps data into a {@link StringBuilder}.+ * @param builder {@link StringBuilder} into which to output the data.+ */+ protected void emitRangeAndGaps(StringBuilder builder) {+ builder.append(addressRange);+ builder.append(String.format(", %d Gaps", addressGapList.size()));+ if (addressGapList.size() == 0) {+ return;+ }+ builder.append(" (startOffset, length):");+ for (AddressGap gap : addressGapList) {+ builder.append(gap);+ }+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractFunctionListMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractFunctionListMsSymbol.javanew file mode 100644index 0000000000..99f0a9f79b--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractFunctionListMsSymbol.java@@ -0,0 +1,76 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.ArrayList;+import java.util.List;++import ghidra.pdb.*;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.CategoryIndex;++/**+ * This class represents various flavors Function List symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractFunctionListMsSymbol extends AbstractMsSymbol {++ protected int count;+ protected List<Integer> functionTypeList = new ArrayList<>();+ protected List<Integer> invocationCountsList = new ArrayList<>();++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public AbstractFunctionListMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ count = reader.parseInt(); // Ignoring unsigned in API+ for (int i = 0; i < count; i++) {+ int typeIndex = reader.parseInt();+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex));+ pdb.popDependencyStack();+ functionTypeList.add(typeIndex);+ }+ for (int i = 0; i < count; i++) {+ // Anything beyond the record length has an implicit invocation count of zero.+ if (reader.hasMore()) {+ invocationCountsList.add(reader.parseInt());+ }+ else {+ invocationCountsList.add(0);+ }+ }+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: Count: %d", getSymbolTypeName(), count));+ DelimiterState ds = new DelimiterState("", ", ");+ for (int i = 0; i < count; i++) {+ if ((i % 4) == 0) {+ builder.append("\n");+ }+ builder.append(ds.out(true, String.format("%s (%d, args) ",+ pdb.getTypeRecord(functionTypeList.get(i)), invocationCountsList.get(i))));+ }+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalDataHighLevelShaderLanguageMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalDataHighLevelShaderLanguageMsSymbol.javanew file mode 100644index 0000000000..fd1e177a28--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalDataHighLevelShaderLanguageMsSymbol.java@@ -0,0 +1,44 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Global High Level Shader Language symbol.+ * <P>+ * Note: we have guessed that HLSL means High Level Shader Language.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractGlobalDataHighLevelShaderLanguageMsSymbol+ extends AbstractDataHighLevelShaderLanguageMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractGlobalDataHighLevelShaderLanguageMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalDataMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalDataMsSymbol.javanew file mode 100644index 0000000000..cf7d22dbb2--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalDataMsSymbol.java@@ -0,0 +1,40 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Global Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractGlobalDataMsSymbol extends AbstractDataMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractGlobalDataMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalManagedDataMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalManagedDataMsSymbol.javanew file mode 100644index 0000000000..c6aa00680f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalManagedDataMsSymbol.java@@ -0,0 +1,41 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Global Managed Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractGlobalManagedDataMsSymbol extends AbstractManagedDataMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractGlobalManagedDataMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalManagedProcedureMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalManagedProcedureMsSymbol.javanew file mode 100644index 0000000000..e93a593afb--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalManagedProcedureMsSymbol.java@@ -0,0 +1,42 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Global Managed Procedure symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractGlobalManagedProcedureMsSymbol+ extends AbstractManagedProcedureMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractGlobalManagedProcedureMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalProcedureStartMipsMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalProcedureStartMipsMsSymbol.javanew file mode 100644index 0000000000..40975872f9--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalProcedureStartMipsMsSymbol.java@@ -0,0 +1,47 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors Global Procedure Start MIPS symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractGlobalProcedureStartMipsMsSymbol+ extends AbstractProcedureStartMipsMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractGlobalProcedureStartMipsMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ protected String getSpecialTypeString() {+ return "Type";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalProcedureStartMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalProcedureStartMsSymbol.javanew file mode 100644index 0000000000..50af96d0a4--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalProcedureStartMsSymbol.java@@ -0,0 +1,46 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors Global Procedure Start symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractGlobalProcedureStartMsSymbol extends AbstractProcedureMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractGlobalProcedureStartMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ protected String getSpecialTypeString() {+ return "Type";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalThreadStorageMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalThreadStorageMsSymbol.javanew file mode 100644index 0000000000..be4fe53320--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractGlobalThreadStorageMsSymbol.java@@ -0,0 +1,41 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Global Thread Storage symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractGlobalThreadStorageMsSymbol extends AbstractThreadStorageMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractGlobalThreadStorageMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLabelMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLabelMsSymbol.javanew file mode 100644index 0000000000..4bd6c2fed5--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLabelMsSymbol.java@@ -0,0 +1,95 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Label symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractLabelMsSymbol extends AbstractMsSymbol {++ protected AbstractOffset offset;+ protected int segment;+ protected ProcedureFlags flags;+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractLabelMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ create();+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ flags = new ProcedureFlags(reader);+ name.parse(reader);+ reader.align4();+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public long getOffset() {+ return offset.get();+ }++ /**+ * Returns the segment.+ * @return Segment.+ */+ public int getSegment() {+ return segment;+ }++ /** Returns the {@link ProcedureFlags}.+ * @return Procedure flags.+ */+ public ProcedureFlags getProcedureFlags() {+ return flags;+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return name.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: [%04X:%08X], %s %s\n", getSymbolTypeName(), segment,+ offset.get(), name.get(), flags.toString()));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #offset} and {@link #name}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalDataHighLevelShaderLanguageMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalDataHighLevelShaderLanguageMsSymbol.javanew file mode 100644index 0000000000..8ad18c617a--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalDataHighLevelShaderLanguageMsSymbol.java@@ -0,0 +1,44 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Local High Level Shader Language symbol.+ * <P>+ * Note: we have guessed that HLSL means High Level Shader Language.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractLocalDataHighLevelShaderLanguageMsSymbol+ extends AbstractDataHighLevelShaderLanguageMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractLocalDataHighLevelShaderLanguageMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalDataMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalDataMsSymbol.javanew file mode 100644index 0000000000..aba46ffd27--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalDataMsSymbol.java@@ -0,0 +1,40 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Local Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractLocalDataMsSymbol extends AbstractDataMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractLocalDataMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalIntermediateLanguageSymbolMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalIntermediateLanguageSymbolMsSymbol.javanew file mode 100644index 0000000000..a60d97c5aa--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalIntermediateLanguageSymbolMsSymbol.java@@ -0,0 +1,64 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Local Intermediate Language Symbol symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractLocalIntermediateLanguageSymbolMsSymbol extends AbstractMsSymbol {++ protected long slotIndex;+ protected int typeIndex;+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractLocalIntermediateLanguageSymbolMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ slotIndex = reader.parseUnsignedIntVal();+ typeIndex = reader.parseInt();+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex));+ pdb.popDependencyStack();+ name.parse(reader);+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: [%08X], Type: %s, %s", getSymbolTypeName(), slotIndex,+ pdb.getTypeRecord(typeIndex), name.get()));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #name}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol.javanew file mode 100644index 0000000000..b41ec98f31--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol.java@@ -0,0 +1,43 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Local Intermediate Language Symbol With Local Slot+ * Index Field symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractLocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol+ extends AbstractLocalIntermediateLanguageSymbolMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractLocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol.javanew file mode 100644index 0000000000..d29bbde39f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol.java@@ -0,0 +1,43 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Local Intermediate Language Symbol With Parameter+ * Slot Index Field symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractLocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol+ extends AbstractLocalIntermediateLanguageSymbolMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractLocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol(+ AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalManagedDataMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalManagedDataMsSymbol.javanew file mode 100644index 0000000000..08ae167562--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalManagedDataMsSymbol.java@@ -0,0 +1,41 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Local Managed Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractLocalManagedDataMsSymbol extends AbstractManagedDataMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractLocalManagedDataMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalManagedProcedureMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalManagedProcedureMsSymbol.javanew file mode 100644index 0000000000..d4c42b5a59--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalManagedProcedureMsSymbol.java@@ -0,0 +1,42 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Local Managed Procedure symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractLocalManagedProcedureMsSymbol+ extends AbstractManagedProcedureMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractLocalManagedProcedureMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalOrParameterRelativeToVirtualFramePointerMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalOrParameterRelativeToVirtualFramePointerMsSymbol.javanew file mode 100644index 0000000000..0c2053dde5--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalOrParameterRelativeToVirtualFramePointerMsSymbol.java@@ -0,0 +1,70 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.AbstractString;++/**+ * This class represents various flavors of Local- Or Parameter-Relative-to-Virtual Frame Pointer+ * symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractLocalOrParameterRelativeToVirtualFramePointerMsSymbol+ extends AbstractMsSymbol {++ protected int offset;+ protected int typeIndex;+ protected LocalVariableAttributes attributes;+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractLocalOrParameterRelativeToVirtualFramePointerMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ create();+ offset = reader.parseInt();+ typeIndex = reader.parseInt();+ attributes = new LocalVariableAttributes(reader);+ name.parse(reader);+ }++ @Override+ public void emit(StringBuilder builder) {+ StringBuilder myBuilder = new StringBuilder();+ myBuilder.append(typeIndex);+ attributes.emit(myBuilder);+ builder.append(String.format("%s: [%08X], %s %s", getSymbolTypeName(), offset,+ myBuilder.toString(), name.get()));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #name}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalOrParameterStoredInRegisterMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalOrParameterStoredInRegisterMsSymbol.javanew file mode 100644index 0000000000..0743515973--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalOrParameterStoredInRegisterMsSymbol.java@@ -0,0 +1,70 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.AbstractString;++/**+ * This class represents various flavors of Local Or Parameter Stored in Register symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractLocalOrParameterStoredInRegisterMsSymbol extends AbstractMsSymbol {++ protected int typeIndex;+ protected LocalVariableAttributes attributes;+ protected int registerIndex;+ protected RegisterName registerName;+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractLocalOrParameterStoredInRegisterMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ typeIndex = reader.parseInt();+ attributes = new LocalVariableAttributes(reader);+ registerIndex = reader.parseUnsignedShortVal();+ registerName = new RegisterName(pdb, registerIndex);+ name.parse(reader);+ }++ @Override+ public void emit(StringBuilder builder) {+ StringBuilder myBuilder = new StringBuilder();+ myBuilder.append(typeIndex);+ attributes.emit(myBuilder);+ builder.append(String.format("%s: %s, %s %s", getSymbolTypeName(), registerName.toString(),+ myBuilder.toString(), name.get()));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #name}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalProcedureReferenceMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalProcedureReferenceMsSymbol.javanew file mode 100644index 0000000000..63e605c463--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalProcedureReferenceMsSymbol.java@@ -0,0 +1,41 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Local Procedure Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractLocalProcedureReferenceMsSymbol extends AbstractReferenceMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractLocalProcedureReferenceMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalProcedureStartMipsMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalProcedureStartMipsMsSymbol.javanew file mode 100644index 0000000000..15a1bcf4ca--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalProcedureStartMipsMsSymbol.java@@ -0,0 +1,47 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors Local Procedure Start MIPS symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractLocalProcedureStartMipsMsSymbol+ extends AbstractProcedureStartMipsMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractLocalProcedureStartMipsMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ protected String getSpecialTypeString() {+ return "Type";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalProcedureStartMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalProcedureStartMsSymbol.javanew file mode 100644index 0000000000..220b566b6d--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalProcedureStartMsSymbol.java@@ -0,0 +1,46 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors Local Procedure Start symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractLocalProcedureStartMsSymbol extends AbstractProcedureMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractLocalProcedureStartMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ protected String getSpecialTypeString() {+ return "Type";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalSymbolInOptimizedCodeMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalSymbolInOptimizedCodeMsSymbol.javanew file mode 100644index 0000000000..4bd379ce5c--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalSymbolInOptimizedCodeMsSymbol.java@@ -0,0 +1,83 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Local Symbol in Optimized Code symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractLocalSymbolInOptimizedCodeMsSymbol extends AbstractMsSymbol {++ protected int typeIndex;+ protected LocalVariableFlags localVariableFlags;+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractLocalSymbolInOptimizedCodeMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ name = new StringUtf8Nt(); // Might need a create() method if the 2005 version needs St ver.+ typeIndex = reader.parseInt();+ localVariableFlags = new LocalVariableFlags(reader);+ name.parse(reader);+ reader.align4();+ }++ /**+ * Returns the type index.+ * @return Type index.+ */+ public int getTypeIndex() {+ return typeIndex;+ }++ /**+ * Returns the {@link LocalVariableFlags}.+ * @return Local variable flags.+ */+ public LocalVariableFlags getLocalVariableFlags() {+ return localVariableFlags;+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return name.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ StringBuilder myBuilder = new StringBuilder();+ myBuilder.append(String.format("%08X ", typeIndex));+ localVariableFlags.emit(myBuilder);+ builder.append(+ String.format("%s: %s, %s", getSymbolTypeName(), myBuilder.toString(), name));+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalThreadStorageMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalThreadStorageMsSymbol.javanew file mode 100644index 0000000000..438efc9ce0--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractLocalThreadStorageMsSymbol.java@@ -0,0 +1,41 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Local Thread Storage symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractLocalThreadStorageMsSymbol extends AbstractThreadStorageMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractLocalThreadStorageMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManagedDataMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManagedDataMsSymbol.javanew file mode 100644index 0000000000..ab488c5b6b--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManagedDataMsSymbol.java@@ -0,0 +1,40 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Managed Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractManagedDataMsSymbol extends AbstractDataMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractManagedDataMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol.javanew file mode 100644index 0000000000..0006a3d86f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol.java@@ -0,0 +1,74 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.AbstractString;++/**+ * This class represents various flavors of Managed Local- Or Parameter-Relative-to-Virtual+ * Frame Pointer symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol+ extends AbstractMsSymbol {++ private long offset;+ private int typeIndex;+ private int register;+ private RegisterName registerName;+ private LocalVariableAttributes attributes;+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ create();+ offset = reader.parseUnsignedIntVal();+ typeIndex = reader.parseInt();+ register = reader.parseUnsignedShortVal();+ registerName = new RegisterName(pdb, register);+ attributes = new LocalVariableAttributes(reader);+ name.parse(reader);+ }++ @Override+ public void emit(StringBuilder builder) {+ StringBuilder myBuilder = new StringBuilder();+ myBuilder.append(typeIndex);+ attributes.emit(myBuilder);+ builder.append(String.format("%s: %s+%08X, %s, %s", getSymbolTypeName(),+ registerName.toString(), offset, myBuilder.toString(), name.get()));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #name}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManagedLocalOrParameterStoredInManyRegisterMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManagedLocalOrParameterStoredInManyRegisterMsSymbol.javanew file mode 100644index 0000000000..f1145a72e8--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManagedLocalOrParameterStoredInManyRegisterMsSymbol.java@@ -0,0 +1,95 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.ArrayList;+import java.util.List;++import ghidra.pdb.*;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Managed Local- Or Parameter Stored in Many Register+ * symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractManagedLocalOrParameterStoredInManyRegisterMsSymbol+ extends AbstractMsSymbol {++ protected int typeIndex;+ protected LocalVariableAttributes attributes;+ // Registers are in most-significant-first order.+ protected List<RegisterName> registerNameList = new ArrayList<>();+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractManagedLocalOrParameterStoredInManyRegisterMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ create();+ typeIndex = reader.parseInt();+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex));+ pdb.popDependencyStack();+ attributes = new LocalVariableAttributes(reader);+ int count = parseVal(reader);+ for (int i = 0; i < count; i++) {+ int register = parseVal(reader);+ RegisterName registerName = new RegisterName(pdb, register);+ registerNameList.add(registerName);+ // TODO: Might be missing information here in the structure. Says counter register+ // enumerates followed by length-prefixed name. Compare with PDB_ID = 0x110a, where+ // the MSFT API also talks about a name, but does not have it in a separate+ // structure member.+ // otherName = parseName(reader); //here????? (if it exists)+ }+ // otherName = parseName(reader); //here????? (if it exists)+ name.parse(reader);+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: ", getSymbolTypeName()));+ DelimiterState ds = new DelimiterState("", ", ");+ for (RegisterName registerName : registerNameList) {+ builder.append(ds.out(true, registerName));+ }+ builder.append(+ String.format(" %s %s", pdb.getTypeRecord(typeIndex).toString(), name.get()));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #name}.+ */+ protected abstract void create();++ /**+ * Parses a value for this symbol.+ * @param reader {@link PdbByteReader} from which to parse the value.+ * @return Value parsed.+ * @throws PdbException Upon not enough data left to parse.+ */+ protected abstract int parseVal(PdbByteReader reader) throws PdbException;++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManagedProcedureMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManagedProcedureMsSymbol.javanew file mode 100644index 0000000000..6ac834d2d8--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManagedProcedureMsSymbol.java@@ -0,0 +1,92 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.AbstractString;++/**+ * This class represents various flavors of Managed Procedure symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractManagedProcedureMsSymbol extends AbstractMsSymbol {++ protected long parentPointer;+ protected long endPointer;+ protected long nextPointer;+ protected long procedureLength;+ protected long debugStartOffset;+ protected long debugEndOffset;+ protected long token;+ protected long symbolOffset;+ protected int symbolSegment;+ protected ProcedureFlags procedureFlags;+ protected int registerIndexContainingReturnValue;+ protected RegisterName registerContainingReturnValue;+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractManagedProcedureMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ parentPointer = reader.parseUnsignedIntVal();+ endPointer = reader.parseUnsignedIntVal();+ nextPointer = reader.parseUnsignedIntVal();+ procedureLength = reader.parseUnsignedIntVal();+ debugStartOffset = reader.parseUnsignedIntVal();+ debugEndOffset = reader.parseUnsignedIntVal();+ token = reader.parseUnsignedIntVal();+ symbolOffset = reader.parseUnsignedIntVal();+ symbolSegment = reader.parseUnsignedShortVal();+ procedureFlags = new ProcedureFlags(reader);+ registerIndexContainingReturnValue = reader.parseUnsignedShortVal();+ registerContainingReturnValue = new RegisterName(pdb, registerIndexContainingReturnValue);+ name.parse(reader);+ }++ @Override+ public void emit(StringBuilder builder) {+ // TODO: need to do more with token map and with debug data in pdb.+ // Need "Token: %0xX (mapped to %08X), "+ builder.append(String.format("%s: [%04X:%08X], Length: %08X, Token: %s, ",+ getSymbolTypeName(), symbolSegment, symbolOffset, procedureLength, token));+ builder.append(name.get());+ builder.append(String.format(" Parent: %08X, End: %08X, Next: %08X\n", parentPointer,+ endPointer, nextPointer));+ builder.append(String.format(" Debug start: %08X, Debug end: %08X\n", debugStartOffset,+ debugEndOffset));+ builder.append(String.format(" %s\n", procedureFlags));+ builder.append(String.format(" Return Reg: %s\n", registerContainingReturnValue));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #name}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManagedSymbolWithSlotIndexFieldMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManagedSymbolWithSlotIndexFieldMsSymbol.javanew file mode 100644index 0000000000..0476634b2f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManagedSymbolWithSlotIndexFieldMsSymbol.java@@ -0,0 +1,68 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.AbstractString;++/**+ * This class represents various flavors of Managed Symbol With Slot Index Field symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractManagedSymbolWithSlotIndexFieldMsSymbol extends AbstractMsSymbol {++ protected long slotIndex;+ protected int typeIndex;+ protected LocalVariableAttributes attributes;+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractManagedSymbolWithSlotIndexFieldMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ slotIndex = reader.parseUnsignedIntVal();+ typeIndex = reader.parseInt();+ attributes = new LocalVariableAttributes(reader);+ name.parse(reader);+ }++ @Override+ public void emit(StringBuilder builder) {+ StringBuilder myBuilder = new StringBuilder();+ myBuilder.append(typeIndex);+ attributes.emit(myBuilder);+ builder.append(String.format("%s: %d, %s %s", getSymbolTypeName(), slotIndex,+ myBuilder.toString(), name.get()));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #name}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManyRegisterVariable2MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManyRegisterVariable2MsSymbol.javanew file mode 100644index 0000000000..1b14f6614b--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManyRegisterVariable2MsSymbol.java@@ -0,0 +1,79 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.ArrayList;+import java.util.List;++import ghidra.pdb.*;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Many Register Variable 2 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractManyRegisterVariable2MsSymbol extends AbstractMsSymbol {++ protected AbstractTypeIndex typeIndex;+ protected int count;+ // List of registers is most-significant first.+ protected List<RegisterName> registerNameList = new ArrayList<>();+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractManyRegisterVariable2MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ typeIndex.parse(reader);+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex.get()));+ pdb.popDependencyStack();+ count = reader.parseUnsignedByteVal();+ for (int i = 0; i < count; i++) {+ int registerIndex = reader.parseUnsignedShortVal();+ RegisterName registerName = new RegisterName(pdb, registerIndex);+ registerNameList.add(registerName);+ }+ name.parse(reader);+ reader.align4();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: ", getSymbolTypeName()));+ DelimiterState ds = new DelimiterState("", ", ");+ for (RegisterName registerName : registerNameList) {+ builder.append(ds.out(true, registerName));+ }+ builder.append(+ String.format(" %s %s", pdb.getTypeRecord(typeIndex.get()).toString(), name));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #typeIndex} and {@link #name}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManyRegisterVariableMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManyRegisterVariableMsSymbol.javanew file mode 100644index 0000000000..a625ad4684--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractManyRegisterVariableMsSymbol.java@@ -0,0 +1,79 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.ArrayList;+import java.util.List;++import ghidra.pdb.*;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Many Register Variable symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractManyRegisterVariableMsSymbol extends AbstractMsSymbol {++ protected AbstractTypeIndex typeIndex;+ protected int count;+ // List of registers is most-significant first.+ protected List<RegisterName> registerNameList = new ArrayList<>();+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractManyRegisterVariableMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ typeIndex.parse(reader);+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex.get()));+ pdb.popDependencyStack();+ count = reader.parseUnsignedByteVal();+ for (int i = 0; i < count; i++) {+ int registerIndex = reader.parseUnsignedShortVal();+ RegisterName registerName = new RegisterName(pdb, registerIndex);+ registerNameList.add(registerName);+ }+ name.parse(reader);+ reader.align4();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: ", getSymbolTypeName()));+ DelimiterState ds = new DelimiterState("", ", ");+ for (RegisterName registerName : registerNameList) {+ builder.append(ds.out(true, registerName));+ }+ builder.append(+ String.format(" %s %s", pdb.getTypeRecord(typeIndex.get()).toString(), name));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #typeIndex} and {@link #name}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractObjectNameMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractObjectNameMsSymbol.javanew file mode 100644index 0000000000..c40674e62d--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractObjectNameMsSymbol.java@@ -0,0 +1,78 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.AbstractString;++/**+ * This class represents various flavors of Object Name symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractObjectNameMsSymbol extends AbstractMsSymbol {++ protected long signature;+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractObjectNameMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ create();+ signature = reader.parseUnsignedIntVal();+ name.parse(reader);+ }++ /**+ * Returns the signature.+ * @return Signature.+ */+ public long getSignature() {+ return signature;+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return name.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: Signature: ", getSymbolTypeName()));+ builder.append(signature);+ builder.append(", ");+ builder.append(name.get());+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #name}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureMsSymbol.javanew file mode 100644index 0000000000..2e3a4237cd--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureMsSymbol.java@@ -0,0 +1,152 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors Procedure symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractProcedureMsSymbol extends AbstractMsSymbol {++ protected AbstractProcedureSymbolInternals internals;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractProcedureMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ create();+ internals.parse(reader);+ }++ /**+ * Returns the parent pointer.+ * @return Parent pointer.+ */+ public long getParentPointer() {+ return internals.parentPointer;+ }++ /**+ * Returns the end pointer.+ * @return End pointer.+ */+ public long getEndPointer() {+ return internals.endPointer;+ }++ /**+ * Returns the next pointer.+ * @return Next pointer.+ */+ public long getNextPointer() {+ return internals.nextPointer;+ }++ /**+ * Returns the procedure length.+ * @return Procedure length.+ */+ public long getProcedureLength() {+ return internals.procedureLength;+ }++ /**+ * Returns the debug start offset.+ * @return Debug start offset.+ */+ public long getDebugStartOffset() {+ return internals.debugStartOffset;+ }++ /**+ * Returns the debug end offset.+ * @return Debug end offset.+ */+ public long getDebugEndOffset() {+ return internals.debugEndOffset;+ }++ /**+ * Returns type index.+ * @return Type index.+ */+ public int getTypeIndex() {+ return internals.typeIndex;+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public long getOffset() {+ return internals.offset;+ }++ /**+ * Returns the segment.+ * @return Segment.+ */+ public int getSegment() {+ return internals.segment;+ }++ /**+ * Returns the {@link ProcedureFlags}.+ * @return Procedure flags.+ */+ public ProcedureFlags getFlags() {+ return internals.flags;+ }++ /**+ * Returns the procedure name.+ * @return Name.+ */+ public String getName() {+ return internals.name.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSpecialTypeString());+ internals.emit(builder);+ builder.insert(0, getSymbolTypeName());+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #internals}.+ */+ protected abstract void create();++ /**+ * Returns the special type string used during Emit.+ * @return Special type string.+ */+ protected abstract String getSpecialTypeString();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureReferenceMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureReferenceMsSymbol.javanew file mode 100644index 0000000000..ef13ba7f7c--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureReferenceMsSymbol.java@@ -0,0 +1,41 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Procedure Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractProcedureReferenceMsSymbol extends AbstractReferenceMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractProcedureReferenceMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureStartIa64MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureStartIa64MsSymbol.javanew file mode 100644index 0000000000..5848f9908b--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureStartIa64MsSymbol.java@@ -0,0 +1,98 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Procedure Start IA64 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractProcedureStartIa64MsSymbol extends AbstractMsSymbol {++ protected long parentPointer;+ protected long endPointer;+ protected long nextPointer;+ protected long procedureLength;+ protected long debugStartOffset;+ protected long debugEndOffset;+ protected int typeIndex;+ protected long symbolOffset;+ protected int symbolSegment;+ protected int registerIndexContainingReturnValue;+ protected RegisterName registerContainingReturnValue;+ protected ProcedureFlags procedureFlags;+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractProcedureStartIa64MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ parentPointer = reader.parseUnsignedIntVal();+ endPointer = reader.parseUnsignedIntVal();+ nextPointer = reader.parseUnsignedIntVal();+ procedureLength = reader.parseUnsignedIntVal();+ debugStartOffset = reader.parseUnsignedIntVal();+ debugEndOffset = reader.parseUnsignedIntVal();+ typeIndex = reader.parseInt();+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex));+ pdb.popDependencyStack();+ symbolOffset = reader.parseUnsignedIntVal();+ symbolSegment = reader.parseUnsignedShortVal();+ registerIndexContainingReturnValue = reader.parseUnsignedShortVal();+ registerContainingReturnValue = new RegisterName(pdb, registerIndexContainingReturnValue);+ procedureFlags = new ProcedureFlags(reader);+ name.parse(reader);+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: [%04X:%08X], Length: %08X, %s: %s, ", getSymbolTypeName(),+ symbolSegment, symbolOffset, procedureLength, getSpecialTypeString(),+ pdb.getTypeRecord(typeIndex)));+ builder.append(name);+ builder.append(String.format(" Parent: %08X, End: %08X, Next: %08X\n", parentPointer,+ endPointer, nextPointer));+ builder.append(String.format(" Debug start: %08X, Debug end: %08X\n", debugStartOffset,+ debugEndOffset));+ builder.append(String.format(" %s\n", procedureFlags));+ builder.append(String.format(" Return Reg: %s\n", registerContainingReturnValue));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #name}.+ */+ protected abstract void create();++ /**+ * Returns the special type string used during Emit.+ * @return Special type string.+ */+ protected abstract String getSpecialTypeString();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureStartMipsMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureStartMipsMsSymbol.javanew file mode 100644index 0000000000..6975f7dcfe--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureStartMipsMsSymbol.java@@ -0,0 +1,65 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors Procedure Start MIPS symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractProcedureStartMipsMsSymbol extends AbstractMsSymbol {++ protected AbstractProcedureStartMipsSymbolInternals internals;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractProcedureStartMipsMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ internals.parse(reader);+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSpecialTypeString());+ internals.emit(builder);+ builder.insert(0, getSymbolTypeName());+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #internals}.+ */+ protected abstract void create();++ /**+ * Returns the special type string used during Emit.+ * @return Special type string.+ */+ protected abstract String getSpecialTypeString();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureStartMipsSymbolInternals.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureStartMipsSymbolInternals.javanew file mode 100644index 0000000000..5e3fab066f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureStartMipsSymbolInternals.java@@ -0,0 +1,122 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Internals of the Procedure Start MIPS symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractProcedureStartMipsSymbolInternals extends AbstractSymbolInternals {++ protected long parentPointer;+ protected long endPointer;+ protected long nextPointer;+ protected long procedureLength;+ protected long debugStartOffset;+ protected long debugEndOffset;+ protected long integerRegisterSaveMask;+ protected long floatingPointRegisterSaveMask;+ protected long integerRegisterSaveOffset;+ protected long floatingPointRegisterSaveOffset;++ // The following have different sizes and order of parsing in parent versus child classes.+ protected int typeIndex;+ protected long symbolOffset;+ protected int symbolSegment;++ // We are using RegisterName (instead of as MSFT API shows of going directly to MIPS register+ // table. Hope this works fine.+ protected int indexOfRegisterContainingReturnValue;+ protected RegisterName registerContainingReturnValue;+ protected int indexOfRegisterContainingFramePointer;+ protected RegisterName registerContainingFramePointer;++ protected AbstractString name;++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public AbstractProcedureStartMipsSymbolInternals(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ public void emit(StringBuilder builder) {+ StringBuilder prefixBuilder = new StringBuilder();+ StringBuilder postfixBuilder = new StringBuilder();++ prefixBuilder.append(String.format(": [%04X:%08X], Length: %08X, ", symbolSegment,+ symbolOffset, procedureLength));++ postfixBuilder.append(String.format(": %s, ", pdb.getTypeRecord(typeIndex)));+ postfixBuilder.append(String.format(" Parent: %08X, End: %08X, Next: %08X\n",+ parentPointer, endPointer, nextPointer));+ postfixBuilder.append(String.format(" Debug start: %08X, Debug end: %08X\n",+ debugStartOffset, debugEndOffset));+ postfixBuilder.append(+ String.format(" Reg Save: %08X, FP Save: %08X, Int Offset: %08X, FP Offset: %08X\n",+ integerRegisterSaveMask, floatingPointRegisterSaveMask, integerRegisterSaveOffset,+ floatingPointRegisterSaveOffset));+ postfixBuilder.append(String.format(" Return Reg: %s, Frame Reg: %s\n",+ registerContainingReturnValue, registerContainingFramePointer));++ builder.insert(0, prefixBuilder);+ builder.append(postfixBuilder);+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ parentPointer = reader.parseUnsignedIntVal();+ endPointer = reader.parseUnsignedIntVal();+ nextPointer = reader.parseUnsignedIntVal();+ procedureLength = reader.parseUnsignedIntVal();+ debugStartOffset = reader.parseUnsignedIntVal();+ debugEndOffset = reader.parseUnsignedIntVal();+ integerRegisterSaveMask = reader.parseUnsignedIntVal();+ floatingPointRegisterSaveMask = reader.parseUnsignedIntVal();+ integerRegisterSaveOffset = reader.parseUnsignedIntVal();+ floatingPointRegisterSaveOffset = reader.parseUnsignedIntVal();++ parseTypeIndexAndSymbolSegmentOffset(reader);+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex));+ pdb.popDependencyStack();++ indexOfRegisterContainingReturnValue = reader.parseUnsignedByteVal();+ registerContainingReturnValue = new RegisterName(pdb, indexOfRegisterContainingReturnValue);++ indexOfRegisterContainingFramePointer = reader.parseUnsignedByteVal();+ registerContainingFramePointer =+ new RegisterName(pdb, indexOfRegisterContainingFramePointer);++ name.parse(reader);+ }++ /**+ * Internal method for parsing the type index and symbol segment and offset.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ protected abstract void parseTypeIndexAndSymbolSegmentOffset(PdbByteReader reader)+ throws PdbException;++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureSymbolInternals.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureSymbolInternals.javanew file mode 100644index 0000000000..eefeedace1--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractProcedureSymbolInternals.java@@ -0,0 +1,178 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Internals of the Procedure symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractProcedureSymbolInternals extends AbstractSymbolInternals {++ protected long parentPointer;+ protected long endPointer;+ protected long nextPointer;+ protected long procedureLength;+ protected long debugStartOffset;+ protected long debugEndOffset;+ protected int typeIndex;+ protected long offset;+ protected int segment;+ protected ProcedureFlags flags;+ protected AbstractString name;++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public AbstractProcedureSymbolInternals(AbstractPdb pdb) {+ super(pdb);+ }++ /**+ * Returns the parent pointer.+ * @return Parent pointer.+ */+ public long getParentPointer() {+ return parentPointer;+ }++ /**+ * Returns the end pointer.+ * @return End pointer.+ */+ public long getEndPointer() {+ return endPointer;+ }++ /**+ * Returns the next pointer.+ * @return next pointer.+ */+ public long getNextPointer() {+ return nextPointer;+ }++ /**+ * Returns the procedure length.+ * @return Length.+ */+ public long getProcedureLength() {+ return procedureLength;+ }++ /**+ * Returns the debug start offset.+ * @return Debug start offset.+ */+ public long getDebugStartOffset() {+ return debugStartOffset;+ }++ /**+ * Returns the debug end offset.+ * @return Debug end offset.+ */+ public long getDebugEndOffset() {+ return debugEndOffset;+ }++ /**+ * Returns the type index.+ * @return Type index.+ */+ public int getTypeIndex() {+ return typeIndex;+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public long getOffset() {+ return offset;+ }++ /**+ * Returns the segment.+ * @return Segment.+ */+ public int getSegment() {+ return segment;+ }++ /**+ * Returns the {@link ProcedureFlags}.+ * @return Procedure flags.+ */+ public ProcedureFlags getFlags() {+ return flags;+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return name.get();+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ parentPointer = reader.parseUnsignedIntVal();+ endPointer = reader.parseUnsignedIntVal();+ nextPointer = reader.parseUnsignedIntVal();+ parseMiddleFields(reader);+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex));+ pdb.popDependencyStack();+ flags = new ProcedureFlags(reader);+ name.parse(reader);+ reader.align4();+ }++ @Override+ public void emit(StringBuilder builder) {+ StringBuilder prefixBuilder = new StringBuilder();+ StringBuilder postfixBuilder = new StringBuilder();++ prefixBuilder.append(+ String.format(": [%04X:%08X], Length: %08X, ", segment, offset, procedureLength));++ postfixBuilder.append(+ String.format(": %s, %s\n", pdb.getTypeRecord(typeIndex), name.get()));+ postfixBuilder.append(String.format(" Parent: %08X, End: %08X, Next: %08X\n",+ parentPointer, endPointer, nextPointer));+ postfixBuilder.append(String.format(" Debug start: %08X, Debug end: %08X\n",+ debugStartOffset, debugEndOffset));+ postfixBuilder.append(flags.toString());++ builder.insert(0, prefixBuilder);+ builder.append(postfixBuilder);+ }++ /**+ * Internal method for parsing the middle range of fields in the data.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ protected abstract void parseMiddleFields(PdbByteReader reader) throws PdbException;++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractPublic16Or3216MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractPublic16Or3216MsSymbol.javanew file mode 100644index 0000000000..7f55af56ef--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractPublic16Or3216MsSymbol.java@@ -0,0 +1,62 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various similar, older flavors of Public symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractPublic16Or3216MsSymbol extends AbstractPublicMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractPublic16Or3216MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public long getOffset() {+ return ((AbstractDataSymbolInternals) internals).getOffset();+ }++ @Override+ public int getSegment() {+ return ((AbstractDataSymbolInternals) internals).getSegment();+ }++ @Override+ public String getName() {+ return ((AbstractDataSymbolInternals) internals).getName();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ internals.emit(builder);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractPublic32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractPublic32MsSymbol.javanew file mode 100644index 0000000000..9dfdc70f60--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractPublic32MsSymbol.java@@ -0,0 +1,81 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various similar, newer flavors of Public symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractPublic32MsSymbol extends AbstractPublicMsSymbol {++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractPublic32MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public long getOffset() {+ return ((AbstractPublicSymbolInternals32) internals).getOffset();+ }++ @Override+ public int getSegment() {+ return ((AbstractPublicSymbolInternals32) internals).getSegment();+ }++ @Override+ public String getName() {+ return ((AbstractPublicSymbolInternals32) internals).getName();+ }++ public long getFlags() {+ return ((AbstractPublicSymbolInternals32) internals).getFlags();+ }++ public boolean isCode() {+ return ((AbstractPublicSymbolInternals32) internals).isCode();+ }++ public boolean isFunction() {+ return ((AbstractPublicSymbolInternals32) internals).isFunction();+ }++ public boolean isManaged() {+ return ((AbstractPublicSymbolInternals32) internals).isManaged();+ }++ public boolean isMicrosoftIntermediateLanguage() {+ return ((AbstractPublicSymbolInternals32) internals).isMicrosoftIntermediateLanguage();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ internals.emit(builder);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractPublicMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractPublicMsSymbol.javanew file mode 100644index 0000000000..57ff64f916--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractPublicMsSymbol.java@@ -0,0 +1,75 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Public symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractPublicMsSymbol extends AbstractMsSymbol {++ protected AbstractSymbolInternals internals;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractPublicMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ create();+ internals.parse(reader);+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public abstract long getOffset();++ /**+ * Returns the segment.+ * @return Segment.+ */+ public abstract int getSegment();++ /**+ * Returns the name.+ * @return Name.+ */+ public abstract String getName();++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ internals.emit(builder);+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #internals}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractPublicSymbolInternals32.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractPublicSymbolInternals32.javanew file mode 100644index 0000000000..437d329be9--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractPublicSymbolInternals32.java@@ -0,0 +1,142 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Internals of newer Public symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractPublicSymbolInternals32 extends AbstractSymbolInternals {++ /**+ * Implementing class must initialize {@link #offset} and {@link #name} in the+ * {@link #create()} method.+ */+ protected AbstractOffset offset;+ protected int segment;+ protected AbstractString name;+ protected long flags;+ protected boolean isCode;+ protected boolean isFunction;+ protected boolean isManaged;+ protected boolean isMicrosoftIntermediateLanguage;++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public AbstractPublicSymbolInternals32(AbstractPdb pdb) {+ super(pdb);+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public long getOffset() {+ return offset.get();+ }++ /**+ * Returns the segment.+ * @return Segment.+ */+ public int getSegment() {+ return segment;+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return name.get();+ }++ /**+ * Returns the flags.+ * @return Flags.+ */+ public long getFlags() {+ return flags;+ }++ /**+ * Tells whether it is code.+ * @return True if it is code.+ */+ public boolean isCode() {+ return isCode;+ }++ /**+ * Tells whether the it is a function.+ * @return True if it is a function.+ */+ public boolean isFunction() {+ return isFunction;+ }++ /**+ * Tells whether the the code is managed.+ * @return True if the code is managed.+ */+ public boolean isManaged() {+ return isManaged;+ }++ /**+ * Tells whether it is Microsoft Intermediate Language.+ * @return True if it is Microsoft Intermediate Language.+ */+ public boolean isMicrosoftIntermediateLanguage() {+ return isMicrosoftIntermediateLanguage;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(+ String.format(": [%04X:%08X], Flags: %08x, %s", segment, offset.get(), flags, name));+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ flags = reader.parseUnsignedIntVal();+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ name.parse(reader);+ processFlags(flags);+ }++ private void processFlags(long flagsIn) {+ isCode = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ isFunction = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ isManaged = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ isMicrosoftIntermediateLanguage = ((flagsIn & 0x0001) == 0x0001);+ //TODO: Maybe study more. Remaining bits are supposed to be zero, but there is also+ // a grfFlags that these are unioned with.+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractReferenceMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractReferenceMsSymbol.javanew file mode 100644index 0000000000..36412ef34e--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractReferenceMsSymbol.java@@ -0,0 +1,81 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractReferenceMsSymbol extends AbstractMsSymbol {++ protected AbstractReferenceSymbolInternals internals;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractReferenceMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ create();+ internals.parse(reader);+ }++ /**+ * Returns "sum" (or "suc" or ?) name.+ * @return Name.+ */+ public long getSumName() {+ return internals.getSumName();+ }++ /**+ * Returns the actual offset in $$symbol.+ * @return Actual offset in $$symbol.+ */+ public long getOffsetActualSymbolInDollarDollarSymbols() {+ return internals.getOffsetActualSymbolInDollarDollarSymbols();+ }++ /**+ * Returns the module index.+ * @return Module index.+ */+ public int getModuleIndex() {+ return internals.getModuleIndex();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ internals.emit(builder);+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #internals}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractReferenceSymbolInternals.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractReferenceSymbolInternals.javanew file mode 100644index 0000000000..ea287d5cce--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractReferenceSymbolInternals.java@@ -0,0 +1,75 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Internals of Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractReferenceSymbolInternals extends AbstractSymbolInternals {++ /**+ * Implementing class's {@link #parse(PdbByteReader)} method must parse {@link #sumName},+ * {@link #offsetActualSymbolInDollarDollarSymbols}, and {@link #moduleIndex}.+ */+ protected long sumName; // Says SUC of the name???+ protected long offsetActualSymbolInDollarDollarSymbols;+ protected int moduleIndex;++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public AbstractReferenceSymbolInternals(AbstractPdb pdb) {+ super(pdb);+ }++ /**+ * Returns "sum" (or "suc" or ?) name.+ * @return Name.+ */+ public long getSumName() {+ return sumName;+ }++ /**+ * Returns the actual offset in $$symbol.+ * @return Actual offset in $$symbol.+ */+ public long getOffsetActualSymbolInDollarDollarSymbols() {+ return offsetActualSymbolInDollarDollarSymbols;+ }++ /**+ * Returns the module index.+ * @return Module index.+ */+ public int getModuleIndex() {+ return moduleIndex;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format(": %08X: (%4d, %08X)", sumName, moduleIndex,+ offsetActualSymbolInDollarDollarSymbols));+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractRegisterRelativeAddressMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractRegisterRelativeAddressMsSymbol.javanew file mode 100644index 0000000000..d3584fbcf7--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractRegisterRelativeAddressMsSymbol.java@@ -0,0 +1,115 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Register Relative Address symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractRegisterRelativeAddressMsSymbol extends AbstractMsSymbol {++ protected AbstractOffset offset;+ protected AbstractTypeIndex typeIndex;+ protected int registerIndex;+ protected RegisterName registerName;+ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractRegisterRelativeAddressMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ parse(reader);+ registerName = new RegisterName(pdb, registerIndex);+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex.get()));+ pdb.popDependencyStack();+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public long getOffset() {+ return offset.get();+ }++ /**+ * Returns the type index.+ * @return Type index.+ */+ public int getTypeIndex() {+ return typeIndex.get();+ }++ /**+ * Returns the register index.+ * @return Register index.+ */+ public int getRegisterIndex() {+ return registerIndex;+ }++ /**+ * Returns the register name.+ * @return Register name.+ */+ public String getRegisterNameString() {+ return registerName.toString();+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return name.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: %s+%08X, Type: %s, %s", getSymbolTypeName(),+ registerName.toString(), offset.get(), pdb.getTypeRecord(typeIndex.get()), name.get()));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #offset}, {@link #typeIndex}, and {@link #name}.+ */+ protected abstract void create();++ /**+ * Parsed the object's fields+ * <P>+ * Implementing class must, in the appropriate order pertinent to itself, parse+ * {@link #offset}, {@link #registerIndex}, {@link #typeIndex}, and {@link #name}.+ * @param reader {@link PdbByteReader} from which the fields are parsed.+ * @throws PdbException upon error parsing a field.+ */+ protected abstract void parse(PdbByteReader reader) throws PdbException;++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractSymbolInternals.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractSymbolInternals.javanew file mode 100644index 0000000000..90c44f79c2--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractSymbolInternals.java@@ -0,0 +1,63 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.*;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * An abstract class for a number of specific PDB symbol type internals that share certain+ * information. Because java does not support multiple inheritance, we chose to implement a+ * design where classes that have the same internal architectures, but which are not of the+ * same class hierarchy, can share the same internal structures.+ * <P>+ * For more information about PDBs, consult the Microsoft PDB API, see+ * <a href="https://devblogs.microsoft.com/cppblog/whats-inside-a-pdb-file">+ * What's inside a PDB File</a>.+ * @see AbstractMsSymbol+ */+public abstract class AbstractSymbolInternals extends AbstractParsableItem {++ protected AbstractPdb pdb;++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public AbstractSymbolInternals(AbstractPdb pdb) {+ this.pdb = pdb;+ create();+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize any items that need to be initialized prior+ * to their being used parsed by {@link #parse(PdbByteReader)} or used anywhere else.+ */+ protected abstract void create();++ /**+ * Parses the contents of these internals to a symbol.+ * <P>+ * Implementing class must parse any items that need to be parsed prior to use; these typically+ * include those items that were initialized by {@link #create()}.+ * @param reader {@link PdbByteReader} containing the information to parse.+ * @throws PdbException upon error parsing a field.+ */+ public abstract void parse(PdbByteReader reader) throws PdbException;++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractThreadStorageMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractThreadStorageMsSymbol.javanew file mode 100644index 0000000000..3666a318bb--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractThreadStorageMsSymbol.java@@ -0,0 +1,90 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of Thread Storage symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractThreadStorageMsSymbol extends AbstractMsSymbol {++ protected AbstractThreadStorageSymbolInternals threadStorageInternals;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractThreadStorageMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ threadStorageInternals.parse(reader);+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public long getOffset() {+ return threadStorageInternals.getOffset();+ }++ /**+ * Returns the segment.+ * @return Segment.+ */+ public int getSegment() {+ return threadStorageInternals.getSegment();+ }++ /**+ * Returns the type index.+ * @return Type index.+ */+ public int getTypeIndex() {+ return threadStorageInternals.getTypeIndex();+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return threadStorageInternals.getName();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ threadStorageInternals.emit(builder);+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #threadStorageInternals}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractThreadStorageSymbolInternals.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractThreadStorageSymbolInternals.javanew file mode 100644index 0000000000..b19e6ffb1e--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractThreadStorageSymbolInternals.java@@ -0,0 +1,87 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Internals of Thread Storage symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractThreadStorageSymbolInternals extends AbstractSymbolInternals {++ /**+ * Implementing class must initialize {@link #typeIndex}, {@link #offset}, and {@link #name}+ * in the {@link #create()} method. These, as well as {@link #segment}, must be parsed in+ * the {@link #parse(PdbByteReader)} method in the appropriate order pertinent to itself.+ */+ protected AbstractTypeIndex typeIndex;+ protected AbstractOffset offset;+ protected int segment;+ protected AbstractString name;++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public AbstractThreadStorageSymbolInternals(AbstractPdb pdb) {+ super(pdb);+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex.get()));+ pdb.popDependencyStack();+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public long getOffset() {+ return offset.get();+ }++ /**+ * Returns the segment.+ * @return Segment.+ */+ public int getSegment() {+ return segment;+ }++ /**+ * Returns the type index.+ * @return Type index.+ */+ public int getTypeIndex() {+ return typeIndex.get();+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return name.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format(": [%04X:%08X], Type: %s, %s", segment, offset.get(),+ pdb.getTypeRecord(typeIndex.get()).toString(), name));+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractThunkMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractThunkMsSymbol.javanew file mode 100644index 0000000000..5f728ddfd0--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractThunkMsSymbol.java@@ -0,0 +1,222 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.HashMap;+import java.util.Map;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Thunk symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractThunkMsSymbol extends AbstractMsSymbol {++ public enum Ordinal {++ NOTYPE("", 0),+ ADJUSTOR("Type: Adjustor", 1),+ VCALL("Type: VCall", 2),+ PCODE("Type: 03", 3),+ LOAD("Type: 04", 4),+ TRAMPOLINE_INCREMENTAL("Type: 05", 5),+ TRANMPOLINE_BRANCHISLAND("Type: 06", 6);++ private static final Map<Integer, Ordinal> BY_VALUE = new HashMap<>();+ static {+ for (Ordinal val : values()) {+ BY_VALUE.put(val.value, val);+ }+ }++ public final String label;+ public final int value;++ @Override+ public String toString() {+ return label;+ }++ public static Ordinal fromValue(int val) {+ return BY_VALUE.getOrDefault(val, NOTYPE);+ }++ private Ordinal(String label, int value) {+ this.label = label;+ this.value = value;+ }+ }++ //==============================================================================================+ protected long parentPointer;+ protected long endPointer;+ protected long nextPointer;+ protected AbstractOffset offset;+ protected int segment;+ protected int length;+ protected Ordinal ordinal;+ protected AbstractString name;+ protected int variant;+ protected AbstractString variantString;++ //==============================================================================================+ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractThunkMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ create();+ parentPointer = reader.parseUnsignedIntVal();+ endPointer = reader.parseUnsignedIntVal();+ nextPointer = reader.parseUnsignedIntVal();+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ length = reader.parseUnsignedShortVal();+ ordinal = Ordinal.fromValue(reader.parseUnsignedByteVal());+ name.parse(reader);+ switch (ordinal) {+ case ADJUSTOR:+ variant = reader.parseUnsignedShortVal();+ variantString.parse(reader);+ break;+ case VCALL:+ variant = reader.parseUnsignedShortVal();+ break;+ default:+ variant = 0;+ break;+ }+ reader.align4();+ }++ /**+ * Returns the parent pointer.+ * @return Parent pointer.+ */+ public long getParentPointer() {+ return parentPointer;+ }++ /**+ * Returns the end pointer.+ * @return End pointer.+ */+ public long getEndPointer() {+ return endPointer;+ }++ /**+ * Returns the next pointer+ * @return Next pointer.+ */+ public long getNextPointer() {+ return nextPointer;+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public long getOffset() {+ return offset.get();+ }++ /**+ * Returns the segment.+ * @return Segment.+ */+ public int getSegment() {+ return segment;+ }++ /**+ * Returns the length.+ * @return Length.+ */+ public int getLength() {+ return length;+ }++ /**+ * Returns the {@link Ordinal}.+ * @return {@link Ordinal}.+ */+ public Ordinal getOrdinal() {+ return ordinal;+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return name.get();+ }++ /**+ * Returns the variant.+ * @return Variant.+ */+ public int getVariant() {+ return variant;+ }++ public String getVariantString() {+ if (ordinal == Ordinal.ADJUSTOR) {+ return variantString.get();+ }+ return "";+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: [%04X:%08X], Length: %08X, %s\n", getSymbolTypeName(),+ segment, offset.get(), length, name.get()));+ builder.append(String.format(" Parent: %08X, End: %08X, Next: %08X\n", parentPointer,+ endPointer, nextPointer));+ switch (ordinal) {+ case NOTYPE:+ break;+ case ADJUSTOR:+ builder.append(String.format(" " + ordinal + ", Delta: %d, Target: %s\n", variant,+ variantString.get()));+ break;+ case VCALL:+ builder.append(String.format(" " + ordinal + ", Table Entry: %d\n", variant));+ break;+ default:+ builder.append(" " + ordinal + "\n");+ break;+ }+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #offset}, {@link #name}, and+ * {@link #variantString}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractUserDefinedTypeMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractUserDefinedTypeMsSymbol.javanew file mode 100644index 0000000000..169b3acf39--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractUserDefinedTypeMsSymbol.java@@ -0,0 +1,74 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents various flavors of User Defined Type symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractUserDefinedTypeMsSymbol extends AbstractMsSymbol {++ protected AbstractUserDefinedTypeSymbolInternals internals;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractUserDefinedTypeMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ internals.parse(reader);+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return internals.getName();+ }++ /**+ * Returns the type index.+ * @return Type index.+ */+ public int getTypeIndex() {+ return internals.getTypeIndex();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ internals.emit(builder);+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #internals}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractUserDefinedTypeSymbolInternals.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractUserDefinedTypeSymbolInternals.javanew file mode 100644index 0000000000..34f2dd60e9--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractUserDefinedTypeSymbolInternals.java@@ -0,0 +1,76 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Internals of User Defined Type symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractUserDefinedTypeSymbolInternals extends AbstractSymbolInternals {++ /**+ * Implementing class must initialize {@link #typeIndex} and {@link #name} in the+ * {@link #create()} method.+ */+ protected AbstractTypeIndex typeIndex;+ protected AbstractString name;++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public AbstractUserDefinedTypeSymbolInternals(AbstractPdb pdb) {+ super(pdb);+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex.get()));+ pdb.popDependencyStack();+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return name.get();+ }++ /**+ * Returns the type index.+ * @return Type index.+ */+ public int getTypeIndex() {+ return typeIndex.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(": ");+ builder.append(pdb.getTypeRecord(typeIndex.get()).toString());+ builder.append(", ");+ builder.append(name);+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ typeIndex.parse(reader);+ name.parse(reader);+ }+}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractUsingNamespaceMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractUsingNamespaceMsSymbol.javanew file mode 100644index 0000000000..988281b153--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractUsingNamespaceMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.AbstractString;++/**+ * This class represents various flavors of Using Namespace symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractUsingNamespaceMsSymbol extends AbstractMsSymbol {++ protected AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractUsingNamespaceMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ name.parse(reader);+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: %s", getSymbolTypeName(), name.get()));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #name}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractVirtualFunctionTableMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractVirtualFunctionTableMsSymbol.javanew file mode 100644index 0000000000..5c5323e0f5--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractVirtualFunctionTableMsSymbol.java@@ -0,0 +1,80 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of Virtual Function Table symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractVirtualFunctionTableMsSymbol extends AbstractMsSymbol {++ protected AbstractTypeIndex rootTypeIndex;+ protected AbstractTypeIndex pathTypeIndex;+ protected AbstractOffset offset;+ protected int segment;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public AbstractVirtualFunctionTableMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ create();+ parse(reader);+ pdb.pushDependencyStack(+ new CategoryIndex(CategoryIndex.Category.DATA, pathTypeIndex.get()));+ pdb.popDependencyStack();+ pdb.pushDependencyStack(+ new CategoryIndex(CategoryIndex.Category.DATA, rootTypeIndex.get()));+ pdb.popDependencyStack();+ }++ @Override+ public void emit(StringBuilder builder) {+ // TODO: determine correct order for root and path+ builder.append(String.format("%s: [%04X:%08X], %s:%s", getSymbolTypeName(), segment,+ offset.get(), pdb.getTypeRecord(pathTypeIndex.get()).toString(),+ pdb.getTypeRecord(rootTypeIndex.get()).toString()));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #offset}, {@link #rootTypeIndex}, and+ * {@link #pathTypeIndex}.+ */+ protected abstract void create();++ /**+ * Parses this symbol.+ * <P>+ * Implementing class must, in the appropriate order pertinent to itself, parse+ * {@link #offset}, {@link #rootTypeIndex}, {@link #pathTypeIndex}, and {@link #segment}.+ * @param reader {@link PdbByteReader} from which the data is parsed.+ * @throws PdbException Upon not enough data left to parse.+ */+ protected abstract void parse(PdbByteReader reader) throws PdbException;++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractWithMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractWithMsSymbol.javanew file mode 100644index 0000000000..78ac20bcb8--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AbstractWithMsSymbol.java@@ -0,0 +1,118 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents various flavors of With symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public abstract class AbstractWithMsSymbol extends AbstractMsSymbol {++ protected long parentPointer;+ protected long endPointer;+ protected AbstractOffset length;+ protected AbstractOffset offset;+ protected int segment;+ protected AbstractString expression;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AbstractWithMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ create();+ parentPointer = reader.parseUnsignedIntVal();+ endPointer = reader.parseUnsignedIntVal();+ length.parse(reader);+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ expression.parse(reader);+ reader.align4();+ }++ /**+ * Returns the parent pointer.+ * @return Parent pointer.+ */+ public long getParentPointer() {+ return parentPointer;+ }++ /**+ * Returns the end pointer.+ * @return End pointer.+ */+ public long getEndPointer() {+ return endPointer;+ }++ /**+ * Returns the length.+ * @return Length.+ */+ public long getLength() {+ return length.get();+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public long getOffset() {+ return offset.get();+ }++ /**+ * Returns the segment.+ * @return Segment.+ */+ public int getSegment() {+ return segment;+ }++ /**+ * Returns the expression.+ * @return Expression.+ */+ public String getExpression() {+ return expression.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(String.format(": [%04X:%08X], Length: %08X, %s\n", segment, offset.get(),+ length.get(), expression.get()));+ builder.append(String.format(" Parent: %08X, End: %08X\n", parentPointer, endPointer));+ }++ /**+ * Creates subcomponents for this class, which can be deserialized later.+ * <P>+ * Implementing class must initialize {@link #length}, {@link #offset}, and {@link #expression}.+ */+ protected abstract void create();++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AddressGap.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AddressGap.javanew file mode 100644index 0000000000..8376eb2b56--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AddressGap.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.*;++/**+ * Address Gap property used by a number of specific PDB symbol types.+ */+public class AddressGap extends AbstractParsableItem {++ private int gapStartOffset;+ private int lengthRange;++ /**+ * Constructor for this symbol component.+ * @param reader {@link PdbByteReader} from which this data is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public AddressGap(PdbByteReader reader) throws PdbException {+ gapStartOffset = reader.parseUnsignedShortVal();+ lengthRange = reader.parseUnsignedShortVal();+ }++ /**+ * Returns the gap start offset.+ * @return Gap start offset.+ */+ public int getGapStartOffset() {+ return gapStartOffset;+ }++ /**+ * Returns the length range.+ * @return Length range.+ */+ public int getLengthRange() {+ return lengthRange;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format(" (%04X, %X)", gapStartOffset, lengthRange));+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AddressRange.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AddressRange.javanew file mode 100644index 0000000000..5520cb4741--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AddressRange.java@@ -0,0 +1,70 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.*;++/**+ * Address Range property used by a number of specific PDB symbol types.+ */+public class AddressRange extends AbstractParsableItem {++ private long startOffset;+ private int sectionStart;+ private int lengthRange;++ /**+ * Constructor for this symbol component.+ * @param reader {@link PdbByteReader} from which this data is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public AddressRange(PdbByteReader reader) throws PdbException {+ startOffset = reader.parseUnsignedIntVal();+ sectionStart = reader.parseUnsignedShortVal();+ lengthRange = reader.parseUnsignedShortVal();+ }++ /**+ * Returns the start offset.+ * @return Start offset.+ */+ public long getStartOffset() {+ return startOffset;+ }++ /**+ * Returns the start section+ * @return Start section.+ */+ public int getSectionStart() {+ return sectionStart;+ }++ /**+ * Returns the length range.+ * @return Length range.+ */+ public int getLengthRange() {+ return lengthRange;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format(" Range: [%04X:%08X] - [%04X:%08X]", sectionStart,+ startOffset, sectionStart, startOffset + lengthRange));+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AlignMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AlignMsSymbol.javanew file mode 100644index 0000000000..b617d8b6d6--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AlignMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Align symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class AlignMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x0402;++ private int recordLength;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ */+ public AlignMsSymbol(AbstractPdb pdb, PdbByteReader reader) {+ super(pdb, reader);+ recordLength = reader.getLimit() - reader.getIndex();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("Align Record, Length = 0x%X", recordLength));+ }++ @Override+ protected String getSymbolTypeName() {+ return "ALIGN";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AnnotationMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AnnotationMsSymbol.javanew file mode 100644index 0000000000..de8e9c5d9c--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AnnotationMsSymbol.java@@ -0,0 +1,80 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.ArrayList;+import java.util.List;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the Annotation symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class AnnotationMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1019;++ private long offset;+ private int segment;+ private List<AbstractString> annotationStringList = new ArrayList<>();++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AnnotationMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ offset = reader.parseUnsignedIntVal();+ segment = reader.parseUnsignedShortVal();+ int count = reader.parseUnsignedShortVal();+ for (int i = 0; i < count; i++) {+ AbstractString string = new StringUtf8Nt();+ string.parse(reader);+ annotationStringList.add(string);+ }+ if (annotationStringList.size() != count) {+ assert false;+ }+ reader.align4();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: [%04X:%08X]\n", getSymbolTypeName(), segment, offset));+ int count = 0;+ for (AbstractString string : annotationStringList) {+ builder.append(String.format("%5d: %s\n", count++, string.get()));+ }+ }++ @Override+ protected String getSymbolTypeName() {+ return "ANNOTATION";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AnnotationReferenceMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AnnotationReferenceMsSymbol.javanew file mode 100644index 0000000000..8352c16410--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AnnotationReferenceMsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Annotation Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class AnnotationReferenceMsSymbol extends AbstractReferenceMsSymbol {++ public static final int PDB_ID = 0x1128;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AnnotationReferenceMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ReferenceSymbolInternals2(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "ANNOTATIONREF";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ArmSwitchTableMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ArmSwitchTableMsSymbol.javanew file mode 100644index 0000000000..20d6fefb14--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ArmSwitchTableMsSymbol.java@@ -0,0 +1,136 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.HashMap;+import java.util.Map;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Arm Switch Table symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ArmSwitchTableMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1159;++ public enum EntryType {++ UNKNOWN("unknown return", -1),+ INT1("signed byte", 0),+ UINT1("unsigned byte", 1),+ INT2("signed two byte", 2),+ UINT2("unsigned two byte", 3),+ INT4("signed four byte", 4),+ UINT4("unsigned four byte", 5),+ POINTER("pointer", 6),+ UINT1SHL1("unsigned byte scaled by two", 7),+ UINT2SHL1("unsigned two byte scaled by two", 8),+ INT1SHL1("signed byte scaled by two", 9),+ INT2SHL1("signed two byte scaled by two", 10);++ private static final Map<Integer, EntryType> BY_VALUE = new HashMap<>();+ static {+ for (EntryType val : values()) {+ BY_VALUE.put(val.value, val);+ }+ }++ public final String label;+ public final int value;++ @Override+ public String toString() {+ return label;+ }++ public static EntryType fromValue(int val) {+ return BY_VALUE.getOrDefault(val, UNKNOWN);+ }++ private EntryType(String label, int value) {+ this.label = label;+ this.value = value;+ }+ }++ //==============================================================================================+ private long offsetToBaseForSwitchOffsets;+ private int sectionIndexOfBaseForSwitchOffsets;+ private EntryType switchType;+ private long offsetToTableBranchInstruction;+ private long offsetToStartOfTable;+ private int sectionIndexOfTableBranchInstruction;+ private int sectionIndexOfTable;+ private long numberOfSwitchTableEntries;++ //==============================================================================================+ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public ArmSwitchTableMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ offsetToBaseForSwitchOffsets = reader.parseUnsignedIntVal();+ sectionIndexOfBaseForSwitchOffsets = reader.parseUnsignedShortVal();+ switchType = EntryType.fromValue(reader.parseUnsignedShortVal());+ offsetToTableBranchInstruction = reader.parseUnsignedIntVal();+ offsetToStartOfTable = reader.parseUnsignedIntVal();+ sectionIndexOfTableBranchInstruction = reader.parseUnsignedShortVal();+ sectionIndexOfTable = reader.parseUnsignedShortVal();+ numberOfSwitchTableEntries = reader.parseUnsignedIntVal();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ /**+ * Returns the {@link EntryType}.+ * @return The {@link EntryType}.+ */+ public EntryType getSwitchEntryType() {+ return switchType;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(":\n");+ builder.append(String.format(" Base address: [%04X:%08X]\n",+ sectionIndexOfBaseForSwitchOffsets, offsetToBaseForSwitchOffsets));+ builder.append(String.format(" Branch address: [%04X:%08X]\n",+ sectionIndexOfTableBranchInstruction, offsetToTableBranchInstruction));+ builder.append(String.format(" Table address: [%04X:%08X]\n", sectionIndexOfTable,+ offsetToStartOfTable));+ builder.append(String.format(" Entry count = %d\n", numberOfSwitchTableEntries));+ builder.append(" Switch entry type = " + switchType + "\n");+ }++ @Override+ protected String getSymbolTypeName() {+ return "ARMSWITCHTABLE";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AttributedLocalOrParameterRelativeToAlternateFramePointerMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AttributedLocalOrParameterRelativeToAlternateFramePointerMsSymbol.javanew file mode 100644index 0000000000..6268410ce2--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AttributedLocalOrParameterRelativeToAlternateFramePointerMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the Attributed Managed Local- Or Parameter-Relative-to-Virtual Frame+ * Pointer symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class AttributedLocalOrParameterRelativeToAlternateFramePointerMsSymbol+ extends AbstractManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol {++ public static final int PDB_ID = 0x1130;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AttributedLocalOrParameterRelativeToAlternateFramePointerMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "ATTR_REGREL";+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AttributedLocalOrParameterRelativeToVirtualFramePointerMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AttributedLocalOrParameterRelativeToVirtualFramePointerMsSymbol.javanew file mode 100644index 0000000000..8fcc9d418b--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AttributedLocalOrParameterRelativeToVirtualFramePointerMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the Attributed Local- Or Parameter-Relative-to-Virtual Frame Pointer+ * symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class AttributedLocalOrParameterRelativeToVirtualFramePointerMsSymbol+ extends AbstractLocalOrParameterRelativeToVirtualFramePointerMsSymbol {++ public static final int PDB_ID = 0x112e;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AttributedLocalOrParameterRelativeToVirtualFramePointerMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "ATTR_MANFRAMEREL";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AttributedLocalOrParameterStoredInManyRegisterMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AttributedLocalOrParameterStoredInManyRegisterMsSymbol.javanew file mode 100644index 0000000000..1481dd8b42--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AttributedLocalOrParameterStoredInManyRegisterMsSymbol.java@@ -0,0 +1,66 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the Attributed Managed Local- Or Parameter Stored in Many Register 2+ * symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class AttributedLocalOrParameterStoredInManyRegisterMsSymbol+ extends AbstractManagedLocalOrParameterStoredInManyRegisterMsSymbol {++ public static final int PDB_ID = 0x1131;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AttributedLocalOrParameterStoredInManyRegisterMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected int parseVal(PdbByteReader reader) throws PdbException {+ return reader.parseUnsignedShortVal();+ }++ @Override+ protected String getSymbolTypeName() {+ return "ATTR_MANYREG";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AttributedLocalOrParameterStoredInRegisterMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AttributedLocalOrParameterStoredInRegisterMsSymbol.javanew file mode 100644index 0000000000..0df17c9ecc--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/AttributedLocalOrParameterStoredInRegisterMsSymbol.java@@ -0,0 +1,60 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the Attributed Local Or Parameter Stored in Register symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class AttributedLocalOrParameterStoredInRegisterMsSymbol+ extends AbstractLocalOrParameterStoredInRegisterMsSymbol {++ public static final int PDB_ID = 0x112f;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public AttributedLocalOrParameterStoredInRegisterMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "ATTR_REGISTER";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/BasePointerRelative16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/BasePointerRelative16MsSymbol.javanew file mode 100644index 0000000000..4ac8ecfe9c--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/BasePointerRelative16MsSymbol.java@@ -0,0 +1,60 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Base Pointer Relative symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class BasePointerRelative16MsSymbol extends AbstractBasePointerRelativeMsSymbol {++ public static final int PDB_ID = 0x0100;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public BasePointerRelative16MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset16();+ typeIndex = new TypeIndex16();+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "BPREL16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/BasePointerRelative3216MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/BasePointerRelative3216MsSymbol.javanew file mode 100644index 0000000000..8ede93df95--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/BasePointerRelative3216MsSymbol.java@@ -0,0 +1,60 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>3216MsSymbol</B> flavor of Base Pointer Relative symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class BasePointerRelative3216MsSymbol extends AbstractBasePointerRelativeMsSymbol {++ public static final int PDB_ID = 0x0200;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public BasePointerRelative3216MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset32();+ typeIndex = new TypeIndex16();+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "BPREL32_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/BasePointerRelative32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/BasePointerRelative32MsSymbol.javanew file mode 100644index 0000000000..7fd679d72d--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/BasePointerRelative32MsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Base Pointer Relative symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class BasePointerRelative32MsSymbol extends AbstractBasePointerRelativeMsSymbol {++ public static final int PDB_ID = 0x110b;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public BasePointerRelative32MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ reader.align4();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset32();+ typeIndex = new TypeIndex32();+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "BPREL32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/BasePointerRelative32StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/BasePointerRelative32StMsSymbol.javanew file mode 100644index 0000000000..51c3500726--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/BasePointerRelative32StMsSymbol.java@@ -0,0 +1,60 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>32StMsSymbol</B> flavor of Base Pointer Relative symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class BasePointerRelative32StMsSymbol extends AbstractBasePointerRelativeMsSymbol {++ public static final int PDB_ID = 0x1006;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public BasePointerRelative32StMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset32();+ typeIndex = new TypeIndex32();+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "BPREL32_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Block16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Block16MsSymbol.javanew file mode 100644index 0000000000..4bfcfba62c--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Block16MsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Block symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Block16MsSymbol extends AbstractBlockMsSymbol {++ public static final int PDB_ID = 0x0107;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Block16MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ length = new Offset16();+ offset = new Offset16();+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "BLOCK16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Block32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Block32MsSymbol.javanew file mode 100644index 0000000000..dfda9dd0e6--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Block32MsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Block symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Block32MsSymbol extends AbstractBlockMsSymbol {++ public static final int PDB_ID = 0x1103;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Block32MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ length = new Offset32();+ offset = new Offset32();+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "BLOCK32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Block32StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Block32StMsSymbol.javanew file mode 100644index 0000000000..c6994c5054--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Block32StMsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>32StMsSymbol</B> flavor of Block symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Block32StMsSymbol extends AbstractBlockMsSymbol {++ public static final int PDB_ID = 0x0207;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Block32StMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ length = new Offset32();+ offset = new Offset32();+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "BLOCK32_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/BuildInformationMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/BuildInformationMsSymbol.javanew file mode 100644index 0000000000..97851c0102--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/BuildInformationMsSymbol.java@@ -0,0 +1,80 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.CategoryIndex;+import ghidra.pdb.pdbreader.type.AbstractMsType;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Build Information symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class BuildInformationMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x114c;++ protected int itemId;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public BuildInformationMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ itemId = reader.parseInt();+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.ITEM, itemId));+ pdb.popDependencyStack();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ /**+ * Returns the item index.+ * @return Item index.+ */+ public int getItemIndex() {+ return itemId;+ }++ /**+ * Returns the {@link String} representation of the {@link AbstractMsType} item type.+ * @return {@link String} representation of the item type.+ */+ public String getItemString() {+ return pdb.getItemRecord(itemId).toString();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: %s\n", getSymbolTypeName(), pdb.getItemRecord(itemId)));+ }++ @Override+ protected String getSymbolTypeName() {+ return "BUILDINFO";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CalleesMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CalleesMsSymbol.javanew file mode 100644index 0000000000..0a7d7475ce--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CalleesMsSymbol.java@@ -0,0 +1,52 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Callers Function List symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class CalleesMsSymbol extends AbstractFunctionListMsSymbol {++ public static final int PDB_ID = 0x115a;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public CalleesMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "CALLEES";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CallersMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CallersMsSymbol.javanew file mode 100644index 0000000000..12cec9773d--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CallersMsSymbol.java@@ -0,0 +1,52 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Callees Function List symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class CallersMsSymbol extends AbstractFunctionListMsSymbol {++ public static final int PDB_ID = 0x115b;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public CallersMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "CALLERS";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ChangeExecutionModel16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ChangeExecutionModel16MsSymbol.javanew file mode 100644index 0000000000..fd6d94a816--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ChangeExecutionModel16MsSymbol.java@@ -0,0 +1,80 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.Offset16;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Change Model Execution symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ChangeExecutionModel16MsSymbol extends AbstractChangeExecutionModelMsSymbol {++ public static final int PDB_ID = 0x010a;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public ChangeExecutionModel16MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset16();+ }++ @Override+ protected String getSymbolTypeName() {+ return "CEXMODEL16";+ }++ @Override+ protected void parseSpecifics(PdbByteReader reader) throws PdbException {+ switch (model) {+ case COBOL:+ subtype = reader.parseUnsignedShortVal();+ flag = reader.parseUnsignedShortVal();+ break;+ case PCODE:+ offsetToPcodeFunctionTable = reader.parseUnsignedShortVal();+ offsetToSegmentPcodeInformation = reader.parseUnsignedShortVal();+ break;+ default:+ break;+ }+ }++ @Override+ protected boolean emitAdditionalModelCases(StringBuilder builder) {+ return false; //false = did not find an additional case statement on switch(model)+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ChangeExecutionModel32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ChangeExecutionModel32MsSymbol.javanew file mode 100644index 0000000000..755b66d9bd--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ChangeExecutionModel32MsSymbol.java@@ -0,0 +1,103 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.Offset32;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Change Model Execution symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ChangeExecutionModel32MsSymbol extends AbstractChangeExecutionModelMsSymbol {++ public static final int PDB_ID = 0x020a;++ // For pcode32Mac:+ private long offsetToFunctionTable;+ private int segmentOfFunctionTable;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public ChangeExecutionModel32MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset32();+ }++ @Override+ protected String getSymbolTypeName() {+ return "CEXMODEL32";+ }++ @Override+ protected void parseSpecifics(PdbByteReader reader) throws PdbException {+ switch (model) {+ case COBOL:+ // subtype (API: values are missing)+ subtype = reader.parseUnsignedShortVal();+ flag = reader.parseUnsignedShortVal();+ break;+ case PCODE:+ offsetToPcodeFunctionTable = reader.parseUnsignedIntVal();+ offsetToSegmentPcodeInformation = reader.parseUnsignedIntVal();+ break;+ case PCODE32MACINTOSH:+ case PCODE32MACINTOSH_NATIVE_ENTRY_POINT:+ offsetToFunctionTable = reader.parseUnsignedIntVal();+ segmentOfFunctionTable = reader.parseUnsignedShortVal();+ break;+ default:+ break;+ }+ }++ @Override+ protected boolean emitAdditionalModelCases(StringBuilder builder) {+ boolean foundCase = true;+ switch (model) {+ case PCODE32MACINTOSH:+ builder.append(String.format("callTable = %08X, segment = %08X\n",+ offsetToFunctionTable, segmentOfFunctionTable));+ break;+ case PCODE32MACINTOSH_NATIVE_ENTRY_POINT:+ builder.append(String.format("callTable = %08X, segment = %08X\n",+ offsetToFunctionTable, segmentOfFunctionTable));+ break;+ default:+ foundCase = false;+ break;+ }+ return foundCase;+ }+}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CobolUserDefinedType16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CobolUserDefinedType16MsSymbol.javanew file mode 100644index 0000000000..3a467db3be--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CobolUserDefinedType16MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Cobol User Defined Type symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class CobolUserDefinedType16MsSymbol extends AbstractCobolUserDefinedTypeMsSymbol {++ public static final int PDB_ID = 0x000b;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public CobolUserDefinedType16MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new UserDefinedTypeSymbolInternals16(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "COBOLUDT_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CobolUserDefinedTypeMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CobolUserDefinedTypeMsSymbol.javanew file mode 100644index 0000000000..f7fb599e5d--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CobolUserDefinedTypeMsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>MsSymbol</B> flavor of Cobol User Defined Type symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class CobolUserDefinedTypeMsSymbol extends AbstractCobolUserDefinedTypeMsSymbol {++ public static final int PDB_ID = 0x1109;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public CobolUserDefinedTypeMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new UserDefinedTypeSymbolInternals(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "COBOLUDT";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CobolUserDefinedTypeStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CobolUserDefinedTypeStMsSymbol.javanew file mode 100644index 0000000000..4c26debe05--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CobolUserDefinedTypeStMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Cobol User Defined Type symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class CobolUserDefinedTypeStMsSymbol extends AbstractCobolUserDefinedTypeMsSymbol {++ public static final int PDB_ID = 0x1004;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public CobolUserDefinedTypeStMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new UserDefinedTypeSymbolInternalsSt(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "COBOLUDT_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Compile2MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Compile2MsSymbol.javanew file mode 100644index 0000000000..5fc0741c4e--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Compile2MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the <B>MsSymbol</B> flavor of Compile 2 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Compile2MsSymbol extends AbstractCompile2MsSymbol {++ public static final int PDB_ID = 0x1116;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Compile2MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ compilerVersionString = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "COMPILE2";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Compile2StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Compile2StMsSymbol.javanew file mode 100644index 0000000000..05d1bd12ef--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Compile2StMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Compile 2 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Compile2StMsSymbol extends AbstractCompile2MsSymbol {++ public static final int PDB_ID = 0x1013;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Compile2StMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ compilerVersionString = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "COMPILE2_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Compile3MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Compile3MsSymbol.javanew file mode 100644index 0000000000..b5f9ce5a34--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Compile3MsSymbol.java@@ -0,0 +1,360 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the Compile 3 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Compile3MsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x113c;++ protected LanguageName language;+ protected boolean compiledForEditAndContinue;+ protected boolean notCompiledWithDebugInfo;+ protected boolean compiledWithLinkTimeCodeGeneration;+ protected boolean compiledWithBzalignNoDataAlign;+ protected boolean managedCodeDataPresent;+ protected boolean compiledWithGsBufferSecurityChecks;+ protected boolean compiledWithHotPatch;+ // Converted from (.NET IL) Common Intermediate Language Module+ protected boolean convertedWithCvtcil;+ protected boolean microsoftIntermediateLanguageNetModule;+ protected boolean compiledWithSdl;+ protected boolean compiledWithLtcgPgoOrPgu;+ protected boolean dotExpModule;+ protected int processorIndex;+ protected ProcessorName processor;+ protected int frontEndMajorVersionNumber;+ protected int frontEndMinorVersionNumber;+ protected int frontEndBuildVersionNumber;+ protected int frontEndQuickFixEngineeringVersionNumber;+ protected int backEndMajorVersionNumber;+ protected int backEndMinorVersionNumber;+ protected int backEndBuildVersionNumber;+ protected int backEndQuickFixEngineeringVersionNumber;+ protected AbstractString compilerVersionString;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Compile3MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ compilerVersionString = new StringUtf8Nt();+ processFlags(reader.parseUnsignedIntVal());+ processorIndex = reader.parseUnsignedShortVal();+ processor = new ProcessorName(processorIndex);+ frontEndMajorVersionNumber = reader.parseUnsignedShortVal();+ frontEndMinorVersionNumber = reader.parseUnsignedShortVal();+ frontEndBuildVersionNumber = reader.parseUnsignedShortVal();+ frontEndQuickFixEngineeringVersionNumber = reader.parseUnsignedShortVal();+ backEndMajorVersionNumber = reader.parseUnsignedShortVal();+ backEndMinorVersionNumber = reader.parseUnsignedShortVal();+ backEndBuildVersionNumber = reader.parseUnsignedShortVal();+ backEndQuickFixEngineeringVersionNumber = reader.parseUnsignedShortVal();+ compilerVersionString.parse(reader);++ // Very important: sStore target machine information. It is used elsewhere, including+ // in RegisterName.+ pdb.setTargetProcessorIndexNumber(processorIndex);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ /**+ * Returns the language.+ * @return Language.+ */+ public String getLanguage() {+ return language.toString();+ }++ /**+ * Tells whether the target was compiled for "Edit and Continue."+ * @return True if it was compiled for "Edit and Continue."+ */+ public boolean isCompiledForEditAndContinue() {+ return compiledForEditAndContinue;+ }++ /**+ * Tells whether the target was not compiled with debug information.+ * @return True if it was not compiled with debug information.+ */+ public boolean isNotCompiledWithDebugInfo() {+ return notCompiledWithDebugInfo;+ }++ /**+ * Tells whether the target was compiled with link-time code generation.+ * @return True if it was compiled with link-time code generation.+ */+ public boolean isCompiledWithLinkTimeCodeGeneration() {+ return compiledWithLinkTimeCodeGeneration;+ }++ /**+ * Tells whether the target was compiled with Bzalign.+ * @return True if compiled with Bzalign.+ */+ public boolean isCompiledWithBzalignNoDataAlign() {+ return compiledWithBzalignNoDataAlign;+ }++ /**+ * Tells whether the target has managed code and/or data present.+ * @return True if has managed code/data present.+ */+ public boolean isManagedCodeDataPresent() {+ return managedCodeDataPresent;+ }++ /**+ * Tells whether the target was compiled with /GS buffer security checks.+ * @return True if it was compiled with /GS buffer security checks.+ */+ public boolean isCompiledWithGsBufferSecurityChecks() {+ return compiledWithGsBufferSecurityChecks;+ }++ /**+ * Tells whether the target was compiled with /hotpatch.+ * @return True if it was compiled with /hotpatch.+ */+ public boolean isCompiledWithHotPatch() {+ return compiledWithHotPatch;+ }++ /**+ * Tells whether the target was converted with CVTCIL.+ * @return True if was converted with CVTCIL.+ */+ public boolean wasConvertedWithCvtcil() {+ return convertedWithCvtcil;+ }++ /**+ * Tells whether the target is a Microsoft Intermediate Language netmodule.+ * @return True if it is a Microsoft Intermediate Language netmodule.+ */+ public boolean isMicrosoftIntermediateLanguageNetModule() {+ return microsoftIntermediateLanguageNetModule;+ }++ /**+ * Tells whether the target is compiled with /sdl.+ * @return True if it was compiled with /sdl.+ */+ public boolean isCompiledWithSdl() {+ return compiledWithSdl;+ }++ /**+ * Tells whether the target is compiled with /ltcg:pgo or pgu.+ * @return True if compiled with /ltcg:pgo or pgu.+ */+ public boolean isCompiledWithLtcgPgoOrPgu() {+ return compiledWithLtcgPgoOrPgu;+ }++ /**+ * Tells whether the target is a .exp module.+ * @return True if a .exp module.+ */+ public boolean isDotExpModule() {+ return dotExpModule;+ }++ /**+ * Returns the processor index.+ * @return Processor index.+ */+ public int getProcessorIndex() {+ return processorIndex;+ }++ /**+ * Returns the processor name.+ * @return Processor name.+ */+ public String getProcessorName() {+ return processor.toString();+ }++ /**+ * Returns the front end major version number.+ * @return Front end major version number.+ */+ public int getFrontEndMajorVersionNumber() {+ return frontEndMajorVersionNumber;+ }++ /**+ * Returns the front end minor version number.+ * @return Front end minor version number.+ */+ public int getFrontEndMinorVersionNumber() {+ return frontEndMinorVersionNumber;+ }++ /**+ * Returns the front end build version number.+ * @return Front end build version number.+ */+ public int getFrontEndBuildVersionNumber() {+ return frontEndBuildVersionNumber;+ }++ /**+ * Returns the front end quick fix engineering version number.+ * @return Front end quick fix engineering version number.+ */+ public int getFrontEndQuickFixEngineeringVersionNumber() {+ return frontEndQuickFixEngineeringVersionNumber;+ }++ /**+ * Returns the back end major version number.+ * @return Back end major version number.+ */+ public int getBackEndMajorVersionNumber() {+ return backEndMajorVersionNumber;+ }++ /**+ * Returns the back end minor version number.+ * @return Back end minor version number.+ */+ public int getBackEndMinorVersionNumber() {+ return backEndMinorVersionNumber;+ }++ /**+ * Returns the back end build version number.+ * @return Back end build version number.+ */+ public int getBackEndBuildVersionNumber() {+ return backEndBuildVersionNumber;+ }++ /**+ * Returns the back end quick fix engineering version number.+ * @return Back end quick fix engineering version number.+ */+ public int getBackEndQuickFixEngineeringVersionNumber() {+ return backEndQuickFixEngineeringVersionNumber;+ }++ /**+ * Returns the compiler version string.+ * @return Compiler version string.+ */+ public String getCompilerVersionString() {+ return compilerVersionString.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(":\n Language: ");+ builder.append(language.toString());+ builder.append("\n Target Processor: ");+ builder.append(processor.toString());++ builder.append(+ "\n Compiled for edit and continue: " + (compiledForEditAndContinue ? "yes" : "no"));+ builder.append(+ "\n Compiled withoug debugging info: " + (notCompiledWithDebugInfo ? "yes" : "no"));+ builder.append(+ "\n Compiled with LTCG: " + (compiledWithLinkTimeCodeGeneration ? "yes" : "no"));+ builder.append(+ "\n Compiled with /bzalign: " + (compiledWithBzalignNoDataAlign ? "yes" : "no"));+ builder.append("\n Managed code present: " + (managedCodeDataPresent ? "yes" : "no"));+ builder.append(+ "\n Compiled with /GS: " + (compiledWithGsBufferSecurityChecks ? "yes" : "no"));+ builder.append("\n Compiled with /hotpatch: " + (compiledWithHotPatch ? "yes" : "no"));+ builder.append("\n Converted by CVTCIL: " + (convertedWithCvtcil ? "yes" : "no"));+ builder.append("\n Microsoft Intermediate Language Module: " ++ (microsoftIntermediateLanguageNetModule ? "yes" : "no"));+ builder.append("\n Compiled with /sdl: " + (compiledWithSdl ? "yes" : "no"));+ builder.append("\n Compiled with Profile Guided Optimization (PGO): " ++ (compiledWithLtcgPgoOrPgu ? "yes" : "no"));+ builder.append("\n .EXP module: " + (dotExpModule ? "yes" : "no"));++ builder.append(+ String.format("\n Frontend Version: Major = %d, Minor = %d, Build = %d, QFE = %d",+ frontEndMajorVersionNumber, frontEndMinorVersionNumber, frontEndBuildVersionNumber,+ frontEndQuickFixEngineeringVersionNumber));+ builder.append(+ String.format("\n Backend Version: Major = %d, Minor = %d, Build = %d, QFE = %d",+ backEndMajorVersionNumber, backEndMinorVersionNumber, backEndBuildVersionNumber,+ backEndQuickFixEngineeringVersionNumber));+ builder.append("\n Version String:" + compilerVersionString);+ builder.append("\n");+ }++ @Override+ protected String getSymbolTypeName() {+ return "COMPILE3";+ }++ /**+ * Internal method that breaks out the flag values from the aggregate integral type.+ * @param flagsIn {@code long} containing unsigned int value.+ */+ protected void processFlags(long flagsIn) {+ language = new LanguageName((int) (flagsIn & 0xff));+ flagsIn >>= 8;++ compiledForEditAndContinue = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ notCompiledWithDebugInfo = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ compiledWithLinkTimeCodeGeneration = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ compiledWithBzalignNoDataAlign = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ managedCodeDataPresent = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ compiledWithGsBufferSecurityChecks = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ compiledWithHotPatch = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ convertedWithCvtcil = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ microsoftIntermediateLanguageNetModule = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ compiledWithSdl = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ compiledWithLtcgPgoOrPgu = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ dotExpModule = ((flagsIn & 0x0001) == 0x0001);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CompileFlagsMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CompileFlagsMsSymbol.javanew file mode 100644index 0000000000..59c015ae53--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CompileFlagsMsSymbol.java@@ -0,0 +1,114 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Compiler Flags symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class CompileFlagsMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x0001;++ protected int processorIndex;+ protected ProcessorName processor;+ protected LanguageName language;+ protected boolean pcodePresent;+ protected int floatingPrecision;+ protected int floatPackage;+ protected int ambiantDataModel;+ protected int ambiantCodeModel;+ protected boolean compiled32BitMode;+ protected String compilerVersionString;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a string.+ */+ public CompileFlagsMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ processorIndex = reader.parseUnsignedByteVal();+ processor = new ProcessorName(processorIndex);+ //Possible padding here for structure???+ byte[] flags = reader.parseBytes(3);+ processFlags(flags);+ compilerVersionString = reader.parseByteLengthPrefixedUtf8String();++ // Very important: sStore target machine information. It is used elsewhere, including+ // in RegisterName.+ pdb.setTargetProcessorIndexNumber(processorIndex);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(":\n Language: ");+ builder.append(language.toString());+ builder.append("\n Target Processor: ");+ builder.append(processor.toString());+ builder.append("\n Floating-point precision: " + floatingPrecision);+ builder.append("\n Floating-point package: " + floatPackage);+ builder.append("\n Ambiant data: " + ambiantDataModel);+ builder.append("\n Ambiant code: " + ambiantCodeModel);+ builder.append("\n PCode present: " + (compiled32BitMode ? "yes" : "no"));+ builder.append("\n Version String:" + compilerVersionString);+ builder.append("\n");+ }++ @Override+ protected String getSymbolTypeName() {+ return "COMPILE";+ }++ /**+ * Internal method that breaks out the flag values {@code byte[3]} array. Method does not+ * check size.+ * @param flagsIn {@code byte[]} that needs to have 3 bytes.+ */+ protected void processFlags(byte[] flagsIn) {+ int flagsByte = flagsIn[0];+ language = new LanguageName(flagsByte);++ flagsByte = flagsIn[1];+ pcodePresent = ((flagsByte & 0x0001) == 0x0001);+ flagsByte >>= 1;+ floatingPrecision = (flagsByte & 0x03);+ flagsByte >>= 2;+ floatPackage = (flagsByte & 0x03);+ flagsByte >>= 2;+ ambiantDataModel = (flagsByte & 0x07);++ flagsByte = flagsIn[2];+ ambiantCodeModel = (flagsByte & 0x07);+ flagsByte >>= 3;+ compiled32BitMode = ((flagsByte & 0x0001) == 0x0001);++ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Constant16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Constant16MsSymbol.javanew file mode 100644index 0000000000..a298204337--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Constant16MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Constant symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Constant16MsSymbol extends AbstractConstantMsSymbol {++ public static final int PDB_ID = 0x0003;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Constant16MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex16();+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "CONSTANT_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ConstantMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ConstantMsSymbol.javanew file mode 100644index 0000000000..a38f726746--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ConstantMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>MsSymbol</B> flavor of Constant symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ConstantMsSymbol extends AbstractConstantMsSymbol {++ public static final int PDB_ID = 0x1107;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ConstantMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex32();+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "CONSTANT";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ConstantStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ConstantStMsSymbol.javanew file mode 100644index 0000000000..8fbecfb575--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ConstantStMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Constant symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ConstantStMsSymbol extends AbstractConstantMsSymbol {++ public static final int PDB_ID = 0x1002;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ConstantStMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex32();+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "CONSTANT_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CvReservedMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CvReservedMsSymbol.javanew file mode 100644index 0000000000..14ba55092d--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/CvReservedMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the CV Reserved symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class CvReservedMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x0008;++ private int recordLength;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ */+ public CvReservedMsSymbol(AbstractPdb pdb, PdbByteReader reader) {+ super(pdb, reader);+ recordLength = reader.getLimit() - reader.getIndex();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s, Length = 0x%X", getSymbolTypeName(), recordLength));+ }++ @Override+ protected String getSymbolTypeName() {+ return "CVRESERVE";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataHighLevelShaderLanguageSymbolInternals.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataHighLevelShaderLanguageSymbolInternals.javanew file mode 100644index 0000000000..74d2db24ad--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataHighLevelShaderLanguageSymbolInternals.java@@ -0,0 +1,71 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.CategoryIndex;++/**+ * This class represents Internals of the High Level Shader Language symbol.+ * <P>+ * Note: we have guessed that HLSL means High Level Shader Language.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DataHighLevelShaderLanguageSymbolInternals+ extends AbstractDataHighLevelShaderLanguageSymbolInternals {++ protected long dataSlot;+ protected long textureSlotStart;+ protected long samplerSlotStart;+ protected long uavSlotStart;++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public DataHighLevelShaderLanguageSymbolInternals(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(+ String.format(": Type: %s. %s\n", pdb.getTypeRecord(typeIndex), getRegisterType()));+ builder.append(String.format(+ " base data: slot = %d offset = %d, texture slot = %d, sampler slot = %d, UAV slot = %d\n",+ dataSlot, dataOffset, textureSlotStart, samplerSlotStart, uavSlotStart));+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ // Different order and different sizes than for parent.+ typeIndex = reader.parseInt();+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex));+ pdb.popDependencyStack();+ registerType = reader.parseUnsignedShortVal();+ dataSlot = reader.parseUnsignedShortVal();+ dataOffset = reader.parseUnsignedShortVal();+ textureSlotStart = reader.parseUnsignedShortVal();+ samplerSlotStart = reader.parseUnsignedShortVal();+ uavSlotStart = reader.parseUnsignedShortVal();+ name.parse(reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataHighLevelShaderLanguageSymbolInternals32.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataHighLevelShaderLanguageSymbolInternals32.javanew file mode 100644index 0000000000..5670876626--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataHighLevelShaderLanguageSymbolInternals32.java@@ -0,0 +1,70 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.CategoryIndex;++/**+ * This class represents Internals 32 of the High Level Shader Language symbol.+ * <P>+ * Note: we have guessed that HLSL means High Level Shader Language.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DataHighLevelShaderLanguageSymbolInternals32+ extends AbstractDataHighLevelShaderLanguageSymbolInternals {++ protected long dataSlot;+ protected long textureSlotStart;+ protected long samplerSlotStart;+ protected long uavSlotStart;++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public DataHighLevelShaderLanguageSymbolInternals32(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(+ String.format(": Type: %s. %s\n", pdb.getTypeRecord(typeIndex), getRegisterType()));+ builder.append(String.format(+ " base data: slot = %d offset = %d, texture slot = %d, sampler slot = %d, UAV slot = %d\n",+ dataSlot, dataOffset, textureSlotStart, samplerSlotStart, uavSlotStart));+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ typeIndex = reader.parseInt();+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex));+ pdb.popDependencyStack();+ dataSlot = reader.parseUnsignedIntVal();+ dataOffset = reader.parseUnsignedIntVal();+ textureSlotStart = reader.parseUnsignedIntVal();+ samplerSlotStart = reader.parseUnsignedIntVal();+ uavSlotStart = reader.parseUnsignedIntVal();+ registerType = reader.parseUnsignedShortVal();+ name.parse(reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataHighLevelShaderLanguageSymbolInternals32Extended.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataHighLevelShaderLanguageSymbolInternals32Extended.javanew file mode 100644index 0000000000..e2e137a463--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataHighLevelShaderLanguageSymbolInternals32Extended.java@@ -0,0 +1,69 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.CategoryIndex;++/**+ * This class represents Extended Internals 32 of the High Level Shader Language symbol.+ * <P>+ * Note: we have guessed that HLSL means High Level Shader Language.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DataHighLevelShaderLanguageSymbolInternals32Extended+ extends AbstractDataHighLevelShaderLanguageSymbolInternals {++ protected long registerIndex;+ protected long bindSpace;+ protected long bindSlot;++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public DataHighLevelShaderLanguageSymbolInternals32Extended(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(+ String.format(": Type: %s. %s\n", pdb.getTypeRecord(typeIndex), getRegisterType()));+ builder.append(String.format(+ " register index = %d, base data offset start = %d, bind space = %d, bind slot = %d\n",+ registerIndex, dataOffset, bindSpace, bindSlot));+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ // Different order, items, and different sizes than for parent.+ typeIndex = reader.parseInt();+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex));+ pdb.popDependencyStack();+ registerIndex = reader.parseUnsignedIntVal();+ dataOffset = reader.parseUnsignedIntVal();+ bindSpace = reader.parseUnsignedIntVal();+ bindSlot = reader.parseUnsignedIntVal();+ registerType = reader.parseUnsignedShortVal();+ name.parse(reader);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataReferenceMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataReferenceMsSymbol.javanew file mode 100644index 0000000000..3943419dbe--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataReferenceMsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Data Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DataReferenceMsSymbol extends AbstractDataReferenceMsSymbol {++ public static final int PDB_ID = 0x1126;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public DataReferenceMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ protected void create() {+ internals = new ReferenceSymbolInternals2(pdb);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "DATAREF";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataReferenceStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataReferenceStMsSymbol.javanew file mode 100644index 0000000000..6e4e93ff28--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataReferenceStMsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Data Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DataReferenceStMsSymbol extends AbstractDataReferenceMsSymbol {++ public static final int PDB_ID = 0x0401;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public DataReferenceStMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ReferenceSymbolInternalsSt(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "DATAREF_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataSymbolInternals16.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataSymbolInternals16.javanew file mode 100644index 0000000000..f7ad46a395--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataSymbolInternals16.java@@ -0,0 +1,56 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>16</B> flavor of Internals for a Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DataSymbolInternals16 extends AbstractDataSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param emitToken Indicates whether typeIndex field is a token or default.+ * typeIndex.+ */+ public DataSymbolInternals16(AbstractPdb pdb, boolean emitToken) {+ super(pdb, emitToken);+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex16();+ offset = new Offset16();+ name = new StringUtf8St();+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ typeIndex.parse(reader);+ name.parse(reader);+ reader.align4();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataSymbolInternals32.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataSymbolInternals32.javanew file mode 100644index 0000000000..af8479ea2b--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataSymbolInternals32.java@@ -0,0 +1,56 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>32</B> flavor of Internals for a Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DataSymbolInternals32 extends AbstractDataSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param emitToken Indicates whether typeIndex field is a token or default.+ * typeIndex.+ */+ public DataSymbolInternals32(AbstractPdb pdb, boolean emitToken) {+ super(pdb, emitToken);+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex32();+ offset = new Offset32();+ name = new StringUtf8Nt();+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ typeIndex.parse(reader);+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ name.parse(reader);+ reader.align4();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataSymbolInternals3216.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataSymbolInternals3216.javanew file mode 100644index 0000000000..999d805b66--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataSymbolInternals3216.java@@ -0,0 +1,56 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>3216</B> flavor of Internals for a Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DataSymbolInternals3216 extends AbstractDataSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param emitToken Indicates whether typeIndex field is a token or default.+ * typeIndex.+ */+ public DataSymbolInternals3216(AbstractPdb pdb, boolean emitToken) {+ super(pdb, emitToken);+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex16();+ offset = new Offset32();+ name = new StringUtf8St();+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ typeIndex.parse(reader);+ name.parse(reader);+ reader.align4();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataSymbolInternals32St.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataSymbolInternals32St.javanew file mode 100644index 0000000000..cf83acd5a0--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DataSymbolInternals32St.java@@ -0,0 +1,56 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>32St</B> flavor of Internals for a Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DataSymbolInternals32St extends AbstractDataSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param emitToken Indicates whether typeIndex field is a token or default.+ * typeIndex.+ */+ public DataSymbolInternals32St(AbstractPdb pdb, boolean emitToken) {+ super(pdb, emitToken);+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex32();+ offset = new Offset32();+ name = new StringUtf8St();+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ typeIndex.parse(reader);+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ name.parse(reader);+ reader.align4();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DeferredProcedureCallPointerTagToSymbolRecordMapEntry.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DeferredProcedureCallPointerTagToSymbolRecordMapEntry.javanew file mode 100644index 0000000000..480e898d15--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DeferredProcedureCallPointerTagToSymbolRecordMapEntry.java@@ -0,0 +1,48 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.*;++/**+ * This class represents and Entry for the Deferred Procedure Call Pointer Tag To Symbol Record Map+ * symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DeferredProcedureCallPointerTagToSymbolRecordMapEntry extends AbstractParsableItem {++ private long tagValue; //MSFT API says "unsigned int"+ private long symbolRecordOffset;++ /**+ * Constructor for this symbol component.+ * @param reader {@link PdbByteReader} from which this data is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public DeferredProcedureCallPointerTagToSymbolRecordMapEntry(PdbByteReader reader)+ throws PdbException {+ tagValue = reader.parseUnsignedIntVal();+ symbolRecordOffset = reader.parseUnsignedIntVal();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("(%d, %X)", tagValue, symbolRecordOffset));+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DeferredProcedureCallPointerTagToSymbolRecordMapMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DeferredProcedureCallPointerTagToSymbolRecordMapMsSymbol.javanew file mode 100644index 0000000000..131dd61986--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DeferredProcedureCallPointerTagToSymbolRecordMapMsSymbol.java@@ -0,0 +1,72 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.ArrayList;+import java.util.List;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Deferred Procedure Call Pointer Tag To Symbol Record Map symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DeferredProcedureCallPointerTagToSymbolRecordMapMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1158;++ private List<DeferredProcedureCallPointerTagToSymbolRecordMapEntry> mapList = new ArrayList<>();++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public DeferredProcedureCallPointerTagToSymbolRecordMapMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ while (reader.hasMore()) {+ DeferredProcedureCallPointerTagToSymbolRecordMapEntry entry =+ new DeferredProcedureCallPointerTagToSymbolRecordMapEntry(reader);+ mapList.add(entry);+ }+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: %d entries", getSymbolTypeName(), mapList.size()));+ for (DeferredProcedureCallPointerTagToSymbolRecordMapEntry entry : mapList) {+ builder.append(String.format(", %s", entry.toString()));+ }+ builder.append("\n");+ }++ @Override+ protected String getSymbolTypeName() {+ return "DPC_SYM_TAG_MAP";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedAddressRangeDeferredProcedureCallPointerTagMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedAddressRangeDeferredProcedureCallPointerTagMsSymbol.javanew file mode 100644index 0000000000..559652f334--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedAddressRangeDeferredProcedureCallPointerTagMsSymbol.java@@ -0,0 +1,54 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Defined Address Range Deferred Procedure Call Pointer Tag symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DefinedAddressRangeDeferredProcedureCallPointerTagMsSymbol+ extends AbstractDefinedAddressRangeWithRegisterDimensionalityMsSymbol {++ public static final int PDB_ID = 0x1157;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public DefinedAddressRangeDeferredProcedureCallPointerTagMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "DEFRANGE_DPC_PTR_TAG";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedAddressRangeHighLevelShaderLanguageMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedAddressRangeHighLevelShaderLanguageMsSymbol.javanew file mode 100644index 0000000000..7497da1ad7--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedAddressRangeHighLevelShaderLanguageMsSymbol.java@@ -0,0 +1,56 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Defined Address Range High Level Shader Language symbol.+ * <P>+ * Note: we have guessed that HLSL means High Level Shader Language.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DefinedAddressRangeHighLevelShaderLanguageMsSymbol+ extends AbstractDefinedAddressRangeWithRegisterDimensionalityMsSymbol {++ public static final int PDB_ID = 0x1150;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public DefinedAddressRangeHighLevelShaderLanguageMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "DEFRANGE_HLSL";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedMultipleAddressRanges2005MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedMultipleAddressRanges2005MsSymbol.javanew file mode 100644index 0000000000..f0be37ea51--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedMultipleAddressRanges2005MsSymbol.java@@ -0,0 +1,64 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.AbstractPdb;++// TODO: MSFT does not give API. Need to see real data to fill in the details.+/**+ * This class represents the 2005 version of Defined Multiple Address Ranges symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DefinedMultipleAddressRanges2005MsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1135;++ // API does not define whatever data is here. Just capturing the bytes.+ private byte[] bytes;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ */+ public DefinedMultipleAddressRanges2005MsSymbol(AbstractPdb pdb, PdbByteReader reader) {+ super(pdb, reader);+ //System.out.println(reader.dump(0x200));+ // TODO: MSFT does not give API. Need to see real data to fill in the details.+ bytes = reader.parseBytesRemaining();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ // TODO: MSFT does not give API. Need to see real data to fill in the details.+ builder.append(+ String.format("%s: <NO API DETAILS, %d BYTES>", getSymbolTypeName(), bytes.length));+ }++ @Override+ protected String getSymbolTypeName() {+ return "DEFRAMGE2_2005";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRange2005MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRange2005MsSymbol.javanew file mode 100644index 0000000000..6f084d1820--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRange2005MsSymbol.java@@ -0,0 +1,64 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.AbstractPdb;++//TODO: MSFT does not give API. Need to see real data to fill in the details.+/**+ * This class represents the 2005 version of Defined Single Address Range symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DefinedSingleAddressRange2005MsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1134;++ // API does not define whatever data is here. Just capturing the bytes.+ private byte[] bytes;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ */+ public DefinedSingleAddressRange2005MsSymbol(AbstractPdb pdb, PdbByteReader reader) {+ super(pdb, reader);+ //System.out.println(reader.dump(0x200));+ // TODO: MSFT does not give API. Need to see real data to fill in the details.+ bytes = reader.parseBytesRemaining();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ // TODO: MSFT does not give API. Need to see real data to fill in the details.+ builder.append(+ String.format("%s: <NO API DETAILS, %d BYTES>", getSymbolTypeName(), bytes.length));+ }++ @Override+ protected String getSymbolTypeName() {+ return "DEFRAMGE_2005";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForEnregisteredFieldOfSymbolMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForEnregisteredFieldOfSymbolMsSymbol.javanew file mode 100644index 0000000000..9ea66270a4--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForEnregisteredFieldOfSymbolMsSymbol.java@@ -0,0 +1,82 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Defined Singled Address Range For Enregistered Field of Symbols symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DefinedSingleAddressRangeForEnregisteredFieldOfSymbolMsSymbol+ extends AbstractDefinedSingleAddressRangeMsSymbol {++ public static final int PDB_ID = 0x1143;++ private int registerHoldingValueOfSymbol;+ private RegisterName registerName;+ private RangeAttribute rangeAttribute;+ private int offsetInParent;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public DefinedSingleAddressRangeForEnregisteredFieldOfSymbolMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "DEFRANGE_SUBFIELD_REGISTER";+ }++ @Override+ protected void parseInitialData(PdbByteReader reader) throws PdbException {+ registerHoldingValueOfSymbol = reader.parseUnsignedShortVal();+ registerName = new RegisterName(pdb, registerHoldingValueOfSymbol);+ rangeAttribute = new RangeAttribute(reader);+ long fields = reader.parseUnsignedIntVal();+ offsetInParent = (int) (fields & 0x0fff);+ }++ @Override+ protected void emitInitialData(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(String.format(": offset at %04X: ", offsetInParent));+ builder.append(rangeAttribute);+ builder.append(" ");+ builder.append(registerName);+ }++ @Override+ protected void emitFinalData(StringBuilder builder) {+ //Do nothing.+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForEnregisteredSymbolMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForEnregisteredSymbolMsSymbol.javanew file mode 100644index 0000000000..fa9d044dfe--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForEnregisteredSymbolMsSymbol.java@@ -0,0 +1,79 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Defined Singled Address Range For Enregistered Symbols symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DefinedSingleAddressRangeForEnregisteredSymbolMsSymbol+ extends AbstractDefinedSingleAddressRangeMsSymbol {++ public static final int PDB_ID = 0x1141;++ private int registerHoldingValueOfSymbol;+ private RegisterName registerHoldingValueRegisterName;+ private RangeAttribute rangeAttribute;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public DefinedSingleAddressRangeForEnregisteredSymbolMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "DEFRANGE_REGISTER";+ }++ @Override+ protected void parseInitialData(PdbByteReader reader) throws PdbException {+ registerHoldingValueOfSymbol = reader.parseUnsignedShortVal();+ registerHoldingValueRegisterName = new RegisterName(pdb, registerHoldingValueOfSymbol);+ rangeAttribute = new RangeAttribute(reader);+ }++ @Override+ protected void emitInitialData(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(":");+ builder.append(rangeAttribute);+ builder.append(" ");+ builder.append(registerHoldingValueRegisterName);+ }++ @Override+ protected void emitFinalData(StringBuilder builder) {+ //Do nothing.+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForEnregisteredSymbolRelativeMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForEnregisteredSymbolRelativeMsSymbol.javanew file mode 100644index 0000000000..f149aa9672--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForEnregisteredSymbolRelativeMsSymbol.java@@ -0,0 +1,87 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Defined Singled Address Range For Enregistered Symbols Relative symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DefinedSingleAddressRangeForEnregisteredSymbolRelativeMsSymbol+ extends AbstractDefinedSingleAddressRangeMsSymbol {++ public static final int PDB_ID = 0x1145;++ private int baseRegister;+ private RegisterName baseRegisterName;+ private boolean isSpilledUserDefinedTypeMember;+ private int offsetInParent;+ private int offsetToBaseRegister;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public DefinedSingleAddressRangeForEnregisteredSymbolRelativeMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "DEFRANGE_REGISTER_REL";+ }++ @Override+ protected void parseInitialData(PdbByteReader reader) throws PdbException {+ baseRegister = reader.parseUnsignedShortVal();+ baseRegisterName = new RegisterName(pdb, baseRegister);+ int fields = reader.parseUnsignedShortVal();+ isSpilledUserDefinedTypeMember = ((fields & 0x0001) == 0x0001);+ fields >>= 4; // Skipping 3 padding bits too.+ offsetInParent = fields & 0x0fff;+ offsetToBaseRegister = reader.parseInt();+ }++ @Override+ protected void emitInitialData(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(+ String.format(": [%s + %04X]", baseRegisterName.toString(), offsetToBaseRegister));+ if (isSpilledUserDefinedTypeMember) {+ builder.append(+ String.format(" spilledUserDefinedTypeMember offset at %d", offsetInParent));+ }+ }++ @Override+ protected void emitFinalData(StringBuilder builder) {+ //Do nothing.+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForFramePointerRelativeFullScopeMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForFramePointerRelativeFullScopeMsSymbol.javanew file mode 100644index 0000000000..a9e6664b0f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForFramePointerRelativeFullScopeMsSymbol.java@@ -0,0 +1,83 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Defined Singled Address Range For Frame Pointer Relative Full Scope+ * symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DefinedSingleAddressRangeForFramePointerRelativeFullScopeMsSymbol+ extends AbstractDefinedSingleAddressRangeMsSymbol {++ public static final int PDB_ID = 0x1144;++ private long offsetToFramePointer;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public DefinedSingleAddressRangeForFramePointerRelativeFullScopeMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE";+ }++ @Override+ protected void parseInitialData(PdbByteReader reader) throws PdbException {+ offsetToFramePointer = reader.parseUnsignedIntVal();+ }++ @Override+ protected void emitInitialData(StringBuilder builder) {+ builder.append(String.format("%s: FrameOffset: %04X FULL_SCOPE", getSymbolTypeName(),+ offsetToFramePointer));+ }++ @Override+ protected void parseRangeAndGaps(PdbByteReader reader) {+ // Purposefully empty.+ }++ @Override+ protected void emitRangeAndGaps(StringBuilder builder) {+ // Purposefully empty.+ }++ @Override+ protected void emitFinalData(StringBuilder builder) {+ //Do nothing.+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForFramePointerRelativeMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForFramePointerRelativeMsSymbol.javanew file mode 100644index 0000000000..3e77921a01--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForFramePointerRelativeMsSymbol.java@@ -0,0 +1,72 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Defined Singled Address Range For Frame Pointer Relative symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DefinedSingleAddressRangeForFramePointerRelativeMsSymbol+ extends AbstractDefinedSingleAddressRangeMsSymbol {++ public static final int PDB_ID = 0x1142;++ private long offsetToFramePointer;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public DefinedSingleAddressRangeForFramePointerRelativeMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "DEFRANGE_FRAMEPOINTER_REL";+ }++ @Override+ protected void parseInitialData(PdbByteReader reader) throws PdbException {+ offsetToFramePointer = reader.parseUnsignedIntVal();+ }++ @Override+ protected void emitInitialData(StringBuilder builder) {+ builder.append(+ String.format("%s: FrameOffset: %04X ", getSymbolTypeName(), offsetToFramePointer));+ }++ @Override+ protected void emitFinalData(StringBuilder builder) {+ //Do nothing.+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForSubfieldMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForSubfieldMsSymbol.javanew file mode 100644index 0000000000..5d7d994819--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeForSubfieldMsSymbol.java@@ -0,0 +1,74 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Defined Singled Address Range For Subfield symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DefinedSingleAddressRangeForSubfieldMsSymbol+ extends AbstractDefinedSingleAddressRangeMsSymbol {++ public static final int PDB_ID = 0x1140;++ private int program;+ private long offsetInParent;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public DefinedSingleAddressRangeForSubfieldMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "DEFRANGE_SUBFIELD";+ }++ @Override+ protected void parseInitialData(PdbByteReader reader) throws PdbException {+ program = reader.parseInt();+ offsetInParent = reader.parseUnsignedIntVal();+ }++ @Override+ protected void emitInitialData(StringBuilder builder) {+ builder.append(String.format("%s: offset at %04X, DIA Program NI: %04X, ",+ getSymbolTypeName(), offsetInParent, program));+ }++ @Override+ protected void emitFinalData(StringBuilder builder) {+ //Do nothing.+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeMsSymbol.javanew file mode 100644index 0000000000..0ffd717eb0--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DefinedSingleAddressRangeMsSymbol.java@@ -0,0 +1,70 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Defined Singled Address Range symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DefinedSingleAddressRangeMsSymbol extends AbstractDefinedSingleAddressRangeMsSymbol {++ public static final int PDB_ID = 0x113f;++ private int program;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public DefinedSingleAddressRangeMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "DEFRANGE";+ }++ @Override+ protected void parseInitialData(PdbByteReader reader) throws PdbException {+ program = reader.parseInt();+ }++ @Override+ protected void emitInitialData(StringBuilder builder) {+ builder.append(String.format("%s: DIA program NI: %04X, ", getSymbolTypeName(), program));+ }++ @Override+ protected void emitFinalData(StringBuilder builder) {+ //Do nothing.+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DiscardedByLinkMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DiscardedByLinkMsSymbol.javanew file mode 100644index 0000000000..64067ea32f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/DiscardedByLinkMsSymbol.java@@ -0,0 +1,130 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.*;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Discarded By Link symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class DiscardedByLinkMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x113b;++ public enum DiscardReason {++ INVALID("", -1),+ UNKNOWN("Unknown", 0),+ NOT_SELECTED("Not selected", 1),+ NOT_REFERENCED("Not referenced", 2);++ private static final Map<Integer, DiscardReason> BY_VALUE = new HashMap<>();+ static {+ for (DiscardReason val : values()) {+ BY_VALUE.put(val.value, val);+ }+ }++ public final String label;+ public final int value;++ @Override+ public String toString() {+ return label;+ }++ public static DiscardReason fromValue(int val) {+ return BY_VALUE.getOrDefault(val, INVALID);+ }++ private DiscardReason(String label, int value) {+ this.label = label;+ this.value = value;+ }+ }++ //==============================================================================================+ private int discardedVal;+ private DiscardReason discard;+ private long fileId;+ private long firstLineNumber;+ private List<AbstractMsSymbol> symbolList;++ //==============================================================================================+ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public DiscardedByLinkMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ long fields = reader.parseUnsignedIntVal();+ discardedVal = (int) (fields & 0xff);+ discard = DiscardReason.fromValue(discardedVal);+ fileId = reader.parseUnsignedIntVal();+ firstLineNumber = reader.parseUnsignedIntVal();+ byte[] data = reader.parseBytesRemaining();+ // This might be wrong, but I'm asuming that data contains a bunch of records that+ // can be parsed. MSFT API is hard to understand... it seems to be accessing global+ // symbol information (GSI) hash records, which is different than what I'm coding here.+ // TODO: Need real data to evaluate.+ PdbByteReader dataReader = new PdbByteReader(data);+// SymbolParser parser = new SymbolParser(pdb);+// symbolList = parser.deserializeSymbolRecords(dataReader);+ symbolList = pdb.getSymbolRecords().deserializeSymbolRecords(dataReader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: ", getSymbolTypeName()));+ if (discard == DiscardReason.UNKNOWN) {+ builder.append(String.format("(%02X)", discardedVal));+ }+ else {+ builder.append(discard);+ }+ if (fileId != 0xffffffff) {+ builder.append(String.format(", FileId: %08X", fileId));+ // TODO: evaluate. MSFT API has a whole bunch of stuff going on here; do not yet+ // understand...+ builder.append(String.format(", Line: %8d", firstLineNumber));+ }+ builder.append("\n");+ for (AbstractMsSymbol symbol : symbolList) {+ builder.append(symbol);+ builder.append("\n");+ }+ }++ @Override+ protected String getSymbolTypeName() {+ return "DISCARDED";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/EndArgumentsListMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/EndArgumentsListMsSymbol.javanew file mode 100644index 0000000000..eb17271272--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/EndArgumentsListMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the End Arguments List symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class EndArgumentsListMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x000a;++ private int recordLength;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ */+ public EndArgumentsListMsSymbol(AbstractPdb pdb, PdbByteReader reader) {+ super(pdb, reader);+ recordLength = reader.getLimit() - reader.getIndex();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s, Length = 0x%X", getSymbolTypeName(), recordLength));+ }++ @Override+ protected String getSymbolTypeName() {+ return "ENDARG";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/EndMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/EndMsSymbol.javanew file mode 100644index 0000000000..d44f76ee8f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/EndMsSymbol.java@@ -0,0 +1,55 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Edn symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class EndMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x0006;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ */+ public EndMsSymbol(AbstractPdb pdb, PdbByteReader reader) {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ }++ @Override+ protected String getSymbolTypeName() {+ return "END";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/EntryThisMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/EntryThisMsSymbol.javanew file mode 100644index 0000000000..29330aafce--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/EntryThisMsSymbol.java@@ -0,0 +1,65 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Entry This symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class EntryThisMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x000e;++ private int thisSym;+ private int bytesRemaining;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public EntryThisMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ thisSym = reader.parseUnsignedByteVal();+ // Don't know what data might remain.+ bytesRemaining = reader.getLimit() - reader.getIndex();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s", getSymbolTypeName()));+ builder.append(String.format(", 'this' symbol: %02x", thisSym));+ builder.append(String.format("; byte length of remaining data = %d", bytesRemaining));+ }++ @Override+ protected String getSymbolTypeName() {+ return "ENTRYTHIS";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/EnvironmentBlockMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/EnvironmentBlockMsSymbol.javanew file mode 100644index 0000000000..bf11e82d0f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/EnvironmentBlockMsSymbol.java@@ -0,0 +1,102 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.ArrayList;+import java.util.List;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the Environment Block symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class EnvironmentBlockMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x113d;++ private int flags;+ // TODO: MSFT API struct shows rev; usage shows fEC somewhere (not in struct)+ private boolean rev;+ private List<AbstractString> stringList = new ArrayList<>();++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public EnvironmentBlockMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ flags = reader.parseUnsignedByteVal();+ while (reader.hasMore()) {+ AbstractString string = new StringUtf8Nt();+ string.parse(reader);+ if (string.get().length() == 0) {+ break;+ }+ stringList.add(string);+ }+ reader.align4();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ public int getFlags() {+ return flags;+ }++ public boolean isRev() {+ return rev;+ }++ /**+ * Note: this method returns {@link List}<{@link AbstractString}> instead of+ * {@link List}<{@link String}>+ * @return {@String} list.+ */+ public List<AbstractString> getStringList() {+ return stringList;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(":\n");+ builder.append(String.format("Compiled for edit and continue: %s\n", rev ? "yes" : "no"));+ if ((stringList.size() & 0x0001) == 0x0001) {+ return; // Some sort of problem that we are not dealing with.+ }+ builder.append("Command block: \n");+ for (int i = 0; i < stringList.size(); i += 2) {+ builder.append(String.format(" %s = '%s'\n", stringList.get(i).get(),+ stringList.get(i + 1).get()));+ }+ }++ @Override+ protected String getSymbolTypeName() {+ return "ENVBLOCK";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ExportMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ExportMsSymbol.javanew file mode 100644index 0000000000..cb6b2f65fc--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ExportMsSymbol.java@@ -0,0 +1,97 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the Export symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ExportMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1138;++ private int ordinal;+ private boolean isConstant;+ private boolean isData;+ private boolean isPrivate;+ private boolean noName;+ private boolean ordinalExplicitlyAssigned;+ private boolean isForwarder;+ private AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ExportMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ name = new StringUtf8Nt();+ ordinal = reader.parseUnsignedShortVal();+ int flags = reader.parseUnsignedShortVal();+ processFlags(flags);+ name.parse(reader);+ reader.align4();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: Ordinal = %d%s, ", getSymbolTypeName(), ordinal,+ ordinalExplicitlyAssigned ? "" : " (implicit)"));+ builder.append(isConstant ? "CONSTANT, " : "");+ builder.append(isData ? "DATA, " : "");+ builder.append(isPrivate ? "PRIVATE, " : "");+ builder.append(noName ? "NONAME, " : "");+ builder.append(isForwarder ? "FORWARDER, " : "");+ builder.append(name.get());+ }++ @Override+ protected String getSymbolTypeName() {+ return "EXPORT";+ }++ /**+ * Internal method that breaks out the flag values from the aggregate integral type.+ * @param flagsIn {@code int} containing unsigned short value.+ */+ protected void processFlags(int flagsIn) {+ isConstant = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ isData = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ isPrivate = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ noName = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ ordinalExplicitlyAssigned = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ isForwarder = ((flagsIn & 0x0001) == 0x0001);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ExtraFrameAndProcedureInformationMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ExtraFrameAndProcedureInformationMsSymbol.javanew file mode 100644index 0000000000..97e65fee48--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ExtraFrameAndProcedureInformationMsSymbol.java@@ -0,0 +1,422 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Extra Frame And Procedure Information symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ExtraFrameAndProcedureInformationMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1012;++ private long procedureFrameTotalLength;+ private long procedureFramePaddingLength;+ private long paddingOffset;+ private long calleeSaveRegistersByteCount;+ private long exceptionHandlerOffset;+ private int exceptionHandlerSectionID;+ private long flags;+ private boolean usesAlloca;+ private boolean usesSetJmp;+ private boolean usesLongJmp;+ private boolean usesInlineAsm;+ private boolean hasExceptionHandlingStates;+ private boolean wasInlineSpec;+ private boolean wasStructuredExceptionHandling;+ private boolean isDeclspecNaked;+ private boolean hasGsBufferSecurityCheck;+ private boolean compiledWithAsyncExceptionHandling;+ private boolean couldNotDoStackOrderingWithGsBufferSecurityChecks;+ private boolean wasInlinedWithinAnotherFunction;+ private boolean isDeclspecStrictGsCheck;+ private boolean isDeclspecSafeBuffers;+ private RegisterName explicitlyEncodedLocalBasePointer;+ private RegisterName explicitlyEncodedParameterPointer;+ private boolean wasCompiledWithPgoPgu; // (Procedure Guided Optimization?)+ private boolean hasvalidPogoCounts; // (Procedure Guided Optimization)+ private boolean optimizedForSpeed;+ private boolean containsCfgChecksButNoWriteChecks;+ private boolean containsCfwChecksAndOrInstrumentation;+ private int padding;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public ExtraFrameAndProcedureInformationMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ procedureFrameTotalLength = reader.parseUnsignedIntVal();+ procedureFramePaddingLength = reader.parseUnsignedIntVal();+ paddingOffset = reader.parseUnsignedIntVal();+ calleeSaveRegistersByteCount = reader.parseUnsignedIntVal();+ exceptionHandlerOffset = reader.parseUnsignedIntVal();+ exceptionHandlerSectionID = reader.parseUnsignedShortVal();+ //padding?+ flags = reader.parseUnsignedIntVal();+ processFlags(flags);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ /**+ * Returns the procedure frame total length.+ * @return Procedure frame total length.+ */+ public long getProcedureFrameTotalLength() {+ return procedureFrameTotalLength;+ }++ /**+ * Returns the procedure frame padding length.+ * @return Procedure frame padding length.+ */+ public long getProcedureFramePaddingLength() {+ return procedureFramePaddingLength;+ }++ /**+ * Returns the padding offset.+ * @return Padding offset.+ */+ public long getPaddingOffset() {+ return paddingOffset;+ }++ /**+ * Returns the callee save registers byte count.+ * @return Callee save registers byte count.+ */+ public long getCalleeSaveRegistersByteCount() {+ return calleeSaveRegistersByteCount;+ }++ /**+ * Returns the exception handler offset.+ * @return Exception handler offset.+ */+ public long getExceptionHandlerOffset() {+ return exceptionHandlerOffset;+ }++ /**+ * Returns the exception handler section ID.+ * @return Exception handler section ID.+ */+ public int getExceptionHandlerSectionID() {+ return exceptionHandlerSectionID;+ }++ /**+ * Returns the flags.+ * @return Flags.+ */+ public long getFlags() {+ return flags;+ }++ /**+ * Tells whether the function uses alloca().+ * @return True if it uses alloca().+ */+ public boolean usesAlloca() {+ return usesAlloca;+ }++ /**+ * Tells whether the function uses setjmp().+ * @return True if it uses setjmp().+ */+ public boolean usesSetJmp() {+ return usesSetJmp;+ }++ /**+ * Tells whether the function uses longjmp().+ * @return True if it uses longjmp().+ */+ public boolean usesLongJmp() {+ return usesLongJmp;+ }++ /**+ * Tells whether the function uses inline asm.+ * @return True if it uses inline asm.+ */+ public boolean usesInlineAsm() {+ return usesInlineAsm;+ }++ /**+ * Tells whether the function has exception handling states.+ * @return True if it has exception handling states.+ */+ public boolean hasExceptionHandlingStates() {+ return hasExceptionHandlingStates;+ }++ /**+ * Tells whether the function "was specified" as inline.+ * @return True if the function was specified" as inline.+ */+ public boolean wasInlineSpec() {+ return wasInlineSpec;+ }++ /**+ * Tells whether the function has structured exception handling.+ * @return True if it has structured exception handling.+ */+ public boolean wasStructuredExceptionHandling() {+ return wasStructuredExceptionHandling;+ }++ /**+ * Tells if the function is __declspec(naked).+ * @return True if it is __declspec(naked).+ */+ public boolean isDeclspecNaked() {+ return isDeclspecNaked;+ }++ /**+ * Tells whether the function has buffer security check due to /GS.+ * @return True if it has buffer security due to /GS.+ */+ public boolean hasGsBufferSecurityCheck() {+ return hasGsBufferSecurityCheck;+ }++ /**+ * Tells whether the function was compiled with /EHa.+ * @return True if it was compiled with /EHa.+ */+ public boolean isCompiledWithAsyncExceptionHandling() {+ return compiledWithAsyncExceptionHandling;+ }++ /**+ * Tells if stack ordering couldn't be done on the function even though it has /GS buffer+ * checks.+ * @return True if stack ordering couldn't be done even with /GS buffer checks.+ */+ public boolean couldNotDoStackOrderingWithGsBufferSecurityChecks() {+ return couldNotDoStackOrderingWithGsBufferSecurityChecks;+ }++ /**+ * Tells whether the function was inlined within another.+ * @return True if the function was inlined within another.+ */+ public boolean wasInlinedWithinAnotherFunction() {+ return wasInlinedWithinAnotherFunction;+ }++ /**+ * Tells if the function is __declspec(strict_gs_check).+ * @return True if it is __declspec(strict_gs_check).+ */+ public boolean isDeclspecStrictGsCheck() {+ return isDeclspecStrictGsCheck;+ }++ /**+ * Tells if the function is __declspec(safebuffers).+ * @return True if it is __declspec(safebuffers).+ */+ public boolean isDeclspecSafeBuffers() {+ return isDeclspecSafeBuffers;+ }++ /**+ * Returns the explicitly encoded local base pointer.+ * @return Explicitly encoded local base pointer.+ */+ public RegisterName getExplicitlyEncodedLocalBasePointer() {+ return explicitlyEncodedLocalBasePointer;+ }++ /**+ * Returns the explicitly encoded parameter pointer.+ * @return Excplicitly encoded parameter pointer.+ */+ public RegisterName getExplicitlyEncodedParameterPointer() {+ return explicitlyEncodedParameterPointer;+ }++ /**+ * Tells whether the function was compiled with Procedure Guided Optimization.+ * <P>+ * Note: Believe this relates to Procedure Guided Optimization+ * @return True if compiled with Procedure Guided Optimization.+ */+ public boolean wasCompiledWithPgoPgu() {+ return wasCompiledWithPgoPgu;+ }++ /**+ * Tells whether there are valid Procedure Guided Optimization counts.+ * <P>+ * Note: Believe this relates to Procedure Guided Optimization+ * @return True if there are Procedure Guided Optimization counts.+ */+ public boolean hasvalidPogoCounts() {+ return hasvalidPogoCounts;+ }++ /**+ * Tells whether the function was optimized for speed.+ * @return True if it was optimized for speed.+ */+ public boolean isOptimizedForSpeed() {+ return optimizedForSpeed;+ }++ /**+ * Tells whether the function contains Guard CF checks but no write checks.+ * @return True if it has Guard CF checks and not write checks.+ */+ public boolean containsCfgChecksButNoWriteChecks() {+ return containsCfgChecksButNoWriteChecks;+ }++ /**+ * Tells whether the function has Guard CFW checks and/or instrumentation.+ * @return True if has Guard CFW checks and/or instrumentation.+ */+ public boolean containsCfwChecksAndOrInstrumentation() {+ return containsCfwChecksAndOrInstrumentation;+ }++ /**+ * Returns the padding.+ * @return Padding.+ */+ public int getPadding() {+ return padding;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s:\n", getSymbolTypeName()));+ builder.append(String.format(" Frame size = %08X bytes\n", procedureFrameTotalLength));+ builder.append(String.format(" Pad size = %08X bytes\n", procedureFramePaddingLength));+ builder.append(String.format(" Offset of pad in frame = %08X\n", paddingOffset));+ builder.append(String.format(" Size of callee save registers = %08X\n",+ calleeSaveRegistersByteCount));+ builder.append(String.format(" Address of exception handler = %04X:%08X\n",+ exceptionHandlerSectionID, exceptionHandlerOffset));+ builder.append(" Function info: ");+ builder.append(usesAlloca ? "alloca " : "");+ builder.append(usesSetJmp ? "setjmp " : "");+ builder.append(usesLongJmp ? "longjmp " : "");+ builder.append(usesInlineAsm ? "inlasm " : "");+ builder.append(hasExceptionHandlingStates ? "eh " : "");+ builder.append(wasInlineSpec ? "inl_specified " : "");+ builder.append(wasStructuredExceptionHandling ? "seh " : "");+ builder.append(isDeclspecNaked ? "naked " : "");+ builder.append(hasGsBufferSecurityCheck ? "gschecks " : "");+ builder.append(compiledWithAsyncExceptionHandling ? "asynceh " : "");+ builder.append(+ couldNotDoStackOrderingWithGsBufferSecurityChecks ? "gsnostackordering " : "");+ builder.append(wasInlinedWithinAnotherFunction ? "wasinlined " : "");+ builder.append(isDeclspecStrictGsCheck ? "strict_gs_check " : "");+ builder.append(isDeclspecSafeBuffers ? "safebuffers " : "");++ builder.append(wasCompiledWithPgoPgu ? "pgo_on " : "");+ builder.append(hasvalidPogoCounts ? "valid_pgo_counts " : "invalid_pgo_counts ");+ builder.append(optimizedForSpeed ? "opt_for_speed " : "");++ builder.append("Local=");+ explicitlyEncodedLocalBasePointer.emit(builder);+ builder.append(" ");+ builder.append("Param=");+ explicitlyEncodedParameterPointer.emit(builder);+ builder.append(" ");++ builder.append(containsCfgChecksButNoWriteChecks ? "guardcf " : "");+ builder.append(containsCfwChecksAndOrInstrumentation ? "guardcfw " : "");++ builder.append(String.format("(%08X)", flags));+ }++ @Override+ protected String getSymbolTypeName() {+ return "FRAMEPROCSYM";+ }++ private void processFlags(long flagsIn) {+ usesAlloca = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ usesSetJmp = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ usesLongJmp = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ usesInlineAsm = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ hasExceptionHandlingStates = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ wasInlineSpec = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ wasStructuredExceptionHandling = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ isDeclspecNaked = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ hasGsBufferSecurityCheck = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ compiledWithAsyncExceptionHandling = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ couldNotDoStackOrderingWithGsBufferSecurityChecks = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ wasInlinedWithinAnotherFunction = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ isDeclspecStrictGsCheck = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ isDeclspecSafeBuffers = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;++ explicitlyEncodedLocalBasePointer = new RegisterName(pdb, (int) (flagsIn & 0x0003));+ flagsIn >>= 2;+ explicitlyEncodedParameterPointer = new RegisterName(pdb, (int) (flagsIn & 0x0003));+ flagsIn >>= 2;++ wasCompiledWithPgoPgu = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ hasvalidPogoCounts = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ optimizedForSpeed = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ containsCfgChecksButNoWriteChecks = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ containsCfwChecksAndOrInstrumentation = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;++ padding = (int) (flagsIn & 0x01ff);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/FileStaticMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/FileStaticMsSymbol.javanew file mode 100644index 0000000000..4a4d415cac--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/FileStaticMsSymbol.java@@ -0,0 +1,114 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the File Static symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class FileStaticMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1153;++ private int typeIndex;+ private int moduleFilenameStringTableIndex;+ private LocalVariableFlags localVariableFlags;+ private AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public FileStaticMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ name = new StringUtf8Nt();+ typeIndex = reader.parseInt();+ moduleFilenameStringTableIndex = reader.parseInt();+ localVariableFlags = new LocalVariableFlags(reader);+ name.parse(reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ /**+ * Returns the type index.+ * @return Type index.+ */+ public int getTypeIndex() {+ return typeIndex;+ }++ /**+ * Returns the module filename string table index.+ * @return Module filename string table index.+ */+ public int getModuleFilenameStringTableIndex() {+ return moduleFilenameStringTableIndex;+ }++ /**+ * Returns the module filename.+ * @return Module filename.+ */+ public String getModuleFilename() {+ return pdb.getNameStringFromOffset(moduleFilenameStringTableIndex);+ }++ /**+ * Returns the {@link LocalVariableFlags}.+ * @return Local variable flags.+ */+ public LocalVariableFlags getLocalVariableFlags() {+ return localVariableFlags;+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return name.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ StringBuilder myBuilder = new StringBuilder();+ myBuilder.append(String.format("%08X ", typeIndex));+ localVariableFlags.emit(myBuilder);+ builder.append(+ String.format("%s: %s, %s", getSymbolTypeName(), myBuilder.toString(), name.get()));+ builder.append("\n Mod: ");+ // TODO....not sure this is correct:+ builder.append(pdb.getNameStringFromOffset(moduleFilenameStringTableIndex));+ }++ @Override+ protected String getSymbolTypeName() {+ return "FILESTATIC";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/FrameSecurityCookieMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/FrameSecurityCookieMsSymbol.javanew file mode 100644index 0000000000..d4d0f2673c--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/FrameSecurityCookieMsSymbol.java@@ -0,0 +1,123 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Frame Security Cookie symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class FrameSecurityCookieMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x113a;++ private String[] cookieTypeString = { "COPY", "XOR_SP", "XOR_BP", "XOR_R13" };++ protected long offset;+ protected int registerIndex;+ protected RegisterName registerName;+ protected int cookieTypeIndex; // cookie type (valid values seem to be 0, 1, 2, 3)+ protected int flags;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public FrameSecurityCookieMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ offset = reader.parseUnsignedIntVal();+ registerIndex = reader.parseUnsignedShortVal();+ registerName = new RegisterName(pdb, registerIndex);+ // One example seems to show only room for a byte here, leaving the last byte for flags.+ cookieTypeIndex = reader.parseUnsignedByteVal();+ if (cookieTypeIndex >= cookieTypeString.length) {+ cookieTypeIndex = 0;+ }+ flags = reader.parseUnsignedByteVal();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public long getOffset() {+ return offset;+ }++ /**+ * Returns the register index.+ * @return Register index.+ */+ public int getRegisterIndex() {+ return registerIndex;+ }++ /**+ * Returns the register name.+ * @return Register name.+ */+ public String getRegisterNameString() {+ return registerName.toString();+ }++ /**+ * Returns the cookie type index.+ * @return Cookie type index.+ */+ public int getCookieTypeIndex() {+ return cookieTypeIndex;+ }++ /**+ * Returns the cookie string.+ * @return Cookie string.+ */+ public String getCookie() {+ return cookieTypeString[cookieTypeIndex];+ }++ /**+ * Returns the flags.+ * @return Flags.+ */+ public int getFlags() {+ return flags;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: %s+%08X, Type: %s, %02X", getSymbolTypeName(),+ registerName.toString(), offset, cookieTypeString[cookieTypeIndex], flags));+ }++ @Override+ protected String getSymbolTypeName() {+ return "FRAMECOOKIE";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalData16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalData16MsSymbol.javanew file mode 100644index 0000000000..c78cf2bf3f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalData16MsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Global Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalData16MsSymbol extends AbstractGlobalDataMsSymbol {++ public static final int PDB_ID = 0x0102;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalData16MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataSymbolInternals16(pdb, false);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GDATA16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalData3216MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalData3216MsSymbol.javanew file mode 100644index 0000000000..6e86b0428b--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalData3216MsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>3216MsSymbol</B> flavor of Global Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalData3216MsSymbol extends AbstractGlobalDataMsSymbol {++ public static final int PDB_ID = 0x0202;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalData3216MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataSymbolInternals3216(pdb, false);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GDATA32_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalData32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalData32MsSymbol.javanew file mode 100644index 0000000000..b03c8eddd7--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalData32MsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Global Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalData32MsSymbol extends AbstractGlobalDataMsSymbol {++ public static final int PDB_ID = 0x110d;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalData32MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataSymbolInternals32(pdb, false);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GDATA32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalData32StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalData32StMsSymbol.javanew file mode 100644index 0000000000..818b9f3cdd--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalData32StMsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32StMsSymbol</B> flavor of Global Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalData32StMsSymbol extends AbstractGlobalDataMsSymbol {++ public static final int PDB_ID = 0x1008;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalData32StMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataSymbolInternals32St(pdb, false);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GDATA32_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalDataHighLevelShaderLanguage32ExtendedMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalDataHighLevelShaderLanguage32ExtendedMsSymbol.javanew file mode 100644index 0000000000..042ebaad82--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalDataHighLevelShaderLanguage32ExtendedMsSymbol.java@@ -0,0 +1,62 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>Extended 32MsSymbol</B> flavor of Global High Level Shader+ * Language symbol.+ * <P>+ * Note: we have guessed that HLSL means High Level Shader Language.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalDataHighLevelShaderLanguage32ExtendedMsSymbol+ extends AbstractGlobalDataHighLevelShaderLanguageMsSymbol {++ public static final int PDB_ID = 0x1164;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalDataHighLevelShaderLanguage32ExtendedMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataHighLevelShaderLanguageSymbolInternals32Extended(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GDATA_HLSL32_EX";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalDataHighLevelShaderLanguage32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalDataHighLevelShaderLanguage32MsSymbol.javanew file mode 100644index 0000000000..60d540a9e2--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalDataHighLevelShaderLanguage32MsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Global High Level Shader Language symbol.+ * <P>+ * Note: we have guessed that HLSL means High Level Shader Language.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalDataHighLevelShaderLanguage32MsSymbol+ extends AbstractGlobalDataHighLevelShaderLanguageMsSymbol {++ public static final int PDB_ID = 0x1162;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalDataHighLevelShaderLanguage32MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataHighLevelShaderLanguageSymbolInternals32(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GDATA_HLSL32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalDataHighLevelShaderLanguageMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalDataHighLevelShaderLanguageMsSymbol.javanew file mode 100644index 0000000000..5ec0b523f8--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalDataHighLevelShaderLanguageMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>MsSymbol</B> flavor of Global High Level Shader Language symbol.+ * <P>+ * Note: we have guessed that HLSL means High Level Shader Language.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalDataHighLevelShaderLanguageMsSymbol+ extends AbstractGlobalDataHighLevelShaderLanguageMsSymbol {++ public static final int PDB_ID = 0x1151;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalDataHighLevelShaderLanguageMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataHighLevelShaderLanguageSymbolInternals(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GDATA_HLSL";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalManagedDataMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalManagedDataMsSymbol.javanew file mode 100644index 0000000000..9af9cada26--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalManagedDataMsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Global Managed Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalManagedDataMsSymbol extends AbstractGlobalManagedDataMsSymbol {++ public static final int PDB_ID = 0x111d;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalManagedDataMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataSymbolInternals32(pdb, true);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GMANDATA32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalManagedDataStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalManagedDataStMsSymbol.javanew file mode 100644index 0000000000..42907a0fe6--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalManagedDataStMsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32StMsSymbol</B> flavor of Global Managed Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalManagedDataStMsSymbol extends AbstractGlobalManagedDataMsSymbol {++ public static final int PDB_ID = 0x1021;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalManagedDataStMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataSymbolInternals32St(pdb, true);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GMANDATA32_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalManagedProcedureMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalManagedProcedureMsSymbol.javanew file mode 100644index 0000000000..bce027060f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalManagedProcedureMsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the <B>MsSymbol</B> flavor Global Managed Procedure symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalManagedProcedureMsSymbol extends AbstractGlobalManagedProcedureMsSymbol {++ public static final int PDB_ID = 0x112a;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalManagedProcedureMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "GMANPROC";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalManagedProcedureStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalManagedProcedureStMsSymbol.javanew file mode 100644index 0000000000..c66c423189--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalManagedProcedureStMsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents the <B>StMsSymbol</B> flavor Global Managed Procedure symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalManagedProcedureStMsSymbol extends AbstractGlobalManagedProcedureMsSymbol {++ public static final int PDB_ID = 0x101a;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalManagedProcedureStMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "GMANPROC_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedure32IdMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedure32IdMsSymbol.javanew file mode 100644index 0000000000..03ad72096e--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedure32IdMsSymbol.java@@ -0,0 +1,62 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Global Procedure 32 ID symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalProcedure32IdMsSymbol extends AbstractProcedureMsSymbol {++ public static final int PDB_ID = 0x1147;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalProcedure32IdMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureSymbolInternals32(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GPROC32_ID";+ }++ @Override+ protected String getSpecialTypeString() {+ return "ID";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureIa64IdMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureIa64IdMsSymbol.javanew file mode 100644index 0000000000..42bc72b33c--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureIa64IdMsSymbol.java@@ -0,0 +1,64 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the Global Procedure IA64 ID symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalProcedureIa64IdMsSymbol extends AbstractProcedureStartIa64MsSymbol {++ public static final int PDB_ID = 0x114b;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalProcedureIa64IdMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "GPROCIA64_ID";+ }++ @Override+ protected String getSpecialTypeString() {+ return "ID";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureMipsIdMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureMipsIdMsSymbol.javanew file mode 100644index 0000000000..176b7b6a99--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureMipsIdMsSymbol.java@@ -0,0 +1,63 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Global Procedure MIPS ID symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalProcedureMipsIdMsSymbol extends AbstractProcedureStartMipsMsSymbol {++ public static final int PDB_ID = 0x1149;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalProcedureMipsIdMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureStartMipsSymbolInternals(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GPROCMIPSSYM_ID";+ }++ @Override+ protected String getSpecialTypeString() {+ return "ID";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStart16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStart16MsSymbol.javanew file mode 100644index 0000000000..1d032fd1c5--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStart16MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Global Procedure Start symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalProcedureStart16MsSymbol extends AbstractGlobalProcedureStartMsSymbol {++ public static final int PDB_ID = 0x0105;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalProcedureStart16MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureSymbolInternals16(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GPROC16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStart3216MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStart3216MsSymbol.javanew file mode 100644index 0000000000..7f5590f459--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStart3216MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>3216MsSymbol</B> flavor of Global Procedure Start symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalProcedureStart3216MsSymbol extends AbstractGlobalProcedureStartMsSymbol {++ public static final int PDB_ID = 0x0205;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalProcedureStart3216MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureSymbolInternals3216(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GPROC32_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStart32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStart32MsSymbol.javanew file mode 100644index 0000000000..9f0d5ad0a9--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStart32MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Global Procedure Start symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalProcedureStart32MsSymbol extends AbstractGlobalProcedureStartMsSymbol {++ public static final int PDB_ID = 0x1110;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalProcedureStart32MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureSymbolInternals32(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GPROC32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStart32StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStart32StMsSymbol.javanew file mode 100644index 0000000000..770ebcca06--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStart32StMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32StMsSymbol</B> flavor of Global Procedure Start symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalProcedureStart32StMsSymbol extends AbstractGlobalProcedureStartMsSymbol {++ public static final int PDB_ID = 0x100b;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalProcedureStart32StMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureSymbolInternals32St(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GPROC32_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStartIa64MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStartIa64MsSymbol.javanew file mode 100644index 0000000000..3abed26364--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStartIa64MsSymbol.java@@ -0,0 +1,64 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the <B>MsSymbol</B> flavor of Global Procedure IA64 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalProcedureStartIa64MsSymbol extends AbstractProcedureStartIa64MsSymbol {++ public static final int PDB_ID = 0x1119;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalProcedureStartIa64MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "GPROCIA64";+ }++ @Override+ protected String getSpecialTypeString() {+ return "Type";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStartIa64StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStartIa64StMsSymbol.javanew file mode 100644index 0000000000..a5e93e5e7e--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStartIa64StMsSymbol.java@@ -0,0 +1,64 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Global Procedure IA64 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalProcedureStartIa64StMsSymbol extends AbstractProcedureStartIa64MsSymbol {++ public static final int PDB_ID = 0x1016;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalProcedureStartIa64StMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "GPROCIA64_ST";+ }++ @Override+ protected String getSpecialTypeString() {+ return "Type";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStartMips16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStartMips16MsSymbol.javanew file mode 100644index 0000000000..6f3dad6372--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStartMips16MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Global Procedure Start MIPS symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalProcedureStartMips16MsSymbol extends AbstractGlobalProcedureStartMipsMsSymbol {++ public static final int PDB_ID = 0x0301;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalProcedureStartMips16MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureStartMipsSymbolInternals16(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GPROCMIPSSYM_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStartMipsMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStartMipsMsSymbol.javanew file mode 100644index 0000000000..87c684373e--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStartMipsMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>MsSymbol</B> flavor of Global Procedure Start MIPS symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalProcedureStartMipsMsSymbol extends AbstractGlobalProcedureStartMipsMsSymbol {++ public static final int PDB_ID = 0x1115;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalProcedureStartMipsMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureStartMipsSymbolInternals(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GPROCMIPSSYM";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStartMipsStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStartMipsStMsSymbol.javanew file mode 100644index 0000000000..357fbae2c8--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalProcedureStartMipsStMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Global Procedure Start MIPS symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalProcedureStartMipsStMsSymbol extends AbstractGlobalProcedureStartMipsMsSymbol {++ public static final int PDB_ID = 0x1011;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalProcedureStartMipsStMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureStartMipsSymbolInternalsSt(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GPROCMIPSSYM_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalThreadStorage3216MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalThreadStorage3216MsSymbol.javanew file mode 100644index 0000000000..0c8a812a4b--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalThreadStorage3216MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>3216MsSymbol</B> flavor of Global Thread symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalThreadStorage3216MsSymbol extends AbstractGlobalThreadStorageMsSymbol {++ public static final int PDB_ID = 0x020e;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalThreadStorage3216MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ threadStorageInternals = new ThreadStorageSymbolInternals3216(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GTHREAD32_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalThreadStorage32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalThreadStorage32MsSymbol.javanew file mode 100644index 0000000000..798b8bc180--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalThreadStorage32MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Global Thread symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalThreadStorage32MsSymbol extends AbstractGlobalThreadStorageMsSymbol {++ public static final int PDB_ID = 0x1113;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalThreadStorage32MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ threadStorageInternals = new ThreadStorageSymbolInternals32(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GTHREAD32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalThreadStorage32StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalThreadStorage32StMsSymbol.javanew file mode 100644index 0000000000..0efca8a94f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/GlobalThreadStorage32StMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32StMsSymbol</B> flavor of Global Thread symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class GlobalThreadStorage32StMsSymbol extends AbstractGlobalThreadStorageMsSymbol {++ public static final int PDB_ID = 0x100f;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public GlobalThreadStorage32StMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ threadStorageInternals = new ThreadStorageSymbolInternals32St(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "GTHREAD32_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/HeapAllocationSiteMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/HeapAllocationSiteMsSymbol.javanew file mode 100644index 0000000000..5296cdc65c--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/HeapAllocationSiteMsSymbol.java@@ -0,0 +1,72 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.CategoryIndex;++/**+ * This class represents the Heap Allocation Site symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class HeapAllocationSiteMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x115e;++ private int callSiteOffset;+ private int callSiteSection;+ private int lengthOfHeapAllocationCallInstruction;+ private int functionSignatureTypeIndex;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public HeapAllocationSiteMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ callSiteOffset = reader.parseInt();+ callSiteSection = reader.parseUnsignedShortVal();+ lengthOfHeapAllocationCallInstruction = reader.parseUnsignedShortVal();+ functionSignatureTypeIndex = reader.parseInt();+ pdb.pushDependencyStack(+ new CategoryIndex(CategoryIndex.Category.DATA, functionSignatureTypeIndex));+ pdb.popDependencyStack();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: [%04X:%08X], instruction length = %d, type = %s\n",+ getSymbolTypeName(), callSiteSection, callSiteOffset,+ lengthOfHeapAllocationCallInstruction, pdb.getTypeRecord(functionSignatureTypeIndex)));+ }++ @Override+ protected String getSymbolTypeName() {+ return "HEAPALLOCSITE";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/IndexForTypeReferencedByNameFromMetadataMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/IndexForTypeReferencedByNameFromMetadataMsSymbol.javanew file mode 100644index 0000000000..9284e38c59--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/IndexForTypeReferencedByNameFromMetadataMsSymbol.java@@ -0,0 +1,64 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.CategoryIndex;++/**+ * This class represents the Index For Type Referenced By Name From Metadata symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class IndexForTypeReferencedByNameFromMetadataMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1028;++ protected int typeIndex;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public IndexForTypeReferencedByNameFromMetadataMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ typeIndex = reader.parseInt();+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex));+ pdb.popDependencyStack();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: %s", getSymbolTypeName(), pdb.getTypeRecord(typeIndex)));+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANTYPEREF";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/IndirectCallSiteInfoMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/IndirectCallSiteInfoMsSymbol.javanew file mode 100644index 0000000000..c002b5f2f6--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/IndirectCallSiteInfoMsSymbol.java@@ -0,0 +1,96 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.CategoryIndex;++/**+ * This class represents the Callsite Information symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class IndirectCallSiteInfoMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1139;++ protected long offset;+ protected int section;+ protected int padding;+ protected int typeIndex;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public IndirectCallSiteInfoMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ offset = reader.parseUnsignedIntVal();+ section = reader.parseUnsignedShortVal();+ padding = reader.parseUnsignedShortVal();+ assert (padding == 0);+ typeIndex = reader.parseInt();+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex));+ pdb.popDependencyStack();+ reader.align4();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public long getOffset() {+ return offset;+ }++ /**+ * Returns the section.+ * @return Section.+ */+ public int getSection() {+ return section;+ }++ /**+ * Returns the type index.+ * @return Type index.+ */+ public int getTypeIndex() {+ return typeIndex;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: [%04X:%08X], Type = %s\n", getSymbolTypeName(), section,+ offset, pdb.getTypeRecord(typeIndex)));+ }++ @Override+ protected String getSymbolTypeName() {+ return "CALLSITEINFO";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/InlinedFunctionCallsiteExtendedMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/InlinedFunctionCallsiteExtendedMsSymbol.javanew file mode 100644index 0000000000..c821129147--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/InlinedFunctionCallsiteExtendedMsSymbol.java@@ -0,0 +1,91 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.ArrayList;+import java.util.List;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.CategoryIndex;++/**+ * This class represents the Inlined Function Callsite Extended symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class InlinedFunctionCallsiteExtendedMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x115d;++ private long pointerToInliner;+ private long pointerToThisBlockEnd;+ private int inlineeIndex;+ private long invocationsCount;+ private List<InstructionAnnotation> binaryAnnotationOpcodeList = new ArrayList<>();++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public InlinedFunctionCallsiteExtendedMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ pointerToInliner = reader.parseUnsignedIntVal();+ pointerToThisBlockEnd = reader.parseUnsignedIntVal();+ inlineeIndex = reader.parseInt();+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.ITEM, inlineeIndex));+ pdb.popDependencyStack();+ invocationsCount = reader.parseUnsignedIntVal();+ while (reader.hasMore()) {+ InstructionAnnotation instruction = new InstructionAnnotation(reader);+ if (instruction.getInstructionCode() != InstructionAnnotation.Opcode.INVALID) {+ binaryAnnotationOpcodeList.add(instruction);+ }+ }+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(String.format(+ ": Parent: %08X, End: %08X, PGO Edge Count: %d, Inlinee: %s\n", pointerToInliner,+ pointerToThisBlockEnd, invocationsCount, pdb.getItemRecord(inlineeIndex)));+ int count = 0;+ for (InstructionAnnotation instruction : binaryAnnotationOpcodeList) {+ if (count++ == 4) {+ builder.append("\n");+ count = 0;+ }+ builder.append(instruction);+ }+ }++ @Override+ protected String getSymbolTypeName() {+ return "INLINESITE2";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/InlinedFunctionCallsiteMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/InlinedFunctionCallsiteMsSymbol.javanew file mode 100644index 0000000000..93ac747bb3--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/InlinedFunctionCallsiteMsSymbol.java@@ -0,0 +1,120 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.ArrayList;+import java.util.List;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.CategoryIndex;++/**+ * This class represents the Inlined Function Callsite symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class InlinedFunctionCallsiteMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x114d;++ private long pointerToInliner;+ private long pointerToThisBlockEnd;+ private int inlineeIndex;+ private List<InstructionAnnotation> binaryAnnotationOpcodeList = new ArrayList<>();++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public InlinedFunctionCallsiteMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ pointerToInliner = reader.parseUnsignedIntVal();+ pointerToThisBlockEnd = reader.parseUnsignedIntVal();+ inlineeIndex = reader.parseInt();+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.ITEM, inlineeIndex));+ pdb.popDependencyStack();+ while (reader.hasMore()) {+ InstructionAnnotation instruction = new InstructionAnnotation(reader);+ if (instruction.getInstructionCode() != InstructionAnnotation.Opcode.INVALID) {+ binaryAnnotationOpcodeList.add(instruction);+ }+ }+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ /**+ * Returns the pointer to inliner.+ * @return Pointer to inliner.+ */+ public long getPointerToInliner() {+ return pointerToInliner;+ }++ /**+ * Returns the pointer to this block end.+ * @return Pointer to this block end.+ */+ public long getPointerToThisBlockEnd() {+ return pointerToThisBlockEnd;+ }++ /**+ * Returns inlinee index.+ * @return Inlinee index.+ */+ public int getInlineeIndex() {+ return inlineeIndex;+ }++ /**+ * Returns {@link List}<{@link InstructionAnnotation}>.+ * @return Instruction annotations.+ */+ public List<InstructionAnnotation> getBinaryAnnotationOpcodeList() {+ return binaryAnnotationOpcodeList;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(String.format(": Parent: %08X, End: %08X, Inlinee: %s\n", pointerToInliner,+ pointerToThisBlockEnd, pdb.getItemRecord(inlineeIndex)));+ int count = 0;+ for (InstructionAnnotation instruction : binaryAnnotationOpcodeList) {+ if (count++ == 4) {+ builder.append("\n");+ count = 0;+ }+ builder.append(instruction);+ }+ }++ @Override+ protected String getSymbolTypeName() {+ return "INLINESITE2";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/InlinedFunctionEndMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/InlinedFunctionEndMsSymbol.javanew file mode 100644index 0000000000..954d0cb07f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/InlinedFunctionEndMsSymbol.java@@ -0,0 +1,55 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Inlined Function End symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class InlinedFunctionEndMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x114e;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ */+ public InlinedFunctionEndMsSymbol(AbstractPdb pdb, PdbByteReader reader) {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ }++ @Override+ protected String getSymbolTypeName() {+ return "INLINESITE_END";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/InstructionAnnotation.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/InstructionAnnotation.javanew file mode 100644index 0000000000..c58500c38a--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/InstructionAnnotation.java@@ -0,0 +1,149 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.HashMap;+import java.util.Map;++import ghidra.pdb.*;++/**+ * Instruction annotation used for certain PDB symbols for inlined functions.+ * @see InlinedFunctionCallsiteMsSymbol+ * @see InlinedFunctionCallsiteExtendedMsSymbol+ */+public class InstructionAnnotation extends AbstractParsableItem {++ public enum Opcode {++ INVALID("Illegal", 0),+ CODE_OFFSET("Offset", 1),+ CHANGE_CODE_OFFSET_BASE("CodeOffsetBase", 2),+ CHANGE_CODE_OFFSET("CodeOffset", 3),+ CHANGE_CODE_LENGTH("CodeLength", 0x04),+ CHANGE_FILE("File", 0x05),+ CHANGE_LINE_OFFSET("LineOffset", 0x06),+ CHANGE_LINE_END_DELTA("LineEndDelta", 0x07),+ CHANGE_RANGE_KIND("RangeKind", 0x08),+ CHANGE_COLUMN_START("ColumnStart", 0x09),+ CHANGE_COLUMN_END_DELTA("ColumnEndDelta", 0x0a),+ CHANGE_CODE_OFFSET_AND_LINE_OFFSET("CodeOffsetAndLineOffset", 0x0b),+ CHANGE_CODE_LENGTH_AND_CODE_OFFSET("CodeLengthAndCodeOffset", 0x0c),+ CHANGE_COLUMN_END("ColumnEnd", 0x0d);++ private static final Map<Integer, Opcode> BY_VALUE = new HashMap<>();+ static {+ for (Opcode val : values()) {+ BY_VALUE.put(val.value, val);+ }+ }++ public final String label;+ public final int value;++ @Override+ public String toString() {+ return label;+ }++ public static Opcode fromValue(int val) {+ return BY_VALUE.getOrDefault(val, INVALID);+ }++ private Opcode(String label, int value) {+ this.label = label;+ this.value = value;+ }+ }++ //==============================================================================================+ private Opcode instructionCode;+ private long parameter1;+ private long parameter2;++ //==============================================================================================+ /**+ * Constructor for this symbol component.+ * @param reader {@link PdbByteReader} from which this data is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public InstructionAnnotation(PdbByteReader reader) throws PdbException {+ instructionCode = Opcode.fromValue(decompressData(reader));+ if (instructionCode == Opcode.INVALID) {+ reader.align4();+ }+ else if (instructionCode == Opcode.CHANGE_CODE_LENGTH_AND_CODE_OFFSET) {+ parameter1 = decompressData(reader);+ parameter2 = decompressData(reader);+ }+ else if ((instructionCode == Opcode.CHANGE_LINE_OFFSET) ||+ (instructionCode == Opcode.CHANGE_COLUMN_END_DELTA)) {+ parameter1 = decodeSignedInt32(decompressData(reader));+ parameter2 = -1;+ }+ else {+ parameter1 = decompressData(reader);+ parameter2 = -1;+ }+ }++ public Opcode getInstructionCode() {+ return instructionCode;+ }++ @Override+ public void emit(StringBuilder builder) {+ if (instructionCode == Opcode.CHANGE_CODE_LENGTH_AND_CODE_OFFSET) {+ builder.append(+ " " + instructionCode + String.format(" %x %x", parameter1, parameter2));+ }+ else if (instructionCode == Opcode.CHANGE_CODE_OFFSET_AND_LINE_OFFSET) {+ // CodeDelta is lower 4 bits, SourceDelta rest of the bits.+ builder.append(" " + instructionCode ++ String.format(" %x %x", (parameter1 >> 4) & 0x0fffffff, parameter1 & 0x0f));+ }+ else {+ builder.append(" " + instructionCode + String.format(" %x", (int) parameter1));+ }+ }++ private int decompressData(PdbByteReader reader) throws PdbException {+ int result = Integer.MIN_VALUE;+ int val = reader.parseUnsignedByteVal();+ if (val < 0x80) {+ result = val;+ }+ else if ((val & 0xc0) == 0x80) {+ result = (val & 0x3f) << 8;+ result |= reader.parseUnsignedByteVal();+ }+ else if ((val & 0xe0) == 0xc0) {+ result = (val & 0x1f) << 24;+ result |= reader.parseUnsignedByteVal() << 16;+ result |= reader.parseUnsignedByteVal() << 8;+ result |= reader.parseUnsignedByteVal();+ }+ return result;+ }++ private int decodeSignedInt32(int input) {+ if ((input & 0x01) == 0x01) {+ return -(input >> 1);+ }+ return input >> 1;+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Label16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Label16MsSymbol.javanew file mode 100644index 0000000000..865559e139--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Label16MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Label symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Label16MsSymbol extends AbstractLabelMsSymbol {++ public static final int PDB_ID = 0x0109;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Label16MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset16();+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "LABEL16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Label32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Label32MsSymbol.javanew file mode 100644index 0000000000..22318268b5--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Label32MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Label symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Label32MsSymbol extends AbstractLabelMsSymbol {++ public static final int PDB_ID = 0x1105;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Label32MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset32();+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "LABEL32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Label32StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Label32StMsSymbol.javanew file mode 100644index 0000000000..22985abe22--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Label32StMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>32StMsSymbol</B> flavor of Label symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Label32StMsSymbol extends AbstractLabelMsSymbol {++ public static final int PDB_ID = 0x0209;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Label32StMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset32();+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "LABEL32_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LanguageName.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LanguageName.javanew file mode 100644index 0000000000..b51b6c9dee--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LanguageName.java@@ -0,0 +1,51 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.AbstractParsableItem;++/**+ * Language name used by certain PDB symbols.+ * @see AbstractCompile2MsSymbol+ * @see Compile3MsSymbol+ * @see CompileFlagsMsSymbol+ */+public class LanguageName extends AbstractParsableItem {++ private static final String idString[] =+ { "C", "C++", "FORTRAN", "MASM", "Pascal", "Basic", "COBOL", "LINK", "CVTRES", "CVTPGD",+ "C#", "VisualBasic", "ILASM", "Java", "JScript", "MSIL", "HLSL", "???" };++ //==============================================================================================+ private int languageIndex;++ //==============================================================================================+ /**+ * Constructor for this symbol component. Takes an int language index argument.+ * @param languageIndexIn Language index.+ */+ public LanguageName(int languageIndexIn) {+ this.languageIndex =+ (languageIndexIn >= 0 && languageIndex < idString.length) ? languageIndexIn+ : idString.length - 1;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(idString[languageIndex]);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalData16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalData16MsSymbol.javanew file mode 100644index 0000000000..4a311aa2a2--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalData16MsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Local Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalData16MsSymbol extends AbstractLocalDataMsSymbol {++ public static final int PDB_ID = 0x0101;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalData16MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataSymbolInternals16(pdb, false);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LDATA16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalData3216MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalData3216MsSymbol.javanew file mode 100644index 0000000000..0e6bf05293--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalData3216MsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>3216MsSymbol</B> flavor of Local Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalData3216MsSymbol extends AbstractLocalDataMsSymbol {++ public static final int PDB_ID = 0x0201;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalData3216MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataSymbolInternals3216(pdb, false);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LDATA32_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalData32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalData32MsSymbol.javanew file mode 100644index 0000000000..e07896ca99--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalData32MsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Local Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalData32MsSymbol extends AbstractLocalDataMsSymbol {++ public static final int PDB_ID = 0x110c;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalData32MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataSymbolInternals32(pdb, false);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LDATA32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalData32StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalData32StMsSymbol.javanew file mode 100644index 0000000000..bdc44870f1--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalData32StMsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32StMsSymbol</B> flavor of Local Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalData32StMsSymbol extends AbstractLocalDataMsSymbol {++ public static final int PDB_ID = 0x1007;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalData32StMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataSymbolInternals32St(pdb, false);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LDATA32_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalDataHighLevelShaderLanguage32ExtendedMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalDataHighLevelShaderLanguage32ExtendedMsSymbol.javanew file mode 100644index 0000000000..b34bf33058--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalDataHighLevelShaderLanguage32ExtendedMsSymbol.java@@ -0,0 +1,62 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>Extended 32MsSymbol</B> flavor of Local High Level Shader+ * Language symbol.+ * <P>+ * Note: we have guessed that HLSL means High Level Shader Language.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalDataHighLevelShaderLanguage32ExtendedMsSymbol+ extends AbstractLocalDataHighLevelShaderLanguageMsSymbol {++ public static final int PDB_ID = 0x1165;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalDataHighLevelShaderLanguage32ExtendedMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataHighLevelShaderLanguageSymbolInternals32Extended(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LDATA_HLSL32_EX";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalDataHighLevelShaderLanguage32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalDataHighLevelShaderLanguage32MsSymbol.javanew file mode 100644index 0000000000..a8154704e3--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalDataHighLevelShaderLanguage32MsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Local High Level Shader Language symbol.+ * <P>+ * Note: we have guessed that HLSL means High Level Shader Language.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalDataHighLevelShaderLanguage32MsSymbol+ extends AbstractLocalDataHighLevelShaderLanguageMsSymbol {++ public static final int PDB_ID = 0x1163;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalDataHighLevelShaderLanguage32MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataHighLevelShaderLanguageSymbolInternals32(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LDATA_HLSL32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalDataHighLevelShaderLanguageMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalDataHighLevelShaderLanguageMsSymbol.javanew file mode 100644index 0000000000..4d715a775e--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalDataHighLevelShaderLanguageMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>MsSymbol</B> flavor of Local High Level Shader Language symbol.+ * * <P>+ * Note: we have guessed that HLSL means High Level Shader Language.+<P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalDataHighLevelShaderLanguageMsSymbol+ extends AbstractLocalDataHighLevelShaderLanguageMsSymbol {++ public static final int PDB_ID = 0x1152;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalDataHighLevelShaderLanguageMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataHighLevelShaderLanguageSymbolInternals(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LDATA_HLSL";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalDeferredProcedureCallGroupSharedMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalDeferredProcedureCallGroupSharedMsSymbol.javanew file mode 100644index 0000000000..4d93d3a838--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalDeferredProcedureCallGroupSharedMsSymbol.java@@ -0,0 +1,74 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the Local Deferred Procedure Call Group Shared symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalDeferredProcedureCallGroupSharedMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1154;++ private int typeIndex;+ private LocalVariableFlags flags;+ private int dataSlot;+ private int dataOffset;+ private AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalDeferredProcedureCallGroupSharedMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ name = new StringUtf8Nt();+ typeIndex = reader.parseInt();+ flags = new LocalVariableFlags(reader);+ dataSlot = reader.parseUnsignedShortVal();+ dataOffset = reader.parseUnsignedShortVal();+ name.parse(reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ StringBuilder myBuilder = new StringBuilder();+ myBuilder.append(typeIndex);+ flags.emit(myBuilder);+ builder.append(String.format("%s: %s base data: slot = %d offset = %d, %s",+ getSymbolTypeName(), myBuilder.toString(), dataSlot, dataOffset, name.get()));+ }++ @Override+ protected String getSymbolTypeName() {+ return "LOCAL_DPC_GROUPSHARED";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol.javanew file mode 100644index 0000000000..9154938202--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the <B>MsSymbol</B> flavor of Local Intermediate Language Symbol+ * With Local Slot Index Field symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol+ extends AbstractLocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol {++ public static final int PDB_ID = 0x111a;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "LOCALSLOT";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldStMsSymbol.javanew file mode 100644index 0000000000..e94891a2a8--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldStMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Local Intermediate Language Symbol+ * With Local Slot Index Field symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldStMsSymbol+ extends AbstractLocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol {++ public static final int PDB_ID = 0x1017;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldStMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "LOCALSLOT_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol.javanew file mode 100644index 0000000000..98ed8b04be--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the <B>MsSymbol</B> flavor of Local Intermediate Language Symbol+ * With Parameter Slot Index Field symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol+ extends AbstractLocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol {++ public static final int PDB_ID = 0x111b;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "PARAMSLOT";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldStMsSymbol.javanew file mode 100644index 0000000000..a646d0f7b0--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldStMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Local Intermediate Language Symbol+ * With Parameter Slot Index Field symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldStMsSymbol+ extends AbstractLocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol {++ public static final int PDB_ID = 0x1018;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldStMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "PARAMSLOT_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalManagedDataMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalManagedDataMsSymbol.javanew file mode 100644index 0000000000..0968f636ea--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalManagedDataMsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Local Managed Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalManagedDataMsSymbol extends AbstractLocalManagedDataMsSymbol {++ public static final int PDB_ID = 0x111c;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalManagedDataMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataSymbolInternals32(pdb, true);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LMANDATA32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalManagedDataStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalManagedDataStMsSymbol.javanew file mode 100644index 0000000000..5d8ff224e2--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalManagedDataStMsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32StMsSymbol</B> flavor of Local Managed Data symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalManagedDataStMsSymbol extends AbstractLocalManagedDataMsSymbol {++ public static final int PDB_ID = 0x1020;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalManagedDataStMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataSymbolInternals32St(pdb, true);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LMANDATA32_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalManagedProcedureMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalManagedProcedureMsSymbol.javanew file mode 100644index 0000000000..8021e4bf30--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalManagedProcedureMsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the <B>MsSymbol</B> flavor Local Managed Procedure symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalManagedProcedureMsSymbol extends AbstractLocalManagedProcedureMsSymbol {++ public static final int PDB_ID = 0x112b;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalManagedProcedureMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "LMANPROC";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalManagedProcedureStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalManagedProcedureStMsSymbol.javanew file mode 100644index 0000000000..4cc990e986--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalManagedProcedureStMsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents the <B>StMsSymbol</B> flavor Local Managed Procedure symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalManagedProcedureStMsSymbol extends AbstractLocalManagedProcedureMsSymbol {++ public static final int PDB_ID = 0x101b;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalManagedProcedureStMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "LMANPROC_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedure32DeferredProcedureCallIdMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedure32DeferredProcedureCallIdMsSymbol.javanew file mode 100644index 0000000000..01467b89ef--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedure32DeferredProcedureCallIdMsSymbol.java@@ -0,0 +1,63 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Local Procedure 32 Deferred Procedure Call ID symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedure32DeferredProcedureCallIdMsSymbol extends AbstractProcedureMsSymbol {++ public static final int PDB_ID = 0x1156;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedure32DeferredProcedureCallIdMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureSymbolInternals32(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROC32_DPC_ID";+ }++ @Override+ protected String getSpecialTypeString() {+ return "ID";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedure32IdMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedure32IdMsSymbol.javanew file mode 100644index 0000000000..14fd15a424--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedure32IdMsSymbol.java@@ -0,0 +1,62 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Local Procedure 32 ID symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedure32IdMsSymbol extends AbstractProcedureMsSymbol {++ public static final int PDB_ID = 0x1146;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedure32IdMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureSymbolInternals32(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROC32_ID";+ }++ @Override+ protected String getSpecialTypeString() {+ return "ID";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureIa64IdMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureIa64IdMsSymbol.javanew file mode 100644index 0000000000..47cb15d21f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureIa64IdMsSymbol.java@@ -0,0 +1,63 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the Local Procedure IA64 ID symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedureIa64IdMsSymbol extends AbstractProcedureStartIa64MsSymbol {++ public static final int PDB_ID = 0x114a;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedureIa64IdMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROCIA64_ID";+ }++ @Override+ protected String getSpecialTypeString() {+ return "ID";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureMipsIdMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureMipsIdMsSymbol.javanew file mode 100644index 0000000000..dd24eb67e9--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureMipsIdMsSymbol.java@@ -0,0 +1,62 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Local Procedure MIPS ID symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedureMipsIdMsSymbol extends AbstractProcedureStartMipsMsSymbol {++ public static final int PDB_ID = 0x1148;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedureMipsIdMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureStartMipsSymbolInternals(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROCMIPSSYM_ID";+ }++ @Override+ protected String getSpecialTypeString() {+ return "ID";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureReferenceMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureReferenceMsSymbol.javanew file mode 100644index 0000000000..d7dc9efa86--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureReferenceMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>MsSymbol</B> flavor of Local Procedure Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedureReferenceMsSymbol extends AbstractLocalProcedureReferenceMsSymbol {++ public static final int PDB_ID = 0x1127;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedureReferenceMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ReferenceSymbolInternals2(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROCREF";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureReferenceStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureReferenceStMsSymbol.javanew file mode 100644index 0000000000..59c122dc35--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureReferenceStMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Local Procedure Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedureReferenceStMsSymbol extends AbstractLocalProcedureReferenceMsSymbol {++ public static final int PDB_ID = 0x0403;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedureReferenceStMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ReferenceSymbolInternalsSt(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROCREF_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStart16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStart16MsSymbol.javanew file mode 100644index 0000000000..ea1ec1150e--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStart16MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Local Procedure Start symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedureStart16MsSymbol extends AbstractLocalProcedureStartMsSymbol {++ public static final int PDB_ID = 0x0104;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedureStart16MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureSymbolInternals16(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROC16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStart3216MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStart3216MsSymbol.javanew file mode 100644index 0000000000..9dadddf624--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStart3216MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>3216MsSymbol</B> flavor of Local Procedure Start symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedureStart3216MsSymbol extends AbstractLocalProcedureStartMsSymbol {++ public static final int PDB_ID = 0x0204;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedureStart3216MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureSymbolInternals3216(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROC32_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStart32DeferredProcedureCallMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStart32DeferredProcedureCallMsSymbol.javanew file mode 100644index 0000000000..d1a6a0db10--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStart32DeferredProcedureCallMsSymbol.java@@ -0,0 +1,63 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Local Procedure 32 Deferred Procedure Call symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedureStart32DeferredProcedureCallMsSymbol extends AbstractProcedureMsSymbol {++ public static final int PDB_ID = 0x1155;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedureStart32DeferredProcedureCallMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureSymbolInternals32(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROC32_DPC";+ }++ @Override+ protected String getSpecialTypeString() {+ return "Type";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStart32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStart32MsSymbol.javanew file mode 100644index 0000000000..2fb4c4bc36--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStart32MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Local Procedure Start symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedureStart32MsSymbol extends AbstractLocalProcedureStartMsSymbol {++ public static final int PDB_ID = 0x110f;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedureStart32MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureSymbolInternals32(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROC32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStart32StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStart32StMsSymbol.javanew file mode 100644index 0000000000..0396b71d97--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStart32StMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32StMsSymbol</B> flavor of Local Procedure Start symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedureStart32StMsSymbol extends AbstractLocalProcedureStartMsSymbol {++ public static final int PDB_ID = 0x100a;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedureStart32StMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureSymbolInternals32St(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROC32_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStartIa64MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStartIa64MsSymbol.javanew file mode 100644index 0000000000..0f488b961d--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStartIa64MsSymbol.java@@ -0,0 +1,64 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the <B>MsSymbol</B> flavor of Local Procedure IA64 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedureStartIa64MsSymbol extends AbstractProcedureStartIa64MsSymbol {++ public static final int PDB_ID = 0x1118;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedureStartIa64MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROCIA64";+ }++ @Override+ protected String getSpecialTypeString() {+ return "Type";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStartIa64StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStartIa64StMsSymbol.javanew file mode 100644index 0000000000..7080f40940--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStartIa64StMsSymbol.java@@ -0,0 +1,64 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Local Procedure IA64 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedureStartIa64StMsSymbol extends AbstractProcedureStartIa64MsSymbol {++ public static final int PDB_ID = 0x1015;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedureStartIa64StMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROCIA64_ST";+ }++ @Override+ protected String getSpecialTypeString() {+ return "Type";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStartMips16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStartMips16MsSymbol.javanew file mode 100644index 0000000000..c294eca4f1--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStartMips16MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Local Procedure Start MIPS symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedureStartMips16MsSymbol extends AbstractLocalProcedureStartMipsMsSymbol {++ public static final int PDB_ID = 0x0300;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedureStartMips16MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureStartMipsSymbolInternals16(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROCMIPSSYM_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStartMipsMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStartMipsMsSymbol.javanew file mode 100644index 0000000000..9b5bd7c6e4--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStartMipsMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>MsSymbol</B> flavor of Local Procedure Start MIPS symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedureStartMipsMsSymbol extends AbstractLocalProcedureStartMipsMsSymbol {++ public static final int PDB_ID = 0x1114;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedureStartMipsMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureStartMipsSymbolInternals(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROCMIPSSYM";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStartMipsStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStartMipsStMsSymbol.javanew file mode 100644index 0000000000..b2134d0b47--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalProcedureStartMipsStMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Local Procedure Start MIPS symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalProcedureStartMipsStMsSymbol extends AbstractLocalProcedureStartMipsMsSymbol {++ public static final int PDB_ID = 0x1010;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalProcedureStartMipsStMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ProcedureStartMipsSymbolInternalsSt(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LPROCMIPSSYM_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalSymbolInOptimizedCode2005MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalSymbolInOptimizedCode2005MsSymbol.javanew file mode 100644index 0000000000..1fdc5e7347--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalSymbolInOptimizedCode2005MsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++// TODO: Do not know the actual implementation, so just extending from the one we know for now.+/**+ * This class represents the <B>Newer</B> flavor of Local Symbol in Optimized Code symbol.+ * <P>+ * Note: We do not know the actual implementation, so just extending from the one we know for now.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalSymbolInOptimizedCode2005MsSymbol+ extends AbstractLocalSymbolInOptimizedCodeMsSymbol {++ public static final int PDB_ID = 0x1133;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalSymbolInOptimizedCode2005MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "LOCAL_2005";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalSymbolInOptimizedCodeMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalSymbolInOptimizedCodeMsSymbol.javanew file mode 100644index 0000000000..0cc868b042--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalSymbolInOptimizedCodeMsSymbol.java@@ -0,0 +1,53 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>Newer</B> flavor of Local Symbol in Optimized Code symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalSymbolInOptimizedCodeMsSymbol extends AbstractLocalSymbolInOptimizedCodeMsSymbol {++ public static final int PDB_ID = 0x113e;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalSymbolInOptimizedCodeMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "LOCAL";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalThreadStorage3216MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalThreadStorage3216MsSymbol.javanew file mode 100644index 0000000000..e9e789da0d--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalThreadStorage3216MsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>3216MsSymbol</B> flavor of Local Thread symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalThreadStorage3216MsSymbol extends AbstractLocalThreadStorageMsSymbol {++ public static final int PDB_ID = 0x020d;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalThreadStorage3216MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ threadStorageInternals = new ThreadStorageSymbolInternals3216(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LTHREAD32_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalThreadStorage32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalThreadStorage32MsSymbol.javanew file mode 100644index 0000000000..59be8b2374--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalThreadStorage32MsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Local Thread symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalThreadStorage32MsSymbol extends AbstractLocalThreadStorageMsSymbol {++ public static final int PDB_ID = 0x1112;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalThreadStorage32MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ threadStorageInternals = new ThreadStorageSymbolInternals32(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LTHREAD32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalThreadStorage32StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalThreadStorage32StMsSymbol.javanew file mode 100644index 0000000000..b4ce21797d--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalThreadStorage32StMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32StMsSymbol</B> flavor of Local Thread symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class LocalThreadStorage32StMsSymbol extends AbstractLocalThreadStorageMsSymbol {++ public static final int PDB_ID = 0x100e;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public LocalThreadStorage32StMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ threadStorageInternals = new ThreadStorageSymbolInternals32St(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "LTHREAD32_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalVariableAttributes.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalVariableAttributes.javanew file mode 100644index 0000000000..a4cbdf29d0--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalVariableAttributes.java@@ -0,0 +1,46 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.*;++/**+ * Local Variable Attributes for certain PDB symbols.+ */+public class LocalVariableAttributes extends AbstractParsableItem {++ private long offset;+ private int segment;+ private LocalVariableFlags flags;++ /**+ * Constructor for this symbol component.+ * @param reader {@link PdbByteReader} from which this data is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public LocalVariableAttributes(PdbByteReader reader) throws PdbException {+ offset = reader.parseUnsignedIntVal();+ segment = reader.parseUnsignedShortVal();+ flags = new LocalVariableFlags(reader);+ }++ @Override+ public void emit(StringBuilder builder) {+ flags.emit(builder);+ builder.insert(0, String.format("[%04X:%08X]: ", segment, offset));+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalVariableFlags.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalVariableFlags.javanew file mode 100644index 0000000000..c1f7b90d29--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/LocalVariableFlags.java@@ -0,0 +1,97 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.*;++/**+ * Local Variable Flags for certain PDB symbols.+ */+public class LocalVariableFlags extends AbstractParsableItem {++ private int flags;+ private boolean isParameter;+ private boolean addressTaken;+ private boolean compilerGenerated;+ private boolean isAggregateWhole;+ private boolean isAggregatedPart;+ private boolean isAliased;+ private boolean isAlias;+ private boolean isFunctionReturnValue;+ private boolean isOptimizedOut;+ private boolean isEnregisteredGlobal;+ private boolean isEnregisteredStatic;++ /**+ * Constructor for this symbol component.+ * @param reader {@link PdbByteReader} from which this data is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public LocalVariableFlags(PdbByteReader reader) throws PdbException {+ flags = reader.parseUnsignedShortVal();+ processFlags(flags);+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.insert(0, (isParameter) ? "Param: " : "Local: ");+ DelimiterState ds = new DelimiterState(" ", ", ");+ builder.append(ds.out(addressTaken, "Address Taken"));+ builder.append(ds.out(compilerGenerated, "Compiler Generated"));+ builder.append(ds.out(isAggregateWhole, "aggregate"));+ builder.append(ds.out(isAggregatedPart, "aggregated"));+ builder.append(ds.out(isAliased, "aliased"));+ builder.append(ds.out(isAlias, "alias"));+ builder.append(ds.out(isFunctionReturnValue, "return value"));+ builder.append(ds.out(isOptimizedOut, "optimized away"));+ if (isEnregisteredGlobal) {+ if (isEnregisteredStatic) {+ builder.append(ds.out(true, "file static"));+ }+ else {+ builder.append(ds.out(true, "global"));+ }+ }+ else if (isEnregisteredStatic) {+ builder.append(ds.out(true, "static local"));+ }+ }++ private void processFlags(int val) {+ isParameter = ((val & 0x0001) == 0x0001);+ val >>= 1;+ addressTaken = ((val & 0x0001) == 0x0001);+ val >>= 1;+ compilerGenerated = ((val & 0x0001) == 0x0001);+ val >>= 1;+ isAggregateWhole = ((val & 0x0001) == 0x0001);+ val >>= 1;+ isAggregatedPart = ((val & 0x0001) == 0x0001);+ val >>= 1;+ isAliased = ((val & 0x0001) == 0x0001);+ val >>= 1;+ isAlias = ((val & 0x0001) == 0x0001);+ val >>= 1;+ isFunctionReturnValue = ((val & 0x0001) == 0x0001);+ val >>= 1;+ isOptimizedOut = ((val & 0x0001) == 0x0001);+ val >>= 1;+ isEnregisteredGlobal = ((val & 0x0001) == 0x0001);+ val >>= 1;+ isEnregisteredStatic = ((val & 0x0001) == 0x0001);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedConstantMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedConstantMsSymbol.javanew file mode 100644index 0000000000..961e55d149--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedConstantMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>MsSymbol</B> flavor of Managed Constant symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManagedConstantMsSymbol extends AbstractConstantMsSymbol {++ public static final int PDB_ID = 0x112d;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManagedConstantMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex32();+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANCONSTANT";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol.javanew file mode 100644index 0000000000..e37f08aa18--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the <B>MsSymbol</B> flavor of Managed Local- Or+ * Parameter-Relative-to-Virtual Frame Pointer symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol+ extends AbstractManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol {++ public static final int PDB_ID = 0x1122;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANREGREL";+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterRelativeToAlternateFramePointerStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterRelativeToAlternateFramePointerStMsSymbol.javanew file mode 100644index 0000000000..4f746ff8e8--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterRelativeToAlternateFramePointerStMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Managed Local- Or+ * Parameter-Relative-to-Virtual Frame Pointer symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManagedLocalOrParameterRelativeToAlternateFramePointerStMsSymbol+ extends AbstractManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol {++ public static final int PDB_ID = 0x1026;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManagedLocalOrParameterRelativeToAlternateFramePointerStMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANREGREL_ST";+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterRelativeToVirtualFramePointerMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterRelativeToVirtualFramePointerMsSymbol.javanew file mode 100644index 0000000000..bc4fc6172e--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterRelativeToVirtualFramePointerMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the <B>MsSymbol</B> flavor Managed Local- Or+ * Parameter-Relative-to-Virtual Frame Pointer symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManagedLocalOrParameterRelativeToVirtualFramePointerMsSymbol+ extends AbstractLocalOrParameterRelativeToVirtualFramePointerMsSymbol {++ public static final int PDB_ID = 0x111e;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManagedLocalOrParameterRelativeToVirtualFramePointerMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANFRAMEREL";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterRelativeToVirtualFramePointerStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterRelativeToVirtualFramePointerStMsSymbol.javanew file mode 100644index 0000000000..4d8cda0064--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterRelativeToVirtualFramePointerStMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents the <B>StMsSymbol</B> flavor Managed Local- Or+ * Parameter-Relative-to-Virtual Frame Pointer symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManagedLocalOrParameterRelativeToVirtualFramePointerStMsSymbol+ extends AbstractLocalOrParameterRelativeToVirtualFramePointerMsSymbol {++ public static final int PDB_ID = 0x1022;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManagedLocalOrParameterRelativeToVirtualFramePointerStMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANFRAMEREL_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInManyRegister2MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInManyRegister2MsSymbol.javanew file mode 100644index 0000000000..f362425a59--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInManyRegister2MsSymbol.java@@ -0,0 +1,66 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the <B>MsSymbol</B> flavor of Managed Local- Or Parameter Stored+ * in Many Register 2 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManagedLocalOrParameterStoredInManyRegister2MsSymbol+ extends AbstractManagedLocalOrParameterStoredInManyRegisterMsSymbol {++ public static final int PDB_ID = 0x1123;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManagedLocalOrParameterStoredInManyRegister2MsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected int parseVal(PdbByteReader reader) throws PdbException {+ return reader.parseUnsignedShortVal();+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANMANYREG2";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInManyRegister2StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInManyRegister2StMsSymbol.javanew file mode 100644index 0000000000..ac857938f5--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInManyRegister2StMsSymbol.java@@ -0,0 +1,66 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Managed Local- Or Parameter Stored+ * in Many Register 2 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManagedLocalOrParameterStoredInManyRegister2StMsSymbol+ extends AbstractManagedLocalOrParameterStoredInManyRegisterMsSymbol {++ public static final int PDB_ID = 0x1027;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManagedLocalOrParameterStoredInManyRegister2StMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected int parseVal(PdbByteReader reader) throws PdbException {+ return reader.parseUnsignedShortVal();+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANMANYREG2_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInManyRegisterMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInManyRegisterMsSymbol.javanew file mode 100644index 0000000000..39c9926bbb--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInManyRegisterMsSymbol.java@@ -0,0 +1,66 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the <B>MsSymbol</B> flavor of Managed Local- Or Parameter Stored+ * in Many Register symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManagedLocalOrParameterStoredInManyRegisterMsSymbol+ extends AbstractManagedLocalOrParameterStoredInManyRegisterMsSymbol {++ public static final int PDB_ID = 0x1121;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManagedLocalOrParameterStoredInManyRegisterMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected int parseVal(PdbByteReader reader) throws PdbException {+ return reader.parseUnsignedByteVal();+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANMANYREG";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInManyRegisterStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInManyRegisterStMsSymbol.javanew file mode 100644index 0000000000..88fc01086e--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInManyRegisterStMsSymbol.java@@ -0,0 +1,66 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Managed Local- Or Parameter Stored+ * in Many Register symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManagedLocalOrParameterStoredInManyRegisterStMsSymbol+ extends AbstractManagedLocalOrParameterStoredInManyRegisterMsSymbol {++ public static final int PDB_ID = 0x1025;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManagedLocalOrParameterStoredInManyRegisterStMsSymbol(AbstractPdb pdb,+ PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected int parseVal(PdbByteReader reader) throws PdbException {+ return reader.parseUnsignedByteVal();+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANMANYREG_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInRegisterMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInRegisterMsSymbol.javanew file mode 100644index 0000000000..cf0c1301b1--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInRegisterMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the <B>MsSymbol</B> flavor of Local Or Parameter Stored in Register+ * symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManagedLocalOrParameterStoredInRegisterMsSymbol+ extends AbstractLocalOrParameterStoredInRegisterMsSymbol {++ public static final int PDB_ID = 0x111f;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManagedLocalOrParameterStoredInRegisterMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANREGISTER";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInRegisterStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInRegisterStMsSymbol.javanew file mode 100644index 0000000000..1f80da6d34--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedLocalOrParameterStoredInRegisterStMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Local Or Parameter Stored in Register+ * symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManagedLocalOrParameterStoredInRegisterStMsSymbol+ extends AbstractLocalOrParameterStoredInRegisterMsSymbol {++ public static final int PDB_ID = 0x1023;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManagedLocalOrParameterStoredInRegisterStMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANREGISTER_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedSymbolWithSlotIndexFieldMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedSymbolWithSlotIndexFieldMsSymbol.javanew file mode 100644index 0000000000..812fe3916a--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedSymbolWithSlotIndexFieldMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the <B>MsSymbol</B> flavor of Managed Symbol With Slot Index Field+ * symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManagedSymbolWithSlotIndexFieldMsSymbol+ extends AbstractManagedSymbolWithSlotIndexFieldMsSymbol {++ public static final int PDB_ID = 0x1120;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManagedSymbolWithSlotIndexFieldMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANSLOT";+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedSymbolWithSlotIndexFieldStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedSymbolWithSlotIndexFieldStMsSymbol.javanew file mode 100644index 0000000000..e3b6c679b1--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManagedSymbolWithSlotIndexFieldStMsSymbol.java@@ -0,0 +1,61 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Managed Symbol With Slot Index Field+ * symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManagedSymbolWithSlotIndexFieldStMsSymbol+ extends AbstractManagedSymbolWithSlotIndexFieldMsSymbol {++ public static final int PDB_ID = 0x1024;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManagedSymbolWithSlotIndexFieldStMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANSLOT_ST";+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManyRegisterVariable16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManyRegisterVariable16MsSymbol.javanew file mode 100644index 0000000000..6667a5885a--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManyRegisterVariable16MsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Many Register Variable symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManyRegisterVariable16MsSymbol extends AbstractManyRegisterVariableMsSymbol {++ public static final int PDB_ID = 0x000c;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManyRegisterVariable16MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex16();+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANYREG_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManyRegisterVariable2MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManyRegisterVariable2MsSymbol.javanew file mode 100644index 0000000000..d39d2e2d93--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManyRegisterVariable2MsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>MsSymbol</B> flavor of Many Register Variable 2 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManyRegisterVariable2MsSymbol extends AbstractManyRegisterVariable2MsSymbol {++ public static final int PDB_ID = 0x1117;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManyRegisterVariable2MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex32();+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANYREG2";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManyRegisterVariable2StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManyRegisterVariable2StMsSymbol.javanew file mode 100644index 0000000000..ba118eda47--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManyRegisterVariable2StMsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Many Register Variable 2 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManyRegisterVariable2StMsSymbol extends AbstractManyRegisterVariable2MsSymbol {++ public static final int PDB_ID = 0x1014;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManyRegisterVariable2StMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex32();+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANYREG2_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManyRegisterVariableMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManyRegisterVariableMsSymbol.javanew file mode 100644index 0000000000..081bf5b388--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManyRegisterVariableMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>MsSymbol</B> flavor of Many Register Variable symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManyRegisterVariableMsSymbol extends AbstractManyRegisterVariableMsSymbol {++ public static final int PDB_ID = 0x110a;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManyRegisterVariableMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex32();+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANYREG";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManyRegisterVariableStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManyRegisterVariableStMsSymbol.javanew file mode 100644index 0000000000..c4bf966716--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ManyRegisterVariableStMsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Many Register Variable symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ManyRegisterVariableStMsSymbol extends AbstractManyRegisterVariableMsSymbol {++ public static final int PDB_ID = 0x1005;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ManyRegisterVariableStMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex32();+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "MANYREG_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/MapToMiniPdbMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/MapToMiniPdbMsSymbol.javanew file mode 100644index 0000000000..3016a31c6a--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/MapToMiniPdbMsSymbol.java@@ -0,0 +1,64 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the Map-To-Mini-PDB symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class MapToMiniPdbMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1161;++ private AbstractString fromName = new StringWcharNt();+ private AbstractString toName = new StringWcharNt();++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public MapToMiniPdbMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ fromName.parse(reader);+ toName.parse(reader);+ reader.align4();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(+ String.format("%s: %s -> %s\n", getSymbolTypeName(), fromName.get(), toName.get()));+ }++ @Override+ protected String getSymbolTypeName() {+ return "PDBMAP";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/MiniPdbReferenceMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/MiniPdbReferenceMsSymbol.javanew file mode 100644index 0000000000..6851751f2d--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/MiniPdbReferenceMsSymbol.java@@ -0,0 +1,120 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the Mini PDB Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class MiniPdbReferenceMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1160;++ private long coffSection;+ private int typeIndex;+ private int moduleIndex;+ private boolean isLocal; // versus global+ private boolean isData; // versus function+ private boolean isUserDefinedType;+ private boolean isLabel;+ private boolean isConst;+ private AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public MiniPdbReferenceMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ name = new StringUtf8Nt();+ long val = reader.parseUnsignedIntVal();+ moduleIndex = reader.parseUnsignedShortVal();+ int flags = reader.parseUnsignedShortVal();+ processFlags(flags);+ if (isUserDefinedType) {+ // Convert from known positive integer stored in a long to an integer.+ typeIndex = (int) val;+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex));+ pdb.popDependencyStack();+ }+ else {+ coffSection = val;+ }+ name.parse(reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: ", getSymbolTypeName()));+ if (isUserDefinedType) {+ builder.append(String.format("(UDT) moduleIndex = %04X, TypeInformation = %s, %s\n",+ moduleIndex, pdb.getTypeRecord(typeIndex), name.get()));+ }+ else {+ builder.append(String.format("(%s) moduleIndex = %04X, coffSection = %X, %s\n",+ getLabel(), moduleIndex, coffSection, name.get()));+ }+ }++ @Override+ protected String getSymbolTypeName() {+ return "REF_MINIPDB";+ }++ private void processFlags(int flags) {+ isLocal = ((flags & 0x01) == 0x01);+ flags >>= 1;+ isData = ((flags & 0x01) == 0x01);+ flags >>= 1;+ isUserDefinedType = ((flags & 0x01) == 0x01);+ flags >>= 1;+ isLabel = ((flags & 0x01) == 0x01);+ flags >>= 1;+ isConst = ((flags & 0x01) == 0x01);+ }++ private String getLabel() {+ StringBuilder myBuilder = new StringBuilder();+ myBuilder.append(isLocal ? "local" : "global");+ if (isData) {+ myBuilder.append(" data");+ }+ else if (isLabel) {+ myBuilder.append(" label");+ }+ else if (isConst) {+ myBuilder.append(" const");+ }+ else {+ myBuilder.append(" func");+ }+ return myBuilder.toString();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ModuleTypeReferenceMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ModuleTypeReferenceMsSymbol.javanew file mode 100644index 0000000000..5b2980ecc8--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ModuleTypeReferenceMsSymbol.java@@ -0,0 +1,129 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Module Type Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ModuleTypeReferenceMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x115f;++ private boolean doesNotReferenceAnyType;+ private boolean referencesZ7PchTypes;+ private boolean containsZ7PchTypes;+ private boolean containsZ7TypeInformation;+ private boolean containsZiOrZITypeInformation;+ private boolean containsOtherModuleTypeReferences;++ private int typeReferenceStreamNumber = -1;+ private int typeIdStreamNumber = -1; // Not sure if this is named appropriately+ private int moduleContainingReferencedPchTypes = -1;+ private int moduleSharingReferencedTypes = -1;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public ModuleTypeReferenceMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ long flags = reader.parseUnsignedIntVal();+ processFlags(flags);+ int val0 = reader.parseUnsignedShortVal();+ int val1 = reader.parseUnsignedShortVal();+ if (containsZ7TypeInformation) {+ typeReferenceStreamNumber = val0;+ if (referencesZ7PchTypes) {+ moduleContainingReferencedPchTypes = val1 + 1;+ }+ }+ else if (!doesNotReferenceAnyType) {+ if (containsZiOrZITypeInformation) {+ typeReferenceStreamNumber = val0;+ typeIdStreamNumber = val1;+ }+ if (containsOtherModuleTypeReferences) {+ moduleSharingReferencedTypes = val0 + 1;+ }+ }+ reader.align4();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: ", getSymbolTypeName()));+ if (doesNotReferenceAnyType) {+ builder.append("No TypeRef");+ }+ else if (containsZ7TypeInformation) {+ builder.append(+ String.format("/Z7 TypeRef, StreamNumber=%04X", typeReferenceStreamNumber));+ if (containsZ7PchTypes) {+ builder.append(", own PCH types");+ }+ if (referencesZ7PchTypes) {+ builder.append(String.format(", reference PCH types in Module %04X",+ moduleContainingReferencedPchTypes));+ }+ }+ else {+ builder.append("/Zi TypeRef");+ if (containsZiOrZITypeInformation) {+ builder.append(String.format(", StreamNumber=%04X (type), StreamNumber=%04X (ID)",+ typeReferenceStreamNumber, typeIdStreamNumber));+ }+ if (containsOtherModuleTypeReferences) {+ builder.append(+ String.format(", shared with Module %04X", moduleSharingReferencedTypes));+ }+ }+ builder.append("\n");+ }++ @Override+ protected String getSymbolTypeName() {+ return "MODTYPEREF";+ }++ private void processFlags(long flags) {+ doesNotReferenceAnyType = ((flags & 0x01) == 0x01);+ flags >>= 1;+ referencesZ7PchTypes = ((flags & 0x01) == 0x01);+ flags >>= 1;+ containsZ7PchTypes = ((flags & 0x01) == 0x01);+ flags >>= 1;+ containsZ7TypeInformation = ((flags & 0x01) == 0x01);+ flags >>= 1;+ containsZiOrZITypeInformation = ((flags & 0x01) == 0x01);+ flags >>= 1;+ containsOtherModuleTypeReferences = ((flags & 0x01) == 0x01);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ObjectNameMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ObjectNameMsSymbol.javanew file mode 100644index 0000000000..b862c0a37d--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ObjectNameMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the <B>MsSymbol</B> flavor of Object Name symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ObjectNameMsSymbol extends AbstractObjectNameMsSymbol {++ public static final int PDB_ID = 0x1101;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ObjectNameMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "OBJNAME";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ObjectNameStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ObjectNameStMsSymbol.javanew file mode 100644index 0000000000..dded55c608--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ObjectNameStMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Object Name symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ObjectNameStMsSymbol extends AbstractObjectNameMsSymbol {++ public static final int PDB_ID = 0x0009;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ObjectNameStMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "OBJNAME_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/OemDefinedMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/OemDefinedMsSymbol.javanew file mode 100644index 0000000000..fd0bd90cc2--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/OemDefinedMsSymbol.java@@ -0,0 +1,92 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.ArrayList;+import java.util.List;++import ghidra.app.util.datatype.microsoft.GUID;+import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.CategoryIndex;++/**+ * This class represents the OEM-Defined symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class OemDefinedMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x0404;++ private static final byte[] guidPartSSOEMID =+ { (byte) 0xbc, 0x25, 0x09, 0x02, (byte) 0xbb, (byte) 0xab, (byte) 0xb4, 0x60 };+ private static final GUID SSOEMID =+ new GUID(0xc6ea3fc9, (short) 0x59b3, (short) 0x49d6, guidPartSSOEMID);++ //==============================================================================================+ private GUID oemID;+ private int typeIndex;+ private List<Long> userData = new ArrayList<>();++ //==============================================================================================+ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public OemDefinedMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ int data1 = reader.parseInt();+ short data2 = reader.parseShort();+ short data3 = reader.parseShort();+ byte[] data4 = reader.parseBytes(8);+ oemID = new GUID(data1, data2, data3, data4);+ typeIndex = reader.parseInt();+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex));+ pdb.popDependencyStack();+ while (reader.hasMore()) {+ long val = reader.parseUnsignedIntVal();+ userData.add(val);+ }+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: %s, Type %s\n", getSymbolTypeName(), oemID,+ pdb.getTypeRecord(typeIndex)));+ if (oemID.equals(SSOEMID)) {+ // TODO: is there a name to output?+ for (long val : userData) {+ builder.append(String.format(" %08X\n", val));+ }+ }+ }++ @Override+ protected String getSymbolTypeName() {+ return "OEM";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/PeCoffGroupMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/PeCoffGroupMsSymbol.javanew file mode 100644index 0000000000..3c0967a7f5--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/PeCoffGroupMsSymbol.java@@ -0,0 +1,111 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the PE COFF Group symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class PeCoffGroupMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1137;++ private int length;+ private int characteristics;+ private long offset;+ private int segment;+ private AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public PeCoffGroupMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ name = new StringUtf8Nt();+ length = reader.parseInt();+ characteristics = reader.parseInt();+ offset = reader.parseUnsignedIntVal();+ segment = reader.parseUnsignedShortVal();+ name.parse(reader);+ reader.align4();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ /**+ * Returns the length.+ * @return Length.+ */+ public int getLength() {+ return length;+ }++ /**+ * Returns the characteristics.+ * @return Characteristics.+ */+ public int getCharacteristics() {+ return characteristics;+ }++ /**+ * Returns the offset.+ * @return Offset.+ */+ public long getOffset() {+ return offset;+ }++ /**+ * Returns the segment.+ * @return Segment.+ */+ public int getSegment() {+ return segment;+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return name.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: [%04X:%08X], Length = %08X, Characteristics = %08X, %s",+ getSymbolTypeName(), segment, offset, length, characteristics, name.get()));+ }++ @Override+ protected String getSymbolTypeName() {+ return "COFFGROUP";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/PeCoffSectionMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/PeCoffSectionMsSymbol.javanew file mode 100644index 0000000000..933c8a139f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/PeCoffSectionMsSymbol.java@@ -0,0 +1,132 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the PE COFF Section symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class PeCoffSectionMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1136;++ private int sectionNumber;+ private int align;+ private int reserved;+ private int rva;+ private int length;+ private int characteristics;+ private AbstractString name;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public PeCoffSectionMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ name = new StringUtf8Nt();+ sectionNumber = reader.parseUnsignedShortVal();+ align = reader.parseUnsignedByteVal();+ reserved = reader.parseUnsignedByteVal();+ rva = reader.parseInt();+ length = reader.parseInt();+ characteristics = reader.parseInt();+ name.parse(reader);+ reader.align4();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ /**+ * Returns the section number.+ * @return Section number.+ */+ public int getSectionNumber() {+ return sectionNumber;+ }++ /**+ * Returns the alignment.+ * @return Alignment.+ */+ public int getAlign() {+ return align;+ }++ /**+ * Returns the reserved value.+ * @return Reserved value.+ */+ public int getReserved() {+ return reserved;+ }++ /**+ * Returns the RVA (real valued address?).+ * @return Real-Valued Address (?).+ */+ public int getRva() {+ return rva;+ }++ /**+ * Returns the length.+ * @return Length.+ */+ public int getLength() {+ return length;+ }++ /**+ * Returns the characteristics.+ * @return Characteristics.+ */+ public int getCharacteristics() {+ return characteristics;+ }++ /**+ * Returns the name.+ * @return Name.+ */+ public String getName() {+ return name.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format(+ "%s: [%04X], RVA = %08x, Length = %08X, Align = %08X, Characteristics = %08X, %s",+ getSymbolTypeName(), sectionNumber, rva, length, align, characteristics, name.get()));+ }++ @Override+ protected String getSymbolTypeName() {+ return "SECTION";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureFlags.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureFlags.javanew file mode 100644index 0000000000..0a65cdc64e--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureFlags.java@@ -0,0 +1,80 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.*;++/**+ * Procedure Flags for certain PDB symbols.+ * <P>+ * Class describes the function return method.+ */+public class ProcedureFlags extends AbstractParsableItem {++ private int flagByte;++ private boolean framePointerPresent;+ private boolean interruptReturn;+ private boolean farReturn;+ private boolean doesNotReturn;+ private boolean labelNotReached;+ private boolean customCallingConvention;+ private boolean markedAsNoInline;+ private boolean hasDebugInformationForOptimizedCode;++ /**+ * Constructor for this symbol component.+ * @param reader {@link PdbByteReader} from which this data is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public ProcedureFlags(PdbByteReader reader) throws PdbException {+ flagByte = reader.parseUnsignedByteVal();+ processFlags(flagByte);+ }++ @Override+ public void emit(StringBuilder builder) {+ DelimiterState ds = new DelimiterState("", ", ");+ builder.append("Flags: ");+ builder.append(ds.out(framePointerPresent, "Frame Ptr Present"));+ builder.append(ds.out(interruptReturn, "Interrupt"));+ builder.append(ds.out(farReturn, "FAR"));+ builder.append(ds.out(doesNotReturn, "Never Return"));+ builder.append(ds.out(labelNotReached, "Not Reached"));+ builder.append(ds.out(customCallingConvention, "Custom Calling Convention"));+ builder.append(ds.out(markedAsNoInline, "Do Not Inline"));+ builder.append(ds.out(hasDebugInformationForOptimizedCode, "Optimized Debug Info"));+ }++ private void processFlags(int val) {+ framePointerPresent = ((val & 0x0001) == 0x0001);+ val >>= 1;+ interruptReturn = ((val & 0x0001) == 0x0001);+ val >>= 1;+ farReturn = ((val & 0x0001) == 0x0001);+ val >>= 1;+ doesNotReturn = ((val & 0x0001) == 0x0001);+ val >>= 1;+ labelNotReached = ((val & 0x0001) == 0x0001);+ val >>= 1;+ customCallingConvention = ((val & 0x0001) == 0x0001);+ val >>= 1;+ markedAsNoInline = ((val & 0x0001) == 0x0001);+ val >>= 1;+ hasDebugInformationForOptimizedCode = ((val & 0x0001) == 0x0001);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureIdEndMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureIdEndMsSymbol.javanew file mode 100644index 0000000000..5201ed0bf0--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureIdEndMsSymbol.java@@ -0,0 +1,55 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Procedure ID End symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ProcedureIdEndMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x114f;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ */+ public ProcedureIdEndMsSymbol(AbstractPdb pdb, PdbByteReader reader) {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ }++ @Override+ protected String getSymbolTypeName() {+ return "PROC_ID_END";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureReferenceMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureReferenceMsSymbol.javanew file mode 100644index 0000000000..cedb134847--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureReferenceMsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>MsSymbol</B> flavor of Procedure Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ProcedureReferenceMsSymbol extends AbstractProcedureReferenceMsSymbol {++ public static final int PDB_ID = 0x1125;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ProcedureReferenceMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ReferenceSymbolInternals2(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "PROCREF";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureReferenceStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureReferenceStMsSymbol.javanew file mode 100644index 0000000000..336b1b3b73--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureReferenceStMsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Procedure Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ProcedureReferenceStMsSymbol extends AbstractProcedureReferenceMsSymbol {++ public static final int PDB_ID = 0x0400;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public ProcedureReferenceStMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ReferenceSymbolInternalsSt(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "PROCREF_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureStartMipsSymbolInternals.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureStartMipsSymbolInternals.javanew file mode 100644index 0000000000..3cf11e1254--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureStartMipsSymbolInternals.java@@ -0,0 +1,52 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents <B>32</B> Internals of the Procedure Start MIPS symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ProcedureStartMipsSymbolInternals extends AbstractProcedureStartMipsSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public ProcedureStartMipsSymbolInternals(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected void parseTypeIndexAndSymbolSegmentOffset(PdbByteReader reader) throws PdbException {+ // Note parsing order and sizes.+ typeIndex = reader.parseInt();+ symbolOffset = reader.parseUnsignedIntVal();+ symbolSegment = reader.parseUnsignedShortVal();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureStartMipsSymbolInternals16.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureStartMipsSymbolInternals16.javanew file mode 100644index 0000000000..6e3c3e4228--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureStartMipsSymbolInternals16.java@@ -0,0 +1,52 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents <B>16</B> Internals of the Procedure Start MIPS symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ProcedureStartMipsSymbolInternals16 extends AbstractProcedureStartMipsSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public ProcedureStartMipsSymbolInternals16(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected void parseTypeIndexAndSymbolSegmentOffset(PdbByteReader reader) throws PdbException {+ // Note parsing order and sizes.+ symbolOffset = reader.parseUnsignedIntVal();+ symbolSegment = reader.parseUnsignedShortVal();+ typeIndex = reader.parseUnsignedShortVal();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureStartMipsSymbolInternalsSt.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureStartMipsSymbolInternalsSt.javanew file mode 100644index 0000000000..b0d0243466--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureStartMipsSymbolInternalsSt.java@@ -0,0 +1,52 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents <B>St</B> Internals of the Procedure Start MIPS symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ProcedureStartMipsSymbolInternalsSt extends AbstractProcedureStartMipsSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public ProcedureStartMipsSymbolInternalsSt(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected void parseTypeIndexAndSymbolSegmentOffset(PdbByteReader reader) throws PdbException {+ // Note parsing order and sizes.+ typeIndex = reader.parseInt();+ symbolOffset = reader.parseUnsignedIntVal();+ symbolSegment = reader.parseUnsignedShortVal();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureSymbolInternals16.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureSymbolInternals16.javanew file mode 100644index 0000000000..3a09b4b94b--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureSymbolInternals16.java@@ -0,0 +1,54 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents <B>16</B> Internals of the Procedure symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ProcedureSymbolInternals16 extends AbstractProcedureSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public ProcedureSymbolInternals16(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected void parseMiddleFields(PdbByteReader reader) throws PdbException {+ procedureLength = reader.parseUnsignedShortVal();+ debugStartOffset = reader.parseUnsignedShortVal();+ debugEndOffset = reader.parseUnsignedShortVal();+ offset = reader.parseUnsignedShortVal();+ segment = reader.parseUnsignedShortVal();+ typeIndex = reader.parseUnsignedShortVal();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureSymbolInternals32.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureSymbolInternals32.javanew file mode 100644index 0000000000..970963d81b--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureSymbolInternals32.java@@ -0,0 +1,54 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents <B>32</B> Internals of the Procedure symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ProcedureSymbolInternals32 extends AbstractProcedureSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public ProcedureSymbolInternals32(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected void parseMiddleFields(PdbByteReader reader) throws PdbException {+ procedureLength = reader.parseUnsignedIntVal();+ debugStartOffset = reader.parseUnsignedIntVal();+ debugEndOffset = reader.parseUnsignedIntVal();+ typeIndex = reader.parseInt();+ offset = reader.parseUnsignedIntVal();+ segment = reader.parseUnsignedShortVal();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureSymbolInternals3216.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureSymbolInternals3216.javanew file mode 100644index 0000000000..98ed86ae40--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureSymbolInternals3216.java@@ -0,0 +1,54 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents <B>3216</B> Internals of the Procedure symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ProcedureSymbolInternals3216 extends AbstractProcedureSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public ProcedureSymbolInternals3216(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected void parseMiddleFields(PdbByteReader reader) throws PdbException {+ procedureLength = reader.parseUnsignedIntVal();+ debugStartOffset = reader.parseUnsignedIntVal();+ debugEndOffset = reader.parseUnsignedIntVal();+ offset = reader.parseUnsignedIntVal();+ segment = reader.parseUnsignedShortVal();+ typeIndex = reader.parseUnsignedShortVal();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureSymbolInternals32St.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureSymbolInternals32St.javanew file mode 100644index 0000000000..16da635963--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcedureSymbolInternals32St.java@@ -0,0 +1,54 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents <B>32St</B> Internals of the Procedure symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ProcedureSymbolInternals32St extends AbstractProcedureSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public ProcedureSymbolInternals32St(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++ @Override+ protected void parseMiddleFields(PdbByteReader reader) throws PdbException {+ procedureLength = reader.parseUnsignedIntVal();+ debugStartOffset = reader.parseUnsignedIntVal();+ debugEndOffset = reader.parseUnsignedIntVal();+ typeIndex = reader.parseInt();+ offset = reader.parseUnsignedIntVal();+ segment = reader.parseUnsignedShortVal();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcessorName.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcessorName.javanew file mode 100644index 0000000000..94ff60444b--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProcessorName.java@@ -0,0 +1,143 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.HashMap;+import java.util.Map;++import ghidra.pdb.AbstractParsableItem;++/**+ * Procedure Name component for certain PDB symbols.+ */+public class ProcessorName extends AbstractParsableItem {++ private static final Map<Integer, String> processorStringMap = new HashMap<>();+ static {+ processorStringMap.put(0x00, "8080");+ processorStringMap.put(0x01, "8086");+ processorStringMap.put(0x02, "80286");+ processorStringMap.put(0x03, "80386");+ processorStringMap.put(0x04, "80486");+ processorStringMap.put(0x05, "Pentium");+ processorStringMap.put(0x06, "Pentium Pro/Pentium II");+ processorStringMap.put(0x07, "Pentium III");++ processorStringMap.put(0x10, "MIPS (Generic)");+ processorStringMap.put(0x11, "MIPS16");+ processorStringMap.put(0x12, "MIPS32");+ processorStringMap.put(0x13, "MIPS64");+ processorStringMap.put(0x14, "MIPS I");+ processorStringMap.put(0x15, "MIPS II");+ processorStringMap.put(0x16, "MIPS III");+ processorStringMap.put(0x17, "MIPS IV");+ processorStringMap.put(0x18, "MIPS V");++ processorStringMap.put(0x20, "M68000");+ processorStringMap.put(0x21, "M68010");+ processorStringMap.put(0x22, "M68020");+ processorStringMap.put(0x23, "M68030");+ processorStringMap.put(0x24, "M68040");++ processorStringMap.put(0x30, "Alpha 21064");+ processorStringMap.put(0x31, "Alpha 21164");+ processorStringMap.put(0x32, "Alpha 21164a");+ processorStringMap.put(0x33, "Alpha 21264");+ processorStringMap.put(0x34, "Alpha 21364");++ processorStringMap.put(0x40, "PPC 601");+ processorStringMap.put(0x41, "PPC 603");+ processorStringMap.put(0x42, "PPC 604");+ processorStringMap.put(0x43, "PPC 620");+ processorStringMap.put(0x44, "PPC w/FP");+ processorStringMap.put(0x45, "PPC (Big Endian)");++ processorStringMap.put(0x50, "SH3");+ processorStringMap.put(0x51, "SH3E");+ processorStringMap.put(0x52, "SH3DSP");+ processorStringMap.put(0x53, "SH4");+ processorStringMap.put(0x54, "SHmedia");++ processorStringMap.put(0x60, "ARMv3 (CE)");+ processorStringMap.put(0x61, "ARMv4 (CE)");+ processorStringMap.put(0x62, "ARMv4T (CE)");+ processorStringMap.put(0x63, "ARMv5 (CE)");+ processorStringMap.put(0x64, "ARMv5T (CE)");+ processorStringMap.put(0x65, "ARMv6 (CE)");+ processorStringMap.put(0x66, "ARM (XMAC) (CE)");+ processorStringMap.put(0x67, "ARM (XMMX) (CE)");+ processorStringMap.put(0x68, "ARMv7 (CE)");++ processorStringMap.put(0x70, "Omni");++ processorStringMap.put(0x80, "Itanium");+ processorStringMap.put(0x81, "Itanium (McKinley)");++ processorStringMap.put(0x90, "CEE");++ processorStringMap.put(0xa0, "AM33");++ processorStringMap.put(0xb0, "M32R");++ processorStringMap.put(0xc0, "TriCore");++ processorStringMap.put(0xd0, "x64");++ processorStringMap.put(0xe0, "EBC");++ processorStringMap.put(0xf0, "Thumb (CE)");+ processorStringMap.put(0xf4, "ARM");+ processorStringMap.put(0xf6, "ARM64");++ processorStringMap.put(0x100, "D3D11_SHADER");+ }++ private static final String badProcessor = "???";++ //==============================================================================================+ private int processorIndex;++ //==============================================================================================+ /**+ * Constructor for this symbol component. Requires argument for the processor index.+ * @param processorIndexIn Processor index.+ */+ public ProcessorName(int processorIndexIn) {+ this.processorIndex = processorIndexIn;+ }++ /**+ * Returns the processor index.+ * @return Processor index.+ */+ public int getProcessorIndex() {+ return processorIndex;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getProcessorName());+ }++ private String getProcessorName() {+ String val = processorStringMap.get(processorIndex);+ if (val != null) {+ return val;+ }+ return badProcessor;+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProfileGuidedOptimizationDataMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProfileGuidedOptimizationDataMsSymbol.javanew file mode 100644index 0000000000..92f3171445--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ProfileGuidedOptimizationDataMsSymbol.java@@ -0,0 +1,74 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Profile-Guided Optimization symbol.+ * <P>+ * Note: We are guessing this for PGO and POGO.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ProfileGuidedOptimizationDataMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x115c;++ private long invocations;+ private long dynamicInstructionCount;+ private long staticInstructionCount;+ private long postInliningStaticInstructionCount;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public ProfileGuidedOptimizationDataMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ invocations = reader.parseUnsignedIntVal();+ dynamicInstructionCount = reader.parseLong();+ staticInstructionCount = reader.parseUnsignedIntVal();+ postInliningStaticInstructionCount = reader.parseUnsignedIntVal();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s:\n", getSymbolTypeName()));+ builder.append(String.format("Call Count: %d\n", invocations));+ builder.append(String.format("Dynamic Instruction Count: %d\n", dynamicInstructionCount));+ builder.append(String.format("Number of Instructions: %d\n", staticInstructionCount));+ builder.append(+ String.format("Number of Live Instructions: %d\n", postInliningStaticInstructionCount));+ }++ @Override+ protected String getSymbolTypeName() {+ return "POGOINFO";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Public16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Public16MsSymbol.javanew file mode 100644index 0000000000..95c3e55a1c--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Public16MsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Public symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Public16MsSymbol extends AbstractPublic16Or3216MsSymbol {++ public static final int PDB_ID = 0x0103;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Public16MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataSymbolInternals16(pdb, false);+ }++ @Override+ protected String getSymbolTypeName() {+ return "PUBSYM16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Public3216MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Public3216MsSymbol.javanew file mode 100644index 0000000000..eb078adf2d--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Public3216MsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>3216MsSymbol</B> flavor of Public symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Public3216MsSymbol extends AbstractPublic16Or3216MsSymbol {++ public static final int PDB_ID = 0x0203;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Public3216MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new DataSymbolInternals3216(pdb, false);+ }++ @Override+ protected String getSymbolTypeName() {+ return "PUBSYM32_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Public32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Public32MsSymbol.javanew file mode 100644index 0000000000..1387c05a3e--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Public32MsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Public symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Public32MsSymbol extends AbstractPublic32MsSymbol {++ public static final int PDB_ID = 0x110e;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Public32MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new PublicSymbolInternals32(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "PUBSYM32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Public32StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Public32StMsSymbol.javanew file mode 100644index 0000000000..52a31ee3d0--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Public32StMsSymbol.java@@ -0,0 +1,97 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>32StMsSymbol</B> flavor of Public symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Public32StMsSymbol extends AbstractPublic32MsSymbol {++ public static final int PDB_ID = 0x1009;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Public32StMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public long getOffset() {+ return ((PublicSymbolInternals32St) internals).getOffset();+ }++ @Override+ public int getSegment() {+ return ((PublicSymbolInternals32St) internals).getSegment();+ }++ @Override+ public String getName() {+ return ((PublicSymbolInternals32St) internals).getName();+ }++ @Override+ public long getFlags() {+ return ((PublicSymbolInternals32St) internals).getFlags();+ }++ @Override+ public boolean isCode() {+ return ((PublicSymbolInternals32St) internals).isCode();+ }++ @Override+ public boolean isFunction() {+ return ((PublicSymbolInternals32St) internals).isFunction();+ }++ @Override+ public boolean isManaged() {+ return ((PublicSymbolInternals32St) internals).isManaged();+ }++ @Override+ public boolean isMicrosoftIntermediateLanguage() {+ return ((PublicSymbolInternals32St) internals).isMicrosoftIntermediateLanguage();+ }++ @Override+ protected void create() {+ internals = new PublicSymbolInternals32St(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "PUBSYM32_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/PublicSymbolInternals32.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/PublicSymbolInternals32.javanew file mode 100644index 0000000000..daa7d0e63d--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/PublicSymbolInternals32.java@@ -0,0 +1,42 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.pdbreader.*;++/**+ * This class represents <B>32</B> Internals of the Public symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class PublicSymbolInternals32 extends AbstractPublicSymbolInternals32 {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public PublicSymbolInternals32(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ offset = new Offset32();+ name = new StringUtf8Nt();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/PublicSymbolInternals32St.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/PublicSymbolInternals32St.javanew file mode 100644index 0000000000..82e98f6d32--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/PublicSymbolInternals32St.java@@ -0,0 +1,42 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.pdbreader.*;++/**+ * This class represents <B>32St</B> Internals of the Public symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class PublicSymbolInternals32St extends AbstractPublicSymbolInternals32 {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public PublicSymbolInternals32St(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ offset = new Offset32();+ name = new StringUtf8St();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RangeAttribute.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RangeAttribute.javanew file mode 100644index 0000000000..29ad7a57cb--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RangeAttribute.java@@ -0,0 +1,48 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.*;++/**+ * Range Attribute component for certain PDB symbols.+ */+public class RangeAttribute extends AbstractParsableItem {++ private int attributes;+ private boolean mayHaveNoUserNameOnAControlFlowPath;++ /**+ * Constructor for this symbol component.+ * @param reader {@link PdbByteReader} from which this data is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public RangeAttribute(PdbByteReader reader) throws PdbException {+ attributes = reader.parseUnsignedShortVal();+ processAttributes(attributes);+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append("Attributes: ");+ builder.append(mayHaveNoUserNameOnAControlFlowPath ? "MayAvailable" : "");+ }++ private void processAttributes(int val) {+ mayHaveNoUserNameOnAControlFlowPath = ((val & 0x0001) == 0x0001);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ReferenceSymbolInternals2.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ReferenceSymbolInternals2.javanew file mode 100644index 0000000000..b1eb5c569b--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ReferenceSymbolInternals2.java@@ -0,0 +1,62 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents <B>2</B> Internals of the Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ReferenceSymbolInternals2 extends AbstractReferenceSymbolInternals {++ protected StringUtf8Nt name; // Hidden name made into a first class member?++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public ReferenceSymbolInternals2(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ public void emit(StringBuilder builder) {+ super.emit(builder);+ builder.append(" ");+ builder.append(name.get());+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ sumName = reader.parseUnsignedIntVal();+ offsetActualSymbolInDollarDollarSymbols = reader.parseUnsignedIntVal();+ moduleIndex = reader.parseUnsignedShortVal();+ name.parse(reader);+ reader.align4();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ReferenceSymbolInternalsSt.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ReferenceSymbolInternalsSt.javanew file mode 100644index 0000000000..e4b40404a5--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ReferenceSymbolInternalsSt.java@@ -0,0 +1,51 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents <B>St</B> Internals of the Reference symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ReferenceSymbolInternalsSt extends AbstractReferenceSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public ReferenceSymbolInternalsSt(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ // Do nothing.+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ sumName = reader.parseUnsignedIntVal();+ offsetActualSymbolInDollarDollarSymbols = reader.parseUnsignedIntVal();+ moduleIndex = reader.parseUnsignedShortVal();+ reader.align4();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Register16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Register16MsSymbol.javanew file mode 100644index 0000000000..32c0e8bb60--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Register16MsSymbol.java@@ -0,0 +1,77 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Register symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Register16MsSymbol extends AbstractRegisterMsSymbol {++ public static final int PDB_ID = 0x0002;++ private RegisterName register2;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Register16MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex16();+ name = new StringUtf8St();+ }++ @Override+ protected RegisterName parseRegister(PdbByteReader reader) throws PdbException {+ int registerVal = reader.parseUnsignedShortVal();+ RegisterName reg = new RegisterName(pdb, registerVal >> 8);+ register2 = new RegisterName(pdb, registerVal & 0xff);+ return reg;+ }++ @Override+ protected void emitRegisterInformation(StringBuilder builder) {+ if (!register.isRegNone()) {+ register.emit(builder);+ builder.append(":");+ }+ register2.emit(builder);+ }++ @Override+ protected String getSymbolTypeName() {+ return "REGISTER_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RegisterRelativeAddress16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RegisterRelativeAddress16MsSymbol.javanew file mode 100644index 0000000000..11e9f95016--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RegisterRelativeAddress16MsSymbol.java@@ -0,0 +1,69 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Register Relative Address symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class RegisterRelativeAddress16MsSymbol extends AbstractRegisterRelativeAddressMsSymbol {++ public static final int PDB_ID = 0x010c;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public RegisterRelativeAddress16MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset16();+ typeIndex = new TypeIndex16();+ name = new StringUtf8St();+ }++ @Override+ protected void parse(PdbByteReader reader) throws PdbException {+ offset.parse(reader);+ registerIndex = reader.parseUnsignedShortVal();+ typeIndex.parse(reader);+ name.parse(reader);+ reader.align4();+ }++ @Override+ protected String getSymbolTypeName() {+ return "REGREL16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RegisterRelativeAddress3216MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RegisterRelativeAddress3216MsSymbol.javanew file mode 100644index 0000000000..12eea99670--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RegisterRelativeAddress3216MsSymbol.java@@ -0,0 +1,69 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>3216MsSymbol</B> flavor of Register Relative Address symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class RegisterRelativeAddress3216MsSymbol extends AbstractRegisterRelativeAddressMsSymbol {++ public static final int PDB_ID = 0x020c;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public RegisterRelativeAddress3216MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset32();+ typeIndex = new TypeIndex16();+ name = new StringUtf8St();+ }++ @Override+ protected void parse(PdbByteReader reader) throws PdbException {+ offset.parse(reader);+ registerIndex = reader.parseUnsignedShortVal();+ typeIndex.parse(reader);+ name.parse(reader);+ reader.align4();+ }++ @Override+ protected String getSymbolTypeName() {+ return "REGREL32_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RegisterRelativeAddress32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RegisterRelativeAddress32MsSymbol.javanew file mode 100644index 0000000000..06c44f56e0--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RegisterRelativeAddress32MsSymbol.java@@ -0,0 +1,69 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Register Relative Address symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class RegisterRelativeAddress32MsSymbol extends AbstractRegisterRelativeAddressMsSymbol {++ public static final int PDB_ID = 0x1111;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public RegisterRelativeAddress32MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset32();+ typeIndex = new TypeIndex32();+ name = new StringUtf8Nt();+ }++ @Override+ protected void parse(PdbByteReader reader) throws PdbException {+ offset.parse(reader);+ typeIndex.parse(reader);+ registerIndex = reader.parseUnsignedShortVal();+ name.parse(reader);+ reader.align4();+ }++ @Override+ protected String getSymbolTypeName() {+ return "REGREL32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RegisterRelativeAddress32StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RegisterRelativeAddress32StMsSymbol.javanew file mode 100644index 0000000000..87643c4ece--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RegisterRelativeAddress32StMsSymbol.java@@ -0,0 +1,69 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>32StMsSymbol</B> flavor of Register Relative Address symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class RegisterRelativeAddress32StMsSymbol extends AbstractRegisterRelativeAddressMsSymbol {++ public static final int PDB_ID = 0x100d;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public RegisterRelativeAddress32StMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset32();+ typeIndex = new TypeIndex32();+ name = new StringUtf8St();+ }++ @Override+ protected void parse(PdbByteReader reader) throws PdbException {+ offset.parse(reader);+ typeIndex.parse(reader);+ registerIndex = reader.parseUnsignedShortVal();+ name.parse(reader);+ reader.align4();+ }++ @Override+ protected String getSymbolTypeName() {+ return "REGREL32_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RegisterStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RegisterStMsSymbol.javanew file mode 100644index 0000000000..1417276d22--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/RegisterStMsSymbol.java@@ -0,0 +1,68 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Register symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class RegisterStMsSymbol extends AbstractRegisterMsSymbol {++ public static final int PDB_ID = 0x1001;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public RegisterStMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex32();+ name = new StringUtf8St();+ }++ @Override+ protected RegisterName parseRegister(PdbByteReader reader) throws PdbException {+ return new RegisterName(pdb, reader.parseUnsignedShortVal());+ }++ @Override+ protected void emitRegisterInformation(StringBuilder builder) {+ register.emit(builder);+ }++ @Override+ protected String getSymbolTypeName() {+ return "REGISTER_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Reserved1MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Reserved1MsSymbol.javanew file mode 100644index 0000000000..3f36089ee0--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Reserved1MsSymbol.java@@ -0,0 +1,55 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Reserved 1 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Reserved1MsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x101c;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ */+ public Reserved1MsSymbol(AbstractPdb pdb, PdbByteReader reader) {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ }++ @Override+ protected String getSymbolTypeName() {+ return "RESERVED1";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Reserved2MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Reserved2MsSymbol.javanew file mode 100644index 0000000000..d351d44c5a--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Reserved2MsSymbol.java@@ -0,0 +1,55 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Reserved 2 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Reserved2MsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x101d;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ */+ public Reserved2MsSymbol(AbstractPdb pdb, PdbByteReader reader) {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ }++ @Override+ protected String getSymbolTypeName() {+ return "RESERVED2";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Reserved3MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Reserved3MsSymbol.javanew file mode 100644index 0000000000..f447266863--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Reserved3MsSymbol.java@@ -0,0 +1,55 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Reserved 3 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Reserved3MsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x101e;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ */+ public Reserved3MsSymbol(AbstractPdb pdb, PdbByteReader reader) {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ }++ @Override+ protected String getSymbolTypeName() {+ return "RESERVED3";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Reserved4MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Reserved4MsSymbol.javanew file mode 100644index 0000000000..ea8aed8830--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Reserved4MsSymbol.java@@ -0,0 +1,55 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Reserved 4 symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Reserved4MsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x101f;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ */+ public Reserved4MsSymbol(AbstractPdb pdb, PdbByteReader reader) {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ }++ @Override+ protected String getSymbolTypeName() {+ return "RESERVED4";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ReturnDescriptionMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ReturnDescriptionMsSymbol.javanew file mode 100644index 0000000000..0fcd1aa475--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ReturnDescriptionMsSymbol.java@@ -0,0 +1,144 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.HashMap;+import java.util.Map;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Return Description symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ReturnDescriptionMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x000d;++ public enum Style {++ UNKNOWN("unknown return", -1),+ VOID("void return", 0x00),+ RETURN_DATA_IN_REGISTERS("return data in registers", 0x01),+ INDIRECT_CALLER_ALLOCATED_NEAR("indirected caller-allocated near", 0x02),+ INDIRECT_CALLER_ALLOCATED_FAR("indirect caller-allocated far", 0x03),+ INDIRECT_RETURNEE_ALLOCATED_NEAR("indirect returnee allocated near", 0x04),+ INDIRECT_RETURNEE_ALLOCATED_FAR("indirect returnee allocated far", 0x05),+ UNUSED("unused", 0x06);++ private static final Map<Integer, Style> BY_VALUE = new HashMap<>();+ static {+ for (Style val : values()) {+ BY_VALUE.put(val.value, val);+ }+ }++ public final String label;+ public final int value;++ @Override+ public String toString() {+ return label;+ }++ public static Style fromValue(int val) {+ return BY_VALUE.getOrDefault(val, UNKNOWN);+ }++ private Style(String label, int value) {+ this.label = label;+ this.value = value;+ }+ }++ //==============================================================================================+ private boolean varargsPushedRightToLeft;+ private boolean returneeCleansUpStack;+ private Style style;+ private int bytesRemaining;++ //==============================================================================================+ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public ReturnDescriptionMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ int flags = reader.parseUnsignedShortVal();+ processFlags(flags);+ style = Style.fromValue(reader.parseUnsignedByteVal());+ // Don't know what the format is of remaining data.+ bytesRemaining = reader.getLimit() - reader.getIndex();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ /**+ * Returns the {@link Style} of return.+ * @return The {@link Style} of return+ */+ public Style getStyle() {+ return style;+ }++ /**+ * Tells whether the varargs are pushed right-to-left.+ * @return True if varargs were pushed right-to-left.+ */+ public boolean isVarargsPushedRightToLeft() {+ return varargsPushedRightToLeft;+ }++ /**+ * Tells whether the returnee is responsible for cleaning up the stack.+ * @return TruE if the returnee is responsible for cleaning up the stack.+ */+ public boolean isReturneeCleansUpStack() {+ return returneeCleansUpStack;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s, ", getSymbolTypeName()));+ builder.append(style);+ builder.append(+ varargsPushedRightToLeft ? ", varargs right-to-left" : ", varargs left-to-right");+ builder.append(returneeCleansUpStack ? ", returnee cleans stack" : ", caller cleans stack");+ builder.append(+ String.format("; byte length of remaining method data = %d", bytesRemaining));+ }++ @Override+ protected String getSymbolTypeName() {+ return "RETURN";+ }++ private void processFlags(int val) {+ varargsPushedRightToLeft = ((val & 0x0001) == 0x0001);+ val >>= 1;+ returneeCleansUpStack = ((val & 0x0001) == 0x0001);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/SeparatedCodeFromCompilerSupportMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/SeparatedCodeFromCompilerSupportMsSymbol.javanew file mode 100644index 0000000000..406be7f9ba--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/SeparatedCodeFromCompilerSupportMsSymbol.java@@ -0,0 +1,93 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Separated Code From Compiler Support symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class SeparatedCodeFromCompilerSupportMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x1132;++ private long parentPointer;+ private long endPointer;+ private long blockLength;+ private boolean isLexicalScope;+ private boolean returnsToParent;+ private long offset;+ private long offsetParent;+ private int section;+ private int sectionParent;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public SeparatedCodeFromCompilerSupportMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ parentPointer = reader.parseUnsignedIntVal();+ endPointer = reader.parseUnsignedIntVal();+ blockLength = reader.parseUnsignedIntVal();+ processFlags(reader.parseUnsignedIntVal());+ offset = reader.parseUnsignedIntVal();+ offsetParent = reader.parseUnsignedIntVal();+ section = reader.parseUnsignedShortVal();+ sectionParent = reader.parseUnsignedShortVal();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: [%04X:%08X], Length: %08X, ", getSymbolTypeName(),+ section, offset, blockLength));+ builder.append(String.format("Parent: %08X, End: %08X\n", parentPointer, endPointer));+ builder.append(+ String.format(" Parent scope beings: [%04X:%08X]\n", sectionParent, offsetParent));+ builder.append(" Separated code flags:");+ builder.append(isLexicalScope ? " lexscope" : "");+ builder.append(returnsToParent ? " retparent" : "");+ }++ @Override+ protected String getSymbolTypeName() {+ return "SEPCODE";+ }++ /**+ * Internal method that breaks out the flag values from the aggregate integral type.+ * @param flagsIn {@code long} containing unsigned int value.+ */+ protected void processFlags(long flagsIn) {+ isLexicalScope = ((flagsIn & 0x0001) == 0x0001);+ flagsIn >>= 1;+ returnsToParent = ((flagsIn & 0x0001) == 0x0001);+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/SkipMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/SkipMsSymbol.javanew file mode 100644index 0000000000..be88028c70--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/SkipMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Skip symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class SkipMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x0007;++ private int recordLength;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ */+ public SkipMsSymbol(AbstractPdb pdb, PdbByteReader reader) {+ super(pdb, reader);+ recordLength = reader.getLimit() - reader.getIndex();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("Skip Record, Length = 0x%X", recordLength));+ }++ @Override+ protected String getSymbolTypeName() {+ return "SKIP";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/StartSearchMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/StartSearchMsSymbol.javanew file mode 100644index 0000000000..11d279d58b--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/StartSearchMsSymbol.java@@ -0,0 +1,62 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Start Search symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class StartSearchMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x0005;++ private long startSym;+ private int segment;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public StartSearchMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ startSym = reader.parseUnsignedIntVal();+ segment = reader.parseUnsignedShortVal();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("Start search for segment 0x%X at 0x%X", segment, startSym));+ }++ @Override+ protected String getSymbolTypeName() {+ return "START_SEARCH";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/StaticLinkForMipsExceptionHandlingMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/StaticLinkForMipsExceptionHandlingMsSymbol.javanew file mode 100644index 0000000000..31422c75c6--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/StaticLinkForMipsExceptionHandlingMsSymbol.java@@ -0,0 +1,68 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Static Link Fro MIPS Exception Handling symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class StaticLinkForMipsExceptionHandlingMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x020f;++ private long framesize;+ private int offset;+ private int register;+ private RegisterName registerName;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public StaticLinkForMipsExceptionHandlingMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ framesize = reader.parseUnsignedIntVal();+ offset = reader.parseInt();+ register = reader.parseUnsignedShortVal();+ registerName = new RegisterName(pdb, register);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: framesize = %08X, offset = %08X, register = %s",+ getSymbolTypeName(), framesize, offset, registerName.toString()));+ }++ @Override+ protected String getSymbolTypeName() {+ return "SLINK32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ThreadStorageSymbolInternals32.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ThreadStorageSymbolInternals32.javanew file mode 100644index 0000000000..9be642f691--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ThreadStorageSymbolInternals32.java@@ -0,0 +1,54 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents <B>32</B> Internals of the Thread Storage symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ThreadStorageSymbolInternals32 extends AbstractThreadStorageSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public ThreadStorageSymbolInternals32(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex32();+ offset = new Offset32();+ name = new StringUtf8Nt();+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ typeIndex.parse(reader);+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ name.parse(reader);+ reader.align4();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ThreadStorageSymbolInternals3216.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ThreadStorageSymbolInternals3216.javanew file mode 100644index 0000000000..7a12b56db5--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ThreadStorageSymbolInternals3216.java@@ -0,0 +1,54 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents <B>3216</B> Internals of the Thread Storage symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ThreadStorageSymbolInternals3216 extends AbstractThreadStorageSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public ThreadStorageSymbolInternals3216(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex16();+ offset = new Offset32();+ name = new StringUtf8St();+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ typeIndex.parse(reader);+ name.parse(reader);+ reader.align4();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ThreadStorageSymbolInternals32St.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ThreadStorageSymbolInternals32St.javanew file mode 100644index 0000000000..3665996a91--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/ThreadStorageSymbolInternals32St.java@@ -0,0 +1,54 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents <B>32St</B> Internals of the Thread Storage symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class ThreadStorageSymbolInternals32St extends AbstractThreadStorageSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public ThreadStorageSymbolInternals32St(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex32();+ offset = new Offset32();+ name = new StringUtf8St();+ }++ @Override+ public void parse(PdbByteReader reader) throws PdbException {+ typeIndex.parse(reader);+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ name.parse(reader);+ reader.align4();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Thunk16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Thunk16MsSymbol.javanew file mode 100644index 0000000000..7d14bc4c6f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Thunk16MsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Thunk symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Thunk16MsSymbol extends AbstractThunkMsSymbol {++ public static final int PDB_ID = 0x0106;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Thunk16MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset16();+ name = new StringUtf8St();+ variantString = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "THUNK16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Thunk32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Thunk32MsSymbol.javanew file mode 100644index 0000000000..541c906829--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Thunk32MsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Thunk symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Thunk32MsSymbol extends AbstractThunkMsSymbol {++ public static final int PDB_ID = 0x1102;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Thunk32MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset32();+ name = new StringUtf8Nt();+ variantString = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "THUNK32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Thunk32StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Thunk32StMsSymbol.javanew file mode 100644index 0000000000..d2ecdf6676--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/Thunk32StMsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>32StMsSymbol</B> flavor of Thunk symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class Thunk32StMsSymbol extends AbstractThunkMsSymbol {++ public static final int PDB_ID = 0x0206;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public Thunk32StMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset32();+ name = new StringUtf8St();+ variantString = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "THUNK32_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/TokenReferenceToManagedProcedureMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/TokenReferenceToManagedProcedureMsSymbol.javanew file mode 100644index 0000000000..191321b694--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/TokenReferenceToManagedProcedureMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Token-Reference-to-Managed-Procedure symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class TokenReferenceToManagedProcedureMsSymbol extends AbstractReferenceMsSymbol {++ public static final int PDB_ID = 0x1129;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public TokenReferenceToManagedProcedureMsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new ReferenceSymbolInternals2(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "TOKENREF";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/TrampolineMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/TrampolineMsSymbol.javanew file mode 100644index 0000000000..8a676cdf48--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/TrampolineMsSymbol.java@@ -0,0 +1,160 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.HashMap;+import java.util.Map;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the Trampoline symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class TrampolineMsSymbol extends AbstractMsSymbol {++ public static final int PDB_ID = 0x112c;++ public enum Type {++ UNKNOWN("<unknown subtype>", -1),+ INCREMENTAL("Incremental", 0),+ BRANCH_ISLAND("BranchIsland", 1);++ private static final Map<Integer, Type> BY_VALUE = new HashMap<>();+ static {+ for (Type val : values()) {+ BY_VALUE.put(val.value, val);+ }+ }++ public final String label;+ public final int value;++ @Override+ public String toString() {+ return label;+ }++ public static Type fromValue(int val) {+ return BY_VALUE.getOrDefault(val, UNKNOWN);+ }++ private Type(String label, int value) {+ this.label = label;+ this.value = value;+ }+ }++ //==============================================================================================+ private Type trampolineType;+ private int sizeOfThunk;+ private long offsetThunk;+ private long offsetTarget;+ private int sectionThunk;+ private int sectionTarget;++ //==============================================================================================+ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public TrampolineMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ trampolineType = Type.fromValue(reader.parseUnsignedShortVal());+ sizeOfThunk = reader.parseUnsignedShortVal();+ offsetThunk = reader.parseUnsignedIntVal();+ offsetTarget = reader.parseUnsignedIntVal();+ sectionThunk = reader.parseUnsignedShortVal();+ sectionTarget = reader.parseUnsignedShortVal();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ /**+ * Returns the {@link Type} of trampoline.+ * @return The {@link Type} of trampoline.+ */+ public Type getType() {+ return trampolineType;+ }++ /**+ * Returns size of thunk.+ * @return Size of thunk.+ */+ public int getSizeOfThunk() {+ return sizeOfThunk;+ }++ /**+ * Returns offset of thunk.+ * @return Offset of thunk.+ */+ public long getOffsetThunk() {+ return offsetThunk;+ }++ /**+ * Returns offset of target.+ * @return Offset of target.+ */+ public long getOffsetTarget() {+ return offsetTarget;+ }++ /**+ * Returns section of thunk.+ * @return Section of thunk.+ */+ public int getSectionThunk() {+ return sectionThunk;+ }++ /**+ * Returns section of target.+ * @return Section of target.+ */+ public int getSectionTarget() {+ return sectionTarget;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(": subtype ");+ builder.append(trampolineType);+ builder.append(String.format(", code size = %d bytes\n", sizeOfThunk));+ builder.append(String.format(" Thunk address: [%04X:%08X]\n", sectionThunk, offsetThunk));+ builder.append(+ String.format(" Thunk target: [%04X:%08X]\n", sectionTarget, offsetTarget));+ }++ @Override+ protected String getSymbolTypeName() {+ return "TRAMPOLINE";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UnknownX1166MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UnknownX1166MsSymbol.javanew file mode 100644index 0000000000..f50c218e21--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UnknownX1166MsSymbol.java@@ -0,0 +1,65 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * There is no documentation for this symbol in the current API. This symbol was not seen,+ * but 1167 and 1168 were seen with a VS2017 compile. Guessing there is likely a 1166 symbol.+ */+public class UnknownX1166MsSymbol extends AbstractUnknownMsSymbol {++ public static final int PDB_ID = 0x1166;++ private byte[] data;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ */+ public UnknownX1166MsSymbol(AbstractPdb pdb, PdbByteReader reader) {+ super(pdb, reader);+ data = reader.parseBytesRemaining();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ /**+ * Returns the data of this symbol (we do not know how to interpret it yet).+ * @return {@code byte[]} data.+ */+ public byte[] getData() {+ return data;+ }++ @Override+ public void emit(StringBuilder builder) {+ PdbByteReader reader = new PdbByteReader(data);+ builder.append(String.format("%s: Bytes:%s", getSymbolTypeName(), reader.dumpBytes()));+ }++ @Override+ protected String getSymbolTypeName() {+ return "UNKNOWN_SYMBOL_X1166";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UnknownX1167MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UnknownX1167MsSymbol.javanew file mode 100644index 0000000000..4aca801867--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UnknownX1167MsSymbol.java@@ -0,0 +1,104 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * There is no documentation for this symbol in the current API. This symbol was seen with a+ * VS2017 compile.+ */+public class UnknownX1167MsSymbol extends AbstractUnknownMsSymbol {++ public static final int PDB_ID = 0x1167;++ // We have no idea about the structure, though unsigned short values and a string+ // seem to be seen.+ private int unknownUnsignedShort1;+ private int unknownUnsignedShort2;+ private int unknownUnsignedShort3;+ private AbstractString string;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public UnknownX1167MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ string = new StringUtf8Nt();+ unknownUnsignedShort1 = reader.parseUnsignedShortVal();+ unknownUnsignedShort2 = reader.parseUnsignedShortVal();+ unknownUnsignedShort3 = reader.parseUnsignedShortVal();+ string.parse(reader);+ reader.align4();+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ /**+ * Returns the value what appears to be the first Unsigned Short.+ * @return Value in what appears to be first unsigned short.+ */+ public int getUnknownUnsignedShort1() {+ return unknownUnsignedShort1;+ }++ /**+ * Returns the value what appears to be the second Unsigned Short.+ * @return Value in what appears to be second unsigned short.+ */+ public int getUnknownUnsignedShort2() {+ return unknownUnsignedShort2;+ }++ /**+ * Returns the value what appears to be the third Unsigned Short.+ * @return Value in what appears to be third unsigned short.+ */+ public int getUnknownUnsignedShort3() {+ return unknownUnsignedShort3;+ }++ /**+ * Returns what appears to be String data after the Unsigned Short fields.+ * @return What appears to be a string after the unsigned short fields.+ */+ public String getStringData() {+ return string.get();+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(String.format("\nunknownUnsignedShort1: %04X", unknownUnsignedShort1));+ builder.append(String.format("\nunknownUnsignedShort2: %04X", unknownUnsignedShort2));+ builder.append(String.format("\nunknownUnsignedShort3: %04X", unknownUnsignedShort3));+ builder.append(String.format("\nString: %s", getStringData()));+ }++ @Override+ protected String getSymbolTypeName() {+ return "UNKNOWN_SYMBOL_X1167";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UnknownX1168MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UnknownX1168MsSymbol.javanew file mode 100644index 0000000000..dbc5f8a92f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UnknownX1168MsSymbol.java@@ -0,0 +1,84 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import java.util.ArrayList;+import java.util.List;++import ghidra.pdb.*;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.CategoryIndex;++/**+ * There is no documentation for this symbol in the current API. This symbol was seen with a+ * VS2017 compile.+ */+public class UnknownX1168MsSymbol extends AbstractUnknownMsSymbol {++ public static final int PDB_ID = 0x1168;++ // Guessing.+ private int count;+ private List<Integer> typeIndexList = new ArrayList<>();++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public UnknownX1168MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ count = reader.parseInt();++ for (int i = 0; i < count; i++) {+ // Am assuming that this is a "type" index.+ int typeIndex = reader.parseInt();+ typeIndexList.add(typeIndex);+ pdb.pushDependencyStack(new CategoryIndex(CategoryIndex.Category.DATA, typeIndex));+ }+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ /**+ * Returns {@link List}<{@link Integer}> of what appears to be type indices.+ * @return Possible type indices.+ */+ public List<Integer> getTypeIndexList() {+ return typeIndexList;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(getSymbolTypeName());+ builder.append(": Type List: {");+ DelimiterState ds = new DelimiterState("", ", ");+ for (int typeIndex : typeIndexList) {+ builder.append(ds.out(true, pdb.getTypeRecord(typeIndex).toString()));+ }+ builder.append("}\n");+ }++ @Override+ protected String getSymbolTypeName() {+ return "UNKNOWN_SYMBOL_X1168";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedType16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedType16MsSymbol.javanew file mode 100644index 0000000000..824bcce6b2--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedType16MsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>16MsSymbol</B> flavor of User Defined symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class UserDefinedType16MsSymbol extends AbstractUserDefinedTypeMsSymbol {++ public static final int PDB_ID = 0x0004;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public UserDefinedType16MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new UserDefinedTypeSymbolInternals16(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "UDT_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedTypeMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedTypeMsSymbol.javanew file mode 100644index 0000000000..7d2203b040--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedTypeMsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>MsSymbol</B> flavor of User Defined symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class UserDefinedTypeMsSymbol extends AbstractUserDefinedTypeMsSymbol {++ public static final int PDB_ID = 0x1108;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public UserDefinedTypeMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new UserDefinedTypeSymbolInternals(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "UDT";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedTypeStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedTypeStMsSymbol.javanew file mode 100644index 0000000000..735439a2ee--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedTypeStMsSymbol.java@@ -0,0 +1,57 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;++/**+ * This class represents the <B>StMsSymbol</B> flavor of User Defined symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class UserDefinedTypeStMsSymbol extends AbstractUserDefinedTypeMsSymbol {++ public static final int PDB_ID = 0x1003;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public UserDefinedTypeStMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ internals = new UserDefinedTypeSymbolInternalsSt(pdb);+ }++ @Override+ protected String getSymbolTypeName() {+ return "UDT_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedTypeSymbolInternals.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedTypeSymbolInternals.javanew file mode 100644index 0000000000..3f6d9d6146--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedTypeSymbolInternals.java@@ -0,0 +1,42 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.pdbreader.*;++/**+ * This class represents <B>32</B> Internals of the User Defined Type symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class UserDefinedTypeSymbolInternals extends AbstractUserDefinedTypeSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public UserDefinedTypeSymbolInternals(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex32();+ name = new StringUtf8Nt();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedTypeSymbolInternals16.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedTypeSymbolInternals16.javanew file mode 100644index 0000000000..a969c7753f--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedTypeSymbolInternals16.java@@ -0,0 +1,42 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.pdbreader.*;++/**+ * This class represents <B>16</B> Internals of the User Defined Type symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class UserDefinedTypeSymbolInternals16 extends AbstractUserDefinedTypeSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public UserDefinedTypeSymbolInternals16(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex16();+ name = new StringUtf8St();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedTypeSymbolInternalsSt.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedTypeSymbolInternalsSt.javanew file mode 100644index 0000000000..6cb3815286--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UserDefinedTypeSymbolInternalsSt.java@@ -0,0 +1,42 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.pdbreader.*;++/**+ * This class represents <B>St</B> Internals of the User Defined Type symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class UserDefinedTypeSymbolInternalsSt extends AbstractUserDefinedTypeSymbolInternals {++ /**+ * Constructor for this symbol internals.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ */+ public UserDefinedTypeSymbolInternalsSt(AbstractPdb pdb) {+ super(pdb);+ }++ @Override+ protected void create() {+ typeIndex = new TypeIndex32();+ name = new StringUtf8St();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UsingNamespaceMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UsingNamespaceMsSymbol.javanew file mode 100644index 0000000000..0d4b17cc47--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UsingNamespaceMsSymbol.java@@ -0,0 +1,63 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8Nt;++/**+ * This class represents the <B>MsSymbol</B> flavor of Using Namespace symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class UsingNamespaceMsSymbol extends AbstractUsingNamespaceMsSymbol {++ public static final int PDB_ID = 0x1124;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public UsingNamespaceMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ public void emit(StringBuilder builder) {+ builder.append(String.format("%s: %s", getSymbolTypeName(), name));+ }++ @Override+ protected void create() {+ name = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "UNAMESPACE";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UsingNamespaceStMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UsingNamespaceStMsSymbol.javanew file mode 100644index 0000000000..47a19a918a--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/UsingNamespaceStMsSymbol.java@@ -0,0 +1,58 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.AbstractPdb;+import ghidra.pdb.pdbreader.StringUtf8St;++/**+ * This class represents the <B>StMsSymbol</B> flavor of Using Namespace symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class UsingNamespaceStMsSymbol extends AbstractUsingNamespaceMsSymbol {++ public static final int PDB_ID = 0x1029;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public UsingNamespaceStMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected String getSymbolTypeName() {+ return "UNAMESPACE_ST";+ }++ @Override+ protected void create() {+ name = new StringUtf8St();+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/VirtualFunctionTable16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/VirtualFunctionTable16MsSymbol.javanew file mode 100644index 0000000000..b95b598686--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/VirtualFunctionTable16MsSymbol.java@@ -0,0 +1,68 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>16MsSymbol</B> flavor of Virtual Function Table symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class VirtualFunctionTable16MsSymbol extends AbstractVirtualFunctionTableMsSymbol {++ public static final int PDB_ID = 0x010b;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public VirtualFunctionTable16MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset16();+ rootTypeIndex = new TypeIndex16();+ pathTypeIndex = new TypeIndex16();+ }++ @Override+ protected void parse(PdbByteReader reader) throws PdbException {+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ rootTypeIndex.parse(reader);+ pathTypeIndex.parse(reader);+ }++ @Override+ protected String getSymbolTypeName() {+ return "VFTABLE16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/VirtualFunctionTable3216MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/VirtualFunctionTable3216MsSymbol.javanew file mode 100644index 0000000000..cd185f3340--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/VirtualFunctionTable3216MsSymbol.java@@ -0,0 +1,68 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>3216MsSymbol</B> flavor of Virtual Function Table symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class VirtualFunctionTable3216MsSymbol extends AbstractVirtualFunctionTableMsSymbol {++ public static final int PDB_ID = 0x020b;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public VirtualFunctionTable3216MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset32();+ rootTypeIndex = new TypeIndex16();+ pathTypeIndex = new TypeIndex16();+ }++ @Override+ protected void parse(PdbByteReader reader) throws PdbException {+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ rootTypeIndex.parse(reader);+ pathTypeIndex.parse(reader);+ }++ @Override+ protected String getSymbolTypeName() {+ return "VFTABLE32_16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/VirtualFunctionTable32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/VirtualFunctionTable32MsSymbol.javanew file mode 100644index 0000000000..7c61eea826--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/VirtualFunctionTable32MsSymbol.java@@ -0,0 +1,68 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>32MsSymbol</B> flavor of Virtual Function Table symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class VirtualFunctionTable32MsSymbol extends AbstractVirtualFunctionTableMsSymbol {++ public static final int PDB_ID = 0x100c;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException Upon not enough data left to parse.+ */+ public VirtualFunctionTable32MsSymbol(AbstractPdb pdb, PdbByteReader reader)+ throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ offset = new Offset32();+ rootTypeIndex = new TypeIndex32();+ pathTypeIndex = new TypeIndex32();+ }++ @Override+ protected void parse(PdbByteReader reader) throws PdbException {+ rootTypeIndex.parse(reader);+ pathTypeIndex.parse(reader);+ offset.parse(reader);+ segment = reader.parseUnsignedShortVal();+ }++ @Override+ protected String getSymbolTypeName() {+ return "VFTABLE32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/With16MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/With16MsSymbol.javanew file mode 100644index 0000000000..10df4d1ee0--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/With16MsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>16MsSymbol</B> flavor of With symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class With16MsSymbol extends AbstractWithMsSymbol {++ public static final int PDB_ID = 0x0108;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public With16MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ length = new Offset16();+ offset = new Offset16();+ expression = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "WITH16";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/With32MsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/With32MsSymbol.javanew file mode 100644index 0000000000..8eb550d2b7--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/With32MsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>32MsSymbol</B> flavor of With symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class With32MsSymbol extends AbstractWithMsSymbol {++ public static final int PDB_ID = 0x1104;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public With32MsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ length = new Offset32();+ offset = new Offset32();+ expression = new StringUtf8Nt();+ }++ @Override+ protected String getSymbolTypeName() {+ return "WITH32";+ }++}diff --git a/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/With32StMsSymbol.java b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/With32StMsSymbol.javanew file mode 100644index 0000000000..12e8613dde--- /dev/null+++ b/Ghidra/Features/PDB/src/main/java/ghidra/pdb/pdbreader/symbol/With32StMsSymbol.java@@ -0,0 +1,59 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import ghidra.pdb.PdbByteReader;+import ghidra.pdb.PdbException;+import ghidra.pdb.pdbreader.*;++/**+ * This class represents the <B>32StMsSymbol</B> flavor of With symbol.+ * <P>+ * Note: we do not necessarily understand each of these symbol type classes. Refer to the+ * base class for more information.+ */+public class With32StMsSymbol extends AbstractWithMsSymbol {++ public static final int PDB_ID = 0x0208;++ /**+ * Constructor for this symbol.+ * @param pdb {@link AbstractPdb} to which this symbol belongs.+ * @param reader {@link PdbByteReader} from which this symbol is deserialized.+ * @throws PdbException upon error parsing a field.+ */+ public With32StMsSymbol(AbstractPdb pdb, PdbByteReader reader) throws PdbException {+ super(pdb, reader);+ }++ @Override+ public int getPdbId() {+ return PDB_ID;+ }++ @Override+ protected void create() {+ length = new Offset32();+ offset = new Offset32();+ expression = new StringUtf8St();+ }++ @Override+ protected String getSymbolTypeName() {+ return "WITH32_ST";+ }++}diff --git a/Ghidra/Features/PDB/src/test/java/ghidra/pdb/pdbreader/symbol/SymbolsTest.java b/Ghidra/Features/PDB/src/test/java/ghidra/pdb/pdbreader/symbol/SymbolsTest.javanew file mode 100644index 0000000000..d3356a0e77--- /dev/null+++ b/Ghidra/Features/PDB/src/test/java/ghidra/pdb/pdbreader/symbol/SymbolsTest.java@@ -0,0 +1,4204 @@+/* ###+ * IP: GHIDRA+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package ghidra.pdb.pdbreader.symbol;++import static org.junit.Assert.*;++import java.math.BigInteger;++import org.junit.Test;++import generic.test.AbstractGenericTest;+import ghidra.pdb.*;+import ghidra.pdb.pdbreader.*;+import ghidra.pdb.pdbreader.type.AbstractMsType;+import ghidra.pdb.pdbreader.type.DummyMsType;+import ghidra.util.Msg;++public class SymbolsTest extends AbstractGenericTest {++ private static AbstractPdb pdb;+ // Important: Must also use this processorIndex value in any tests below that need it to+ // ensure consistency across the tests. We are setting it int the pdb here (in the static+ // assignment block), but we do not know the order that any tests are run, so having the+ // same value will ensure consistent results.+ private static final int processorIndex = 0x0000;+ //private static TypeProgramInterface tpi;+ private static SymbolParser symbolParser;+ static {+ try (DummyPdb700 dummyPdb700 = new DummyPdb700(4096, 4096, 4096, 4096)) {+ pdb = dummyPdb700;+ pdb.setTargetProcessorIndexNumber(processorIndex);++ symbolParser = pdb.getSymbolParser();+ AbstractMsType type;+ AbstractMsType item;+ //PdbByteReader reader;+ // Create records that will be used indirectly+ type = new DummyMsType(pdb, null);+ item = new DummyMsType(pdb, null, "Item");++ //=================================+ // TPI Records+ dummyPdb700.setTypeRecord(4096, type);++ //=================================+ // IPI Records+ dummyPdb700.setItemRecord(4096, item);+ }+ catch (Exception e) {+ Msg.error(null, "Error in static initialization of test", e);+ assert false;+ }+ }++ //==============================================================================================+ //==============================================================================================+ //==============================================================================================+ @Test+ public void testInstructionAnnotationCodeOffsetSmallMin() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x01, 0x00, 0x00);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" Offset 0", result);+ }++ @Test+ public void testInstructionAnnotationCodeOffsetSmallMax() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x01, 0x7f, 0x00);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" Offset 7f", result);+ }++ @Test+ public void testInstructionAnnotationCodeOffsetMediumMin() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x01, 0x80, 0x00);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" Offset 80", result);+ }++ @Test+ public void testInstructionAnnotationCodeOffsetMediumMax() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x01, 0x3fff, 0x00);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" Offset 3fff", result);+ }++ @Test+ public void testInstructionAnnotationCodeOffsetLargeMin() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x01, 0x4000, 0x00);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" Offset 4000", result);+ }++ @Test+ public void testInstructionAnnotationCodeOffsetLarge() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x01, 0x1fffffff, 0x00);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" Offset 1fffffff", result);+ }++ @Test+ public void testInstructionAnnotationChangeCodeOffsetBase() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x02, 0x20, 0x21);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" CodeOffsetBase 20", result);+ }++ @Test+ public void testInstructionAnnotationChangeCodeOffset() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x03, 0x30, 0x31);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" CodeOffset 30", result);+ }++ @Test+ public void testInstructionAnnotationChangeCodeLength() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x04, 0x40, 0x41);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" CodeLength 40", result);+ }++ @Test+ public void testInstructionAnnotationChangeFile() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x05, 0x50, 0x51);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" File 50", result);+ }++ @Test+ public void testInstructionAnnotationChangeLineOffset() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x06, 0x60, 0x61);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" LineOffset 60", result);+ }++ @Test+ public void testInstructionAnnotationChangeLineEndDelta() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x07, 0x70, 0x71);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" LineEndDelta 70", result);+ }++ @Test+ public void testInstructionAnnotationChangeRangeKind() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x08, 0x80, 0x81);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" RangeKind 80", result);+ }++ @Test+ public void testInstructionAnnotationChangeColumnStart() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x09, 0x90, 0x91);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" ColumnStart 90", result);+ }++ @Test+ public void testInstructionAnnotationChangeColumnEndDelta() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x0a, 0xa0, 0xa1);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" ColumnEndDelta a0", result);+ }++ @Test+ public void testInstructionAnnotationChangeColumnEndDeltaNegValue() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x0a, -(0x40), 0xa1);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" ColumnEndDelta ffffffc0", result);+ }++ @Test+ public void testInstructionAnnotationChangeCodeOffsetAndLineOffset() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x0b, 0xb0, 0xb1);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" CodeOffsetAndLineOffset b 0", result);+ }++ @Test+ public void testInstructionAnnotationChangeCodeLengthAndCodeOffset() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x0c, 0xc0, 0xc1);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" CodeLengthAndCodeOffset c0 c1", result);+ }++ @Test+ public void testInstructionAnnotationChangeColumnEnd() throws PdbException {+ byte[] buf = createInstructionAnnotationBuffer(0x0d, 0xd0, 0xd1);+ PdbByteReader reader = new PdbByteReader(buf);+ InstructionAnnotation annotation = new InstructionAnnotation(reader);+ String result = annotation.toString();+ assertEquals(" ColumnEnd d0", result);+ }++ //==============================================================================================+ //==============================================================================================+ //==============================================================================================+ @Test+ public void testUnknownMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(0xffff);+ writer.putBytes(new byte[] { (byte) 0xfe, (byte) 0xfd, (byte) 0xfc }); // dummy data+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof UnknownMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("UNKNOWN_SYMBOL (0XFFFF): Bytes:\n" + "000000 fe fd fc", result);+ }++ @Test+ public void testBadMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(CompileFlagsMsSymbol.PDB_ID);+ writer.putUnsignedByte(0x00); // Processor value.+ // Incomplete record should cause BadMsSymbol to be created.+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof BadMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("BAD_SYMBOL: ID=0X0001", result);+ }++ @Test+ public void testCompileFlagsMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(CompileFlagsMsSymbol.PDB_ID);+ writer.putUnsignedByte(0x00); // Processor value.+ writer.putBytes(new byte[] { 0x00, 0x00, 0x00 }); // 3 bytes of flags+ writer.putByteLengthPrefixedString("CompilerVersionString");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof CompileFlagsMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("COMPILE:\n" + " Language: C\n" + " Target Processor: 8080\n" ++ " Floating-point precision: 0\n" + " Floating-point package: 0\n" ++ " Ambiant data: 0\n" + " Ambiant code: 0\n" + " PCode present: no\n" ++ " Version String:CompilerVersionString", result);+ }++ @Test+ public void testCompile2StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Compile2StMsSymbol.PDB_ID);+ writer.putUnsignedInt(0); // flags+ writer.putUnsignedShort(processorIndex); // Processor value.+ writer.putUnsignedShort(0x0001); // front end major version number+ writer.putUnsignedShort(0x0002); // front end minor version number+ writer.putUnsignedShort(0x0003); // front end build version number+ writer.putUnsignedShort(0x0004); // back end major version number+ writer.putUnsignedShort(0x0005); // back end minor version number+ writer.putUnsignedShort(0x0006); // back end build version number+ writer.putByteLengthPrefixedUtf8String("CompilerVersionString"); // This is len pref.+ writer.putNullTerminatedUtf8String("optionalString1"); // These are null term.+ writer.putNullTerminatedUtf8String("optionalString2"); // These are null term.+ writer.putUnsignedByte(0);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Compile2StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("COMPILE2_ST:\n" + " Language: C\n" + " Target Processor: 8080\n" ++ " Compiled for edit and continue: no\n" + " Compiled withoug debugging info: no\n" ++ " Compiled with LTCG: no\n" + " Compiled with /bzalign: no\n" ++ " Managed code present: no\n" + " Compiled with /GS: no\n" ++ " Compiled with /hotpatch: no\n" + " Converted by CVTCIL: no\n" ++ " Microsoft Intermediate Language Module: no\n" ++ " Frontend Version: Major = 1, Minor = 2, Build = 3\n" ++ " Backend Version: Major = 4, Minor = 5, Build = 6\n" ++ " Version String:CompilerVersionString\n" + "Command block: \n" ++ " optionalString1 = 'optionalString2'", result);+ }++ @Test+ public void testCompile2MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Compile2MsSymbol.PDB_ID);+ writer.putUnsignedInt(0); // flags+ writer.putUnsignedShort(processorIndex); // Processor value.+ writer.putUnsignedShort(0x0001); // front end major version number+ writer.putUnsignedShort(0x0002); // front end minor version number+ writer.putUnsignedShort(0x0003); // front end build version number+ writer.putUnsignedShort(0x0004); // back end major version number+ writer.putUnsignedShort(0x0005); // back end minor version number+ writer.putUnsignedShort(0x0006); // back end build version number+ writer.putNullTerminatedUtf8String("CompilerVersionString"); // These are null term.+ writer.putNullTerminatedUtf8String("optionalString1"); // These are null term.+ writer.putNullTerminatedUtf8String("optionalString2"); // These are null term.+ writer.putUnsignedByte(0);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Compile2MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("COMPILE2:\n" + " Language: C\n" + " Target Processor: 8080\n" ++ " Compiled for edit and continue: no\n" + " Compiled withoug debugging info: no\n" ++ " Compiled with LTCG: no\n" + " Compiled with /bzalign: no\n" ++ " Managed code present: no\n" + " Compiled with /GS: no\n" ++ " Compiled with /hotpatch: no\n" + " Converted by CVTCIL: no\n" ++ " Microsoft Intermediate Language Module: no\n" ++ " Frontend Version: Major = 1, Minor = 2, Build = 3\n" ++ " Backend Version: Major = 4, Minor = 5, Build = 6\n" ++ " Version String:CompilerVersionString\n" + "Command block: \n" ++ " optionalString1 = 'optionalString2'", result);+ }++ @Test+ public void testCompile3MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Compile3MsSymbol.PDB_ID);+ writer.putUnsignedInt(0); // flags+ writer.putUnsignedShort(processorIndex); // Processor value.+ writer.putUnsignedShort(0x0001); // front end major version number+ writer.putUnsignedShort(0x0002); // front end minor version number+ writer.putUnsignedShort(0x0003); // front end build version number+ writer.putUnsignedShort(0x0004); // front end QFE version number+ writer.putUnsignedShort(0x0005); // back end major version number+ writer.putUnsignedShort(0x0006); // back end minor version number+ writer.putUnsignedShort(0x0007); // back end build version number+ writer.putUnsignedShort(0x0008); // back end QFE version number+ writer.putNullTerminatedUtf8String("CompilerVersionString"); // These are null term.+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Compile3MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("COMPILE3:\n" + " Language: C\n" + " Target Processor: 8080\n" ++ " Compiled for edit and continue: no\n" + " Compiled withoug debugging info: no\n" ++ " Compiled with LTCG: no\n" + " Compiled with /bzalign: no\n" ++ " Managed code present: no\n" + " Compiled with /GS: no\n" ++ " Compiled with /hotpatch: no\n" + " Converted by CVTCIL: no\n" ++ " Microsoft Intermediate Language Module: no\n" + " Compiled with /sdl: no\n" ++ " Compiled with Profile Guided Optimization (PGO): no\n" + " .EXP module: no\n" ++ " Frontend Version: Major = 1, Minor = 2, Build = 3, QFE = 4\n" ++ " Backend Version: Major = 5, Minor = 6, Build = 7, QFE = 8\n" ++ " Version String:CompilerVersionString", result);+ }++ @Test+ public void testEnvironmentBlockMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(EnvironmentBlockMsSymbol.PDB_ID);+ writer.putUnsignedByte(0); // 1 if compiled for edit-and-continue debug+ writer.putNullTerminatedUtf8String("optionalString1");+ writer.putNullTerminatedUtf8String("optionalString2");+ writer.putNullTerminatedUtf8String("optionalString3");+ writer.putNullTerminatedUtf8String("optionalString4");+ writer.putUnsignedByte(0);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof EnvironmentBlockMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("ENVBLOCK:\n" + "Compiled for edit and continue: no\n" + "Command block: \n" ++ " optionalString1 = 'optionalString2'\n" + " optionalString3 = 'optionalString4'",+ result);+ }++ @Test+ public void testRegister16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Register16MsSymbol.PDB_ID);+ writer.putUnsignedShort(4096); // Type index or metadata token+ writer.putUnsignedShort(0x0102); // Register enumerate+ writer.putByteLengthPrefixedUtf8String("registerSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Register16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("REGISTER_16: al:cl, Type: DummyMsType, registerSymbolName", result);+ }++ @Test+ public void testRegisterStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(RegisterStMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index or metadata token+ writer.putUnsignedShort(0x01); // Register enumerate+ writer.putByteLengthPrefixedUtf8String("registerSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof RegisterStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("REGISTER_ST: al, Type: DummyMsType, registerSymbolName", result);+ }++ @Test+ public void testRegisterMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(RegisterMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index or metadata token+ writer.putUnsignedShort(0x01); // Register enumerate+ writer.putNullTerminatedUtf8String("registerSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof RegisterMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("REGISTER: al, Type: DummyMsType, registerSymbolName", result);+ }++ @Test+ public void testConstant16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Constant16MsSymbol.PDB_ID);+ writer.putUnsignedShort(4096); // Type index containing enum if enumerate+ writer.putUnsignedShort(0x01); // Value+ writer.putByteLengthPrefixedUtf8String("constantSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Constant16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("CONSTANT_16: Type: DummyMsType, Value: 1, constantSymbolName", result);+ }++ @Test+ public void testConstantStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ConstantStMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index containing enum if enumerate+ writer.putUnsignedShort(0x01); // Value+ writer.putByteLengthPrefixedUtf8String("constantSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ConstantStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("CONSTANT_ST: Type: DummyMsType, Value: 1, constantSymbolName", result);+ }++ @Test+ public void testConstantMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ConstantMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index containing enum if enumerate+ writer.putUnsignedShort(0x01); // Value+ writer.putNullTerminatedUtf8String("constantSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ConstantMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("CONSTANT: Type: DummyMsType, Value: 1, constantSymbolName", result);+ }++ @Test+ public void testManagedConstantMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ManagedConstantMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index containing enum if enumerate+ writer.putUnsignedShort(0x01); // Value+ writer.putNullTerminatedUtf8String("constantSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ManagedConstantMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANCONSTANT: Type: DummyMsType, Value: 1, constantSymbolName", result);+ }++ @Test+ public void testUserDefinedType16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(UserDefinedType16MsSymbol.PDB_ID);+ writer.putUnsignedShort(4096); // Type index containing enum if enumerate+ writer.putByteLengthPrefixedUtf8String("UDTSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof UserDefinedType16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("UDT_16: DummyMsType, UDTSymbolName", result);+ }++ @Test+ public void testUserDefinedTypeStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(UserDefinedTypeStMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index containing enum if enumerate+ writer.putByteLengthPrefixedUtf8String("UDTSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof UserDefinedTypeStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("UDT_ST: DummyMsType, UDTSymbolName", result);+ }++ @Test+ public void testUserDefinedTypeMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(UserDefinedTypeMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index containing enum if enumerate+ writer.putNullTerminatedUtf8String("UDTSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof UserDefinedTypeMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("UDT: DummyMsType, UDTSymbolName", result);+ }++ @Test+ public void testCobolUserDefinedType16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(CobolUserDefinedType16MsSymbol.PDB_ID);+ writer.putUnsignedShort(4096); // Type index containing enum if enumerate+ writer.putByteLengthPrefixedUtf8String("CobolUDTSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof CobolUserDefinedType16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("COBOLUDT_16: DummyMsType, CobolUDTSymbolName", result);+ }++ @Test+ public void testCobolUserDefinedTypeStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(CobolUserDefinedTypeStMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index containing enum if enumerate+ writer.putByteLengthPrefixedUtf8String("CobolUDTSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof CobolUserDefinedTypeStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("COBOLUDT_ST: DummyMsType, CobolUDTSymbolName", result);+ }++ @Test+ public void testCobolUserDefinedTypeMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(CobolUserDefinedTypeMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index containing enum if enumerate+ writer.putNullTerminatedUtf8String("CobolUDTSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof CobolUserDefinedTypeMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("COBOLUDT: DummyMsType, CobolUDTSymbolName", result);+ }++ @Test+ public void testStartSearchMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(StartSearchMsSymbol.PDB_ID);+ writer.putInt(0x100); // Offset of the procedure+ writer.putUnsignedShort(0x1); // Setment of the symbol+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof StartSearchMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("Start search for segment 0x1 at 0x100", result);+ }++ @Test+ public void testEndMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(EndMsSymbol.PDB_ID);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof EndMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("END", result);+ }++ @Test+ public void testSkipMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(SkipMsSymbol.PDB_ID);+ writer.putBytes(new byte[] { 0x00, 0x00 }); // Putting data, but might never be any.+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof SkipMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("Skip Record, Length = 0x2", result);+ }++ @Test+ public void testCvReservedMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(CvReservedMsSymbol.PDB_ID);+ writer.putBytes(new byte[] { 0x00, 0x00 }); // Putting data, but might never be any.+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof CvReservedMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("CVRESERVE, Length = 0x2", result);+ }++ @Test+ public void testObjectNameStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ObjectNameStMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index containing enum if enumerate+ writer.putByteLengthPrefixedUtf8String("ObjectNameSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ObjectNameStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("OBJNAME_ST: Signature: 4096, ObjectNameSymbolName", result);+ }++ @Test+ public void testObjectNameMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ObjectNameMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index containing enum if enumerate+ writer.putNullTerminatedUtf8String("ObjectNameSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ObjectNameMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("OBJNAME: Signature: 4096, ObjectNameSymbolName", result);+ }++ @Test+ public void testEndArgumentsListMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(EndArgumentsListMsSymbol.PDB_ID);+ writer.putBytes(new byte[] { 0x00, 0x00 }); // Putting data, but might never be any.+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof EndArgumentsListMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("ENDARG, Length = 0x2", result);+ }++ @Test+ public void testManyRegisterVariable16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ManyRegisterVariable16MsSymbol.PDB_ID);+ writer.putUnsignedShort(4096); // Type index containing enum if enumerate+ int count = 2;+ writer.putUnsignedByte(count);+ for (int i = 0; i < count; i++) {+ writer.putUnsignedShort(i + 1);+ }+ writer.putByteLengthPrefixedUtf8String("ManyRegisterVariableName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ManyRegisterVariable16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANYREG_16: al, cl DummyMsType ManyRegisterVariableName", result);+ }++ @Test+ public void testManyRegisterVariableStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ManyRegisterVariableStMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index containing enum if enumerate+ int count = 2;+ writer.putUnsignedByte(count);+ for (int i = 0; i < count; i++) {+ writer.putUnsignedShort(i + 1);+ }+ writer.putByteLengthPrefixedUtf8String("ManyRegisterVariableName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ManyRegisterVariableStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANYREG_ST: al, cl DummyMsType ManyRegisterVariableName", result);+ }++ @Test+ public void testManyRegisterVariableMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ManyRegisterVariableMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index containing enum if enumerate+ int count = 2;+ writer.putUnsignedByte(count);+ for (int i = 0; i < count; i++) {+ writer.putUnsignedShort(i + 1);+ }+ writer.putNullTerminatedUtf8String("ManyRegisterVariableName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ManyRegisterVariableMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANYREG: al, cl DummyMsType ManyRegisterVariableName", result);+ }++ @Test+ public void testManyRegisterVariable2StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ManyRegisterVariable2StMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index containing enum if enumerate+ int count = 2;+ writer.putUnsignedByte(count);+ for (int i = 0; i < count; i++) {+ writer.putUnsignedShort(i + 1);+ }+ writer.putByteLengthPrefixedUtf8String("ManyRegisterVariable2Name");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ManyRegisterVariable2StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANYREG2_ST: al, cl DummyMsType ManyRegisterVariable2Name", result);+ }++ @Test+ public void testManyRegisterVariable2MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ManyRegisterVariable2MsSymbol.PDB_ID);+ writer.putInt(4096); // Type index containing enum if enumerate+ int count = 2;+ writer.putUnsignedByte(count);+ for (int i = 0; i < count; i++) {+ writer.putUnsignedShort(i + 1);+ }+ writer.putNullTerminatedUtf8String("ManyRegisterVariable2Name");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ManyRegisterVariable2MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANYREG2: al, cl DummyMsType ManyRegisterVariable2Name", result);+ }++ @Test+ public void testReturnDescriptionMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ReturnDescriptionMsSymbol.PDB_ID);+ writer.putUnsignedShort(0x00); // Generic flags+ writer.putUnsignedByte(0x01); // Generic style.+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ReturnDescriptionMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals(+ "RETURN, return data in registers, varargs left-to-right, caller cleans stack;" ++ " byte length of remaining method data = 0",+ result);+ }++ @Test+ public void testEntryThisMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(EntryThisMsSymbol.PDB_ID);+ // API: "Symbol describing this pointer on entry" TODO: made up data; what should it be?+ writer.putUnsignedByte(0x55);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof EntryThisMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("ENTRYTHIS, 'this' symbol: 55; byte length of remaining data = 0", result);+ }++ @Test+ public void testBasePointerRelative16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(BasePointerRelative16MsSymbol.PDB_ID);+ writer.putUnsignedShort(0x10); // BasePointer-relative offset.+ writer.putUnsignedShort(4096); // Type index+ writer.putByteLengthPrefixedUtf8String("BasePointerRelativeName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof BasePointerRelative16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("BPREL16: [00000010], Type: DummyMsType, BasePointerRelativeName", result);+ }++ @Test+ public void testBasePointerRelative3216MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(BasePointerRelative3216MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // BasePointer-relative offset.+ writer.putUnsignedShort(4096); // Type index+ writer.putByteLengthPrefixedUtf8String("BasePointerRelativeName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof BasePointerRelative3216MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("BPREL32_16: [00000010], Type: DummyMsType, BasePointerRelativeName", result);+ }++ @Test+ public void testBasePointerRelative32StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(BasePointerRelative32StMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // BasePointer-relative offset.+ writer.putInt(4096); // Type index+ writer.putByteLengthPrefixedUtf8String("BasePointerRelativeName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof BasePointerRelative32StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("BPREL32_ST: [00000010], Type: DummyMsType, BasePointerRelativeName", result);+ }++ @Test+ public void testBasePointerRelative32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(BasePointerRelative32MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // BasePointer-relative offset.+ writer.putInt(4096); // Type index+ writer.putNullTerminatedUtf8String("BasePointerRelativeName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof BasePointerRelative32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("BPREL32: [00000010], Type: DummyMsType, BasePointerRelativeName", result);+ }++ @Test+ public void testLocalData16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalData16MsSymbol.PDB_ID);+ writer.putUnsignedShort(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putUnsignedShort(4096); // Type index+ writer.putByteLengthPrefixedUtf8String("LocalDataName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalData16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LDATA16: [0001:00000010], Type: DummyMsType, LocalDataName", result);+ }++ @Test+ public void testLocalData3216MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalData3216MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putUnsignedShort(4096); // Type index+ writer.putByteLengthPrefixedUtf8String("LocalDataName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalData3216MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LDATA32_16: [0001:00000010], Type: DummyMsType, LocalDataName", result);+ }++ @Test+ public void testLocalData32StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalData32StMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putByteLengthPrefixedUtf8String("LocalDataName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalData32StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LDATA32_ST: [0001:00000010], Type: DummyMsType, LocalDataName", result);+ }++ @Test+ public void testLocalData32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalData32MsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putNullTerminatedUtf8String("LocalDataName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalData32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LDATA32: [0001:00000010], Type: DummyMsType, LocalDataName", result);+ }++ @Test+ public void testGlobalData16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalData16MsSymbol.PDB_ID);+ writer.putUnsignedShort(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putUnsignedShort(4096); // Type index+ writer.putByteLengthPrefixedUtf8String("GlobalDataName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalData16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GDATA16: [0001:00000010], Type: DummyMsType, GlobalDataName", result);+ }++ @Test+ public void testGlobalData3216MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalData3216MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putUnsignedShort(4096); // Type index+ writer.putByteLengthPrefixedUtf8String("GlobalDataName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalData3216MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GDATA32_16: [0001:00000010], Type: DummyMsType, GlobalDataName", result);+ }++ @Test+ public void testGlobalData32StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalData32StMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putByteLengthPrefixedUtf8String("GlobalDataName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalData32StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GDATA32_ST: [0001:00000010], Type: DummyMsType, GlobalDataName", result);+ }++ @Test+ public void testGlobalData32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalData32MsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putNullTerminatedUtf8String("GlobalDataName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalData32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GDATA32: [0001:00000010], Type: DummyMsType, GlobalDataName", result);+ }++ @Test+ public void testPublic16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Public16MsSymbol.PDB_ID);+ writer.putUnsignedShort(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putUnsignedShort(4096); // Type index+ writer.putByteLengthPrefixedUtf8String("PublicName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Public16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("PUBSYM16: [0001:00000010], Type: DummyMsType, PublicName", result);+ }++ @Test+ public void testPublic3216MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Public3216MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putUnsignedShort(4096); // Type index+ writer.putByteLengthPrefixedUtf8String("PublicName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Public3216MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("PUBSYM32_16: [0001:00000010], Type: DummyMsType, PublicName", result);+ }++ @Test+ public void testPublic32StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Public32StMsSymbol.PDB_ID);+ writer.putInt(0x0f); // Public symbol flags+ writer.putUnsignedInt(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putByteLengthPrefixedUtf8String("PublicName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Public32StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("PUBSYM32_ST: [0001:00000010], Flags: 0000000f, PublicName", result);+ }++ @Test+ public void testPublic32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Public32MsSymbol.PDB_ID);+ writer.putInt(0x0f); // Public symbol flags+ writer.putUnsignedInt(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putNullTerminatedUtf8String("PublicName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Public32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("PUBSYM32: [0001:00000010], Flags: 0000000f, PublicName", result);+ }++ @Test+ public void testLocalManagedDataStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalManagedDataStMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putByteLengthPrefixedString("LocalManagedDataName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalManagedDataStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LMANDATA32_ST: [0001:00000010], Token: 00001000, LocalManagedDataName",+ result);+ }++ @Test+ public void testLocalManagedDataMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalManagedDataMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putNullTerminatedUtf8String("LocalManagedDataName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalManagedDataMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LMANDATA32: [0001:00000010], Token: 00001000, LocalManagedDataName", result);+ }++ @Test+ public void testGlobalManagedDataStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalManagedDataStMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putByteLengthPrefixedString("GlobalManagedDataName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalManagedDataStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GMANDATA32_ST: [0001:00000010], Token: 00001000, GlobalManagedDataName",+ result);+ }++ @Test+ public void testGlobalManagedDataMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalManagedDataMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x10); // Offset of symbol.+ writer.putUnsignedShort(0x01); // Segment.+ writer.putNullTerminatedUtf8String("GlobalManagedDataName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalManagedDataMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GMANDATA32: [0001:00000010], Token: 00001000, GlobalManagedDataName", result);+ }++ @Test+ public void testLocalThreadStorage3216MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalThreadStorage3216MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // Offset into thread storage+ writer.putUnsignedShort(0x01); // Segment of thread storage.+ writer.putUnsignedShort(4096); // Type index+ writer.putByteLengthPrefixedUtf8String("LocalThreadStorageName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalThreadStorage3216MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LTHREAD32_16: [0001:00000010], Type: DummyMsType, LocalThreadStorageName",+ result);+ }++ @Test+ public void testLocalThreadStorage32StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalThreadStorage32StMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x10); // Offset into thread storage+ writer.putUnsignedShort(0x01); // Segment of thread storage.+ writer.putByteLengthPrefixedUtf8String("LocalThreadStorageName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalThreadStorage32StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LTHREAD32_ST: [0001:00000010], Type: DummyMsType, LocalThreadStorageName",+ result);+ }++ @Test+ public void testLocalThreadStorage32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalThreadStorage32MsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x10); // Offset into thread storage+ writer.putUnsignedShort(0x01); // Segment of thread storage.+ writer.putNullTerminatedUtf8String("LocalThreadStorageName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalThreadStorage32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LTHREAD32: [0001:00000010], Type: DummyMsType, LocalThreadStorageName",+ result);+ }++ @Test+ public void testGlobalThreadStorage3216MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalThreadStorage3216MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // Offset into thread storage+ writer.putUnsignedShort(0x01); // Segment of thread storage.+ writer.putUnsignedShort(4096); // Type index+ writer.putByteLengthPrefixedUtf8String("GlobalThreadStorageName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalThreadStorage3216MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GTHREAD32_16: [0001:00000010], Type: DummyMsType, GlobalThreadStorageName",+ result);+ }++ @Test+ public void testGlobalThreadStorage32StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalThreadStorage32StMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x10); // Offset into thread storage+ writer.putUnsignedShort(0x01); // Segment of thread storage.+ writer.putByteLengthPrefixedUtf8String("GlobalThreadStorageName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalThreadStorage32StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GTHREAD32_ST: [0001:00000010], Type: DummyMsType, GlobalThreadStorageName",+ result);+ }++ @Test+ public void testGlobalThreadStorage32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalThreadStorage32MsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x10); // Offset into thread storage+ writer.putUnsignedShort(0x01); // Segment of thread storage.+ writer.putNullTerminatedUtf8String("GlobalThreadStorageName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalThreadStorage32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GTHREAD32: [0001:00000010], Type: DummyMsType, GlobalThreadStorageName",+ result);+ }++ @Test+ public void testLocalDataHighLevelShaderLanguageMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalDataHighLevelShaderLanguageMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedShort(0x01); // HLSL register type+ writer.putUnsignedShort(0x02); // Base data slot+ writer.putUnsignedShort(0x03); // Base data byte offset start+ writer.putUnsignedShort(0x04); // Texture slot start+ writer.putUnsignedShort(0x05); // Sampler slot start+ writer.putUnsignedShort(0x06); // UAV slot start+ writer.putNullTerminatedUtf8String("LocalDataHighLevelShaderLanguageSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalDataHighLevelShaderLanguageMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LDATA_HLSL: Type: DummyMsType. INPUT\n" ++ " base data: slot = 2 offset = 3, texture slot = 4, sampler slot = 5," ++ " UAV slot = 6", result);+ }++ @Test+ public void testLocalDataHighLevelShaderLanguage32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalDataHighLevelShaderLanguage32MsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x02); // Base data slot+ writer.putUnsignedInt(0x03); // Base data byte offset start+ writer.putUnsignedInt(0x04); // Texture slot start+ writer.putUnsignedInt(0x05); // Sampler slot start+ writer.putUnsignedInt(0x06); // UAV slot start+ writer.putUnsignedShort(0x01); // HLSL register type+ writer.putNullTerminatedUtf8String("LocalDataHighLevelShaderLanguageSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalDataHighLevelShaderLanguage32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LDATA_HLSL32: Type: DummyMsType. INPUT\n" ++ " base data: slot = 2 offset = 3, texture slot = 4, sampler slot = 5," ++ " UAV slot = 6", result);+ }++ @Test+ public void testLocalDataHighLevelShaderLanguage32ExtendedMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalDataHighLevelShaderLanguage32ExtendedMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x02); // HLSL register index (regID)+ writer.putUnsignedInt(0x03); // Base data byte offset start+ writer.putUnsignedInt(0x04); // bindSpace (binding space)+ writer.putUnsignedInt(0x05); // bindSlot (lower bound in binding space)+ writer.putUnsignedShort(0x01); // HLSL register type+ writer.putNullTerminatedUtf8String("LocalDataHighLevelShaderLanguageSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalDataHighLevelShaderLanguage32ExtendedMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LDATA_HLSL32_EX: Type: DummyMsType. INPUT\n" ++ " register index = 2, base data offset start = 3, bind space = 4," + " bind slot = 5",+ result);+ }++ @Test+ public void testGlobalDataHighLevelShaderLanguageMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalDataHighLevelShaderLanguageMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedShort(0x01); // HLSL register type+ writer.putUnsignedShort(0x02); // Base data slot+ writer.putUnsignedShort(0x03); // Base data byte offset start+ writer.putUnsignedShort(0x04); // Texture slot start+ writer.putUnsignedShort(0x05); // Sampler slot start+ writer.putUnsignedShort(0x06); // UAV slot start+ writer.putNullTerminatedUtf8String("GlobalDataHighLevelShaderLanguageSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalDataHighLevelShaderLanguageMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GDATA_HLSL: Type: DummyMsType. INPUT\n" ++ " base data: slot = 2 offset = 3, texture slot = 4, sampler slot = 5," ++ " UAV slot = 6", result);+ }++ @Test+ public void testGlobalDataHighLevelShaderLanguage32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalDataHighLevelShaderLanguage32MsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x02); // Base data slot+ writer.putUnsignedInt(0x03); // Base data byte offset start+ writer.putUnsignedInt(0x04); // Texture slot start+ writer.putUnsignedInt(0x05); // Sampler slot start+ writer.putUnsignedInt(0x06); // UAV slot start+ writer.putUnsignedShort(0x01); // HLSL register type+ writer.putNullTerminatedUtf8String("GlobalDataHighLevelShaderLanguageSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalDataHighLevelShaderLanguage32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GDATA_HLSL32: Type: DummyMsType. INPUT\n" ++ " base data: slot = 2 offset = 3, texture slot = 4, sampler slot = 5," ++ " UAV slot = 6", result);+ }++ @Test+ public void testGlobalDataHighLevelShaderLanguage32ExtendedMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalDataHighLevelShaderLanguage32ExtendedMsSymbol.PDB_ID);+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x02); // HLSL register index (regID)+ writer.putUnsignedInt(0x03); // Base data byte offset start+ writer.putUnsignedInt(0x04); // bindSpace (binding space)+ writer.putUnsignedInt(0x05); // bindSlot (lower bound in binding space)+ writer.putUnsignedShort(0x01); // HLSL register type+ writer.putNullTerminatedUtf8String("GlobalDataHighLevelShaderLanguageSymbolName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalDataHighLevelShaderLanguage32ExtendedMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GDATA_HLSL32_EX: Type: DummyMsType. INPUT\n" ++ " register index = 2, base data offset start = 3, bind space = 4," + " bind slot = 5",+ result);+ }++ @Test+ public void testLocalProcedureStart16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedureStart16MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedShort(0x100); // Procedure length+ writer.putUnsignedShort(0x10); // Debug start offset+ writer.putUnsignedShort(0x20); // Debug end offset+ writer.putUnsignedShort(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(4096); // Type index+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putByteLengthPrefixedUtf8String("LocalProcedureStartName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedureStart16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROC16: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " LocalProcedureStartName\n" + " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ "Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info", result);+ }++ @Test+ public void testLocalProcedureStart3216MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedureStart3216MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(4096); // Type index+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putByteLengthPrefixedUtf8String("LocalProcedureStartName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedureStart3216MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROC32_16: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " LocalProcedureStartName\n" + " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ "Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info", result);+ }++ @Test+ public void testLocalProcedureStart32StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedureStart32StMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putByteLengthPrefixedUtf8String("LocalProcedureStartName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedureStart32StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROC32_ST: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " LocalProcedureStartName\n" + " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ "Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info", result);+ }++ @Test+ public void testLocalProcedureStart32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedureStart32MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putNullTerminatedUtf8String("LocalProcedureStartName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedureStart32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROC32: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " LocalProcedureStartName\n" + " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ "Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info", result);+ }++ @Test+ public void testGlobalProcedureStart16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalProcedureStart16MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedShort(0x100); // Procedure length+ writer.putUnsignedShort(0x10); // Debug start offset+ writer.putUnsignedShort(0x20); // Debug end offset+ writer.putUnsignedShort(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(4096); // Type index+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putByteLengthPrefixedUtf8String("GlobalProcedureStartName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalProcedureStart16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GPROC16: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " GlobalProcedureStartName\n" + " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ "Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info", result);+ }++ @Test+ public void testGlobalProcedureStart3216MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalProcedureStart3216MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(4096); // Type index+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putByteLengthPrefixedUtf8String("GlobalProcedureStartName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalProcedureStart3216MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GPROC32_16: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " GlobalProcedureStartName\n" + " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ "Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info", result);+ }++ @Test+ public void testGlobalProcedureStart32StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalProcedureStart32StMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putByteLengthPrefixedUtf8String("GlobalProcedureStartName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalProcedureStart32StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GPROC32_ST: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " GlobalProcedureStartName\n" + " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ "Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info", result);+ }++ @Test+ public void testGlobalProcedureStart32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalProcedureStart32MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putNullTerminatedUtf8String("GlobalProcedureStartName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalProcedureStart32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GPROC32: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " GlobalProcedureStartName\n" + " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ "Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info", result);+ }++ @Test+ public void testLocalProcedure32IdMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedure32IdMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putNullTerminatedUtf8String("LocalProcedure32IdName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedure32IdMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROC32_ID: [0001:00000030], Length: 00000100, ID: DummyMsType," ++ " LocalProcedure32IdName\n" + " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ "Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info", result);+ }++ @Test+ public void testGlobalProcedure32IdMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalProcedure32IdMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putNullTerminatedUtf8String("GlobalProcedure32IdName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalProcedure32IdMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GPROC32_ID: [0001:00000030], Length: 00000100, ID: DummyMsType," ++ " GlobalProcedure32IdName\n" + " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ "Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info", result);+ }++ @Test+ public void testLocalProcedureStart32DeferredProcedureCallMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedureStart32DeferredProcedureCallMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putNullTerminatedUtf8String("LocalProcedureStart32DeferredProcedureCallName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedureStart32DeferredProcedureCallMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROC32_DPC: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " LocalProcedureStart32DeferredProcedureCallName\n" + " Parent: 00000010," ++ " End: 00000010, Next: 00000010\n" + " Debug start: 00000010, Debug end: 00000020\n" ++ "Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info", result);+ }++ @Test+ public void testLocalProcedure32DeferredProcedureCallIdMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedure32DeferredProcedureCallIdMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putNullTerminatedUtf8String("LocalProcedure32DeferredProcedureCallIdName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedure32DeferredProcedureCallIdMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROC32_DPC_ID: [0001:00000030], Length: 00000100, ID: DummyMsType," ++ " LocalProcedure32DeferredProcedureCallIdName\n" + " Parent: 00000010," ++ " End: 00000010, Next: 00000010\n" + " Debug start: 00000010, Debug end: 00000020\n" ++ "Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info", result);+ }++ @Test+ public void testLocalProcedureStartMips16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedureStartMips16MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putUnsignedInt(0x55); // integer register save mask+ writer.putUnsignedInt(0xaa); // floating point register save mask+ writer.putUnsignedInt(0x50); // integer register save offset+ writer.putUnsignedInt(0xa0); // floating point register offset+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(4096); // Type index+ writer.putUnsignedByte(0x01); // Return value register+ writer.putUnsignedByte(0x01); // Frame pointer register+ writer.putByteLengthPrefixedUtf8String("LocalProcedureStartMipsName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedureStartMips16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROCMIPSSYM_16: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Reg Save: 00000055, FP Save: 000000AA, Int Offset: 00000050," ++ " FP Offset: 000000A0\n" + " Return Reg: al, Frame Reg: al", result);+ }++ @Test+ public void testLocalProcedureStartMipsStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedureStartMipsStMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putUnsignedInt(0x55); // integer register save mask+ writer.putUnsignedInt(0xaa); // floating point register save mask+ writer.putUnsignedInt(0x50); // integer register save offset+ writer.putUnsignedInt(0xa0); // floating point register offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedByte(0x01); // Return value register+ writer.putUnsignedByte(0x01); // Frame pointer register+ writer.putByteLengthPrefixedUtf8String("LocalProcedureStartMipsName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedureStartMipsStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROCMIPSSYM_ST: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Reg Save: 00000055, FP Save: 000000AA, Int Offset: 00000050," ++ " FP Offset: 000000A0\n" + " Return Reg: al, Frame Reg: al", result);+ }++ @Test+ public void testLocalProcedureStartMipsMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedureStartMipsMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putUnsignedInt(0x55); // integer register save mask+ writer.putUnsignedInt(0xaa); // floating point register save mask+ writer.putUnsignedInt(0x50); // integer register save offset+ writer.putUnsignedInt(0xa0); // floating point register offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedByte(0x01); // Return value register+ writer.putUnsignedByte(0x01); // Frame pointer register+ writer.putNullTerminatedUtf8String("LocalProcedureStartMipsName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedureStartMipsMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROCMIPSSYM: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Reg Save: 00000055, FP Save: 000000AA, Int Offset: 00000050," ++ " FP Offset: 000000A0\n" + " Return Reg: al, Frame Reg: al", result);+ }++ @Test+ public void testGlobalProcedureStartMips16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalProcedureStartMips16MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putUnsignedInt(0x55); // integer register save mask+ writer.putUnsignedInt(0xaa); // floating point register save mask+ writer.putUnsignedInt(0x50); // integer register save offset+ writer.putUnsignedInt(0xa0); // floating point register offset+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(4096); // Type index+ writer.putUnsignedByte(0x01); // Return value register+ writer.putUnsignedByte(0x01); // Frame pointer register+ writer.putByteLengthPrefixedUtf8String("GlobalProcedureStartMipsName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalProcedureStartMips16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GPROCMIPSSYM_16: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Reg Save: 00000055, FP Save: 000000AA, Int Offset: 00000050," ++ " FP Offset: 000000A0\n" + " Return Reg: al, Frame Reg: al", result);+ }++ @Test+ public void testGlobalProcedureStartMipsStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalProcedureStartMipsStMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putUnsignedInt(0x55); // integer register save mask+ writer.putUnsignedInt(0xaa); // floating point register save mask+ writer.putUnsignedInt(0x50); // integer register save offset+ writer.putUnsignedInt(0xa0); // floating point register offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedByte(0x01); // Return value register+ writer.putUnsignedByte(0x01); // Frame pointer register+ writer.putByteLengthPrefixedUtf8String("GlobalProcedureStartMipsName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalProcedureStartMipsStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GPROCMIPSSYM_ST: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Reg Save: 00000055, FP Save: 000000AA, Int Offset: 00000050," ++ " FP Offset: 000000A0\n" + " Return Reg: al, Frame Reg: al", result);+ }++ @Test+ public void testGlobalProcedureStartMipsMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalProcedureStartMipsMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putUnsignedInt(0x55); // integer register save mask+ writer.putUnsignedInt(0xaa); // floating point register save mask+ writer.putUnsignedInt(0x50); // integer register save offset+ writer.putUnsignedInt(0xa0); // floating point register offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedByte(0x01); // Return value register+ writer.putUnsignedByte(0x01); // Frame pointer register+ writer.putNullTerminatedUtf8String("GlobalProcedureStartMipsName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalProcedureStartMipsMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GPROCMIPSSYM: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Reg Save: 00000055, FP Save: 000000AA, Int Offset: 00000050," ++ " FP Offset: 000000A0\n" + " Return Reg: al, Frame Reg: al", result);+ }++ @Test+ public void testLocalProcedureMipsIdMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedureMipsIdMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putUnsignedInt(0x55); // integer register save mask+ writer.putUnsignedInt(0xaa); // floating point register save mask+ writer.putUnsignedInt(0x50); // integer register save offset+ writer.putUnsignedInt(0xa0); // floating point register offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedByte(0x01); // Return value register+ writer.putUnsignedByte(0x01); // Frame pointer register+ writer.putNullTerminatedUtf8String("LocalProcedureMipsIdName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedureMipsIdMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROCMIPSSYM_ID: [0001:00000030], Length: 00000100, ID: DummyMsType," ++ " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Reg Save: 00000055, FP Save: 000000AA, Int Offset: 00000050," ++ " FP Offset: 000000A0\n" + " Return Reg: al, Frame Reg: al", result);+ }++ @Test+ public void testGlobalProcedureMipsIdMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalProcedureMipsIdMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putUnsignedInt(0x55); // integer register save mask+ writer.putUnsignedInt(0xaa); // floating point register save mask+ writer.putUnsignedInt(0x50); // integer register save offset+ writer.putUnsignedInt(0xa0); // floating point register offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedByte(0x01); // Return value register+ writer.putUnsignedByte(0x01); // Frame pointer register+ writer.putNullTerminatedUtf8String("GlobalProcedureMipsIdName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalProcedureMipsIdMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GPROCMIPSSYM_ID: [0001:00000030], Length: 00000100, ID: DummyMsType," ++ " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Reg Save: 00000055, FP Save: 000000AA, Int Offset: 00000050," ++ " FP Offset: 000000A0\n" + " Return Reg: al, Frame Reg: al", result);+ }++ @Test+ public void testLocalProcedureStartIa64StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedureStartIa64StMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(0x01); // Return value register+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putByteLengthPrefixedUtf8String("LocalProcedureStartIa64Name");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedureStartIa64StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROCIA64_ST: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " LocalProcedureStartIa64Name Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info\n" ++ " Return Reg: al", result);+ }++ @Test+ public void testLocalProcedureStartIa64MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedureStartIa64MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(0x01); // Return value register+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putNullTerminatedUtf8String("LocalProcedureStartIa64Name");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedureStartIa64MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROCIA64: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " LocalProcedureStartIa64Name Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info\n" ++ " Return Reg: al", result);+ }++ @Test+ public void testGlobalProcedureStartIa64StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalProcedureStartIa64StMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(0x01); // Return value register+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putByteLengthPrefixedUtf8String("GlobalProcedureStartIa64Name");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalProcedureStartIa64StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GPROCIA64_ST: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " GlobalProcedureStartIa64Name Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info\n" ++ " Return Reg: al", result);+ }++ @Test+ public void testGlobalProcedureStartIa64MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalProcedureStartIa64MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(0x01); // Return value register+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putNullTerminatedUtf8String("GlobalProcedureStartIa64Name");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalProcedureStartIa64MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GPROCIA64: [0001:00000030], Length: 00000100, Type: DummyMsType," ++ " GlobalProcedureStartIa64Name Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info\n" ++ " Return Reg: al", result);+ }++ @Test+ public void testLocalProcedureIa64IdMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedureIa64IdMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(0x01); // Return value register+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putNullTerminatedUtf8String("LocalProcedureIa64IdName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedureIa64IdMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROCIA64_ID: [0001:00000030], Length: 00000100, ID: DummyMsType," ++ " LocalProcedureIa64IdName Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info\n" ++ " Return Reg: al", result);+ }++ @Test+ public void testGlobalProcedureIa64IdMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalProcedureIa64IdMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putInt(4096); // Type index+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(0x01); // Return value register+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putNullTerminatedUtf8String("GlobalProcedureIa64IdName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalProcedureIa64IdMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GPROCIA64_ID: [0001:00000030], Length: 00000100, ID: DummyMsType," ++ " GlobalProcedureIa64IdName Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info\n" ++ " Return Reg: al", result);+ }++ @Test+ public void testThunk16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Thunk16MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedShort(0x30); // Offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(1); // Length of thunk+ writer.putUnsignedByte(0x01); // Type of thunk (1=ADJUSTOR)+ writer.putByteLengthPrefixedUtf8String("ThunkName");+ //variant info (for ADJUSTOR)+ writer.putUnsignedShort(0x02); // unsigned short (variant)+ writer.putByteLengthPrefixedUtf8String("VariantString");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Thunk16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("THUNK16: [0001:00000030], Length: 00000001, ThunkName\n" ++ " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Type: Adjustor, Delta: 2, Target: VariantString", result);+ }++ @Test+ public void testThunkStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Thunk32StMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x30); // Offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(1); // Length of thunk+ writer.putUnsignedByte(0x01); // Type of thunk (1=ADJUSTOR)+ writer.putByteLengthPrefixedUtf8String("ThunkName");+ //variant info (for ADJUSTOR)+ writer.putUnsignedShort(0x02); // unsigned short (variant)+ writer.putByteLengthPrefixedUtf8String("VariantString");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Thunk32StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("THUNK32_ST: [0001:00000030], Length: 00000001, ThunkName\n" ++ " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Type: Adjustor, Delta: 2, Target: VariantString", result);+ }++ @Test+ public void testThunkMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Thunk32MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x30); // Offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(1); // Length of thunk+ writer.putUnsignedByte(0x01); // Type of thunk (1=ADJUSTOR)+ writer.putNullTerminatedUtf8String("ThunkName");+ //variant info (for ADJUSTOR)+ writer.putUnsignedShort(0x02); // unsigned short (variant)+ writer.putNullTerminatedUtf8String("VariantString");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Thunk32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("THUNK32: [0001:00000030], Length: 00000001, ThunkName\n" ++ " Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Type: Adjustor, Delta: 2, Target: VariantString", result);+ }++ @Test+ public void testBlock16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Block16MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedShort(0x10); // Block length+ writer.putUnsignedShort(0x30); // Offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putByteLengthPrefixedUtf8String("BlockName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Block16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("BLOCK16: [0001:00000030], Length: 00000010, BlockName\n" ++ " Parent: 00000010, End: 00000010", result);+ }++ @Test+ public void testBlock32StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Block32StMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // Block length+ writer.putUnsignedInt(0x30); // Offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putByteLengthPrefixedUtf8String("BlockName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Block32StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("BLOCK32_ST: [0001:00000030], Length: 00000010, BlockName\n" ++ " Parent: 00000010, End: 00000010", result);+ }++ @Test+ public void testBlock32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Block32MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // Block length+ writer.putUnsignedInt(0x30); // Offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putNullTerminatedUtf8String("BlockName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Block32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("BLOCK32: [0001:00000030], Length: 00000010, BlockName\n" ++ " Parent: 00000010, End: 00000010", result);+ }++ @Test+ public void testWith16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(With16MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedShort(0x10); // Block length+ writer.putUnsignedShort(0x30); // Offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putByteLengthPrefixedUtf8String("WithExpression");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof With16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("WITH16: [0001:00000030], Length: 00000010, WithExpression\n" ++ " Parent: 00000010, End: 00000010", result);+ }++ @Test+ public void testWith32StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(With32StMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // Block length+ writer.putUnsignedInt(0x30); // Offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putByteLengthPrefixedUtf8String("WithExpression");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof With32StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("WITH32_ST: [0001:00000030], Length: 00000010, WithExpression\n" ++ " Parent: 00000010, End: 00000010", result);+ }++ @Test+ public void testWith32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(With32MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // Block length+ writer.putUnsignedInt(0x30); // Offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putNullTerminatedUtf8String("WithExpression");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof With32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("WITH32: [0001:00000030], Length: 00000010, WithExpression\n" ++ " Parent: 00000010, End: 00000010", result);+ }++ @Test+ public void testLabel16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Label16MsSymbol.PDB_ID);+ writer.putUnsignedShort(0x30); // Offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putByteLengthPrefixedUtf8String("LabelName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Label16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LABEL16: [0001:00000030], LabelName Flags: Frame Ptr Present, Interrupt," ++ " FAR, Never Return, Not Reached, Custom Calling Convention, Do Not Inline," ++ " Optimized Debug Info", result);+ }++ @Test+ public void testLabel32StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Label32StMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x30); // Offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putByteLengthPrefixedUtf8String("LabelName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Label32StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LABEL32_ST: [0001:00000030], LabelName Flags: Frame Ptr Present, Interrupt," ++ " FAR, Never Return, Not Reached, Custom Calling Convention, Do Not Inline," ++ " Optimized Debug Info", result);+ }++ @Test+ public void testLabel32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Label32MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x30); // Offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putNullTerminatedUtf8String("LabelName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Label32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LABEL32: [0001:00000030], LabelName Flags: Frame Ptr Present, Interrupt," ++ " FAR, Never Return, Not Reached, Custom Calling Convention, Do Not Inline," ++ " Optimized Debug Info", result);+ }++ @Test+ public void testChangeExecutionModel16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ChangeExecutionModel16MsSymbol.PDB_ID);+ writer.putUnsignedShort(0x30); // Offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(0x40); // Execution model (0x40=PCODE)+ writer.putUnsignedShort(0x10); // pcode: offset to pcode function table+ writer.putUnsignedShort(0x20); // pcode: offset to segment pcode information+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ChangeExecutionModel16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("CEXMODEL16:\n" + " segment, offset = 0001:00000030, model = PCODE\n" ++ "offsetToPcodeFunctionTable = 00000010," ++ " offsetToSegmentPcodeInformation = 00000020", result);+ }++ @Test+ public void testChangeExecutionModel32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ChangeExecutionModel32MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x30); // Offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(0x40); // Execution model (0x40=PCODE)+ writer.putUnsignedInt(0x10); // pcode: offset to pcode function table+ writer.putUnsignedInt(0x20); // pcode: offset to segment pcode information+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ChangeExecutionModel32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("CEXMODEL32:\n" + " segment, offset = 0001:00000030, model = PCODE\n" ++ "offsetToPcodeFunctionTable = 00000010," ++ " offsetToSegmentPcodeInformation = 00000020", result);+ }++ @Test+ public void testVirtualFunctionTable16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(VirtualFunctionTable16MsSymbol.PDB_ID);+ writer.putUnsignedShort(0x10); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(4096); // root+ writer.putUnsignedShort(4096); // path+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof VirtualFunctionTable16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("VFTABLE16: [0001:00000010], DummyMsType:DummyMsType", result);+ }++ @Test+ public void testVirtualFunctionTable3216MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(VirtualFunctionTable3216MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ writer.putUnsignedShort(4096); // root+ writer.putUnsignedShort(4096); // path+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof VirtualFunctionTable3216MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("VFTABLE32_16: [0001:00000010], DummyMsType:DummyMsType", result);+ }++ @Test+ public void testVirtualFunctionTable32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(VirtualFunctionTable32MsSymbol.PDB_ID);+ writer.putUnsignedInt(4096); // root+ writer.putUnsignedInt(4096); // path+ writer.putUnsignedInt(0x10); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof VirtualFunctionTable32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("VFTABLE32: [0001:00000010], DummyMsType:DummyMsType", result);+ }++ @Test+ public void testRegisterRelativeAddress16MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(RegisterRelativeAddress16MsSymbol.PDB_ID);+ writer.putUnsignedShort(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Register index+ writer.putUnsignedShort(4096); // Type index+ writer.putByteLengthPrefixedUtf8String("RegisterRelativeAddressName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof RegisterRelativeAddress16MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("REGREL16: al+00000030, Type: DummyMsType, RegisterRelativeAddressName",+ result);+ }++ @Test+ public void testRegisterRelativeAddress3216MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(RegisterRelativeAddress3216MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putUnsignedShort(1); // Register index+ writer.putUnsignedShort(4096); // Type index+ writer.putByteLengthPrefixedUtf8String("RegisterRelativeAddressName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof RegisterRelativeAddress3216MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("REGREL32_16: al+00000030, Type: DummyMsType, RegisterRelativeAddressName",+ result);+ }++ @Test+ public void testRegisterRelativeAddress32StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(RegisterRelativeAddress32StMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putInt(4096); // Type index+ writer.putUnsignedShort(1); // Register index+ writer.putByteLengthPrefixedUtf8String("RegisterRelativeAddressName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof RegisterRelativeAddress32StMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("REGREL32_ST: al+00000030, Type: DummyMsType, RegisterRelativeAddressName",+ result);+ }++ @Test+ public void testRegisterRelativeAddress32MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(RegisterRelativeAddress32MsSymbol.PDB_ID);+ writer.putUnsignedInt(0x30); // offset of symbol+ writer.putInt(4096); // Type index+ writer.putUnsignedShort(1); // Register index+ writer.putNullTerminatedUtf8String("RegisterRelativeAddressName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof RegisterRelativeAddress32MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("REGREL32: al+00000030, Type: DummyMsType, RegisterRelativeAddressName",+ result);+ }++ @Test+ public void testStaticLinkForMipsExceptionHandlingMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(StaticLinkForMipsExceptionHandlingMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // frame size of parent procedure+ writer.putUnsignedInt(0x20); // offset of symbol+ writer.putUnsignedShort(1); // Register+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof StaticLinkForMipsExceptionHandlingMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("SLINK32: framesize = 00000010, offset = 00000020, register = al", result);+ }++ @Test+ public void testProcedureReferenceStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ProcedureReferenceStMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // frame size of parent procedure+ writer.putUnsignedInt(0x20); // offset of symbol+ writer.putUnsignedShort(1); // module containing the symbol+ writer.putAlign(0);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ProcedureReferenceStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("PROCREF_ST: 00000010: ( 1, 00000020)", result);+ }++ @Test+ public void testDataReferenceStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(DataReferenceStMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // frame size of parent procedure+ writer.putUnsignedInt(0x20); // offset of symbol+ writer.putUnsignedShort(1); // module containing the symbol+ writer.putAlign(0);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof DataReferenceStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("DATAREF_ST: 00000010: ( 1, 00000020)", result);+ }++ @Test+ public void testLocalProcedureReferenceStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedureReferenceStMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // frame size of parent procedure+ writer.putUnsignedInt(0x20); // offset of symbol+ writer.putUnsignedShort(1); // module containing the symbol+ writer.putAlign(0);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedureReferenceStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROCREF_ST: 00000010: ( 1, 00000020)", result);+ }++ @Test+ public void testProcedureReferenceMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ProcedureReferenceMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // frame size of parent procedure+ writer.putUnsignedInt(0x20); // offset of symbol+ writer.putUnsignedShort(1); // module containing the symbol+ writer.putNullTerminatedUtf8String("ProcedureReferenceName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ProcedureReferenceMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("PROCREF: 00000010: ( 1, 00000020) ProcedureReferenceName", result);+ }++ @Test+ public void testDataReferenceMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(DataReferenceMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // frame size of parent procedure+ writer.putUnsignedInt(0x20); // offset of symbol+ writer.putUnsignedShort(1); // module containing the symbol+ writer.putNullTerminatedUtf8String("DataReferenceName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof DataReferenceMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("DATAREF: 00000010: ( 1, 00000020) DataReferenceName", result);+ }++ @Test+ public void testLocalProcedureReferenceMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalProcedureReferenceMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // frame size of parent procedure+ writer.putUnsignedInt(0x20); // offset of symbol+ writer.putUnsignedShort(1); // module containing the symbol+ writer.putNullTerminatedUtf8String("LocalProcedureReferenceName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalProcedureReferenceMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LPROCREF: 00000010: ( 1, 00000020) LocalProcedureReferenceName", result);+ }++ @Test+ public void testAnnotationReferenceMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(AnnotationReferenceMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // frame size of parent procedure+ writer.putUnsignedInt(0x20); // offset of symbol+ writer.putUnsignedShort(1); // module containing the symbol+ writer.putNullTerminatedUtf8String("AnnotationReferenceName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof AnnotationReferenceMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("ANNOTATIONREF: 00000010: ( 1, 00000020) AnnotationReferenceName", result);+ }++ @Test+ public void testTokenReferenceToManagedProcedureMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(TokenReferenceToManagedProcedureMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // frame size of parent procedure+ writer.putUnsignedInt(0x20); // offset of symbol+ writer.putUnsignedShort(1); // module containing the symbol+ writer.putNullTerminatedUtf8String("TokenReferenceName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof TokenReferenceToManagedProcedureMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("TOKENREF: 00000010: ( 1, 00000020) TokenReferenceName", result);+ }++ @Test+ public void testAlignMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(AlignMsSymbol.PDB_ID);+ writer.putBytes(new byte[] { 0x00, 0x00 }); // Putting data, but might never be any.+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof AlignMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("Align Record, Length = 0x2", result);+ }++ @Test+ public void testOemDefinedMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(OemDefinedMsSymbol.PDB_ID);+ // SS_OEMID GUID (from API doc)+ writer.putUnsignedInt(0xc6ea3fc9);+ writer.putUnsignedShort(0x59b3);+ writer.putUnsignedShort(0x49d6);+ writer.putBytes(new byte[] { (byte) 0xbc, 0x25, 0x09, 0x02, (byte) 0xbb, (byte) 0xab,+ (byte) 0xb4, 0x60 });+ writer.putInt(4096); // Type index+ writer.putBytes(new byte[] { 0x01, 0x02, 0x03, 0x04 }); // User data, with align 4+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof OemDefinedMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals(+ "OEM: c6ea3fc9-59b3-49d6-bc25-0902bbabb460, Type DummyMsType\n" + " 04030201",+ result);+ }++ @Test+ public void testLocalIntermediateLanguageSymbolWithLocalSlotIndexFieldStMsSymbol()+ throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(+ LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldStMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // slot index+ writer.putInt(4096); // type index or metadata token+ writer.putByteLengthPrefixedUtf8String("LocalSlotName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(+ symbol instanceof LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldStMsSymbol,+ true);+ String result = symbol.toString().trim();+ assertEquals("LOCALSLOT_ST: [00000010], Type: DummyMsType, LocalSlotName", result);+ }++ @Test+ public void testLocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol()+ throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(+ LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // slot index+ writer.putInt(4096); // type index or metadata token+ writer.putNullTerminatedUtf8String("LocalSlotName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(+ symbol instanceof LocalIntermediateLanguageSymbolWithLocalSlotIndexFieldMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LOCALSLOT: [00000010], Type: DummyMsType, LocalSlotName", result);+ }++ @Test+ public void testLocalIntermediateLanguageSymbolWithParameterSlotIndexFieldStMsSymbol()+ throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(+ LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldStMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // slot index+ writer.putInt(4096); // type index or metadata token+ writer.putByteLengthPrefixedUtf8String("ParamSlotName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(+ symbol instanceof LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldStMsSymbol,+ true);+ String result = symbol.toString().trim();+ assertEquals("PARAMSLOT_ST: [00000010], Type: DummyMsType, ParamSlotName", result);+ }++ @Test+ public void testLocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol()+ throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(+ LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // slot index+ writer.putInt(4096); // type index or metadata token+ writer.putNullTerminatedUtf8String("ParamSlotName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(+ symbol instanceof LocalIntermediateLanguageSymbolWithParameterSlotIndexFieldMsSymbol,+ true);+ String result = symbol.toString().trim();+ assertEquals("PARAMSLOT: [00000010], Type: DummyMsType, ParamSlotName", result);+ }++ @Test+ public void testAnnotationMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(AnnotationMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x3000); // Offset+ writer.putUnsignedShort(1); // Segment+ writer.putUnsignedShort(3); // Count of annotation strings+ writer.putNullTerminatedUtf8String("Annotation0Name");+ writer.putNullTerminatedUtf8String("Annotation1Name");+ writer.putNullTerminatedUtf8String("Annotation2Name");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof AnnotationMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("ANNOTATION: [0001:00003000]\n" + " 0: Annotation0Name\n" ++ " 1: Annotation1Name\n" + " 2: Annotation2Name", result);+ }++ @Test+ public void testReserved1MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Reserved1MsSymbol.PDB_ID);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Reserved1MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("RESERVED1", result);+ }++ @Test+ public void testReserved2MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Reserved2MsSymbol.PDB_ID);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Reserved2MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("RESERVED2", result);+ }++ @Test+ public void testReserved3MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Reserved3MsSymbol.PDB_ID);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Reserved3MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("RESERVED3", result);+ }++ @Test+ public void testReserved4MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Reserved4MsSymbol.PDB_ID);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof Reserved4MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("RESERVED4", result);+ }++ @Test+ public void testLocalManagedProcedureStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalManagedProcedureStMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putUnsignedInt(0x10000); // Token+ writer.putUnsignedInt(0x3000); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putUnsignedShort(0x01); // Return register+ writer.putByteLengthPrefixedUtf8String("LocalManagedProcedureName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalManagedProcedureStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LMANPROC_ST: [0001:00003000], Length: 00000100, Token: 65536," ++ " LocalManagedProcedureName Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info\n" ++ " Return Reg: al", result);+ }++ @Test+ public void testLocalManagedProcedureMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalManagedProcedureMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putUnsignedInt(0x10000); // Token+ writer.putUnsignedInt(0x3000); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putUnsignedShort(0x01); // Return register+ writer.putNullTerminatedUtf8String("LocalManagedProcedureName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalManagedProcedureMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LMANPROC: [0001:00003000], Length: 00000100, Token: 65536," ++ " LocalManagedProcedureName Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info\n" ++ " Return Reg: al", result);+ }++ @Test+ public void testGlobalManagedProcedureStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalManagedProcedureStMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putUnsignedInt(0x10000); // Token+ writer.putUnsignedInt(0x3000); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putUnsignedShort(0x01); // Return register+ writer.putByteLengthPrefixedUtf8String("GlobalManagedProcedureName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalManagedProcedureStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GMANPROC_ST: [0001:00003000], Length: 00000100, Token: 65536," ++ " GlobalManagedProcedureName Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info\n" ++ " Return Reg: al", result);+ }++ @Test+ public void testGlobalManagedProcedureMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(GlobalManagedProcedureMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x10); // pointer to next symbol+ writer.putUnsignedInt(0x100); // Procedure length+ writer.putUnsignedInt(0x10); // Debug start offset+ writer.putUnsignedInt(0x20); // Debug end offset+ writer.putUnsignedInt(0x10000); // Token+ writer.putUnsignedInt(0x3000); // offset of symbol+ writer.putUnsignedShort(1); // Segment of symbol+ byte[] procflags =+ createProcedureMsFlagsBuffer(true, true, true, true, true, true, true, true);+ writer.putBytes(procflags);+ writer.putUnsignedShort(0x01); // Return register+ writer.putNullTerminatedUtf8String("GlobalManagedProcedureName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof GlobalManagedProcedureMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("GMANPROC: [0001:00003000], Length: 00000100, Token: 65536," ++ " GlobalManagedProcedureName Parent: 00000010, End: 00000010, Next: 00000010\n" ++ " Debug start: 00000010, Debug end: 00000020\n" ++ " Flags: Frame Ptr Present, Interrupt, FAR, Never Return, Not Reached," ++ " Custom Calling Convention, Do Not Inline, Optimized Debug Info\n" ++ " Return Reg: al", result);+ }++ @Test+ public void testManagedLocalOrParameterRelativeToVirtualFramePointerStMsSymbol()+ throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(+ ManagedLocalOrParameterRelativeToVirtualFramePointerStMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x3000); // Frame-relative offset+ writer.putInt(4096); // type index or mdatadata token+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putByteLengthPrefixedUtf8String("ManagedFrameName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(+ symbol instanceof ManagedLocalOrParameterRelativeToVirtualFramePointerStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANFRAMEREL_ST: [00003000], [0001:00001000]: Param: 4096 Address Taken," ++ " Compiler Generated, aggregate, aggregated, aliased, alias, return value," ++ " optimized away, file static ManagedFrameName", result);+ }++ @Test+ public void testManagedLocalOrParameterRelativeToVirtualFramePointerMsSymbol()+ throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(+ ManagedLocalOrParameterRelativeToVirtualFramePointerMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x3000); // Frame-relative offset+ writer.putInt(4096); // type index or mdatadata token+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putNullTerminatedUtf8String("ManagedFrameName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ManagedLocalOrParameterRelativeToVirtualFramePointerMsSymbol,+ true);+ String result = symbol.toString().trim();+ assertEquals("MANFRAMEREL: [00003000], [0001:00001000]: Param: 4096 Address Taken," ++ " Compiler Generated, aggregate, aggregated, aliased, alias, return value," ++ " optimized away, file static ManagedFrameName", result);+ }++ @Test+ public void testAttributedLocalOrParameterRelativeToVirtualFramePointerMsSymbol()+ throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(+ AttributedLocalOrParameterRelativeToVirtualFramePointerMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x3000); // Frame-relative offset+ writer.putInt(4096); // type index or mdatadata token+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putNullTerminatedUtf8String("AttributedFrameName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(+ symbol instanceof AttributedLocalOrParameterRelativeToVirtualFramePointerMsSymbol,+ true);+ String result = symbol.toString().trim();+ assertEquals("ATTR_MANFRAMEREL: [00003000], [0001:00001000]: Param: 4096 Address Taken," ++ " Compiler Generated, aggregate, aggregated, aliased, alias, return value," ++ " optimized away, file static AttributedFrameName", result);+ }++ @Test+ public void testManagedLocalOrParameterStoredInRegisterStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ManagedLocalOrParameterStoredInRegisterStMsSymbol.PDB_ID);+ writer.putInt(4096); // type index or mdatadata token+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putUnsignedShort(1); // Register+ writer.putByteLengthPrefixedUtf8String("ManagedRegisterName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ManagedLocalOrParameterStoredInRegisterStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANREGISTER_ST: al, [0001:00001000]: Param: 4096 Address Taken," ++ " Compiler Generated, aggregate, aggregated, aliased, alias, return value," ++ " optimized away, file static ManagedRegisterName", result);+ }++ @Test+ public void testManagedLocalOrParameterStoredInRegisterMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ManagedLocalOrParameterStoredInRegisterMsSymbol.PDB_ID);+ writer.putInt(4096); // type index or mdatadata token+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putUnsignedShort(1); // Register+ writer.putNullTerminatedUtf8String("ManagedRegisterName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ManagedLocalOrParameterStoredInRegisterMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANREGISTER: al, [0001:00001000]: Param: 4096 Address Taken," ++ " Compiler Generated, aggregate, aggregated, aliased, alias, return value," ++ " optimized away, file static ManagedRegisterName", result);+ }++ @Test+ public void testAttributedLocalOrParameterStoredInRegisterMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(AttributedLocalOrParameterStoredInRegisterMsSymbol.PDB_ID);+ writer.putInt(4096); // type index or mdatadata token+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putUnsignedShort(1); // Register+ writer.putNullTerminatedUtf8String("AttributedRegisterName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof AttributedLocalOrParameterStoredInRegisterMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("ATTR_REGISTER: al, [0001:00001000]: Param: 4096 Address Taken," ++ " Compiler Generated, aggregate, aggregated, aliased, alias, return value," ++ " optimized away, file static AttributedRegisterName", result);+ }++ @Test+ public void testManagedSymbolWithSlotIndexFieldStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ManagedSymbolWithSlotIndexFieldStMsSymbol.PDB_ID);+ writer.putUnsignedInt(1); // Slot index+ writer.putInt(4096); // type index or mdatadata token+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putByteLengthPrefixedUtf8String("ManagedSlotName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ManagedSymbolWithSlotIndexFieldStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANSLOT_ST: 1, [0001:00001000]: Param: 4096 Address Taken," ++ " Compiler Generated, aggregate, aggregated, aliased, alias, return value," ++ " optimized away, file static ManagedSlotName", result);+ }++ @Test+ public void testManagedSymbolWithSlotIndexFieldMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ManagedSymbolWithSlotIndexFieldMsSymbol.PDB_ID);+ writer.putUnsignedInt(1); // Slot index+ writer.putInt(4096); // type index or mdatadata token+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putNullTerminatedUtf8String("ManagedSlotName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ManagedSymbolWithSlotIndexFieldMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANSLOT: 1, [0001:00001000]: Param: 4096 Address Taken," ++ " Compiler Generated, aggregate, aggregated, aliased, alias, return value," ++ " optimized away, file static ManagedSlotName", result);+ }++ @Test+ public void testManagedLocalOrParameterStoredInManyRegisterStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ManagedLocalOrParameterStoredInManyRegisterStMsSymbol.PDB_ID);+ writer.putInt(4096); // type index or mdatadata token+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putUnsignedByte(3); // Number of registers+ writer.putUnsignedByte(1); // Register+ writer.putUnsignedByte(2); // Register+ writer.putUnsignedByte(3); // Register+ writer.putByteLengthPrefixedUtf8String("ManagedManyRegisterName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ManagedLocalOrParameterStoredInManyRegisterStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANMANYREG_ST: al, cl, dl DummyMsType ManagedManyRegisterName", result);+ }++ @Test+ public void testManagedLocalOrParameterStoredInManyRegisterMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ManagedLocalOrParameterStoredInManyRegisterMsSymbol.PDB_ID);+ writer.putInt(4096); // type index or mdatadata token+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putUnsignedByte(3); // Number of registers+ writer.putUnsignedByte(1); // Register+ writer.putUnsignedByte(2); // Register+ writer.putUnsignedByte(3); // Register+ writer.putNullTerminatedUtf8String("ManagedManyRegisterName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ManagedLocalOrParameterStoredInManyRegisterMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANMANYREG: al, cl, dl DummyMsType ManagedManyRegisterName", result);+ }++ @Test+ public void testManagedLocalOrParameterStoredInManyRegister2StMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ManagedLocalOrParameterStoredInManyRegister2StMsSymbol.PDB_ID);+ writer.putInt(4096); // type index or mdatadata token+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putUnsignedShort(3); // Number of registers+ writer.putUnsignedShort(1); // Register+ writer.putUnsignedShort(2); // Register+ writer.putUnsignedShort(3); // Register+ writer.putByteLengthPrefixedUtf8String("ManagedManyRegister2Name");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ManagedLocalOrParameterStoredInManyRegister2StMsSymbol,+ true);+ String result = symbol.toString().trim();+ assertEquals("MANMANYREG2_ST: al, cl, dl DummyMsType ManagedManyRegister2Name", result);+ }++ @Test+ public void testManagedLocalOrParameterStoredInManyRegister2MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ManagedLocalOrParameterStoredInManyRegister2MsSymbol.PDB_ID);+ writer.putInt(4096); // type index or mdatadata token+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putUnsignedShort(3); // Number of registers+ writer.putUnsignedShort(1); // Register+ writer.putUnsignedShort(2); // Register+ writer.putUnsignedShort(3); // Register+ writer.putNullTerminatedUtf8String("ManagedManyRegister2Name");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ManagedLocalOrParameterStoredInManyRegister2MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANMANYREG2: al, cl, dl DummyMsType ManagedManyRegister2Name", result);+ }++ @Test+ public void testAttributedLocalOrParameterStoredInManyRegisterMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(AttributedLocalOrParameterStoredInManyRegisterMsSymbol.PDB_ID);+ writer.putInt(4096); // type index or mdatadata token+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putUnsignedShort(3); // Number of registers+ writer.putUnsignedShort(1); // Register+ writer.putUnsignedShort(2); // Register+ writer.putUnsignedShort(3); // Register+ writer.putNullTerminatedUtf8String("ManagedManyRegister2Name");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof AttributedLocalOrParameterStoredInManyRegisterMsSymbol,+ true);+ String result = symbol.toString().trim();+ assertEquals("ATTR_MANYREG: al, cl, dl DummyMsType ManagedManyRegister2Name", result);+ }++ @Test+ public void testManagedLocalOrParameterRelativeToAlternateFramePointerStMsSymbol()+ throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(+ ManagedLocalOrParameterRelativeToAlternateFramePointerStMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x3000); // Frame-relative offset+ writer.putInt(4096); // type index or mdatadata token+ writer.putUnsignedShort(1); // Register index+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putByteLengthPrefixedUtf8String("ManagedAltFrameName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(+ symbol instanceof ManagedLocalOrParameterRelativeToAlternateFramePointerStMsSymbol,+ true);+ String result = symbol.toString().trim();+ assertEquals("MANREGREL_ST: al+00003000, [0001:00001000]: Param: 4096 Address Taken," ++ " Compiler Generated, aggregate, aggregated, aliased, alias, return value," ++ " optimized away, file static, ManagedAltFrameName", result);+ }++ @Test+ public void testManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol()+ throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(+ ManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x3000); // Frame-relative offset+ writer.putInt(4096); // type index or mdatadata token+ writer.putUnsignedShort(1); // Register index+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putNullTerminatedUtf8String("ManagedAltFrameName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(+ symbol instanceof ManagedLocalOrParameterRelativeToAlternateFramePointerMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANREGREL: al+00003000, [0001:00001000]: Param: 4096 Address Taken," ++ " Compiler Generated, aggregate, aggregated, aliased, alias, return value," ++ " optimized away, file static, ManagedAltFrameName", result);+ }++ @Test+ public void testAttributedLocalOrParameterRelativeToAlternateFramePointerMsSymbol()+ throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(+ AttributedLocalOrParameterRelativeToAlternateFramePointerMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x3000); // Frame-relative offset+ writer.putInt(4096); // type index or mdatadata token+ writer.putUnsignedShort(1); // Register index+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ byte[] attributesBuffer = createLocalVariableAttributesBuffer(0x1000, 1, localVarFlags);+ writer.putBytes(attributesBuffer);+ writer.putNullTerminatedUtf8String("AttributedAltFrameName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(+ symbol instanceof AttributedLocalOrParameterRelativeToAlternateFramePointerMsSymbol,+ true);+ String result = symbol.toString().trim();+ assertEquals("ATTR_REGREL: al+00003000, [0001:00001000]: Param: 4096 Address Taken," ++ " Compiler Generated, aggregate, aggregated, aliased, alias, return value," ++ " optimized away, file static, AttributedAltFrameName", result);+ }++ @Test+ public void testIndexForTypeReferencedByNameFromMetadataMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(IndexForTypeReferencedByNameFromMetadataMsSymbol.PDB_ID);+ writer.putInt(4096); // type index or mdatadata token+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof IndexForTypeReferencedByNameFromMetadataMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MANTYPEREF: DummyMsType", result);+ }++ @Test+ public void testUsingNamespaceStMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(UsingNamespaceStMsSymbol.PDB_ID);+ writer.putByteLengthPrefixedUtf8String("UsingNamespaceName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof UsingNamespaceStMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("UNAMESPACE_ST: UsingNamespaceName", result);+ }++ @Test+ public void testUsingNamespaceMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(UsingNamespaceMsSymbol.PDB_ID);+ writer.putNullTerminatedUtf8String("UsingNamespaceName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof UsingNamespaceMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("UNAMESPACE: UsingNamespaceName", result);+ }++ @Test+ public void testTrampolineMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(TrampolineMsSymbol.PDB_ID);+ writer.putUnsignedShort(1); // trampoline subtype+ writer.putUnsignedShort(0x10); // size of thunk+ writer.putUnsignedInt(0x1000); // thunk offset+ writer.putUnsignedInt(0x2000); // thunk target offset+ writer.putUnsignedShort(1); // section index of thunk+ writer.putUnsignedShort(1); // section index of thunk target+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof TrampolineMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals(+ "TRAMPOLINE: subtype BranchIsland, code size = 16 bytes\n" ++ " Thunk address: [0001:00001000]\n" + " Thunk target: [0001:00002000]",+ result);+ }++ @Test+ public void testSeparatedCodeFromCompilerSupportMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(SeparatedCodeFromCompilerSupportMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // pointer to the parent+ writer.putUnsignedInt(0x10); // pointer to this block's end+ writer.putUnsignedInt(0x100); // count of bytes in block+ writer.putUnsignedInt(0x03); // flags+ writer.putUnsignedInt(0x1000); // Offset of separated code+ writer.putUnsignedInt(0x1000); // Offset of parent of enclosing scope+ writer.putUnsignedShort(1); // Section of separated code+ writer.putUnsignedShort(1); // Section of parent of enclosing scope+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof SeparatedCodeFromCompilerSupportMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals(+ "SEPCODE: [0001:00001000], Length: 00000100, Parent: 00000010, End: 00000010\n" ++ " Parent scope beings: [0001:00001000]\n" ++ " Separated code flags: lexscope retparent",+ result);+ }++ @Test+ public void testLocalSymbolInOptimizedCode2005MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalSymbolInOptimizedCode2005MsSymbol.PDB_ID);+ writer.putInt(4096); // type index+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ writer.putBytes(localVarFlags);+ writer.putNullTerminatedUtf8String("LocalSymbolInOptimizedCode2005Name");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalSymbolInOptimizedCode2005MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LOCAL_2005: Param: 00001000 Address Taken, Compiler Generated, aggregate," ++ " aggregated, aliased, alias, return value, optimized away, file static," ++ " LocalSymbolInOptimizedCode2005Name", result);+ //LOCAL_2005: Param: 00001000 Address Taken, Compiler Generated, aggregate, aggregated, aliased, alias, return value, optimized away, file static, LocalSymbolInOptimizedCode2005Name+ }++ @Test+ public void testLocalSymbolInOptimizedCodeMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalSymbolInOptimizedCodeMsSymbol.PDB_ID);+ writer.putInt(4096); // type index+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ writer.putBytes(localVarFlags);+ writer.putNullTerminatedUtf8String("LocalSymbolInOptimizedCodeName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalSymbolInOptimizedCodeMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LOCAL: Param: 00001000 Address Taken, Compiler Generated, aggregate," ++ " aggregated, aliased, alias, return value, optimized away, file static," ++ " LocalSymbolInOptimizedCodeName", result);+ //LOCAL: Param: 00001000 Address Taken, Compiler Generated, aggregate, aggregated, aliased, alias, return value, optimized away, file static, LocalSymbolInOptimizedCodeName+ }++ @Test+ public void testDefinedSingleAddressRange2005MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(DefinedSingleAddressRange2005MsSymbol.PDB_ID);+ // API not given; writing dummy data here.+ writer.putBytes(new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 });+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof DefinedSingleAddressRange2005MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("DEFRAMGE_2005: <NO API DETAILS, 8 BYTES>", result);+ }++ @Test+ public void testDefinedMultipleAddressRanges2005MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(DefinedMultipleAddressRanges2005MsSymbol.PDB_ID);+ // API not given; writing dummy data here.+ writer.putBytes(new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 });+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof DefinedMultipleAddressRanges2005MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("DEFRAMGE2_2005: <NO API DETAILS, 8 BYTES>", result);+ }++ @Test+ public void testPeCoffSectionMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(PeCoffSectionMsSymbol.PDB_ID);+ writer.putUnsignedShort(1); // Section number+ writer.putUnsignedByte(16); // power-of-2 alignment of this section+ writer.putUnsignedByte(0x00); // reserved (must be zero)+ writer.putUnsignedInt(0); // rva (?)+ writer.putUnsignedInt(0x100); // cb (probably length?)+ writer.putUnsignedInt(0x05); // characteristics+ writer.putNullTerminatedUtf8String("PeCoffSectionName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof PeCoffSectionMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("SECTION: [0001], RVA = 00000000, Length = 00000100, Align = 00000010," ++ " Characteristics = 00000005, PeCoffSectionName", result);+ }++ @Test+ public void testPeCoffGroupMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(PeCoffGroupMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x100); // cb (probably length?)+ writer.putUnsignedInt(0x05); // characteristics+ writer.putUnsignedInt(0x1000); // Offset+ writer.putUnsignedShort(1); // Segment+ writer.putNullTerminatedUtf8String("PeCoffGroupName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof PeCoffGroupMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("COFFGROUP: [0001:00001000], Length = 00000100, Characteristics = 00000005," ++ " PeCoffGroupName", result);+ }++ @Test+ public void testExportMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ExportMsSymbol.PDB_ID);+ writer.putUnsignedShort(1); // Ordinal+ writer.putUnsignedShort(0x2f); // flags+ writer.putNullTerminatedUtf8String("ExportName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ExportMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("EXPORT: Ordinal = 1 (implicit), CONSTANT, DATA, PRIVATE, NONAME," ++ " FORWARDER, ExportName", result);+ }++ @Test+ public void testIndirectCallSiteInfoMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(IndirectCallSiteInfoMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x1000); // Offset+ writer.putUnsignedShort(1); // Section+ writer.putUnsignedShort(0x00); // Reserved (must be zero)+ writer.putUnsignedInt(4096); // type index+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof IndirectCallSiteInfoMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("CALLSITEINFO: [0001:00001000], Type = DummyMsType", result);+ }++ @Test+ public void testFrameSecurityCookieMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(FrameSecurityCookieMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x1000); // Offset+ writer.putUnsignedShort(1); // Register index+ // One real data example seems to indicate cookie type is only one byte (for the enum)+ writer.putUnsignedByte(0x00); // cookie type (valid values seem to be 0, 1, 2, 3)+ writer.putUnsignedByte(0x55); // flags+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof FrameSecurityCookieMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("FRAMECOOKIE: al+00001000, Type: COPY, 55", result);+ }++ @Test+ public void testDiscardedByLinkMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(DiscardedByLinkMsSymbol.PDB_ID);+ writer.putUnsignedInt(1); // "discarded" enum value (0, 1, 2?)+ writer.putUnsignedInt(1); // first file ID if line number present+ writer.putUnsignedInt(234); // first line number+ // original records with invalid type indices follow. I made up information here+ // based on what I coded in the type under test, which I admit is not correct. Need+ // to see some real data to understand this symbol type better.+ byte[] symbolBuffer = createRegister16MsSymbolBuffer();+ writer.putUnsignedShort(symbolBuffer.length);+ writer.putBytes(symbolBuffer);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof DiscardedByLinkMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("DISCARDED: Not selected, FileId: 00000001, Line: 234\n" ++ "REGISTER_16: al:cl, Type: DummyMsType, registerSymbolName", result);+ }++ @Test+ public void testDefinedSingleAddressRangeMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(DefinedSingleAddressRangeMsSymbol.PDB_ID);+ writer.putUnsignedInt(1); // DIA program to eval value of the symbol+ byte[] range = createLocalVariableAddressRangeBuffer(0x2000, 1, 0x1000);+ writer.putBytes(range);+ byte[] gap1 = createLocalVariableAddressGapBuffer(0x100, 0x80);+ writer.putBytes(gap1);+ byte[] gap2 = createLocalVariableAddressGapBuffer(0x400, 0x100);+ writer.putBytes(gap2);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof DefinedSingleAddressRangeMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals(+ "DEFRANGE: DIA program NI: 0001," + " Range: [0001:00002000] - [0001:00003000]," ++ " 2 Gaps (startOffset, length): (0100, 80) (0400, 100)",+ result);+ }++ @Test+ public void testDefinedSingleAddressRangeForSubfieldMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(DefinedSingleAddressRangeForSubfieldMsSymbol.PDB_ID);+ writer.putUnsignedInt(1); // DIA program to eval value of the symbol+ writer.putUnsignedInt(0x10); // Offset in parent variable+ byte[] range = createLocalVariableAddressRangeBuffer(0x2000, 1, 0x1000);+ writer.putBytes(range);+ byte[] gap1 = createLocalVariableAddressGapBuffer(0x100, 0x80);+ writer.putBytes(gap1);+ byte[] gap2 = createLocalVariableAddressGapBuffer(0x400, 0x100);+ writer.putBytes(gap2);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof DefinedSingleAddressRangeForSubfieldMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("DEFRANGE_SUBFIELD: offset at 0010, DIA Program NI: 0001," ++ " Range: [0001:00002000] - [0001:00003000]," ++ " 2 Gaps (startOffset, length): (0100, 80) (0400, 100)", result);+ }++ @Test+ public void testDefinedSingleAddressRangeForEnregisteredSymbolMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(DefinedSingleAddressRangeForEnregisteredSymbolMsSymbol.PDB_ID);+ writer.putUnsignedShort(1); // register to hold value fo the symbol+ // attribute (bit 0: 1=may have no user name on one of the control flow paths+ writer.putUnsignedShort(0x01);+ byte[] range = createLocalVariableAddressRangeBuffer(0x2000, 1, 0x1000);+ writer.putBytes(range);+ byte[] gap1 = createLocalVariableAddressGapBuffer(0x100, 0x80);+ writer.putBytes(gap1);+ byte[] gap2 = createLocalVariableAddressGapBuffer(0x400, 0x100);+ writer.putBytes(gap2);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof DefinedSingleAddressRangeForEnregisteredSymbolMsSymbol,+ true);+ String result = symbol.toString().trim();+ assertEquals("DEFRANGE_REGISTER:Attributes: MayAvailable al" ++ " Range: [0001:00002000] - [0001:00003000]," ++ " 2 Gaps (startOffset, length): (0100, 80) (0400, 100)", result);+ }++ @Test+ public void testDefinedSingleAddressRangeForFramePointerRelativeMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(DefinedSingleAddressRangeForFramePointerRelativeMsSymbol.PDB_ID);+ writer.putInt(0x1000); // offset to frame pointer+ byte[] range = createLocalVariableAddressRangeBuffer(0x2000, 1, 0x1000);+ writer.putBytes(range);+ byte[] gap1 = createLocalVariableAddressGapBuffer(0x100, 0x80);+ writer.putBytes(gap1);+ byte[] gap2 = createLocalVariableAddressGapBuffer(0x400, 0x100);+ writer.putBytes(gap2);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof DefinedSingleAddressRangeForFramePointerRelativeMsSymbol,+ true);+ String result = symbol.toString().trim();+ assertEquals("DEFRANGE_FRAMEPOINTER_REL: FrameOffset: 1000" ++ " Range: [0001:00002000] - [0001:00003000]," ++ " 2 Gaps (startOffset, length): (0100, 80) (0400, 100)", result);+ }++ @Test+ public void testDefinedSingleAddressRangeForEnregisteredFieldOfSymbolMsSymbol()+ throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(+ DefinedSingleAddressRangeForEnregisteredFieldOfSymbolMsSymbol.PDB_ID);+ writer.putUnsignedShort(1); // register holding the value of the symbol+ // attribute (bit 0: 1=may have no user name on one of the control flow paths+ writer.putUnsignedShort(0x01);+ // offset in parent variable. (12 bits; rest is padding for now)+ writer.putUnsignedInt(0x010 & 0xfff);+ byte[] range = createLocalVariableAddressRangeBuffer(0x2000, 1, 0x1000);+ writer.putBytes(range);+ byte[] gap1 = createLocalVariableAddressGapBuffer(0x100, 0x80);+ writer.putBytes(gap1);+ byte[] gap2 = createLocalVariableAddressGapBuffer(0x400, 0x100);+ writer.putBytes(gap2);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(+ symbol instanceof DefinedSingleAddressRangeForEnregisteredFieldOfSymbolMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("DEFRANGE_SUBFIELD_REGISTER: offset at 0010: Attributes: MayAvailable al" ++ " Range: [0001:00002000] - [0001:00003000]," ++ " 2 Gaps (startOffset, length): (0100, 80) (0400, 100)", result);+ }++ @Test+ public void testDefinedSingleAddressRangeForFramePointerRelativeFullScopeMsSymbol()+ throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(+ DefinedSingleAddressRangeForFramePointerRelativeFullScopeMsSymbol.PDB_ID);+ writer.putInt(0x0100); // offset to frame pointer+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(+ symbol instanceof DefinedSingleAddressRangeForFramePointerRelativeFullScopeMsSymbol,+ true);+ String result = symbol.toString().trim();+ assertEquals("DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE: FrameOffset: 0100 FULL_SCOPE", result);+ }++ @Test+ public void testDefinedSingleAddressRangeForEnregisteredSymbolRelativeMsSymbol()+ throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(+ DefinedSingleAddressRangeForEnregisteredSymbolRelativeMsSymbol.PDB_ID);+ writer.putUnsignedShort(1); // register holding base pointer of symbol+ // spilled member for s.i. (1 bit)+ // padding for future (3 bits)+ // offset in parent variable. (12 bits)+ writer.putUnsignedShort(0x01 | (0x10 << 4));+ writer.putInt(0x100); // offset to register (base pointer)+ byte[] range = createLocalVariableAddressRangeBuffer(0x2000, 1, 0x1000);+ writer.putBytes(range);+ byte[] gap1 = createLocalVariableAddressGapBuffer(0x100, 0x80);+ writer.putBytes(gap1);+ byte[] gap2 = createLocalVariableAddressGapBuffer(0x400, 0x100);+ writer.putBytes(gap2);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(+ symbol instanceof DefinedSingleAddressRangeForEnregisteredSymbolRelativeMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals(+ "DEFRANGE_REGISTER_REL: [al + 0100] spilledUserDefinedTypeMember offset at 16" ++ " Range: [0001:00002000] - [0001:00003000]," ++ " 2 Gaps (startOffset, length): (0100, 80) (0400, 100)",+ result);+ }++ @Test+ public void testBuildInformationMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(BuildInformationMsSymbol.PDB_ID);+ writer.putUnsignedInt(4096); // item id of build info+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof BuildInformationMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("BUILDINFO: ItemDummyMsType", result);+ }++ @Test+ public void testProcedureIdEndMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ProcedureIdEndMsSymbol.PDB_ID);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ProcedureIdEndMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("PROC_ID_END", result);+ }++ @Test+ public void testInlinedFunctionCallsiteMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(InlinedFunctionCallsiteMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x1000); // pointer to the parent+ writer.putUnsignedInt(0x2000); // pointer to this block's end+ writer.putUnsignedInt(4096); // item Id of inlinee+ // Binary annotation opcode (list)+ byte[] annotationBuf1 = createInstructionAnnotationBuffer(0x01, 0x10, 0x11);+ writer.putBytes(annotationBuf1);+ byte[] annotationBuf2 = createInstructionAnnotationBuffer(0x02, 0x20, 0x21);+ writer.putBytes(annotationBuf2);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof InlinedFunctionCallsiteMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("INLINESITE2: Parent: 00001000, End: 00002000, Inlinee: ItemDummyMsType\n" ++ " Offset 10 CodeOffsetBase 20", result);+ }++ @Test+ public void testInlinedFunctionCallsiteExtendedMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(InlinedFunctionCallsiteExtendedMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x1000); // pointer to the parent+ writer.putUnsignedInt(0x2000); // pointer to this block's end+ writer.putUnsignedInt(4096); // item Id of inlinee+ // Binary annotation opcode (list)+ writer.putUnsignedInt(2); // Number of invocations+ byte[] annotationBuf1 = createInstructionAnnotationBuffer(0x01, 0x10, 0x11);+ writer.putBytes(annotationBuf1);+ byte[] annotationBuf2 = createInstructionAnnotationBuffer(0x02, 0x20, 0x21);+ writer.putBytes(annotationBuf2);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof InlinedFunctionCallsiteExtendedMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("INLINESITE2: Parent: 00001000, End: 00002000, PGO Edge Count: 2," ++ " Inlinee: ItemDummyMsType\n" + " Offset 10 CodeOffsetBase 20", result);+ }++ @Test+ public void testInlinedFunctionEndMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(InlinedFunctionEndMsSymbol.PDB_ID);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof InlinedFunctionEndMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("INLINESITE_END", result);+ }++ @Test+ public void testFileStaticMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(FileStaticMsSymbol.PDB_ID);+ writer.putUnsignedInt(4096); // type index+ writer.putUnsignedInt(1); // index of module filename in stringtable+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ writer.putBytes(localVarFlags);+ writer.putNullTerminatedUtf8String("FileStaticName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof FileStaticMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("FILESTATIC: Param: 00001000 Address Taken, Compiler Generated, aggregate," ++ " aggregated, aliased, alias, return value, optimized away, file static," ++ " FileStaticName\n" + " Mod: NameTableTestString", result);+ }++ @Test+ public void testLocalDeferredProcedureCallGroupSharedMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(LocalDeferredProcedureCallGroupSharedMsSymbol.PDB_ID);+ writer.putUnsignedInt(4096); // type index+ byte[] localVarFlags = createLocalVariableFlagsBuffer(true, true, true, true, true, true,+ true, true, true, true, true);+ writer.putBytes(localVarFlags);+ writer.putUnsignedShort(1); // base data slot+ writer.putUnsignedShort(2); // base data offset+ writer.putNullTerminatedUtf8String("LocalDPCGroupSharedName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof LocalDeferredProcedureCallGroupSharedMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("LOCAL_DPC_GROUPSHARED: Param: 4096 Address Taken, Compiler Generated," ++ " aggregate, aggregated, aliased, alias, return value, optimized away," ++ " file static base data: slot = 1 offset = 2, LocalDPCGroupSharedName", result);+ }++ @Test+ public void testDefinedAddressRangeHighLevelShaderLanguageMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(DefinedAddressRangeHighLevelShaderLanguageMsSymbol.PDB_ID);+ writer.putUnsignedShort(1); // register type from HLSLREG+ int registerSpaceDimensionality = 2; // valid: 0, 1, 2.+ int spilledUdtMember = 1; // 1=true.+ int memorySpace = 1; // 4 bits+ // rest is padding.+ writer.putUnsignedShort(((memorySpace & 0x0f) << 3) | ((spilledUdtMember & 0x01) << 2) |+ (registerSpaceDimensionality & 0x03));+ writer.putUnsignedShort(0x20); // offset in parent variable.+ writer.putUnsignedShort(0x10); // size of enregistered portion+ byte[] range = createLocalVariableAddressRangeBuffer(0x2000, 1, 0x1000);+ writer.putBytes(range);+ byte[] gap1 = createLocalVariableAddressGapBuffer(0x100, 0x80);+ writer.putBytes(gap1);+ byte[] gap2 = createLocalVariableAddressGapBuffer(0x400, 0x100);+ writer.putBytes(gap2);+ // Multi-dimensional offset of variable location in register.+ for (int i = 0; i < registerSpaceDimensionality; i++) {+ writer.putInt(i + 3);+ }+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof DefinedAddressRangeHighLevelShaderLanguageMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("DEFRANGE_HLSL: al, RegisterIndices = 2, SAMPLER" ++ " Range: [0001:00002000] - [0001:00003000]," ++ " 2 Gaps (startOffset, length): (0100, 80) (0400, 100) 3 4", result);+ }++ @Test+ public void testDefinedAddressRangeDeferredProcedureCallPointerTagMsSymbol()+ throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(DefinedAddressRangeDeferredProcedureCallPointerTagMsSymbol.PDB_ID);+ writer.putUnsignedShort(1); // register type from HLSLREG+ int registerSpaceDimensionality = 2; // valid: 0, 1, 2.+ int spilledUdtMember = 1; // 1=true.+ int memorySpace = 1; // 4 bits+ // rest is padding.+ writer.putUnsignedShort(((memorySpace & 0x0f) << 3) | ((spilledUdtMember & 0x01) << 2) |+ (registerSpaceDimensionality & 0x03));+ writer.putUnsignedShort(0x20); // offset in parent variable.+ writer.putUnsignedShort(0x10); // size of enregistered portion+ byte[] range = createLocalVariableAddressRangeBuffer(0x2000, 1, 0x1000);+ writer.putBytes(range);+ byte[] gap1 = createLocalVariableAddressGapBuffer(0x100, 0x80);+ writer.putBytes(gap1);+ byte[] gap2 = createLocalVariableAddressGapBuffer(0x400, 0x100);+ writer.putBytes(gap2);+ // Multi-dimensional offset of variable location in register.+ for (int i = 0; i < registerSpaceDimensionality; i++) {+ writer.putInt(i + 3);+ }+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof DefinedAddressRangeDeferredProcedureCallPointerTagMsSymbol,+ true);+ String result = symbol.toString().trim();+ assertEquals("DEFRANGE_DPC_PTR_TAG: al, RegisterIndices = 2, SAMPLER" ++ " Range: [0001:00002000] - [0001:00003000]," ++ " 2 Gaps (startOffset, length): (0100, 80) (0400, 100) 3 4", result);+ }++ @Test+ public void testDeferredProcedureCallPointerTagToSymbolRecordMapMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(DeferredProcedureCallPointerTagToSymbolRecordMapMsSymbol.PDB_ID);+ // write array of mappings from DPC pointer tag values to symbol record offsets.+ int num = 3;+ for (int i = 0; i < num; i++) {+ writer.putUnsignedInt(i);+ writer.putUnsignedInt(0x10 * (i + 1));+ }+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof DeferredProcedureCallPointerTagToSymbolRecordMapMsSymbol,+ true);+ String result = symbol.toString().trim();+ assertEquals("DPC_SYM_TAG_MAP: 3 entries, (0, 10), (1, 20), (2, 30)", result);+ }++ @Test+ public void testArmSwitchTableMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ArmSwitchTableMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x1000); // section-relative offset to the base for switch offsets+ writer.putUnsignedShort(1); // section index of the base+ writer.putUnsignedShort(1); // (0 - 10)+ writer.putUnsignedInt(0x2000); // section-relative offset to the table branch instruction+ writer.putUnsignedInt(0x3000); // section-relative offset to the start of the table+ writer.putUnsignedShort(1); // section index of the table branch instruction+ writer.putUnsignedShort(1); // section index of the table+ writer.putUnsignedInt(0x5); // number of switch table entries+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ArmSwitchTableMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("ARMSWITCHTABLE:\n" + " Base address: [0001:00001000]\n" ++ " Branch address: [0001:00002000]\n" + " Table address: [0001:00003000]\n" ++ " Entry count = 5\n" + " Switch entry type = unsigned byte", result);+ }++ @Test+ public void testCallersMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(CallersMsSymbol.PDB_ID);+ int num = 3;+ writer.putUnsignedInt(num);+ for (int i = 0; i < num; i++) {+ writer.putUnsignedInt(4096);+ }+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof CallersMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("CALLERS: Count: 3\n" ++ "DummyMsType (0, args) , DummyMsType (0, args) , DummyMsType (0, args)", result);+ }++ @Test+ public void testCalleesMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(CalleesMsSymbol.PDB_ID);+ int num = 3;+ writer.putUnsignedInt(num);+ for (int i = 0; i < num; i++) {+ writer.putUnsignedInt(4096);+ }+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof CalleesMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("CALLEES: Count: 3\n" ++ "DummyMsType (0, args) , DummyMsType (0, args) , DummyMsType (0, args)", result);+ }++ @Test+ public void testProfileGuidedOptimizationDataMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ProfileGuidedOptimizationDataMsSymbol.PDB_ID);+ writer.putUnsignedInt(5); // Number of times function was called (invocations)+ BigInteger dynamicInstructionCount = new BigInteger("100");+ writer.putUnsignedLong(dynamicInstructionCount);+ writer.putUnsignedInt(15); // static instruction count+ writer.putUnsignedInt(25); // final static instruction count (after inlining)+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ProfileGuidedOptimizationDataMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("POGOINFO:\n" + "Call Count: 5\n" + "Dynamic Instruction Count: 100\n" ++ "Number of Instructions: 15\n" + "Number of Live Instructions: 25", result);+ }++ @Test+ public void testHeapAllocationSiteMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(HeapAllocationSiteMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x1000); // Offset of call site+ writer.putUnsignedShort(1); // Section of call site+ writer.putUnsignedShort(8); // Length of headp allocation call instruction+ writer.putUnsignedInt(4096); // Type index describing function signature+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof HeapAllocationSiteMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("HEAPALLOCSITE: [0001:00001000], instruction length = 8, type = DummyMsType",+ result);+ }++ @Test+ public void testModuleTypeReferenceMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ModuleTypeReferenceMsSymbol.PDB_ID);+ // flags: 1=true at given bit offset.+ // bit 0: module does not reference a type+ // bit 1: reference /Z7 PCH types+ // bit 2: module contains /Z7 PCH types+ // bit 3: module contains type info due to /Z7+ // bit 4: module contains type info due to /Zi or /ZI+ // bit 5: module references type info owned by other module+ // next 9 bits are reserved+ // next 16 bits are not specified in the API+ writer.putUnsignedInt(0x10); // flags+ // Following values have meaning depending on flags used above.+ writer.putUnsignedShort(0x01);+ writer.putUnsignedShort(0x02);+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ModuleTypeReferenceMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("MODTYPEREF: /Zi TypeRef, StreamNumber=0001 (type), StreamNumber=0002 (ID)",+ result);+ }++ @Test+ public void testMiniPdbReferenceMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(MiniPdbReferenceMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x10); // union of coff section and type index--context later.+ writer.putUnsignedShort(1); // module index+ // flags: 1=true at given bit offset.+ // bit 0: reference to local (vs. global) function or data+ // bit 1: reference to data (vs. function)+ // bit 2: reference to User Defined Data+ // bit 3: reference to label+ // bit 4: reference to constant+ // next 11 bits are reserved+ writer.putUnsignedShort(0x1f); // flags+ writer.putNullTerminatedUtf8String("MiniPdbName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof MiniPdbReferenceMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("REF_MINIPDB: (UDT) moduleIndex = 0001, TypeInformation = signed char," ++ " MiniPdbName", result);+ }++ @Test+ public void testMapToMiniPdbMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(MapToMiniPdbMsSymbol.PDB_ID);+ writer.putNullTerminatedWchartString("SourcePdbFileName");+ writer.putNullTerminatedWchartString("DestinationPdbFileName");+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof MapToMiniPdbMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("PDBMAP: SourcePdbFileName -> DestinationPdbFileName", result);+ }++ @Test+ public void testExtraFrameAndProcedureInformationMsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(ExtraFrameAndProcedureInformationMsSymbol.PDB_ID);+ writer.putUnsignedInt(0x1000); // total bytes in frame of procedure+ writer.putUnsignedInt(0x0030); // bytes of padding in frame+ writer.putUnsignedInt(0x0fd0); // offset from frame pointer to start of padding+ writer.putUnsignedInt(0x0100); // count of bytes of calle save registers+ writer.putUnsignedInt(0x1100); // offset of exception handler+ writer.putUnsignedShort(1); // section ID of exception handler+ // flags: 1=true at given bit offset.+ // bit 0: function uses _alloca()+ // bit 1: function uses setjmp()+ // bit 2: function uses longjmp()+ // bit 3: function uses inline asm+ // bit 4: function has EH states+ // bit 5: function was specified as inline+ // bit 6: function has SEH+ // bit 7: function is __declspec(naked)+ // bit 8: function has buffer security check introduced by /GS+ // bit 9: function compiled with /EHa+ // bit 10: function has /GS buffer checks, but stack ordering could not be done+ // bit 11: function was inline within another function+ // bit 12: function is __declspec(strict_gs_check)+ // bit 13: function is __declspec(safebuffers)+ // bits 14-15: record function's local pointer explicitly+ // bits 16-17: record function's parameter pointer explicitly+ // bit 18: function was compiled with PGO/PGU+ // bit 19: function Do we have valid Pogo counts?+ // bit 20: function Did we optimized for speed?+ // bit 21: function contains CFG checks (and no write checks)+ // bit 22: function contains CFW check and/or instrumentation+ // next 9 bits are reserved+ writer.putUnsignedInt(0x007fffff); // flags+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof ExtraFrameAndProcedureInformationMsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("FRAMEPROCSYM:\n" + " Frame size = 00001000 bytes\n" ++ " Pad size = 00000030 bytes\n" + " Offset of pad in frame = 00000FD0\n" ++ " Size of callee save registers = 00000100\n" ++ " Address of exception handler = 0001:00001100\n" ++ " Function info: alloca setjmp longjmp inlasm eh inl_specified seh naked" ++ " gschecks asynceh gsnostackordering wasinlined strict_gs_check safebuffers" ++ " pgo_on valid_pgo_counts opt_for_speed Local=dl Param=dl guardcf" ++ " guardcfw (007FFFFF)", result);+ }++ @Test+ public void testUnknownX1166MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(UnknownX1166MsSymbol.PDB_ID);+ // We have no idea of the symbol contents; just probable existence of symbol type x1166.+ writer.putBytes(new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 });+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof UnknownX1166MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("UNKNOWN_SYMBOL_X1166: Bytes:\n" + "000000 01 02 03 04 05 06 07 08", result);+ }++ @Test+ public void testUnknownX1167MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(UnknownX1167MsSymbol.PDB_ID);+ writer.putUnsignedShort(1); // unknown+ writer.putUnsignedShort(2); // unknown+ writer.putUnsignedShort(3); // unknown+ writer.putNullTerminatedUtf8String("UnknownX1167String"); // string+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof UnknownX1167MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("UNKNOWN_SYMBOL_X1167\n" + "unknownUnsignedShort1: 0001\n" ++ "unknownUnsignedShort2: 0002\n" + "unknownUnsignedShort3: 0003\n" ++ "String: UnknownX1167String", result);+ }++ @Test+ public void testUnknownX1168MsSymbol() throws PdbException {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(UnknownX1168MsSymbol.PDB_ID);+ writer.putInt(2); // we believe this is a count+ writer.putInt(4096); // we are assuming this is a type record index+ writer.putInt(4096); // we are assuming this is a type record index+ PdbByteReader reader = new PdbByteReader(writer.get());+ AbstractMsSymbol symbol = symbolParser.parse(reader);+ assertEquals(symbol instanceof UnknownX1168MsSymbol, true);+ String result = symbol.toString().trim();+ assertEquals("UNKNOWN_SYMBOL_X1168: Type List: {DummyMsType, DummyMsType}", result);+ }++ //==============================================================================================+ // Private Methods+ //==============================================================================================+ private static byte[] createProcedureMsFlagsBuffer(boolean framePointerPresent,+ boolean interruptReturn, boolean farReturn, boolean doesNotReturn,+ boolean labelNotFallenInto, boolean customCallingConvention, boolean markedNoInline,+ boolean hasDebugInfo) {+ int flags = 0;+ flags |= (hasDebugInfo ? 1 : 0);+ flags <<= 1;+ flags |= (markedNoInline ? 1 : 0);+ flags <<= 1;+ flags |= (customCallingConvention ? 1 : 0);+ flags <<= 1;+ flags |= (labelNotFallenInto ? 1 : 0);+ flags <<= 1;+ flags |= (doesNotReturn ? 1 : 0);+ flags <<= 1;+ flags |= (farReturn ? 1 : 0);+ flags <<= 1;+ flags |= (interruptReturn ? 1 : 0);+ flags <<= 1;+ flags |= (framePointerPresent ? 1 : 0);+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedByte(flags);+ return writer.get();+ }++ private static byte[] createLocalVariableFlagsBuffer(boolean isParameter, boolean addressTaken,+ boolean compilerGenerated, boolean isAggregateWhole, boolean isAggregatedPart,+ boolean isAliased, boolean isAlias, boolean isFunctionReturnValue,+ boolean isOptimizedOut, boolean isEnregisteredGlobal, boolean isEnregisteredStatic) {+ int flags = 0;+ flags |= (isEnregisteredStatic ? 1 : 0);+ flags <<= 1;+ flags |= (isEnregisteredGlobal ? 1 : 0);+ flags <<= 1;+ flags |= (isOptimizedOut ? 1 : 0);+ flags <<= 1;+ flags |= (isFunctionReturnValue ? 1 : 0);+ flags <<= 1;+ flags |= (isAlias ? 1 : 0);+ flags <<= 1;+ flags |= (isAliased ? 1 : 0);+ flags <<= 1;+ flags |= (isAggregatedPart ? 1 : 0);+ flags <<= 1;+ flags |= (isAggregateWhole ? 1 : 0);+ flags <<= 1;+ flags |= (compilerGenerated ? 1 : 0);+ flags <<= 1;+ flags |= (addressTaken ? 1 : 0);+ flags <<= 1;+ flags |= (isParameter ? 1 : 0);+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(flags);+ return writer.get();+ }++ private static byte[] createLocalVariableAttributesBuffer(long offset, int segment,+ byte[] localVariableFlagsBuffer) {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedInt(offset);+ writer.putUnsignedShort(segment);+ writer.putBytes(localVariableFlagsBuffer);+ return writer.get();+ }++ private static byte[] createLocalVariableAddressRangeBuffer(long offset, int sectionStart,+ int length) {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedInt(offset);+ writer.putUnsignedShort(sectionStart);+ writer.putUnsignedShort(length);+ return writer.get();+ }++ private static byte[] createLocalVariableAddressGapBuffer(int gapStartOffset, int length) {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(gapStartOffset);+ writer.putUnsignedShort(length);+ return writer.get();+ }++ private static void compressData(PdbByteWriter writer, long int32) {+ if (int32 < 0x80L) {+ writer.putUnsignedByte((int) int32);+ }+ else if (int32 < 0x4000L) {+ writer.putUnsignedByte((int) (((int32 >> 8) & 0x3f) | 0x80));+ writer.putUnsignedByte((int) (int32 & 0xff));+ }+ else if (int32 < 0x20000000L) {+ writer.putUnsignedByte((int) (((int32 >> 24) & 0x1f) | 0xc0));+ writer.putUnsignedByte((int) ((int32 >> 16) & 0xff));+ writer.putUnsignedByte((int) ((int32 >> 8) & 0xff));+ writer.putUnsignedByte((int) (int32 & 0xff));+ }+ else {+ // error. decompress converts big values to -1.+ // silently fail.+ }+ }++ private static long encodeSignedInt32(long int32) {+ int flagBit = 0x00;+ if (int32 < 0) {+ int32 = -int32;+ flagBit = 0x01;+ }+ return ((int32 & 0x7fffffff) << 1) | flagBit;+ }++ private static byte[] createInstructionAnnotationBuffer(int instructionCode, long int32Param1,+ long int32Param2) {+ PdbByteWriter writer = new PdbByteWriter();+ compressData(writer, instructionCode);+ if (instructionCode == 0x00) {+ writer.putAlign(0);+ }+ else if (instructionCode == 0x0c) {+ compressData(writer, int32Param1);+ compressData(writer, int32Param2);+ }+ else if ((instructionCode == 0x06) || (instructionCode == 0x0a)) {+ compressData(writer, encodeSignedInt32(int32Param1));+ }+ else {+ compressData(writer, int32Param1);+ }+ return writer.get();+ }++ // Code here was copied from the test code for this type, but we just want a buffer of data.+ private byte[] createRegister16MsSymbolBuffer() {+ PdbByteWriter writer = new PdbByteWriter();+ writer.putUnsignedShort(Register16MsSymbol.PDB_ID);+ writer.putUnsignedShort(4096); // Type index or metadata token+ writer.putUnsignedShort(0x0102); // Register enumerate+ writer.putByteLengthPrefixedUtf8String("registerSymbolName");+ return writer.get();+ }++}