Commit graph

9 commits

Author SHA1 Message Date
Stefan Ginsberg f84d5a02f4 - Fix support for /CRASHDEBUG and /NODEBUG; we didn't respect those settings properly and would initialize KD at boot even if they were set.
- Re-enable the breakpoint in vDbgPrintExWithPrefixInternal() as this works properly now. Without this breakpoint some break-in requests got lost if the break-in occurred when handling a debug print (happened a lot at boot).
- Implement Command String support for DbgCommandString() -- we now handle every debug service call.
- Implement NtSetDebugFilterState() and NtQueryDebugFilterState() for KD, meaning we now support debug filters properly.
- Implement KdRefreshDebuggerNotPresent(), KdChangeOption() and KdPowerTransition(). Stub KdSystemDebugControl() to return error status instead of hanging the system.
- Stub the rest of the KD API to print a warning and return a failure packet instead of hanging.
- Set and respect KdpContextSent when getting and setting the thread context -- WinDbg doesn't seem to rely on this, but better safe than sorry.
- Support MP when getting and setting the thread context too -- if the context is operation is for another processor than the current, just get it through the KiProcessorBlock array.
- Initialize the MajorVersion in the KD version block more properly -- the high byte is the major identifier (0 for NT). Add the required DBGKD_MAJOR_TYPES enumeration to wdbgexts.h.
- Simplify setting and clearing the InDbgPrint flag in the TEB to minimize the impact on kernel execution; use 2 dedicated routines instead of a generic one.
- KdpSymbol doesn't return anything, so don't return an ignore status from KdpReportLoadSymbolsStateChange.
- Expose the KdpDefaultRetries and Kd_WIN2000_Mask variables to the registry and add them to KDBG too (unused there).
- No reason to implement KdpSysGetVersion per architecture; move it back to the generic code.
- Add some ARM offsets to the debugger data block that (N/A on other architectures).
- Fix the default size of the DbgPrint log buffer for free builds to save some space. It should be 4 KB for a free build and 32 KB for a checked build.
- Move KeDisableInterrupts to cpu.c as it fits here more than in the IRQ support code in irqobj.c.
- Use KeDisableInterrupts in KeFreezeExecution instead of checking the x86 EFLAG directly.

svn path=/trunk/; revision=43912
2009-11-02 17:45:51 +00:00
Stefan Ginsberg 82bd7858d1 - Add 'simple' implementation of MmDbgCopyMemory to read/write virtual memory in a somewhat safe way (still no support for physical memory). Properly implement KdpCopyMemoryChunks as a wrapper around MmDbgCopyMemory and make most of the remaining unsafe copies use it instead of RtlCopyMemory. This fixes most of the remaining crashes during KD debugging as WinDbg/KD relies on the kernel support to handle bad addresses.
- Stub out the remaining missing global variables for the debugger data block -- fixes some cases of WinDbg failures and gives it a chance to handle errors instead of failing on a NULL read. Several of these variables are for functionality we don't yet implement, so I tried to put them where they are "least wrong". Everything besides the MmLoadedUserImageList variable is left unitialized -- KD should mostly be able to handle this properly.
- Define correctly sized KDDEBUGGER_DATA64 for our kernel (needs to be done in a better way).

svn path=/trunk/; revision=43863
2009-10-31 01:02:35 +00:00
Stefan Ginsberg 3c5b2d9a61 Mega KD64 revival patch:
KD64
- Fix some 64-bit issues and some x86 specificness.
- Sub out some KdpTrap cases more properly.
- Implement support for .crash and .reboot. Does not seem to work currently because of weird issues.
- Implement KdpDprintf to send strings directly to the debugger from inside of KD64. Use it in KdEnterDebugger instead of DbgPrint so we won't try to enter the debugger recursively.
- Implement KdUpdateDataBlock to set the KeUserCallbackDispatcher pointer in the debugger block after its address is retrieved from ntdll.
- Don't assume breakpoints are 1 byte long in portable code -- use KD_BREAKPOINT_SIZE and define it per architecture.
- KdpStub: KdEnableDebugger returns NTSTATUS, not TRUE/FALSE.

