diff --git a/reactos/ntoskrnl/dbg/kdb_stabs.c b/reactos/ntoskrnl/dbg/kdb_stabs.c index 88b5bab15c1..9457bdee827 100644 --- a/reactos/ntoskrnl/dbg/kdb_stabs.c +++ b/reactos/ntoskrnl/dbg/kdb_stabs.c @@ -210,12 +210,20 @@ KdbPrintAddress(PVOID address) } VOID -KdbFreeSymbolsProcess(PPEB Peb) +KdbFreeSymbolsProcess(PEPROCESS Process) { PLIST_ENTRY CurrentEntry; PLDR_MODULE Current; PIMAGE_SYMBOL_INFO SymbolInfo; + PEPROCESS CurrentProcess; + PPEB Peb; + CurrentProcess = PsGetCurrentProcess(); + if (CurrentProcess != Process) + { + KeAttachProcess(Process); + } + Peb = Process->Peb; assert (Peb); assert (Peb->Ldr); @@ -231,6 +239,10 @@ KdbFreeSymbolsProcess(PPEB Peb) CurrentEntry = CurrentEntry->Flink; } + if (CurrentProcess != Process) + { + KeDetachProcess(); + } } VOID @@ -456,6 +468,7 @@ LdrpGetFunctionName(IN PIMAGE_SYMBOL_INFO SymbolInfo, Length = strlen(Symbol->Name.Buffer); strncpy(FunctionName, Symbol->Name.Buffer, Length); + FunctionName[Length]=0; return STATUS_SUCCESS; } Symbol = NextSymbol; @@ -783,6 +796,11 @@ KdbLdrLoadUserModuleSymbols(PLDR_MODULE LdrModule) RtlCreateUnicodeString(&CacheEntry->FullName, LdrModule->FullDllName.Buffer); assert(CacheEntry->FullName.Buffer); LdrpLoadModuleSymbols(&LdrModule->FullDllName, &LdrModule->SymbolInfo); + CacheEntry->FileBuffer = LdrModule->SymbolInfo.FileBuffer; + CacheEntry->SymbolsBase = LdrModule->SymbolInfo.SymbolsBase; + CacheEntry->SymbolsLength = LdrModule->SymbolInfo.SymbolsLength; + CacheEntry->SymbolStringsBase = LdrModule->SymbolInfo.SymbolStringsBase; + CacheEntry->SymbolStringsLength = LdrModule->SymbolInfo.SymbolStringsLength; InsertTailList(&SymbolListHead, &CacheEntry->ListEntry); } } diff --git a/reactos/ntoskrnl/include/internal/kd.h b/reactos/ntoskrnl/include/internal/kd.h index 5b038e2b0cd..7af92ec9f78 100644 --- a/reactos/ntoskrnl/include/internal/kd.h +++ b/reactos/ntoskrnl/include/internal/kd.h @@ -1,4 +1,4 @@ -/* $Id: kd.h,v 1.16 2002/09/08 10:23:21 chorns Exp $ +/* $Id: kd.h,v 1.17 2003/01/19 01:46:33 hbirr Exp $ * * kernel debugger prototypes */ @@ -96,7 +96,7 @@ KdbUnloadDriver(PMODULE_OBJECT ModuleObject); VOID KdbLoadDriver(PUNICODE_STRING Filename, PMODULE_OBJECT Module); VOID -KdbFreeSymbolsProcess(PPEB Peb); +KdbFreeSymbolsProcess(PEPROCESS Process); BOOLEAN KdbPrintAddress(PVOID address); KD_CONTINUE_TYPE diff --git a/reactos/ntoskrnl/ps/process.c b/reactos/ntoskrnl/ps/process.c index eb78d239f47..a5e912c4361 100644 --- a/reactos/ntoskrnl/ps/process.c +++ b/reactos/ntoskrnl/ps/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.94 2002/11/03 20:01:07 chorns Exp $ +/* $Id: process.c,v 1.95 2003/01/19 01:46:32 hbirr Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -299,12 +299,12 @@ PiDeleteProcess(PVOID ObjectBody) KeReleaseSpinLock(&PsProcessListLock, oldIrql); /* KDB hook */ - KDB_DELETEPROCESS_HOOK(Process->Peb); + KDB_DELETEPROCESS_HOOK(Process); ObDereferenceObject(Process->Token); + ObDeleteHandleTable(Process); (VOID)MmReleaseMmInfo(Process); - ObDeleteHandleTable(Process); }