Handle #DBs and #BPs for kernel debugger.
815{
817 ULONG ExitInstructionLength = 0;
818 UINT32 SizeOfSafeBufferToRead = 0;
819 RFLAGS Rflags = {0};
823
824
825
826
828 {
830 }
831
832
833
834
836
837 if (!ProcessDebuggingDetails)
838 {
839
840
841
843 }
844
845
846
847
849
850 if (!ThreadDebuggingDetails)
851 {
852
853
854
856 }
857
858
859
860
861 if (ThreadDebuggingDetails->
IsPaused)
862 {
863
864
865
867
868
869
870
872 }
873
874
875
876
878
879
880
881
883
884
885
886
887
889
890
891
892
894
895
896
897
901
902
903
904
905 PausePacket.
Rip = LastVmexitRip;
907
908
909
910
912 PausePacket.
Rflags = Rflags.AsUInt;
913
914
915
916
917 if (EventDetails != NULL)
918 {
921 }
922
923
924
925
927 {
929 }
930 else
931 {
932
933
934
935
936
937
938
939
940 SizeOfSafeBufferToRead = (
UINT32)(LastVmexitRip & 0xfff);
942
944 {
945 SizeOfSafeBufferToRead = SizeOfSafeBufferToRead -
PAGE_SIZE;
947 }
948 else
949 {
951 }
952
953
954
955
956 ExitInstructionLength = SizeOfSafeBufferToRead;
957 }
958
959
960
961
963
964
965
966
969 ExitInstructionLength);
970
971
972
973
974
976 &PausePacket,
979
980
981
982
984 ProcessDebuggingDetails,
986 ExitInstructionLength);
987
988
989
990
992}
PUSERMODE_DEBUGGING_PROCESS_DETAILS AttachingFindProcessDebuggingDetailsByProcessId(UINT32 ProcessId)
Find user-mode debugging details for threads by process Id.
Definition Attaching.c:184
BOOLEAN KdIsGuestOnUsermode32Bit()
determines if the guest was in 32-bit user-mode or 64-bit (long mode)
Definition Kd.c:3220
PUSERMODE_DEBUGGING_THREAD_DETAILS ThreadHolderFindOrCreateThreadDebuggingDetail(UINT32 ThreadId, PUSERMODE_DEBUGGING_PROCESS_DETAILS ProcessDebuggingDetail)
Find or create user-mode debugging details for threads.
Definition ThreadHolder.c:293
struct _USERMODE_DEBUGGING_THREAD_DETAILS * PUSERMODE_DEBUGGING_THREAD_DETAILS
VOID UdPrePausingReasons(PROCESSOR_DEBUGGING_STATE *DbgState, PUSERMODE_DEBUGGING_THREAD_DETAILS ThreadDebuggingDetails, DEBUGGEE_PAUSING_REASON Reason, PDEBUGGER_TRIGGERED_EVENT_DETAILS EventDetails)
Handle special reasons pre-pausings.
Definition Ud.c:778
VOID UdSetThreadPausingState(PUSERMODE_DEBUGGING_THREAD_DETAILS ThreadDebuggingDetails, PUSERMODE_DEBUGGING_PROCESS_DETAILS ProcessDebuggingDetails, PVOID InstructionBytesBuffer, UINT32 SizeOfInstruction)
Set the thread pausing state.
Definition Ud.c:734
IMPORT_EXPORT_HYPERLOG BOOLEAN LogCallbackSendBuffer(_In_ UINT32 OperationCode, _In_reads_bytes_(BufferLength) PVOID Buffer, _In_ UINT32 BufferLength, _In_ BOOLEAN Priority)
routines callback for sending buffer
Definition HyperLogCallback.c:123
IMPORT_EXPORT_VMM UINT64 VmFuncGetRflags()
Read guest's RFLAGS.
Definition Export.c:397
IMPORT_EXPORT_VMM UINT64 VmFuncGetLastVmexitRip(UINT32 CoreId)
get the last vm-exit RIP
Definition Export.c:363
IMPORT_EXPORT_VMM BOOLEAN MemoryMapperReadMemorySafeOnTargetProcess(_In_ UINT64 VaAddressToRead, _Inout_ PVOID BufferToSaveMemory, _In_ SIZE_T SizeToRead)
NULL()
Definition test-case-generator.py:530
DEBUGGEE_PAUSING_REASON PausingReason
Definition DataTypes.h:266
UINT16 ReadInstructionLen
Definition DataTypes.h:273
UINT64 Rip
Definition DataTypes.h:263
VMM_CALLBACK_EVENT_CALLING_STAGE_TYPE EventCallingStage
Definition DataTypes.h:271
BOOLEAN Is32Bit
Definition DataTypes.h:265
UINT64 ProcessDebuggingToken
Definition DataTypes.h:264
UINT64 EventTag
Definition DataTypes.h:270
BYTE InstructionBytesOnRip[MAXIMUM_INSTR_SIZE]
Definition DataTypes.h:272
UINT64 Rflags
Definition DataTypes.h:269
UINT32 ThreadId
Definition DataTypes.h:268
UINT32 ProcessId
Definition DataTypes.h:267
UINT64 Tag
Definition DataTypes.h:226
VMM_CALLBACK_EVENT_CALLING_STAGE_TYPE Stage
Definition DataTypes.h:228
UINT32 CoreId
Definition State.h:168
UINT16 InstructionLengthHint
Definition State.h:182
UINT64 Token
Definition Ud.h:25
UINT32 ActiveThreadId
Definition Ud.h:28
UINT32 ThreadId
Definition ThreadHolder.h:34
UINT64 NumberOfBlockedContextSwitches
Definition ThreadHolder.h:39
BOOLEAN IsPaused
Definition ThreadHolder.h:36