Changeset 86143 in vbox for trunk/src/VBox/Debugger
- Timestamp:
- Sep 17, 2020 7:15:48 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/DBGCRemoteKd.cpp
r86113 r86143 325 325 NTCONTEXT64 Ctx; 326 326 } NTKCONTEXT64; 327 AssertCompileMemberAlignment(NTKCONTEXT64, Ctx, 16); 327 328 /** Pointer to an amd64 NT context. */ 328 329 typedef NTKCONTEXT64 *PNTKCONTEXT64; … … 517 518 uint64_t u64PtrDebuggerDataList; 518 519 } KDPACKETMANIPULATE_GETVERSION64; 519 AssertCompileSize(KDPACKETMANIPULATE_GETVERSION64, 8 * 2 + 3 * 8);520 AssertCompileSize(KDPACKETMANIPULATE_GETVERSION64, 40); 520 521 /** Pointer to a 64bit get version manipulate payload. */ 521 522 typedef KDPACKETMANIPULATE_GETVERSION64 *PKDPACKETMANIPULATE_GETVERSION64; … … 538 539 uint64_t au64Pad[3]; 539 540 } KDPACKETMANIPULATE_XFERMEM64; 540 AssertCompileSize(KDPACKETMANIPULATE_XFERMEM64, 4 * 8 + 2 * 4);541 AssertCompileSize(KDPACKETMANIPULATE_XFERMEM64, 40); 541 542 /** Pointer to a 64bit memory transfer manipulate payload. */ 542 543 typedef KDPACKETMANIPULATE_XFERMEM64 *PKDPACKETMANIPULATE_XFERMEM64; … … 562 563 uint64_t au64Pad[3]; 563 564 } KDPACKETMANIPULATE_XFERCTRLSPACE64; 564 AssertCompileSize(KDPACKETMANIPULATE_XFERCTRLSPACE64, 4 * 8 + 2 * 4);565 AssertCompileSize(KDPACKETMANIPULATE_XFERCTRLSPACE64, 40); 565 566 /** Pointer to a 64bit memory transfer manipulate payload. */ 566 567 typedef KDPACKETMANIPULATE_XFERCTRLSPACE64 *PKDPACKETMANIPULATE_XFERCTRLSPACE64; … … 598 599 599 600 /** 600 * context extended manipulate payload.601 * Context extended manipulate payload. 601 602 */ 602 603 typedef struct KDPACKETMANIPULATE_CONTEXTEX … … 608 609 /** Number of bytes actually transfered. */ 609 610 uint32_t cbXfered; 611 /** Blows up the request to the required size. */ 612 uint8_t abPad[28]; 610 613 } KDPACKETMANIPULATE_CONTEXTEX; 611 AssertCompileSize(KDPACKETMANIPULATE_CONTEXTEX, 3 * 4);614 AssertCompileSize(KDPACKETMANIPULATE_CONTEXTEX, 40); 612 615 /** Pointer to a context extended manipulate payload. */ 613 616 typedef KDPACKETMANIPULATE_CONTEXTEX *PKDPACKETMANIPULATE_CONTEXTEX; 614 617 /** Pointer to a const context extended manipulate payload. */ 615 618 typedef const KDPACKETMANIPULATE_CONTEXTEX *PCKDPACKETMANIPULATE_CONTEXTEX; 619 620 621 /** 622 * Continue manipulate payload. 623 */ 624 typedef struct KDPACKETMANIPULATE_CONTINUE 625 { 626 /** Continue (status?). */ 627 uint32_t u32NtContSts; 628 /** Blows up the request to the required size. */ 629 uint8_t abPad[36]; 630 } KDPACKETMANIPULATE_CONTINUE; 631 AssertCompileSize(KDPACKETMANIPULATE_CONTINUE, 40); 632 /** Pointer to a context extended manipulate payload. */ 633 typedef KDPACKETMANIPULATE_CONTINUE *PKDPACKETMANIPULATE_CONTINUE; 634 /** Pointer to a const context extended manipulate payload. */ 635 typedef const KDPACKETMANIPULATE_CONTINUE *PCKDPACKETMANIPULATE_CONTINUE; 636 637 638 /** 639 * Continue 2 manipulate payload. 640 */ 641 typedef struct KDPACKETMANIPULATE_CONTINUE2 642 { 643 /** Continue (status?). */ 644 uint32_t u32NtContSts; 645 /** Trace flag. */ 646 uint32_t fTrace; 647 /** Bitsize dependent data. */ 648 union 649 { 650 /** 32bit. */ 651 struct 652 { 653 /** DR7 value to continue with. */ 654 uint32_t u32RegDr7; 655 /** @todo (?) */ 656 uint32_t u32SymCurStart; 657 uint32_t u32SymCurEnd; 658 } x86; 659 /** 64bit. */ 660 struct 661 { 662 /** DR7 value to continue with. */ 663 uint64_t u64RegDr7; 664 /** @todo (?) */ 665 uint64_t u64SymCurStart; 666 uint64_t u64SymCurEnd; 667 } amd64; 668 } u; 669 /** Blows up the request to the required size. */ 670 uint8_t abPad[8]; 671 } KDPACKETMANIPULATE_CONTINUE2; 672 AssertCompileSize(KDPACKETMANIPULATE_CONTINUE2, 40); 673 /** Pointer to a context extended manipulate payload. */ 674 typedef KDPACKETMANIPULATE_CONTINUE2 *PKDPACKETMANIPULATE_CONTINUE2; 675 /** Pointer to a const context extended manipulate payload. */ 676 typedef const KDPACKETMANIPULATE_CONTINUE2 *PCKDPACKETMANIPULATE_CONTINUE2; 616 677 617 678 … … 653 714 /** Read/Write memory. */ 654 715 KDPACKETMANIPULATE_XFERMEM64 XferMem; 716 /** Continue. */ 717 KDPACKETMANIPULATE_CONTINUE Continue; 718 /** Continue2. */ 719 KDPACKETMANIPULATE_CONTINUE2 Continue2; 655 720 /** Read/Write control space. */ 656 721 KDPACKETMANIPULATE_XFERCTRLSPACE64 XferCtrlSpace; … … 908 973 break; 909 974 } 975 case KD_PACKET_MANIPULATE_REQ_CONTINUE: 976 { 977 KDPACKETMANIPULATE_CONTINUE Continue; 978 cbCopied = RTSgBufCopyToBuf(pSgBuf, &Continue, sizeof(Continue)); 979 if (cbCopied == sizeof(Continue)) 980 Log3((" u32NtContSts: %RX32\n", Continue.u32NtContSts)); 981 else 982 Log3((" Payload to small, expected %u, got %zu\n", sizeof(Continue), cbCopied)); 983 break; 984 } 985 case KD_PACKET_MANIPULATE_REQ_CONTINUE2: 986 { 987 KDPACKETMANIPULATE_CONTINUE2 Continue; 988 cbCopied = RTSgBufCopyToBuf(pSgBuf, &Continue, sizeof(Continue)); 989 if (cbCopied == sizeof(Continue)) 990 Log3((" u32NtContSts: %RX32\n" 991 " fTrace: %RX32\n", 992 Continue.u32NtContSts, Continue.fTrace)); 993 else 994 Log3((" Payload to small, expected %u, got %zu\n", sizeof(Continue), cbCopied)); 995 break; 996 } 910 997 case KD_PACKET_MANIPULATE_REQ_READ_CTRL_SPACE: 911 998 case KD_PACKET_MANIPULATE_REQ_WRITE_CTRL_SPACE: … … 922 1009 else 923 1010 Log3((" Payload to small, expected %u, got %zu\n", sizeof(XferCtrlSpace64), cbCopied)); 1011 break; 1012 } 1013 case KD_PACKET_MANIPULATE_REQ_GET_CONTEXT_EX: 1014 { 1015 KDPACKETMANIPULATE_CONTEXTEX GetContextEx; 1016 cbCopied = RTSgBufCopyToBuf(pSgBuf, &GetContextEx, sizeof(GetContextEx)); 1017 if (cbCopied == sizeof(GetContextEx)) 1018 { 1019 Log3((" offStart: %RX32\n" 1020 " cbXferReq: %RX32\n" 1021 " cbXfered: %RX32\n", 1022 GetContextEx.offStart, GetContextEx.cbXfer, GetContextEx.cbXfered)); 1023 } 1024 else 1025 Log3((" Payload to small, expected %u, got %zu\n", sizeof(GetContextEx), cbCopied)); 924 1026 break; 925 1027 } … … 1672 1774 1673 1775 /** 1776 * Processes a continue request. 1777 * 1778 * @returns VBox status code. 1779 * @param pThis The KD context. 1780 * @param pPktManip The manipulate packet request. 1781 */ 1782 static int dbgcKdCtxPktManipulate64Continue(PKDCTX pThis, PCKDPACKETMANIPULATE64 pPktManip) 1783 { 1784 RT_NOREF(pPktManip); 1785 int rc = VINF_SUCCESS; 1786 1787 /* No response, just resume. */ 1788 if (DBGFR3IsHalted(pThis->Dbgc.pUVM, VMCPUID_ALL)) 1789 rc = DBGFR3Resume(pThis->Dbgc.pUVM, VMCPUID_ALL); 1790 1791 return rc; 1792 } 1793 1794 1795 /** 1796 * Processes a continue request. 1797 * 1798 * @returns VBox status code. 1799 * @param pThis The KD context. 1800 * @param pPktManip The manipulate packet request. 1801 */ 1802 static int dbgcKdCtxPktManipulate64Continue2(PKDCTX pThis, PCKDPACKETMANIPULATE64 pPktManip) 1803 { 1804 int rc = VINF_SUCCESS; 1805 1806 /* Resume if not single stepping, the single step will get a state change when the VM stepped. */ 1807 if (pPktManip->u.Continue2.fTrace) 1808 { 1809 PDBGFADDRESS pStackPop = NULL; 1810 RTGCPTR cbStackPop = 0; 1811 rc = DBGFR3StepEx(pThis->Dbgc.pUVM, pThis->Dbgc.idCpu, DBGF_STEP_F_INTO, NULL, 1812 pStackPop, cbStackPop, 1 /*cMaxSteps*/); 1813 } 1814 else if (DBGFR3IsHalted(pThis->Dbgc.pUVM, VMCPUID_ALL)) 1815 rc = DBGFR3Resume(pThis->Dbgc.pUVM, VMCPUID_ALL); 1816 1817 return rc; 1818 } 1819 1820 1821 /** 1674 1822 * Processes a read control space 64 request. 1675 1823 * … … 1881 2029 { 1882 2030 rc = dbgcKdCtxPktManipulate64ReadMem(pThis, pPktManip); 2031 break; 2032 } 2033 case KD_PACKET_MANIPULATE_REQ_CONTINUE: 2034 { 2035 rc = dbgcKdCtxPktManipulate64Continue(pThis, pPktManip); 2036 break; 2037 } 2038 case KD_PACKET_MANIPULATE_REQ_CONTINUE2: 2039 { 2040 rc = dbgcKdCtxPktManipulate64Continue2(pThis, pPktManip); 1883 2041 break; 1884 2042 }
Note:
See TracChangeset
for help on using the changeset viewer.