mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[NTOS:PS] Use KD routine to safely read memory from thread stack
Should fix a crash when hitting TAB+(Whatever I typed that triggerred this)
This commit is contained in:
parent
0fb3c1e91e
commit
04e9251612
1 changed files with 18 additions and 3 deletions
|
@ -70,9 +70,24 @@ PspDumpThreads(BOOLEAN IncludeSystem)
|
|||
/* Walk it */
|
||||
while(Ebp != 0 && Ebp >= (PULONG)Thread->Tcb.StackLimit)
|
||||
{
|
||||
/* Print what's on the stack */
|
||||
DbgPrint("%.8X %.8X%s", Ebp[0], Ebp[1], (i % 8) == 7 ? "\n" : " ");
|
||||
Ebp = (PULONG)Ebp[0];
|
||||
ULONG EbpContent[2];
|
||||
ULONG MemoryCopied;
|
||||
NTSTATUS Status;
|
||||
|
||||
/* Get stack frame content */
|
||||
Status = KdpCopyMemoryChunks((ULONG64)(ULONG_PTR)Ebp,
|
||||
EbpContent,
|
||||
sizeof(EbpContent),
|
||||
sizeof(EbpContent),
|
||||
MMDBG_COPY_UNSAFE,
|
||||
&MemoryCopied);
|
||||
if (!NT_SUCCESS(Status) || (MemoryCopied < sizeof(EbpContent)))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
DbgPrint("%.8X %.8X%s", EbpContent[0], EbpContent[1], (i % 8) == 7 ? "\n" : " ");
|
||||
Ebp = (PULONG)EbpContent[0];
|
||||
i++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue