VirtualBox

Changeset 64590 in vbox for trunk


Ignore:
Timestamp:
Nov 6, 2016 7:15:01 PM (8 years ago)
Author:
vboxsync
Message:

DBGFR3Flow: Small additions

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/dbgf.h

    r64589 r64590  
    26152615VMMR3DECL(uint32_t)          DBGFR3FlowBranchTblGetSlots(DBGFFLOWBRANCHTBL hFlowBranchTbl);
    26162616VMMR3DECL(PDBGFADDRESS)      DBGFR3FlowBranchTblGetStartAddress(DBGFFLOWBRANCHTBL hFlowBranchTbl, PDBGFADDRESS pAddrStart);
     2617VMMR3DECL(PDBGFADDRESS)      DBGFR3FlowBranchTblGetAddrAtSlot(DBGFFLOWBRANCHTBL hFlowBranchTbl, uint32_t idxSlot, PDBGFADDRESS pAddrSlot);
    26172618VMMR3DECL(int)               DBGFR3FlowBranchTblQueryAddresses(DBGFFLOWBRANCHTBL hFlowBranchTbl, PDBGFADDRESS paAddrs, uint32_t cAddrs);
    26182619
  • trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp

    r64589 r64590  
    492492    return NULL;
    493493}
     494VMMR3DECL(PDBGFADDRESS) DBGFR3FlowBranchTblGetAddrAtSlot(DBGFFLOWBRANCHTBL hFlowBranchTbl, uint32_t idxSlot, PDBGFADDRESS pAddrSlot)
     495{
     496    return NULL;
     497}
    494498VMMR3DECL(int) DBGFR3FlowBranchTblQueryAddresses(DBGFFLOWBRANCHTBL hFlowBranchTbl, PDBGFADDRESS paAddrs, uint32_t cAddrs)
    495499{
  • trunk/src/VBox/VMM/VMMR3/DBGFR3Flow.cpp

    r64589 r64590  
    15241524
    15251525/**
     1526 * Returns the number of branch tables inside the control flow graph.
     1527 *
     1528 * @returns Number of basic blocks.
     1529 * @param   hFlow                The control flow graph handle.
     1530 */
     1531VMMR3DECL(uint32_t) DBGFR3FlowGetBranchTblCount(DBGFFLOW hFlow)
     1532{
     1533    PDBGFFLOWINT pThis = hFlow;
     1534    AssertPtrReturn(pThis, 0);
     1535
     1536    return pThis->cBranchTbls;
     1537}
     1538
     1539
     1540/**
    15261541 * Retains the basic block handle.
    15271542 *
     
    15961611 *
    15971612 * @returns Pointer to DBGF adress containing the branch address of the basic block.
    1598  * @param   hFlowBb              The basic block handle.
     1613 * @param   hFlowBb             The basic block handle.
    15991614 * @param   pAddrTarget         Where to store the branch address of the basic block.
    16001615 *
    16011616 * @note This is only valid for unconditional or conditional branches and will assert
    16021617 *       for every other basic block type.
     1618 * @note For indirect unconditional branches using a branch table this will return the start address
     1619 *       of the branch table.
    16031620 */
    16041621VMMR3DECL(PDBGFADDRESS) DBGFR3FlowBbGetBranchAddress(DBGFFLOWBB hFlowBb, PDBGFADDRESS pAddrTarget)
     
    16081625    AssertPtrReturn(pAddrTarget, NULL);
    16091626    AssertReturn(   pFlowBb->enmEndType == DBGFFLOWBBENDTYPE_UNCOND_JMP
    1610                  || pFlowBb->enmEndType == DBGFFLOWBBENDTYPE_COND,
     1627                 || pFlowBb->enmEndType == DBGFFLOWBBENDTYPE_COND
     1628                 || pFlowBb->enmEndType == DBGFFLOWBBENDTYPE_UNCOND_INDIRECT_JMP,
    16111629                 NULL);
    16121630
    1613     *pAddrTarget = pFlowBb->AddrTarget;
     1631    if (   pFlowBb->enmEndType == DBGFFLOWBBENDTYPE_UNCOND_INDIRECT_JMP
     1632        && pFlowBb->pFlowBranchTbl)
     1633        *pAddrTarget = pFlowBb->pFlowBranchTbl->AddrStart;
     1634    else
     1635        *pAddrTarget = pFlowBb->AddrTarget;
    16141636    return pAddrTarget;
    16151637}
     
    19191941    *pAddrStart = pFlowBranchTbl->AddrStart;
    19201942    return pAddrStart;
     1943}
     1944
     1945
     1946/**
     1947 * Returns one address in the branch table at the given slot index.
     1948 *
     1949 * @return Pointer to the address at the given slot in the given branch table.
     1950 * @param  hFlowBranchTbl       The branch table handle.
     1951 * @param  idxSlot              The slot the address should be returned from.
     1952 * @param  pAddrSlot            Where to store the address.
     1953 */
     1954VMMR3DECL(PDBGFADDRESS) DBGFR3FlowBranchTblGetAddrAtSlot(DBGFFLOWBRANCHTBL hFlowBranchTbl, uint32_t idxSlot, PDBGFADDRESS pAddrSlot)
     1955{
     1956    PDBGFFLOWBRANCHTBLINT pFlowBranchTbl = hFlowBranchTbl;
     1957    AssertPtrReturn(pFlowBranchTbl, NULL);
     1958    AssertPtrReturn(pAddrSlot, NULL);
     1959    AssertReturn(idxSlot < pFlowBranchTbl->cSlots, NULL);
     1960
     1961    *pAddrSlot = pFlowBranchTbl->aAddresses[idxSlot];
     1962    return pAddrSlot;
    19211963}
    19221964
  • trunk/src/VBox/VMM/VMMR3/VMMR3.def

    r64589 r64590  
    157157    DBGFR3FlowBranchTblGetSlots
    158158    DBGFR3FlowBranchTblGetStartAddress
     159    DBGFR3FlowBranchTblGetAddrAtSlot
    159160    DBGFR3FlowBranchTblQueryAddresses
    160161    DBGFR3FlowItCreate
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