VirtualBox

Changeset 76691 in vbox


Ignore:
Timestamp:
Jan 8, 2019 5:54:14 AM (6 years ago)
Author:
vboxsync
Message:

DBGPlugInOS2.cpp: Added info items sas, gis, lis, and panic. Skip executables and resource segments when loading modules.

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Debugger/DBGPlugInOS2.cpp

    r76553 r76691  
    5454typedef struct DBGDIGGEROS2
    5555{
     56    /** The user-mode VM handle for use in info handlers. */
     57    PUVM                pUVM;
     58
    5659    /** Whether the information is valid or not.
    5760     * (For fending off illegal interface method calls.) */
     
    6669
    6770    /** Guest's Global Info Segment selector. */
    68     uint16_t            selGIS;
     71    uint16_t            selGis;
     72    /** The 16:16 address of the LIS. */
     73    RTFAR32             Lis;
     74
     75    /** The kernel virtual address (excluding DOSMVDMINSTDATA & DOSSWAPINSTDATA). */
     76    uint32_t            uKernelAddr;
     77    /** The kernel size. */
     78    uint32_t            cbKernel;
    6979
    7080} DBGDIGGEROS2;
     
    312322{
    313323    uint16_t    SAS_info_global;    /**< GIS selector. */
    314     uint32_t    SAS_info_local;     /**< Flat address of LIS for current task. */
     324    uint32_t    SAS_info_local;     /**< 16:16 address of LIS for current task. */
    315325    uint32_t    SAS_info_localRM;
    316326    uint16_t    SAS_info_CDIB;      /**< Selector. */
     
    331341
    332342
     343typedef struct OS2GIS
     344{
     345    uint32_t    time;
     346    uint32_t    msecs;
     347    uint8_t     hour;
     348    uint8_t     minutes;
     349    uint8_t     seconds;
     350    uint8_t     hundredths;
     351    int16_t     timezone;
     352    uint16_t    cusecTimerInterval;
     353    uint8_t     day;
     354    uint8_t     month;
     355    uint16_t    year;
     356    uint8_t     weekday;
     357    uint8_t     uchMajorVersion;
     358    uint8_t     uchMinorVersion;
     359    uint8_t     chRevisionLetter;
     360    uint8_t     sgCurrent;
     361    uint8_t     sgMax;
     362    uint8_t     cHugeShift;
     363    uint8_t     fProtectModeOnly;
     364    uint16_t    pidForeground;
     365    uint8_t     fDynamicSched;
     366    uint8_t     csecMaxWait;
     367    uint16_t    cmsecMinSlice;
     368    uint16_t    cmsecMaxSlice;
     369    uint16_t    bootdrive;
     370    uint8_t     amecRAS[32];
     371    uint8_t     csgWindowableVioMax;
     372    uint8_t     csgPMMax;
     373    uint16_t    SIS_Syslog;
     374    uint16_t    SIS_MMIOBase;
     375    uint16_t    SIS_MMIOAddr;
     376    uint8_t     SIS_MaxVDMs;
     377    uint8_t     SIS_Reserved;
     378} OS2GIS;
     379
     380typedef struct OS2LIS
     381{
     382    uint16_t    pidCurrent;
     383    uint16_t    pidParent;
     384    uint16_t    prtyCurrent;
     385    uint16_t    tidCurrent;
     386    uint16_t    sgCurrent;
     387    uint8_t     rfProcStatus;
     388    uint8_t     bReserved1;
     389    uint16_t    fForeground;
     390    uint8_t     typeProcess;
     391    uint8_t     bReserved2;
     392    uint16_t    selEnvironment;
     393    uint16_t    offCmdLine;
     394    uint16_t    cbDataSegment;
     395    uint16_t    cbStack;
     396    uint16_t    cbHeap;
     397    uint16_t    hmod;
     398    uint16_t    selDS;
     399} OS2LIS;
     400
    333401
    334402/*********************************************************************************************************************************
     
    348416
    349417
    350 
    351 #if 0 /* unused */
    352 /**
    353  * Process a PE image found in guest memory.
    354  *
    355  * @param   pThis           The instance data.
    356  * @param   pUVM            The user mode VM handle.
    357  * @param   pszName         The image name.
    358  * @param   pImageAddr      The image address.
    359  * @param   cbImage         The size of the image.
    360  * @param   pbBuf           Scratch buffer containing the first
    361  *                          RT_MIN(cbBuf, cbImage) bytes of the image.
    362  * @param   cbBuf           The scratch buffer size.
    363  */
    364 static void dbgDiggerOS2ProcessImage(PDBGDIGGEROS2 pThis, PUVM pUVM, const char *pszName,
    365                                      PCDBGFADDRESS pImageAddr, uint32_t cbImage,
    366                                      uint8_t *pbBuf, size_t cbBuf)
    367 {
    368     RT_NOREF7(pThis, pUVM, pszName, pImageAddr, cbImage, pbBuf, cbBuf);
    369     LogFlow(("DigOS2: %RGp %#x %s\n", pImageAddr->FlatPtr, cbImage, pszName));
    370 
    371     /* To be implemented.*/
    372 }
    373 #endif
     418static int dbgDiggerOS2DisplaySelectorAndInfoEx(PDBGDIGGEROS2 pThis, PCDBGFINFOHLP pHlp, uint16_t uSel, uint32_t off,
     419                                                int cchWidth, const char *pszMessage, PDBGFSELINFO pSelInfo)
     420{
     421    RT_ZERO(*pSelInfo);
     422    int rc = DBGFR3SelQueryInfo(pThis->pUVM, 0 /*idCpu*/, uSel, DBGFSELQI_FLAGS_DT_GUEST, pSelInfo);
     423    if (RT_SUCCESS(rc))
     424    {
     425        if (off == UINT32_MAX)
     426            pHlp->pfnPrintf(pHlp, "%*s: %#06x (%RGv LB %#RX64 flags=%#x)\n",
     427                            cchWidth, pszMessage, uSel, pSelInfo->GCPtrBase, pSelInfo->cbLimit, pSelInfo->fFlags);
     428        else
     429            pHlp->pfnPrintf(pHlp, "%*s: %04x:%04x (%RGv LB %#RX64 flags=%#x)\n",
     430                            cchWidth, pszMessage, uSel, off, pSelInfo->GCPtrBase + off, pSelInfo->cbLimit - off, pSelInfo->fFlags);
     431    }
     432    else if (off == UINT32_MAX)
     433        pHlp->pfnPrintf(pHlp, "%*s: %#06x (%Rrc)\n", cchWidth, pszMessage, uSel, rc);
     434    else
     435        pHlp->pfnPrintf(pHlp, "%*s: %04x:%04x (%Rrc)\n", cchWidth, pszMessage, uSel, off, rc);
     436    return rc;
     437}
     438
     439DECLINLINE(int) dbgDiggerOS2DisplaySelectorAndInfo(PDBGDIGGEROS2 pThis, PCDBGFINFOHLP pHlp, uint16_t uSel, uint32_t off,
     440                                                   int cchWidth, const char *pszMessage)
     441{
     442    DBGFSELINFO SelInfo;
     443    return dbgDiggerOS2DisplaySelectorAndInfoEx(pThis, pHlp, uSel, off, cchWidth, pszMessage, &SelInfo);
     444}
     445
     446
     447/**
     448 * @callback_method_impl{FNDBGFHANDLEREXT,
     449 *  Display the OS/2 system anchor segment}
     450 */
     451static DECLCALLBACK(void) dbgDiggerOS2InfoSas(void *pvUser, PCDBGFINFOHLP pHlp, const char *pszArgs)
     452{
     453    RT_NOREF(pszArgs);
     454    PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvUser;
     455    DBGFSELINFO   SelInfo;
     456    int rc = DBGFR3SelQueryInfo(pThis->pUVM, 0 /*idCpu*/, 0x70, DBGFSELQI_FLAGS_DT_GUEST, &SelInfo);
     457    if (RT_FAILURE(rc))
     458    {
     459        pHlp->pfnPrintf(pHlp, "DBGFR3SelQueryInfo failed on selector 0x70: %Rrc\n", rc);
     460        return;
     461    }
     462    pHlp->pfnPrintf(pHlp, "Selector 0x70: %RGv LB %#RX64 (flags %#x)\n",
     463                    SelInfo.GCPtrBase, (uint64_t)SelInfo.cbLimit, SelInfo.fFlags);
     464
     465    /*
     466     * The SAS header.
     467     */
     468    union
     469    {
     470        SAS Sas;
     471        uint16_t au16Sas[sizeof(SAS) / sizeof(uint16_t)];
     472    };
     473    DBGFADDRESS Addr;
     474    rc = DBGFR3MemRead(pThis->pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pThis->pUVM, &Addr, SelInfo.GCPtrBase), &Sas, sizeof(Sas));
     475    if (RT_FAILURE(rc))
     476    {
     477        pHlp->pfnPrintf(pHlp, "Failed to read SAS header: %Rrc\n", rc);
     478        return;
     479    }
     480    if (memcmp(&Sas.SAS_signature[0], SAS_SIGNATURE, sizeof(Sas.SAS_signature)) != 0)
     481    {
     482        pHlp->pfnPrintf(pHlp, "Invalid SAS signature: %#x %#x %#x %#x (expected %#x %#x %#x %#x)\n",
     483                        Sas.SAS_signature[0], Sas.SAS_signature[1], Sas.SAS_signature[2], Sas.SAS_signature[3],
     484                        SAS_SIGNATURE[0], SAS_SIGNATURE[1], SAS_SIGNATURE[2], SAS_SIGNATURE[3]);
     485        return;
     486    }
     487    pHlp->pfnPrintf(pHlp, " Flat kernel DS: %#06x\n",         Sas.SAS_flat_sel);
     488    pHlp->pfnPrintf(pHlp, "SAS_tables_data: %#06x (%#RGv)\n", Sas.SAS_tables_data, SelInfo.GCPtrBase + Sas.SAS_tables_data);
     489    pHlp->pfnPrintf(pHlp, "SAS_config_data: %#06x (%#RGv)\n", Sas.SAS_config_data, SelInfo.GCPtrBase + Sas.SAS_config_data);
     490    pHlp->pfnPrintf(pHlp, "    SAS_dd_data: %#06x (%#RGv)\n", Sas.SAS_dd_data,     SelInfo.GCPtrBase + Sas.SAS_dd_data);
     491    pHlp->pfnPrintf(pHlp, "    SAS_vm_data: %#06x (%#RGv)\n", Sas.SAS_vm_data,     SelInfo.GCPtrBase + Sas.SAS_vm_data);
     492    pHlp->pfnPrintf(pHlp, "  SAS_task_data: %#06x (%#RGv)\n", Sas.SAS_task_data,   SelInfo.GCPtrBase + Sas.SAS_task_data);
     493    pHlp->pfnPrintf(pHlp, "   SAS_RAS_data: %#06x (%#RGv)\n", Sas.SAS_RAS_data,    SelInfo.GCPtrBase + Sas.SAS_RAS_data);
     494    pHlp->pfnPrintf(pHlp, "  SAS_file_data: %#06x (%#RGv)\n", Sas.SAS_file_data,   SelInfo.GCPtrBase + Sas.SAS_file_data);
     495    pHlp->pfnPrintf(pHlp, "  SAS_info_data: %#06x (%#RGv)\n", Sas.SAS_info_data,   SelInfo.GCPtrBase + Sas.SAS_info_data);
     496    bool fIncludeMP = true;
     497    if (Sas.SAS_mp_data < sizeof(Sas))
     498        fIncludeMP = false;
     499    else
     500        for (unsigned i = 2; i < RT_ELEMENTS(au16Sas) - 1; i++)
     501            if (au16Sas[i] < sizeof(SAS))
     502            {
     503                fIncludeMP = false;
     504                break;
     505            }
     506    if (fIncludeMP)
     507        pHlp->pfnPrintf(pHlp, "    SAS_mp_data: %#06x (%#RGv)\n", Sas.SAS_mp_data, SelInfo.GCPtrBase + Sas.SAS_mp_data);
     508
     509    /* shared databuf */
     510    union
     511    {
     512        SASINFO Info;
     513    } u;
     514
     515    /*
     516     * Info data.
     517     */
     518    rc = DBGFR3MemRead(pThis->pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pThis->pUVM, &Addr, SelInfo.GCPtrBase + Sas.SAS_info_data),
     519                       &u.Info, sizeof(u.Info));
     520    if (RT_SUCCESS(rc))
     521    {
     522        pHlp->pfnPrintf(pHlp, "SASINFO:\n");
     523        dbgDiggerOS2DisplaySelectorAndInfo(pThis, pHlp, u.Info.SAS_info_global, UINT32_MAX, 28, "Global info segment");
     524        pHlp->pfnPrintf(pHlp, "%28s: %#010x\n", "Local info segment", u.Info.SAS_info_local);
     525        pHlp->pfnPrintf(pHlp, "%28s: %#010x\n", "Local info segment (RM)", u.Info.SAS_info_localRM);
     526        dbgDiggerOS2DisplaySelectorAndInfo(pThis, pHlp, u.Info.SAS_info_CDIB, UINT32_MAX, 28, "SAS_info_CDIB");
     527    }
     528    else
     529        pHlp->pfnPrintf(pHlp, "Failed to read SAS info data: %Rrc\n", rc);
     530
     531    /** @todo more    */
     532}
     533
     534
     535/**
     536 * @callback_method_impl{FNDBGFHANDLEREXT,
     537 *  Display the OS/2 global info segment}
     538 */
     539static DECLCALLBACK(void) dbgDiggerOS2InfoGis(void *pvUser, PCDBGFINFOHLP pHlp, const char *pszArgs)
     540{
     541    RT_NOREF(pszArgs);
     542    PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvUser;
     543    DBGFSELINFO   SelInfo;
     544    int rc = dbgDiggerOS2DisplaySelectorAndInfoEx(pThis, pHlp, pThis->selGis, UINT32_MAX, 0, "Global info segment", &SelInfo);
     545    if (RT_FAILURE(rc))
     546        return;
     547
     548    /*
     549     * Read the GIS.
     550     */
     551    DBGFADDRESS Addr;
     552    OS2GIS      Gis;
     553    RT_ZERO(Gis);
     554    rc = DBGFR3MemRead(pThis->pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pThis->pUVM, &Addr, SelInfo.GCPtrBase), &Gis,
     555                       RT_MIN(sizeof(Gis), SelInfo.cbLimit + 1));
     556    if (RT_FAILURE(rc))
     557    {
     558        pHlp->pfnPrintf(pHlp, "Failed to read GIS: %Rrc\n", rc);
     559        return;
     560    }
     561    pHlp->pfnPrintf(pHlp, "               time: %#010x\n", Gis.time);
     562    pHlp->pfnPrintf(pHlp, "              msecs: %#010x\n", Gis.msecs);
     563    pHlp->pfnPrintf(pHlp, "          timestamp: %04u-%02u-%02u %02u:%02u:%02u.%02u\n",
     564                    Gis.year, Gis.month, Gis.day, Gis.hour, Gis.minutes, Gis.seconds, Gis.hundredths);
     565    pHlp->pfnPrintf(pHlp, "           timezone: %+2d (min delta)\n", (int)Gis.timezone);
     566    pHlp->pfnPrintf(pHlp, "            weekday: %u\n", Gis.weekday);
     567    pHlp->pfnPrintf(pHlp, " cusecTimerInterval: %u\n", Gis.cusecTimerInterval);
     568    pHlp->pfnPrintf(pHlp, "            version: %u.%u\n", Gis.uchMajorVersion, Gis.uchMinorVersion);
     569    pHlp->pfnPrintf(pHlp, "           revision: %#04x (%c)\n", Gis.chRevisionLetter, Gis.chRevisionLetter);
     570    pHlp->pfnPrintf(pHlp, " current screen grp: %#04x (%u)\n", Gis.sgCurrent, Gis.sgCurrent);
     571    pHlp->pfnPrintf(pHlp, "  max screen groups: %#04x (%u)\n", Gis.sgMax, Gis.sgMax);
     572    pHlp->pfnPrintf(pHlp, "csgWindowableVioMax: %#x (%u)\n", Gis.csgWindowableVioMax, Gis.csgWindowableVioMax);
     573    pHlp->pfnPrintf(pHlp, "           csgPMMax: %#x (%u)\n", Gis.csgPMMax, Gis.csgPMMax);
     574    pHlp->pfnPrintf(pHlp, "         cHugeShift: %#04x\n", Gis.cHugeShift);
     575    pHlp->pfnPrintf(pHlp, "   fProtectModeOnly: %d\n", Gis.fProtectModeOnly);
     576    pHlp->pfnPrintf(pHlp, "      pidForeground: %#04x (%u)\n", Gis.pidForeground, Gis.pidForeground);
     577    pHlp->pfnPrintf(pHlp, "      fDynamicSched: %u\n", Gis.fDynamicSched);
     578    pHlp->pfnPrintf(pHlp, "        csecMaxWait: %u\n", Gis.csecMaxWait);
     579    pHlp->pfnPrintf(pHlp, "      cmsecMinSlice: %u\n", Gis.cmsecMinSlice);
     580    pHlp->pfnPrintf(pHlp, "      cmsecMaxSlice: %u\n", Gis.cmsecMaxSlice);
     581    pHlp->pfnPrintf(pHlp, "          bootdrive: %#x\n", Gis.bootdrive);
     582    pHlp->pfnPrintf(pHlp, "            amecRAS: %.32Rhxs\n", &Gis.amecRAS[0]);
     583    pHlp->pfnPrintf(pHlp, "         SIS_Syslog: %#06x (%u)\n", Gis.SIS_Syslog, Gis.SIS_Syslog);
     584    pHlp->pfnPrintf(pHlp, "       SIS_MMIOBase: %#06x\n", Gis.SIS_MMIOBase);
     585    pHlp->pfnPrintf(pHlp, "       SIS_MMIOAddr: %#06x\n", Gis.SIS_MMIOAddr);
     586    pHlp->pfnPrintf(pHlp, "        SIS_MaxVDMs: %#04x (%u)\n", Gis.SIS_MaxVDMs, Gis.SIS_MaxVDMs);
     587    pHlp->pfnPrintf(pHlp, "       SIS_Reserved: %#04x\n", Gis.SIS_Reserved);
     588}
     589
     590
     591/**
     592 * @callback_method_impl{FNDBGFHANDLEREXT,
     593 *  Display the OS/2 local info segment}
     594 */
     595static DECLCALLBACK(void) dbgDiggerOS2InfoLis(void *pvUser, PCDBGFINFOHLP pHlp, const char *pszArgs)
     596{
     597    RT_NOREF(pszArgs);
     598    PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvUser;
     599    DBGFSELINFO   SelInfo;
     600    int rc = dbgDiggerOS2DisplaySelectorAndInfoEx(pThis, pHlp, pThis->Lis.sel, pThis->Lis.off, 19, "Local info segment", &SelInfo);
     601    if (RT_FAILURE(rc))
     602        return;
     603
     604    /*
     605     * Read the LIS.
     606     */
     607    DBGFADDRESS Addr;
     608    OS2LIS      Lis;
     609    RT_ZERO(Lis);
     610    rc = DBGFR3MemRead(pThis->pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pThis->pUVM, &Addr, SelInfo.GCPtrBase + pThis->Lis.off),
     611                       &Lis, sizeof(Lis));
     612    if (RT_FAILURE(rc))
     613    {
     614        pHlp->pfnPrintf(pHlp, "Failed to read LIS: %Rrc\n", rc);
     615        return;
     616    }
     617    pHlp->pfnPrintf(pHlp, "         pidCurrent: %#06x (%u)\n", Lis.pidCurrent, Lis.pidCurrent);
     618    pHlp->pfnPrintf(pHlp, "          pidParent: %#06x (%u)\n", Lis.pidParent, Lis.pidParent);
     619    pHlp->pfnPrintf(pHlp, "        prtyCurrent: %#06x (%u)\n", Lis.prtyCurrent, Lis.prtyCurrent);
     620    pHlp->pfnPrintf(pHlp, "         tidCurrent: %#06x (%u)\n", Lis.tidCurrent, Lis.tidCurrent);
     621    pHlp->pfnPrintf(pHlp, "          sgCurrent: %#06x (%u)\n", Lis.sgCurrent, Lis.sgCurrent);
     622    pHlp->pfnPrintf(pHlp, "       rfProcStatus: %#04x\n", Lis.rfProcStatus);
     623    if (Lis.bReserved1)
     624        pHlp->pfnPrintf(pHlp, "         bReserved1: %#04x\n", Lis.bReserved1);
     625    pHlp->pfnPrintf(pHlp, "        fForeground: %#04x (%u)\n", Lis.fForeground, Lis.fForeground);
     626    pHlp->pfnPrintf(pHlp, "        typeProcess: %#04x (%u)\n", Lis.typeProcess, Lis.typeProcess);
     627    if (Lis.bReserved2)
     628        pHlp->pfnPrintf(pHlp, "         bReserved2: %#04x\n", Lis.bReserved2);
     629    dbgDiggerOS2DisplaySelectorAndInfo(pThis, pHlp, Lis.selEnvironment, UINT32_MAX, 19, "selEnvironment");
     630    pHlp->pfnPrintf(pHlp, "         offCmdLine: %#06x (%u)\n", Lis.offCmdLine, Lis.offCmdLine);
     631    pHlp->pfnPrintf(pHlp, "      cbDataSegment: %#06x (%u)\n", Lis.cbDataSegment, Lis.cbDataSegment);
     632    pHlp->pfnPrintf(pHlp, "            cbStack: %#06x (%u)\n", Lis.cbStack, Lis.cbStack);
     633    pHlp->pfnPrintf(pHlp, "             cbHeap: %#06x (%u)\n", Lis.cbHeap, Lis.cbHeap);
     634    pHlp->pfnPrintf(pHlp, "               hmod: %#06x\n", Lis.hmod); /** @todo look up the name*/
     635    dbgDiggerOS2DisplaySelectorAndInfo(pThis, pHlp, Lis.selDS, UINT32_MAX, 19, "selDS");
     636}
     637
     638
     639/**
     640 * @callback_method_impl{FNDBGFHANDLEREXT,
     641 *  Display the OS/2 panic message}
     642 */
     643static DECLCALLBACK(void) dbgDiggerOS2InfoPanic(void *pvUser, PCDBGFINFOHLP pHlp, const char *pszArgs)
     644{
     645    RT_NOREF(pszArgs);
     646    PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvUser;
     647    DBGFADDRESS   HitAddr;
     648    int rc = DBGFR3MemScan(pThis->pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pThis->pUVM, &HitAddr, pThis->uKernelAddr),
     649                           pThis->cbKernel, 1, RT_STR_TUPLE("Exception in module:"), &HitAddr);
     650    if (RT_FAILURE(rc))
     651        rc = DBGFR3MemScan(pThis->pUVM, 0 /*idCpu&*/, DBGFR3AddrFromFlat(pThis->pUVM, &HitAddr, pThis->uKernelAddr),
     652                           pThis->cbKernel, 1, RT_STR_TUPLE("Exception in device driver:"), &HitAddr);
     653    /** @todo support pre-2001 kernels w/o the module/drivce name.   */
     654    if (RT_SUCCESS(rc))
     655    {
     656        char szMsg[728 + 1];
     657        RT_ZERO(szMsg);
     658        rc = DBGFR3MemRead(pThis->pUVM, 0, &HitAddr, szMsg, sizeof(szMsg) - 1);
     659        if (szMsg[0] != '\0')
     660        {
     661            RTStrPurgeEncoding(szMsg);
     662            char *psz = szMsg;
     663            while (*psz != '\0')
     664            {
     665                char *pszEol = strchr(psz, '\r');
     666                if (pszEol)
     667                    *pszEol = '\0';
     668                pHlp->pfnPrintf(pHlp, "%s\n", psz);
     669                if (!pszEol)
     670                    break;
     671                psz = ++pszEol;
     672                if (*psz == '\n')
     673                    psz++;
     674            }
     675        }
     676        else
     677            pHlp->pfnPrintf(pHlp, "DBGFR3MemRead -> %Rrc\n", rc);
     678    }
     679    else
     680        pHlp->pfnPrintf(pHlp, "Unable to locate OS/2 panic message. (%Rrc)\n", rc);
     681}
     682
    374683
    375684
     
    450759    Assert(pThis->fValid);
    451760
     761    DBGFR3InfoDeregisterExternal(pUVM, "sas");
     762    DBGFR3InfoDeregisterExternal(pUVM, "gis");
     763    DBGFR3InfoDeregisterExternal(pUVM, "lis");
     764    DBGFR3InfoDeregisterExternal(pUVM, "panic");
     765
    452766    pThis->fValid = false;
    453767}
     
    490804}
    491805
     806
    492807/** Buffer shared by dbgdiggerOS2ProcessModule and dbgDiggerOS2Init.*/
    493808typedef union DBGDIGGEROS2BUF
     
    555870
    556871    /*
     872     * Don't load program modules into the global address spaces.
     873     */
     874    if ((Mte.mte_flags1 & MTE1_CLASS_MASK) == MTE1_CLASS_PROGRAM)
     875    {
     876        LogRel(("DbgDiggerOs2: Program module, skipping.\n", Mte.mte_flags1));
     877        return;
     878    }
     879
     880    /*
    557881     * Try read the swappable MTE.  Save it too.
    558882     */
     
    617941    }
    618942
    619     /* No need to continue without an address space (shouldn't happen). */
     943    /*
     944     * If it is the kernel, take down the general address range so we can easily search
     945     * it all in one go when looking for panic messages and such.
     946     */
     947    if (Mte.mte_flags1 & MTE1_DOSMOD)
     948    {
     949        uint32_t uMax = 0;
     950        uint32_t uMin = UINT32_MAX;
     951        for (uint32_t i = 0; i < SwapMte.smte_objcnt; i++)
     952            if (pBuf->aOtes[i].ote_base > _512M)
     953            {
     954                if (pBuf->aOtes[i].ote_base < uMin)
     955                    uMin = pBuf->aOtes[i].ote_base;
     956                uint32_t uTmp = pBuf->aOtes[i].ote_base + pBuf->aOtes[i].ote_size;
     957                if (uTmp > uMax)
     958                    uMax = uTmp;
     959            }
     960        if (uMax != 0)
     961        {
     962            pThis->uKernelAddr = uMin;
     963            pThis->cbKernel    = uMax - uMin;
     964            LogRel(("DbgDiggerOs2: High kernel range: %#RX32 LB %#RX32 (%#RX32)\n", uMin, pThis->cbKernel, uMax));
     965        }
     966    }
     967
     968    /*
     969     * No need to continue without an address space (shouldn't happen).
     970     */
    620971    if (hAs == NIL_RTDBGAS)
    621972        return;
     
    6731024    {
    6741025        for (uint32_t i = 0; i < SwapMte.smte_objcnt; i++)
    675         {
    676             rc = RTDbgAsModuleLinkSeg(hAs, hDbgMod, i, pBuf->aOtes[i].ote_base, RTDBGASLINK_FLAGS_REPLACE /*fFlags*/);
    677             if (RT_FAILURE(rc))
    678                 LogRel(("DbgDiggerOs2: RTDbgAsModuleLinkSeg failed (i=%u, ote_base=%#x): %Rrc\n",
    679                         i, pBuf->aOtes[i].ote_base, rc));
    680         }
     1026            if (pBuf->aOtes[i].ote_base != 0)
     1027            {
     1028                rc = RTDbgAsModuleLinkSeg(hAs, hDbgMod, i, pBuf->aOtes[i].ote_base, RTDBGASLINK_FLAGS_REPLACE /*fFlags*/);
     1029                if (RT_FAILURE(rc))
     1030                    LogRel(("DbgDiggerOs2: RTDbgAsModuleLinkSeg failed (i=%u, ote_base=%#x): %Rrc\n",
     1031                            i, pBuf->aOtes[i].ote_base, rc));
     1032            }
    6811033    }
    6821034    else
     
    7021054     */
    7031055    /* Version info is at GIS:15h (major/minor/revision). */
    704     rc = DBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, pThis->selGIS, 0x15);
     1056    rc = DBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, pThis->selGis, 0x15);
    7051057    if (RT_FAILURE(rc))
    7061058        return VERR_NOT_SUPPORTED;
     
    7771129    }
    7781130
     1131    /*
     1132     * Register info handlers.
     1133     */
     1134    DBGFR3InfoRegisterExternal(pUVM, "sas",   "Dumps the OS/2 system anchor block (SAS)", dbgDiggerOS2InfoSas, pThis);
     1135    DBGFR3InfoRegisterExternal(pUVM, "gis",   "Dumps the OS/2 global info segment (GIS)", dbgDiggerOS2InfoGis, pThis);
     1136    DBGFR3InfoRegisterExternal(pUVM, "lis",   "Dumps the OS/2 local info segment (current process)", dbgDiggerOS2InfoLis, pThis);
     1137    DBGFR3InfoRegisterExternal(pUVM, "panic", "Dumps the OS/2 system panic message",      dbgDiggerOS2InfoPanic, pThis);
     1138
    7791139    return VINF_SUCCESS;
    7801140}
     
    8311191
    8321192        /* The global infoseg selector is the first entry in the info table. */
    833         pThis->selGIS = u.au16[offInfo/2];
     1193        SASINFO const *pInfo = (SASINFO const *)&u.au8[offInfo];
     1194        pThis->selGis   = pInfo->SAS_info_global;
     1195        pThis->Lis.sel  = RT_HI_U16(pInfo->SAS_info_local);
     1196        pThis->Lis.off  = RT_LO_U16(pInfo->SAS_info_local);
    8341197        return true;
    8351198    } while (0);
     
    8581221    pThis->f32Bit = false;
    8591222    pThis->enmVer = DBGDIGGEROS2VER_UNKNOWN;
     1223    pThis->pUVM   = pUVM;
    8601224    return VINF_SUCCESS;
    8611225}
  • trunk/src/VBox/VMM/VMMR3/VMMR3.def

    r76553 r76691  
    178178    DBGFR3PlugInLoadAll
    179179    DBGFR3PlugInUnloadAll
     180    DBGFR3SelQueryInfo
    180181    DBGFR3StackWalkBegin
    181182    DBGFR3StackWalkNext
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