VirtualBox

Changeset 101539 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Oct 22, 2023 2:43:09 AM (16 months ago)
Author:
vboxsync
Message:

DIS,VMM,DBGC,IPRT,++: Some disassembler tweaks and TB disassembly work. bugref:10371 bugref:9898

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r101538 r101539  
    814814/** Pointer to a native instruction unit. */
    815815typedef IEMNATIVEINSTR *PIEMNATIVEINSTR;
     816/** Pointer to a const native instruction unit. */
     817typedef IEMNATIVEINSTR const *PCIEMNATIVEINSTR;
    816818
    817819/**
     
    869871 * This will throw/longjmp on occation.  */
    870872typedef FNIEMTBNATIVE *PFNIEMTBNATIVE;
     873
     874
     875/**
     876 * Translation block debug info entry type.
     877 */
     878typedef enum IEMTBDBGENTRYTYPE
     879{
     880    kIemTbDbgEntryType_Invalid = 0,
     881    /** The entry is for a new guest instruction. */
     882    kIemTbDbgEntryType_GuestInstruction,
     883    /** Marks the start of a native call. */
     884    kIemTbDbgEntryType_ThreadedCall1,
     885    /** 2nd entry for the start of a native call. */
     886    kIemTbDbgEntryType_ThreadedCall2,
     887    /** Info about a host register shadowing a guest register. */
     888    kIemTbDbgEntryType_GuestRegShadow,
     889    kIemTbDbgEntryType_End
     890} IEMTBDBGENTRYTYPE;
     891
     892/**
     893 * Translation block debug info entry.
     894 */
     895typedef union IEMTBDBGENTRY
     896{
     897    /** Plain 32-bit view. */
     898    uint32_t u;
     899
     900    /** Generic view for getting at the type field. */
     901    struct
     902    {
     903        /** IEMTBDBGENTRYTYPE */
     904        uint32_t    uType : 4;
     905        uint32_t    uTypeSpecific : 28;
     906    } Gen;
     907
     908    struct
     909    {
     910        /** kIemTbDbgEntryType_GuestInstruction. */
     911        uint32_t    uType      : 4;
     912        /** Index into IEMTB::aRanges. */
     913        uint32_t    idxRange   : 4;
     914        /** Offset relative to the start of the range. */
     915        uint32_t    offOpcodes : 12;
     916        /** Number of opcode bytes for the instruction. */
     917        uint32_t    cbOpcodes  : 4;
     918        /** Basic CPU mode for the disassembler (low 8 bits IEM_F_XXX). */
     919        uint32_t    fCpuMode   : 8;
     920    } GuestInstruction;
     921
     922    struct
     923    {
     924        /** kIemTbDbgEntryType_ThreadedCall1. */
     925        uint32_t    uType      : 4;
     926        /** Native code offset. */
     927        uint32_t    offNative  : 28;
     928    } ThreadedCall1;
     929
     930    struct
     931    {
     932        /* kIemTbDbgEntryType_ThreadedCall2. */
     933        uint32_t    uType      : 4;
     934        /** The threaded call number (IEMTHREADEDFUNCS). */
     935        uint32_t    enmCall    : 16;
     936    } ThreadedCall2;
     937
     938    struct
     939    {
     940        /* kIemTbDbgEntryType_GuestRegShadow. */
     941        uint32_t    uType      : 4;
     942        uint32_t    uPadding   : 4;
     943        /** The host register number. */
     944        uint32_t    idxHstReg  : 8;
     945        /** The guest register being shadowed (IEMNATIVEGSTREG). */
     946        uint32_t    idxGstReg  : 8;
     947        uint32_t    uUnused    : 8;
     948    } GuestRegShadow;
     949} IEMTBDBGENTRY;
     950AssertCompileSize(IEMTBDBGENTRY, sizeof(uint32_t));
     951
     952/**
     953 * Translation block debug info.
     954 */
     955typedef struct IEMTBDBG
     956{
     957    /** Number of entries in aEntries. */
     958    uint32_t        cEntries;
     959    /** Number of entries we've allocated. */
     960    uint32_t        cAllocated;
     961    /** Debug info entries. */
     962    RT_FLEXIBLE_ARRAY_EXTENSION
     963    IEMTBDBGENTRY   aEntries[RT_FLEXIBLE_ARRAY];
     964} IEMTBDBG;
     965/** Pointer to TB debug info. */
     966typedef IEMTBDBG *PIEMTBDBG;
     967/** Pointer to const TB debug info. */
     968typedef IEMTBDBG const *PCIEMTBDBG;
    871969
    872970
     
    9451043    uint8_t            *pabOpcodes;
    9461044
    947     /** Debug info or smth. */
    948     void               *pvDbg;
     1045    /** Debug info if enabled.
     1046     * This is only generated by the native recompiler. */
     1047    PIEMTBDBG           pDbgInfo;
    9491048
    9501049    /* --- 64 byte cache line end --- */
     
    9811080     * The GCPhysPc w/o page offset is element zero, so starting here with 1. */
    9821081    RTGCPHYS            aGCPhysPages[2];
    983 
    9841082} IEMTB;
    9851083#pragma pack()
     
    9871085AssertCompileMemberAlignment(IEMTB, Thrd, sizeof(void *));
    9881086AssertCompileMemberAlignment(IEMTB, pabOpcodes, sizeof(void *));
    989 AssertCompileMemberAlignment(IEMTB, pvDbg, sizeof(void *));
     1087AssertCompileMemberAlignment(IEMTB, pDbgInfo, sizeof(void *));
    9901088AssertCompileMemberAlignment(IEMTB, aGCPhysPages, sizeof(RTGCPHYS));
    9911089AssertCompileMemberOffset(IEMTB, aRanges[0], 64);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette