- Timestamp:
- Sep 17, 2020 7:37:46 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/DBGCRemoteKd.cpp
r86143 r86144 590 590 /** The breakpoint handle to restore. */ 591 591 uint32_t u32HndBkpt; 592 /** Blows up the request to the required size. */ 593 uint8_t abPad[36]; 592 594 } KDPACKETMANIPULATE_RESTOREBKPT64; 593 AssertCompileSize(KDPACKETMANIPULATE_RESTOREBKPT64, 4 );595 AssertCompileSize(KDPACKETMANIPULATE_RESTOREBKPT64, 40); 594 596 /** Pointer to a 64bit restore breakpoint manipulate payload. */ 595 597 typedef KDPACKETMANIPULATE_RESTOREBKPT64 *PKDPACKETMANIPULATE_RESTOREBKPT64; 596 598 /** Pointer to a const 64bit restore breakpoint manipulate payload. */ 597 599 typedef const KDPACKETMANIPULATE_RESTOREBKPT64 *PCKDPACKETMANIPULATE_RESTOREBKPT64; 600 601 602 /** 603 * 64bit write breakpoint manipulate payload. 604 */ 605 typedef struct KDPACKETMANIPULATE_WRITEBKPT64 606 { 607 /** Where to write the breakpoint. */ 608 uint64_t u64PtrBkpt; 609 /** The breakpoint handle returned in the response. */ 610 uint32_t u32HndBkpt; 611 /** Blows up the request to the required size. */ 612 uint8_t abPad[28]; 613 } KDPACKETMANIPULATE_WRITEBKPT64; 614 AssertCompileSize(KDPACKETMANIPULATE_WRITEBKPT64, 40); 615 /** Pointer to a 64bit write breakpoint manipulate payload. */ 616 typedef KDPACKETMANIPULATE_WRITEBKPT64 *PKDPACKETMANIPULATE_WRITEBKPT64; 617 /** Pointer to a const 64bit write breakpoint manipulate payload. */ 618 typedef const KDPACKETMANIPULATE_WRITEBKPT64 *PCKDPACKETMANIPULATE_WRITEBKPT64; 598 619 599 620 … … 630 651 } KDPACKETMANIPULATE_CONTINUE; 631 652 AssertCompileSize(KDPACKETMANIPULATE_CONTINUE, 40); 632 /** Pointer to a cont ext extendedmanipulate payload. */653 /** Pointer to a continue manipulate payload. */ 633 654 typedef KDPACKETMANIPULATE_CONTINUE *PKDPACKETMANIPULATE_CONTINUE; 634 /** Pointer to a const cont ext extendedmanipulate payload. */655 /** Pointer to a const continue manipulate payload. */ 635 656 typedef const KDPACKETMANIPULATE_CONTINUE *PCKDPACKETMANIPULATE_CONTINUE; 636 657 … … 671 692 } KDPACKETMANIPULATE_CONTINUE2; 672 693 AssertCompileSize(KDPACKETMANIPULATE_CONTINUE2, 40); 673 /** Pointer to a cont ext extendedmanipulate payload. */694 /** Pointer to a continue 2 manipulate payload. */ 674 695 typedef KDPACKETMANIPULATE_CONTINUE2 *PKDPACKETMANIPULATE_CONTINUE2; 675 /** Pointer to a const cont ext extendedmanipulate payload. */696 /** Pointer to a const continue 2 manipulate payload. */ 676 697 typedef const KDPACKETMANIPULATE_CONTINUE2 *PCKDPACKETMANIPULATE_CONTINUE2; 677 698 … … 722 743 /** Restore breakpoint. */ 723 744 KDPACKETMANIPULATE_RESTOREBKPT64 RestoreBkpt; 745 /** Write breakpoint. */ 746 KDPACKETMANIPULATE_WRITEBKPT64 WriteBkpt; 724 747 /** Context extended. */ 725 748 KDPACKETMANIPULATE_CONTEXTEX ContextEx; … … 973 996 break; 974 997 } 998 case KD_PACKET_MANIPULATE_REQ_RESTORE_BKPT: 999 { 1000 KDPACKETMANIPULATE_RESTOREBKPT64 RestoreBkpt64; 1001 cbCopied = RTSgBufCopyToBuf(pSgBuf, &RestoreBkpt64, sizeof(RestoreBkpt64)); 1002 if (cbCopied == sizeof(RestoreBkpt64)) 1003 Log3((" u32HndBkpt: %RX32\n", RestoreBkpt64.u32HndBkpt)); 1004 else 1005 Log3((" Payload to small, expected %u, got %zu\n", sizeof(RestoreBkpt64), cbCopied)); 1006 break; 1007 } 1008 case KD_PACKET_MANIPULATE_REQ_WRITE_BKPT: 1009 { 1010 KDPACKETMANIPULATE_WRITEBKPT64 WriteBkpt64; 1011 cbCopied = RTSgBufCopyToBuf(pSgBuf, &WriteBkpt64, sizeof(WriteBkpt64)); 1012 if (cbCopied == sizeof(WriteBkpt64)) 1013 Log3((" u64PtrBkpt: %RX64\n" 1014 " u32HndBkpt: %RX32\n", 1015 WriteBkpt64.u64PtrBkpt, WriteBkpt64.u32HndBkpt)); 1016 else 1017 Log3((" Payload to small, expected %u, got %zu\n", sizeof(WriteBkpt64), cbCopied)); 1018 break; 1019 } 975 1020 case KD_PACKET_MANIPULATE_REQ_CONTINUE: 976 1021 { … … 1953 1998 aRespSegs[1].cbSeg = sizeof(RestoreBkpt64); 1954 1999 1955 /** @todo */ 2000 int rc = DBGFR3BpClear(pThis->Dbgc.pUVM, pPktManip->u.RestoreBkpt.u32HndBkpt); 2001 if ( RT_FAILURE(rc) 2002 && rc != VERR_DBGF_BP_NOT_FOUND) 2003 RespHdr.u32NtStatus = NTSTATUS_UNSUCCESSFUL; 2004 2005 return dbgcKdCtxPktSendSg(pThis, KD_PACKET_HDR_SIGNATURE_DATA, KD_PACKET_HDR_SUB_TYPE_STATE_MANIPULATE, 2006 &aRespSegs[0], RT_ELEMENTS(aRespSegs), true /*fAck*/); 2007 } 2008 2009 2010 /** 2011 * Processes a write breakpoint 64 request. 2012 * 2013 * @returns VBox status code. 2014 * @param pThis The KD context. 2015 * @param pPktManip The manipulate packet request. 2016 */ 2017 static int dbgcKdCtxPktManipulate64WriteBkpt(PKDCTX pThis, PCKDPACKETMANIPULATE64 pPktManip) 2018 { 2019 KDPACKETMANIPULATEHDR RespHdr; 2020 KDPACKETMANIPULATE_WRITEBKPT64 WriteBkpt64; 2021 RT_ZERO(RespHdr); RT_ZERO(WriteBkpt64); 2022 2023 RTSGSEG aRespSegs[2]; 2024 RespHdr.idReq = KD_PACKET_MANIPULATE_REQ_WRITE_BKPT; 2025 RespHdr.u16CpuLvl = pPktManip->Hdr.u16CpuLvl; 2026 RespHdr.idCpu = pPktManip->Hdr.idCpu; 2027 RespHdr.u32NtStatus = NTSTATUS_SUCCESS; 2028 2029 aRespSegs[0].pvSeg = &RespHdr; 2030 aRespSegs[0].cbSeg = sizeof(RespHdr); 2031 aRespSegs[1].pvSeg = &WriteBkpt64; 2032 aRespSegs[1].cbSeg = sizeof(WriteBkpt64); 2033 2034 WriteBkpt64.u64PtrBkpt = pPktManip->u.WriteBkpt.u64PtrBkpt; 2035 2036 DBGFADDRESS BpAddr; 2037 DBGFR3AddrFromFlat(pThis->Dbgc.pUVM, &BpAddr, pPktManip->u.WriteBkpt.u64PtrBkpt); 2038 int rc = DBGFR3BpSetInt3(pThis->Dbgc.pUVM, pThis->Dbgc.idCpu, &BpAddr, 2039 1 /*iHitTrigger*/, UINT64_MAX /*iHitDisable*/, &WriteBkpt64.u32HndBkpt); 2040 if (RT_FAILURE(rc)) 2041 RespHdr.u32NtStatus = NTSTATUS_UNSUCCESSFUL; 1956 2042 1957 2043 return dbgcKdCtxPktSendSg(pThis, KD_PACKET_HDR_SIGNATURE_DATA, KD_PACKET_HDR_SUB_TYPE_STATE_MANIPULATE, … … 2049 2135 { 2050 2136 rc = dbgcKdCtxPktManipulate64RestoreBkpt(pThis, pPktManip); 2137 break; 2138 } 2139 case KD_PACKET_MANIPULATE_REQ_WRITE_BKPT: 2140 { 2141 rc = dbgcKdCtxPktManipulate64WriteBkpt(pThis, pPktManip); 2051 2142 break; 2052 2143 }
Note:
See TracChangeset
for help on using the changeset viewer.