C# Класс Reko.Core.Platform

Наследование: IPlatform
Показать файл Открыть проект

Открытые методы

Метод Описание
AdjustProcedureAddress ( Address addr ) : Address

Some architectures platforms (I'm looking at you ARM Thumb) will use addresses that are offset by 1. Most don't.

CreateAbsoluteMemoryMap ( ) : Reko.Core.SegmentMap

Creates an empty imagemap based on the absolute memory map. It is the caller's responsibility to fill in the MemoryArea properties of each resulting ImageSegment.

CreateImplicitArgumentRegisters ( ) : HashSet

Creates a set that represents those registers that are never used as arguments to a procedure.

Typically, the stack pointer register is one of these registers. Some architectures define global registers that are preserved across calls; these should also be present in this set.

CreateMetadata ( ) : Reko.Core.TypeLibrary
CreatePointerScanner ( Reko.Core.SegmentMap segmentMap, Reko.Core.ImageReader rdr, IEnumerable
address, PointerScannerFlags pointerScannerFlags ) : IEnumerable
CreateProcedureSerializer ( ISerializedTypeVisitor typeLoader, string defaultConvention ) : Reko.Core.Serialization.ProcedureSerializer

Creates a procedure serializer that understands the calling conventions used on this processor and environment

CreateTrashedRegisters ( ) : HashSet

Creates a set of registers that the "standard" ABI cannot guarantee will survive a call.

Reko will do its best to determine what registers are trashed by a procedure, but when indirect calls are involved we have to guess. If Reko's guess is incorrect, users can override it by proving oracular type information.

DataTypeFromImportName ( string importName ) : Tuple
DetermineCallingConvention ( FunctionType signature ) : string
EnsureTypeLibraries ( string envName ) : void

Utility function for subclasses that loads all type libraries and characteristics libraries defined in the Reko configuration file.

FindMainProcedure ( Program program, Address addrStart ) : Reko.Core.ImageSymbol
FindService ( RtlInstruction rtl, ProcessorState state ) : Reko.Core.SystemService
FindService ( int vector, ProcessorState state ) : Reko.Core.SystemService
FindService ( string name ) : Reko.Core.SystemService
FormatProcedureName ( Program program, Procedure proc ) : string

Formats a program/module and a procedure name together.

This is done in the Windows way {module}!{procname}. Other platforms may have other conventions. Please override this in the other platforms to give the correct output.

GetByteSizeFromCBasicType ( CBasicType cb ) : int
GetPrimitiveTypeName ( PrimitiveType pt, string language ) : string
GetTrampolineDestination ( Reko.Core.ImageReader imageReader, IRewriterHost host ) : Reko.Core.ProcedureBase

If the instructions located at the address the image reader is reading are a trampoline, returns the procedure where the destination is located, otherwise returns null.

InjectProcedureEntryStatements ( Procedure proc, Address addr, Reko.Core.CodeEmitter emitter ) : void
LoadUserOptions ( object>.Dictionary options ) : void

If the platform can be customized by user, load those customizations here.

LookupCharacteristicsByName ( string procName ) : Reko.Core.Serialization.ProcedureCharacteristics
LookupGlobalByName ( string moduleName, string globalName ) : Identifier
LookupGlobalByOrdinal ( string moduleName, int ordinal ) : Identifier
LookupProcedureByName ( string moduleName, string procName ) : Reko.Core.ExternalProcedure
LookupProcedureByOrdinal ( string moduleName, int ordinal ) : ExternalProcedure
MakeAddressFromConstant ( Constant c ) : Address
MakeAddressFromLinear ( ulong uAddr ) : Address

Given a linear address, converts it to an Address instance. By default, use the architecture pointer size for the address.

The method is virtual to allow a platform to override the pointer size. For instance although the PowerPC 64 has 64-bit addresses, the Playstation3 implementation uses 32-bit addresses.

SaveUserOptions ( ) : object>.Dictionary

If the platform can be customized by user, save those customizations here.

SignatureFromName ( string fnName ) : ExternalProcedure

Guess signature from the name of the procedure.

TryParseAddress ( string sAddress, Address &addr ) : bool

Защищенные методы

Метод Описание
Platform ( IServiceProvider services, IProcessorArchitecture arch, string platformId ) : Reko.Core.CLanguage

Initializes a Platform instance

Описание методов

AdjustProcedureAddress() публичный Метод

Some architectures platforms (I'm looking at you ARM Thumb) will use addresses that are offset by 1. Most don't.
public AdjustProcedureAddress ( Address addr ) : Address
addr Address
Результат Address

CreateAbsoluteMemoryMap() публичный Метод

Creates an empty imagemap based on the absolute memory map. It is the caller's responsibility to fill in the MemoryArea properties of each resulting ImageSegment.
public CreateAbsoluteMemoryMap ( ) : Reko.Core.SegmentMap
Результат Reko.Core.SegmentMap

CreateImplicitArgumentRegisters() публичный абстрактный Метод

Creates a set that represents those registers that are never used as arguments to a procedure.
Typically, the stack pointer register is one of these registers. Some architectures define global registers that are preserved across calls; these should also be present in this set.
public abstract CreateImplicitArgumentRegisters ( ) : HashSet
Результат HashSet

CreateMetadata() публичный Метод

public CreateMetadata ( ) : Reko.Core.TypeLibrary
Результат Reko.Core.TypeLibrary

CreatePointerScanner() публичный Метод

public CreatePointerScanner ( Reko.Core.SegmentMap segmentMap, Reko.Core.ImageReader rdr, IEnumerable
address, PointerScannerFlags pointerScannerFlags ) : IEnumerable
segmentMap Reko.Core.SegmentMap
rdr Reko.Core.ImageReader
address IEnumerable
pointerScannerFlags PointerScannerFlags
Результат IEnumerable

CreateProcedureSerializer() публичный абстрактный Метод

Creates a procedure serializer that understands the calling conventions used on this processor and environment
public abstract CreateProcedureSerializer ( ISerializedTypeVisitor typeLoader, string defaultConvention ) : Reko.Core.Serialization.ProcedureSerializer
typeLoader ISerializedTypeVisitor Used to resolve data types
defaultConvention string Default calling convention, if none specified.
Результат Reko.Core.Serialization.ProcedureSerializer

CreateTrashedRegisters() публичный абстрактный Метод

Creates a set of registers that the "standard" ABI cannot guarantee will survive a call.
Reko will do its best to determine what registers are trashed by a procedure, but when indirect calls are involved we have to guess. If Reko's guess is incorrect, users can override it by proving oracular type information.
public abstract CreateTrashedRegisters ( ) : HashSet
Результат HashSet

DataTypeFromImportName() публичный Метод

public DataTypeFromImportName ( string importName ) : Tuple
importName string
Результат Tuple

DetermineCallingConvention() публичный Метод

public DetermineCallingConvention ( FunctionType signature ) : string
signature FunctionType
Результат string

EnsureTypeLibraries() публичный Метод

Utility function for subclasses that loads all type libraries and characteristics libraries defined in the Reko configuration file.
public EnsureTypeLibraries ( string envName ) : void
envName string
Результат void

FindMainProcedure() публичный Метод

public FindMainProcedure ( Program program, Address addrStart ) : Reko.Core.ImageSymbol
program Program
addrStart Address
Результат Reko.Core.ImageSymbol

FindService() публичный Метод

public FindService ( RtlInstruction rtl, ProcessorState state ) : Reko.Core.SystemService
rtl RtlInstruction
state ProcessorState
Результат Reko.Core.SystemService

FindService() публичный абстрактный Метод

public abstract FindService ( int vector, ProcessorState state ) : Reko.Core.SystemService
vector int
state ProcessorState
Результат Reko.Core.SystemService

FindService() публичный Метод

public FindService ( string name ) : Reko.Core.SystemService
name string
Результат Reko.Core.SystemService

FormatProcedureName() публичный Метод

Formats a program/module and a procedure name together.
This is done in the Windows way {module}!{procname}. Other platforms may have other conventions. Please override this in the other platforms to give the correct output.
public FormatProcedureName ( Program program, Procedure proc ) : string
program Program
proc Procedure
Результат string

GetByteSizeFromCBasicType() публичный абстрактный Метод

public abstract GetByteSizeFromCBasicType ( CBasicType cb ) : int
cb CBasicType
Результат int

GetPrimitiveTypeName() публичный Метод

public GetPrimitiveTypeName ( PrimitiveType pt, string language ) : string
pt PrimitiveType
language string
Результат string

GetTrampolineDestination() публичный абстрактный Метод

If the instructions located at the address the image reader is reading are a trampoline, returns the procedure where the destination is located, otherwise returns null.
public abstract GetTrampolineDestination ( Reko.Core.ImageReader imageReader, IRewriterHost host ) : Reko.Core.ProcedureBase
imageReader Reko.Core.ImageReader
host IRewriterHost
Результат Reko.Core.ProcedureBase

InjectProcedureEntryStatements() публичный Метод

public InjectProcedureEntryStatements ( Procedure proc, Address addr, Reko.Core.CodeEmitter emitter ) : void
proc Procedure
addr Address
emitter Reko.Core.CodeEmitter
Результат void

LoadUserOptions() публичный Метод

If the platform can be customized by user, load those customizations here.
public LoadUserOptions ( object>.Dictionary options ) : void
options object>.Dictionary
Результат void

LookupCharacteristicsByName() публичный Метод

public LookupCharacteristicsByName ( string procName ) : Reko.Core.Serialization.ProcedureCharacteristics
procName string
Результат Reko.Core.Serialization.ProcedureCharacteristics

LookupGlobalByName() публичный Метод

public LookupGlobalByName ( string moduleName, string globalName ) : Identifier
moduleName string
globalName string
Результат Identifier

LookupGlobalByOrdinal() публичный Метод

public LookupGlobalByOrdinal ( string moduleName, int ordinal ) : Identifier
moduleName string
ordinal int
Результат Identifier

LookupProcedureByName() публичный абстрактный Метод

public abstract LookupProcedureByName ( string moduleName, string procName ) : Reko.Core.ExternalProcedure
moduleName string
procName string
Результат Reko.Core.ExternalProcedure

LookupProcedureByOrdinal() публичный Метод

public LookupProcedureByOrdinal ( string moduleName, int ordinal ) : ExternalProcedure
moduleName string
ordinal int
Результат ExternalProcedure

MakeAddressFromConstant() публичный Метод

public MakeAddressFromConstant ( Constant c ) : Address
c Constant
Результат Address

MakeAddressFromLinear() публичный Метод

Given a linear address, converts it to an Address instance. By default, use the architecture pointer size for the address.
The method is virtual to allow a platform to override the pointer size. For instance although the PowerPC 64 has 64-bit addresses, the Playstation3 implementation uses 32-bit addresses.
public MakeAddressFromLinear ( ulong uAddr ) : Address
uAddr ulong
Результат Address

Platform() защищенный Метод

Initializes a Platform instance
protected Platform ( IServiceProvider services, IProcessorArchitecture arch, string platformId ) : Reko.Core.CLanguage
services IServiceProvider
arch IProcessorArchitecture
platformId string
Результат Reko.Core.CLanguage

SaveUserOptions() публичный Метод

If the platform can be customized by user, save those customizations here.
public SaveUserOptions ( ) : object>.Dictionary
Результат object>.Dictionary

SignatureFromName() публичный Метод

Guess signature from the name of the procedure.
public SignatureFromName ( string fnName ) : ExternalProcedure
fnName string
Результат ExternalProcedure

TryParseAddress() публичный Метод

public TryParseAddress ( string sAddress, Address &addr ) : bool
sAddress string
addr Address
Результат bool