Package ghidra.trace.database.guest

# Class DBTracePlatformManager.DBTraceHostPlatform

java.lang.Object
ghidra.trace.database.guest.DBTracePlatformManager.DBTraceHostPlatform

All Implemented Interfaces:
  `ProgramArchitecture`, `InternalTracePlatform`, `TracePlatform`

Enclosing class:
  `DBTracePlatformManager`

public class DBTracePlatformManager.DBTraceHostPlatform extends Object implements InternalTracePlatform

- ## Field Summary

  ### Fields inherited from interface ghidra.trace.database.guest.InternalTracePlatform

  `REG_MAP_BE, REG_MAP_LE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DBTraceHostPlatform()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `AddressFactory`
  `getAddressFactory()`
  Get the address factory of the guest platform
  `CompilerSpec`
  `getCompilerSpec()`
  Get the compiler of the guest platform
  `TraceBasedDataTypeManager`
  `getDataTypeManager()`
  Get the data type manager for this platform.
  `AddressSetView`
  `getGuestAddressSet()`
  Get the addresses in the guest which are mapped to somehere in the host
  `AddressSetView`
  `getHostAddressSet()`
  Get the addresses in the host which are mapped to somewhere in the guest
  `int`
  `getIntKey()`
  Get the entry's key in the table as an integer
  `Language`
  `getLanguage()`
  Get the language of the guest platform
  `DBTraceGuestPlatform.DBTraceGuestLanguage`
  `getLanguageEntry()`
  `MemBuffer`
  `getMappedMemBuffer(long snap, Address guestAddress)`
  Get a memory buffer, which presents the host bytes in the guest address space
  `Trace`
  `getTrace()`
  Get the trace
  `boolean`
  `isGuest()`
  Check if this is a guest platform
  `InstructionSet`
  `mapGuestInstructionAddressesToHost(InstructionSet set)`
  Copy the given instruction set, but with addresses mapped from the guest space to the host space
  `Address`
  `mapGuestToHost(Address guestAddress)`
  Translate an address from guest to host
  `AddressRange`
  `mapGuestToHost(AddressRange guestRange)`
  Translate a range from guest to host
  `AddressSetView`
  `mapGuestToHost(AddressSetView guestSet)`
  Translate a set from guest to host
  `Address`
  `mapHostToGuest(Address hostAddress)`
  Translate an address from host to guest
  `AddressRange`
  `mapHostToGuest(AddressRange hostRange)`
  Translate a range from host to guest
  `AddressSetView`
  `mapHostToGuest(AddressSetView hostSet)`
  Translate a set from host to guest

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface ghidra.trace.database.guest.InternalTracePlatform

  `addRegisterMapOverride, getConventionalRegisterObjectNames, getConventionalRegisterPath, getConventionalRegisterPath, getConventionalRegisterPath, getConventionalRegisterPath, getConventionalRegisterRange, getRegistersRange, listRegNames`

  ### Methods inherited from interface ghidra.program.model.lang.ProgramArchitecture

  `getLanguageCompilerSpecPair`

  ### Methods inherited from interface ghidra.trace.model.guest.TracePlatform

  `isHost`

- ## Constructor Details

  - ### DBTraceHostPlatform

    public DBTraceHostPlatform()

- ## Method Details

  - ### getTrace

    public Trace getTrace()
    Description copied from interface: `TracePlatform`
    Get the trace
    Specified by:
      `getTrace` in interface `TracePlatform`
    Returns:
      the trace

  - ### getLanguageEntry

    public DBTraceGuestPlatform.DBTraceGuestLanguage getLanguageEntry()
    Specified by:
      `getLanguageEntry` in interface `InternalTracePlatform`

  - ### getIntKey

    public int getIntKey()
    Description copied from interface: `InternalTracePlatform`
    Get the entry's key in the table as an integer
    Specified by:
      `getIntKey` in interface `InternalTracePlatform`
    Returns:
      the key

  - ### isGuest

    public boolean isGuest()
    Description copied from interface: `TracePlatform`
    Check if this is a guest platform
    Specified by:
      `isGuest` in interface `TracePlatform`
    Returns:
      true for guest, false for host

  - ### getLanguage

    public Language getLanguage()
    Description copied from interface: `TracePlatform`
    Get the language of the guest platform
    Specified by:
      `getLanguage` in interface `ProgramArchitecture`
    Specified by:
      `getLanguage` in interface `TracePlatform`
    Returns:
      the language

  - ### getCompilerSpec

    public CompilerSpec getCompilerSpec()
    Description copied from interface: `TracePlatform`
    Get the compiler of the guest platform
    Specified by:
      `getCompilerSpec` in interface `ProgramArchitecture`
    Specified by:
      `getCompilerSpec` in interface `TracePlatform`
    Returns:
      the compiler specification

  - ### getAddressFactory

    public AddressFactory getAddressFactory()
    Description copied from interface: `TracePlatform`
    Get the address factory of the guest platform
    Specified by:
      `getAddressFactory` in interface `InternalTracePlatform`
    Specified by:
      `getAddressFactory` in interface `ProgramArchitecture`
    Specified by:
      `getAddressFactory` in interface `TracePlatform`
    Returns:
      the factory

  - ### getDataTypeManager

    public TraceBasedDataTypeManager getDataTypeManager()
    Description copied from interface: `TracePlatform`
    Get the data type manager for this platform.
    Specified by:
      `getDataTypeManager` in interface `TracePlatform`
    Returns:
      the data type manager

  - ### getHostAddressSet

    public AddressSetView getHostAddressSet()
    Description copied from interface: `TracePlatform`
    Get the addresses in the host which are mapped to somewhere in the guest
    Specified by:
      `getHostAddressSet` in interface `TracePlatform`
    Returns:
      the address set

  - ### getGuestAddressSet

    public AddressSetView getGuestAddressSet()
    Description copied from interface: `TracePlatform`
    Get the addresses in the guest which are mapped to somehere in the host
    Specified by:
      `getGuestAddressSet` in interface `TracePlatform`
    Returns:
      the address set

  - ### mapHostToGuest

    public Address mapHostToGuest(Address hostAddress)
    Description copied from interface: `TracePlatform`
    Translate an address from host to guest
    Specified by:
      `mapHostToGuest` in interface `TracePlatform`
    Parameters:
      `hostAddress` - the host address
    Returns:
      the guest address

  - ### mapHostToGuest

    public AddressRange mapHostToGuest(AddressRange hostRange)
    Description copied from interface: `TracePlatform`
    Translate a range from host to guest

    The entire range must be mapped to a single range.

    Specified by:
      `mapHostToGuest` in interface `TracePlatform`
    Parameters:
      `hostRange` - the host range
    Returns:
      the guest range

  - ### mapHostToGuest

    public AddressSetView mapHostToGuest(AddressSetView hostSet)
    Description copied from interface: `TracePlatform`
    Translate a set from host to guest

    Only those ranges (or parts of ranges) that mapped are included.

    Specified by:
      `mapHostToGuest` in interface `TracePlatform`
    Parameters:
      `hostSet` - the host set
    Returns:
      the guest set

  - ### mapGuestToHost

    public Address mapGuestToHost(Address guestAddress)
    Description copied from interface: `TracePlatform`
    Translate an address from guest to host
    Specified by:
      `mapGuestToHost` in interface `TracePlatform`
    Parameters:
      `guestAddress` - the guest address
    Returns:
      the host address

  - ### mapGuestToHost

    public AddressRange mapGuestToHost(AddressRange guestRange)
    Description copied from interface: `TracePlatform`
    Translate a range from guest to host

    The entire range must be mapped to a single range.

    Specified by:
      `mapGuestToHost` in interface `TracePlatform`
    Parameters:
      `guestRange` - the guest range
    Returns:
      the host range

  - ### mapGuestToHost

    public AddressSetView mapGuestToHost(AddressSetView guestSet)
    Description copied from interface: `TracePlatform`
    Translate a set from guest to host

    Only those ranges (or parts of ranges) that mapped are included.

    Specified by:
      `mapGuestToHost` in interface `TracePlatform`
    Parameters:
      `guestSet` - the guest set
    Returns:
      the host set

  - ### getMappedMemBuffer

    public MemBuffer getMappedMemBuffer(long snap, Address guestAddress)
    Description copied from interface: `TracePlatform`
    Get a memory buffer, which presents the host bytes in the guest address space

    This, with pseudo-disassembly, is the primary mechanism for adding instructions in the guest language.

    Specified by:
      `getMappedMemBuffer` in interface `TracePlatform`
    Parameters:
      `snap` - the snap, up to which the most recent memory changes are presented
      `guestAddress` - the starting address in the guest space
    Returns:
      the mapped memory buffer

  - ### mapGuestInstructionAddressesToHost

    public InstructionSet mapGuestInstructionAddressesToHost(InstructionSet set)
    Description copied from interface: `TracePlatform`
    Copy the given instruction set, but with addresses mapped from the guest space to the host space

    Instructions which do not map are silently ignored. If concerned, the caller ought to examine the resulting instruction set and/or the resulting address set after it is added to the trace. A single instruction cannot span two mapped ranges, even if the comprised bytes are consecutive in the guest space. Mapping such an instruction back into the host space would cause the instruction to be split in the middle, which is not possible. Thus, such instructions are silently ignored.

    Specified by:
      `mapGuestInstructionAddressesToHost` in interface `TracePlatform`
    Parameters:
      `set` - the instruction set in the guest space
    Returns:
      the instruction set in the host space