Other
- wdbgexts.h: Properly define CURRENT_KD_SECONDARY_VERSION for AMD64.
- Make PsNtosImageBase pointer-sized as it should be.
- Change the definition of KDSTATUS so it is guaranteed to be 32-bit.
- Fix a critical bug in KiRestoreProcessorControlState: it didn't clear the busy flag in the TSS before reloading the task register, resulting in a GPF if we tried to reload the same register.
- Add macros for getting and setting special purpose registers (the Program Counter and the "return register") in portable code instead of using #ifdef every time. Do likewise for setting IMAGE_FILE_MACHINE_XXX, using a new IMAGE_FILE_MACHINE_ARCHITECTURE macro.
- Don't refer to the Program Counter as "Eip" in portable code.
- Define DBG_STATUS_CONTROL_C for assembly code and use it in KeUpdateSystemTime.

svn path=/trunk/; revision=43283
2009-10-04 16:53:15 +00:00
Stefan Ginsberg ea23cd10c2 - Start deprecating TAG()
- Fix inverted tags in prntfont.h, stdunk.h and win32k/objects/font.c

svn path=/trunk/; revision=42915
2009-08-24 17:12:25 +00:00
Stefan Ginsberg 56a1175be8 - Add 32-bit versions to wdbgexts.h
- Add lots of missing definitions to windbgkd.h, gathered from Singularity, tinykrnl, articles, blogs, etc

svn path=/trunk/; revision=38961
2009-01-19 23:34:27 +00:00
Hervé Poussineau 762f833b44 Add missing svn:eol-style native properties
svn path=/trunk/; revision=29082
2007-09-17 13:43:34 +00:00
Alex Ionescu 24f9e136e6 - Add a bunch of hacks to KdpReadVirtualMemory to make it work for now.
- Fix bugs in KdpGetVersion, KdpReadVirtualMemory.
- Implement KdpReadControlSpace.
- Fix setting kernel range address instead of kernel image load address.
- WinDBG is slowly trying to talk with us. Now it wants to restore breakpoints since it thinks this is the same machine I was debugging last night.

svn path=/branches/alex-kd-branch/; revision=25849
2007-02-20 01:13:22 +00:00
Alex Ionescu b9cd3f2d9d - Create GCC_ULONG64 type to hack around a bug in GCC which is incapable of creating entries for externals at compile-time for 64-bit pointers.
- Rename NameSpaceRoot to ObpRootDirectoryObject, IopLogListHead to IopErrorLogListHead, BugcheckCallbackListHead to KeBugcheckCallbackListHead, BugcheckReasonCallbackListHead to KeBugcheckReasonCallbackListHead, ObTypeObjectType to ObpTypeObjectType.
- Fill out KdDebuggerDataBlock with the variables that ROS currently supports. Most Mm variables we don't have yet -- it's unknown how much this will hurt WinDBG compatibility/functionality.
- Add KdPrint circular buffer and buffer location/data variables.

svn path=/branches/alex-kd-branch/; revision=25845
2007-02-19 18:52:23 +00:00
Alex Ionescu 59caa79d63 - Add EXCEPTION_RECORD64 and LIST_ENTRY64, KeTryToAcquireSpinLockAtDpcLevel, BREAKPOINT_COMMAND_STRING, Ke386SetCr2, Ke386SetDr3, Ke386SetDr6.
- Remove non-kernel routines from kdfuncs.h and remove deprecated routines from ke.h.
- Implement KiRestoreProcessorControlState, KeFreezeExecution, KeThawExecution, ExAcquireTimeRefreshLock, ExReleaseTimeRefreshLock.
- Rename ModuleLoadList to PsLoadedModuleList. Add PsNtosImageBase and set value in it.
- Add skeleton wdbgexts.h with what's needed until now, this is a PSDK header.
- Add kddll.h for KDCOM/1394/USB2.DLL prototypes.
- Add windbgkd.h with KD protocol definitions. Used to be an NT5 DDK header, but was removed, so this goes into include\reactos.

svn path=/branches/alex-kd-branch/; revision=25833
2007-02-18 07:21:03 +00:00