[KDROSDBG]

In fact, the kdcom used for KDBG (in GCC builds) is really a thin layer atop of CPORTLIB.
Remove extra code (remove also the KD_PORT_INFORMATION type) and replace it with calls to CPORTLIB functions.
Next step is to put all that thing into KDBG directly, as helper functions. Then, if one wants to make a really kdcom (as we have for MSVC builds), one has to refactor all KDBG.

svn path=/branches/kd++/; revision=58964
This commit is contained in:
Hermès Bélusca-Maïto 2013-05-07 00:14:36 +00:00
parent a23361e756
commit cbdc727f61
9 changed files with 339 additions and 482 deletions

View file

@ -19,7 +19,6 @@
#define DEFAULT_BAUD_RATE 19200
#if defined(_M_IX86) || defined(_M_AMD64)
const ULONG BaseArray[] = {0, 0x3F8, 0x2F8, 0x3E8, 0x2E8};
#elif defined(_M_PPC)

View file

@ -10,27 +10,20 @@
#define NOEXTAPI
#include <ntifs.h>
#include <halfuncs.h>
#include <stdio.h>
#include <arc/arc.h>
#include <halfuncs.h>
#include <windbgkd.h>
#include <kddll.h>
#include <ioaccess.h>
#include <ioaccess.h> /* port intrinsics */
#include <cportlib/cportlib.h>
#include <arm/peripherals/pl011.h>
#include <stdio.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
typedef struct _KD_PORT_INFORMATION
{
ULONG ComPort;
ULONG BaudRate;
ULONG BaseAddress;
} KD_PORT_INFORMATION, *PKD_PORT_INFORMATION;
KD_PORT_INFORMATION DefaultPort = {0, 0, 0};
CPPORT DefaultPort = {0, 0, 0};
//
// We need to build this in the configuration root and use KeFindConfigurationEntry
@ -42,9 +35,8 @@ KD_PORT_INFORMATION DefaultPort = {0, 0, 0};
BOOLEAN
NTAPI
KdPortInitializeEx(IN PKD_PORT_INFORMATION PortInformation,
IN ULONG Unknown1,
IN ULONG Unknown2)
KdPortInitializeEx(IN PCPPORT PortInformation,
IN ULONG ComPortNumber)
{
ULONG Divider, Remainder, Fraction;
ULONG Baudrate = PortInformation->BaudRate;
@ -94,7 +86,7 @@ KdPortInitializeEx(IN PKD_PORT_INFORMATION PortInformation,
BOOLEAN
NTAPI
KdPortGetByteEx(IN PKD_PORT_INFORMATION PortInformation,
KdPortGetByteEx(IN PCPPORT PortInformation,
OUT PUCHAR ByteReceived)
{
UNIMPLEMENTED;
@ -104,7 +96,7 @@ KdPortGetByteEx(IN PKD_PORT_INFORMATION PortInformation,
VOID
NTAPI
KdPortPutByteEx(IN PKD_PORT_INFORMATION PortInformation,
KdPortPutByteEx(IN PCPPORT PortInformation,
IN UCHAR ByteToSend)
{
//

View file

@ -11,25 +11,17 @@
#define NOEXTAPI
#include <ntifs.h>
#include <halfuncs.h>
#include <stdio.h>
#include <arc/arc.h>
#include <halfuncs.h>
#include <windbgkd.h>
#include <kddll.h>
#include <ioaccess.h> /* port intrinsics */
#include <cportlib/cportlib.h>
#include <stdio.h>
#define NDEBUG
#include <debug.h>
typedef struct _KD_PORT_INFORMATION
{
ULONG ComPort;
ULONG BaudRate;
ULONG BaseAddress;
} KD_PORT_INFORMATION, *PKD_PORT_INFORMATION;
#define DEFAULT_BAUD_RATE 19200
#if defined(_M_IX86) || defined(_M_AMD64)
@ -44,57 +36,11 @@ const ULONG BaseArray[] = {0, 0xF1012000};
#error Unknown architecture
#endif
/* MACROS *******************************************************************/
/* STATIC VARIABLES ***********************************************************/
#define SER_RBR(x) ((PUCHAR)(x)+0)
#define SER_THR(x) ((PUCHAR)(x)+0)
#define SER_DLL(x) ((PUCHAR)(x)+0)
#define SER_IER(x) ((PUCHAR)(x)+1)
#define SR_IER_ERDA 0x01
#define SR_IER_ETHRE 0x02
#define SR_IER_ERLSI 0x04
#define SR_IER_EMS 0x08
#define SR_IER_ALL 0x0F
#define SER_DLM(x) ((PUCHAR)(x)+1)
#define SER_IIR(x) ((PUCHAR)(x)+2)
#define SER_FCR(x) ((PUCHAR)(x)+2)
#define SR_FCR_ENABLE_FIFO 0x01
#define SR_FCR_CLEAR_RCVR 0x02
#define SR_FCR_CLEAR_XMIT 0x04
#define SER_LCR(x) ((PUCHAR)(x)+3)
#define SR_LCR_CS5 0x00
#define SR_LCR_CS6 0x01
#define SR_LCR_CS7 0x02
#define SR_LCR_CS8 0x03
#define SR_LCR_ST1 0x00
#define SR_LCR_ST2 0x04
#define SR_LCR_PNO 0x00
#define SR_LCR_POD 0x08
#define SR_LCR_PEV 0x18
#define SR_LCR_PMK 0x28
#define SR_LCR_PSP 0x38
#define SR_LCR_BRK 0x40
#define SR_LCR_DLAB 0x80
#define SER_MCR(x) ((PUCHAR)(x)+4)
#define SR_MCR_DTR 0x01
#define SR_MCR_RTS 0x02
#define SR_MCR_OUT1 0x04
#define SR_MCR_OUT2 0x08
#define SR_MCR_LOOP 0x10
#define SER_LSR(x) ((PUCHAR)(x)+5)
#define SR_LSR_DR 0x01
#define SR_LSR_TBE 0x20
#define SER_MSR(x) ((PUCHAR)(x)+6)
#define SR_MSR_CTS 0x10
#define SR_MSR_DSR 0x20
#define SER_SCR(x) ((PUCHAR)(x)+7)
// static CPPORT DefaultPort = {0, 0, 0};
/* STATIC VARIABLES *********************************************************/
// static KD_PORT_INFORMATION DefaultPort = { 0, 0, 0 };
/* The com port must only be initialized once! */
/* The COM port must only be initialized once! */
// static BOOLEAN PortInitialized = FALSE;
@ -103,14 +49,11 @@ const ULONG BaseArray[] = {0, 0xF1012000};
BOOLEAN
NTAPI
KdPortInitializeEx(
IN PKD_PORT_INFORMATION PortInformation,
IN ULONG Unknown1,
IN ULONG Unknown2)
IN PCPPORT PortInformation,
IN ULONG ComPortNumber)
{
ULONG ComPortBase;
NTSTATUS Status;
CHAR buffer[80];
ULONG divisor;
UCHAR lcr;
#if 0 // Deactivated because never used in fact (was in KdPortInitialize but we use KdPortInitializeEx)
/*
@ -122,7 +65,7 @@ KdPortInitializeEx(
{
DefaultPort.BaudRate = PortInformation->BaudRate;
if (PortInformation->ComPort == 0)
if (ComPortNumber == 0)
{
/*
* Start enumerating COM ports from the last one to the first one,
@ -134,12 +77,12 @@ KdPortInitializeEx(
{
if (CpDoesPortExist(UlongToPtr(BaseArray[i])))
{
PortInformation->BaseAddress = DefaultPort.BaseAddress = BaseArray[i];
PortInformation->ComPort = DefaultPort.ComPort = i;
PortInformation->Address = DefaultPort.Address = BaseArray[i];
ComPortNumber = (ULONG)i;
break;
}
}
if (i == 0)
if (ComPortNumber == 0)
{
sprintf(buffer,
"\nKernel Debugger: No COM port found!\n\n");
@ -155,108 +98,54 @@ KdPortInitializeEx(
/*
* Initialize the port
*/
if (PortInformation->BaudRate == 0)
PortInformation->BaudRate = DEFAULT_BAUD_RATE;
if (PortInformation->ComPort != 0)
{
if (!CpDoesPortExist(UlongToPtr(BaseArray[PortInformation->ComPort])))
Status = CpInitialize(PortInformation,
(ComPortNumber == 0 ? PortInformation->Address
: UlongToPtr(BaseArray[ComPortNumber])),
(PortInformation->BaudRate == 0 ? DEFAULT_BAUD_RATE
: PortInformation->BaudRate));
if (!NT_SUCCESS(Status))
{
sprintf(buffer,
"\nKernel Debugger: Serial port not found!\n\n");
HalDisplayString(buffer);
return FALSE;
}
ComPortBase = BaseArray[PortInformation->ComPort];
PortInformation->BaseAddress = ComPortBase;
}
else
{
ComPortBase = PortInformation->BaseAddress;
}
if (ComPortBase == 0)
return FALSE;
#ifndef NDEBUG
/* Print message to blue screen */
sprintf(buffer,
"\nSerial port COM%ld found at 0x%lx\n",
PortInformation->ComPort,
ComPortBase);
HalDisplayString(buffer);
#endif /* NDEBUG */
/* set baud rate and data format (8N1) */
/* turn on DTR and RTS */
WRITE_PORT_UCHAR(SER_MCR(ComPortBase), SR_MCR_DTR | SR_MCR_RTS);
/* set DLAB */
lcr = READ_PORT_UCHAR(SER_LCR(ComPortBase)) | SR_LCR_DLAB;
WRITE_PORT_UCHAR(SER_LCR(ComPortBase), lcr);
/* set baud rate */
divisor = 115200 / PortInformation->BaudRate;
WRITE_PORT_UCHAR(SER_DLL(ComPortBase), (UCHAR)(divisor & 0xff));
WRITE_PORT_UCHAR(SER_DLM(ComPortBase), (UCHAR)((divisor >> 8) & 0xff));
/* reset DLAB and set 8N1 format */
WRITE_PORT_UCHAR(SER_LCR(ComPortBase),
SR_LCR_CS8 | SR_LCR_ST1 | SR_LCR_PNO);
/* read junk out of the RBR */
lcr = READ_PORT_UCHAR(SER_RBR(ComPortBase));
#ifndef NDEBUG
/* print message to blue screen */
sprintf(buffer,
"\nKernel Debugger: COM%ld (Port 0x%lx) BaudRate %ld\n\n",
PortInformation->ComPort,
ComPortBase,
"\nKernel Debugger: Serial port found: COM%ld (Port 0x%lx) BaudRate %ld\n\n",
ComPortNumber,
PortInformation->Address,
PortInformation->BaudRate);
HalDisplayString(buffer);
#endif /* NDEBUG */
#if 0
/* set global info */
KdComPortInUse = (PUCHAR)DefaultPort.BaseAddress;
/* Set global info */
KdComPortInUse = DefaultPort.Address;
#endif
return TRUE;
}
}
BOOLEAN
NTAPI
KdPortGetByteEx(
IN PKD_PORT_INFORMATION PortInformation,
IN PCPPORT PortInformation,
OUT PUCHAR ByteReceived)
{
PUCHAR ComPortBase = (PUCHAR)PortInformation->BaseAddress;
if ((READ_PORT_UCHAR(SER_LSR(ComPortBase)) & SR_LSR_DR))
{
*ByteReceived = READ_PORT_UCHAR(SER_RBR(ComPortBase));
return TRUE;
}
return FALSE;
return (CpGetByte(PortInformation, ByteReceived, FALSE) == CP_GET_SUCCESS);
}
VOID
NTAPI
KdPortPutByteEx(
IN PKD_PORT_INFORMATION PortInformation,
IN PCPPORT PortInformation,
IN UCHAR ByteToSend)
{
PUCHAR ComPortBase = (PUCHAR)PortInformation->BaseAddress;
while ((READ_PORT_UCHAR(SER_LSR(ComPortBase)) & SR_LSR_TBE) == 0)
;
WRITE_PORT_UCHAR(SER_THR(ComPortBase), ByteToSend);
CpPutByte(PortInformation, ByteToSend);
}
/* EOF */

View file

@ -8,6 +8,6 @@
8 stdcall KdSendPacket(long ptr ptr ptr)
; Legacy KD
@ stdcall KdPortInitializeEx(ptr long long)
@ stdcall KdPortInitializeEx(ptr long)
@ stdcall KdPortGetByteEx(ptr ptr)
@ stdcall KdPortPutByteEx(ptr long)

View file

@ -1,5 +1,7 @@
#pragma once
#include <cportlib/cportlib.h>
#ifdef _M_PPC
#define KdDebuggerEnabled _KdDebuggerEnabled
#define KdDebuggerNotPresent _KdDebuggerNotPresent
@ -8,15 +10,8 @@
//
// Kernel Debugger Port Definition
//
typedef struct _KD_PORT_INFORMATION
{
ULONG ComPort;
ULONG BaudRate;
ULONG BaseAddress;
} KD_PORT_INFORMATION, *PKD_PORT_INFORMATION;
struct _KD_DISPATCH_TABLE;
extern KD_PORT_INFORMATION GdbPortInfo;
extern CPPORT GdbPortInfo;
extern BOOLEAN _KdDebuggerEnabled;
extern BOOLEAN _KdDebuggerNotPresent;
extern BOOLEAN KdBreakAfterSymbolLoad;
@ -26,21 +21,20 @@ extern BOOLEAN KdIgnoreUmExceptions;
BOOLEAN
NTAPI
KdPortInitializeEx(
PKD_PORT_INFORMATION PortInformation,
ULONG Unknown1,
ULONG Unknown2
PCPPORT PortInformation,
ULONG ComPortNumber
);
BOOLEAN
NTAPI
KdPortGetByteEx(
PKD_PORT_INFORMATION PortInformation,
PCPPORT PortInformation,
PUCHAR ByteReceived);
VOID
NTAPI
KdPortPutByteEx(
PKD_PORT_INFORMATION PortInformation,
PCPPORT PortInformation,
UCHAR ByteToSend
);
@ -340,7 +334,8 @@ extern ULONG KdpPortIrq;
extern ULONG KdpPort;
/* Port Information for the Serial Native Mode */
extern KD_PORT_INFORMATION SerialPortInfo;
extern ULONG SerialPortNumber;
extern CPPORT SerialPortInfo;
/* Init Functions for Native Providers */
extern PKDP_INIT_ROUTINE InitRoutines[KdMax];

View file

@ -16,7 +16,8 @@
/* VARIABLES ***************************************************************/
KD_PORT_INFORMATION PortInfo = {DEFAULT_DEBUG_PORT, DEFAULT_DEBUG_BAUD_RATE, 0};
ULONG PortNumber = DEFAULT_DEBUG_PORT;
CPPORT PortInfo = {0, DEFAULT_DEBUG_BAUD_RATE, 0};
ULONG KdpPortIrq;
#ifdef AUTO_ENABLE_BOCHS
KDP_DEBUG_MODE KdpDebugMode = {{{.Bochs=TRUE}}};
@ -68,7 +69,7 @@ KdpGetDebugMode(PCHAR Currentp2)
KdpDebugMode.Serial = TRUE;
/* Set the port to use */
SerialPortInfo.ComPort = Value;
SerialPortNumber = Value;
KdpPort = Value;
}
}
@ -78,8 +79,8 @@ KdpGetDebugMode(PCHAR Currentp2)
if (Value)
{
KdpDebugMode.Serial = TRUE;
SerialPortInfo.BaseAddress = Value;
SerialPortInfo.ComPort = 0;
SerialPortInfo.Address = UlongToPtr(Value);
SerialPortNumber = 0;
KdpPort = 0;
}
}

View file

@ -26,7 +26,8 @@ HANDLE KdpLogFileHandle;
ANSI_STRING KdpLogFileName = RTL_CONSTANT_STRING("\\SystemRoot\\debug.log");
KSPIN_LOCK KdpSerialSpinLock;
KD_PORT_INFORMATION SerialPortInfo = { DEFAULT_DEBUG_PORT, DEFAULT_DEBUG_BAUD_RATE, 0 };
ULONG SerialPortNumber = DEFAULT_DEBUG_PORT;
CPPORT SerialPortInfo = {0, DEFAULT_DEBUG_BAUD_RATE, 0};
/* Current Port in use. FIXME: Do we support more then one? */
ULONG KdpPort;
@ -358,12 +359,12 @@ KdpSerialInit(PKD_DISPATCH_TABLE DispatchTable,
DispatchTable->KdpPrintRoutine = KdpSerialDebugPrint;
/* Initialize the Port */
if (!KdPortInitializeEx(&SerialPortInfo, 0, 0))
if (!KdPortInitializeEx(&SerialPortInfo, SerialPortNumber))
{
KdpDebugMode.Serial = FALSE;
return;
}
KdComPortInUse = (PUCHAR)(ULONG_PTR)SerialPortInfo.BaseAddress;
KdComPortInUse = SerialPortInfo.Address;
/* Initialize spinlock */
KeInitializeSpinLock(&KdpSerialSpinLock);

View file

@ -44,7 +44,8 @@ static FAST_MUTEX GspLock;
extern LIST_ENTRY PsActiveProcessHead;
/* FIXME hardcoded for COM2, 115200 baud */
KD_PORT_INFORMATION GdbPortInfo = { 2, 115200, 0 };
ULONG GdbPortNumber = DEFAULT_DEBUG_PORT;
CPPORT GdbPortInfo = {0, DEFAULT_DEBUG_BAUD_RATE, 0};
static CHAR GspInBuffer[1000];
static CHAR GspOutBuffer[1000];
@ -126,9 +127,7 @@ GdbGetChar(VOID)
{
UCHAR Value;
while (!KdPortGetByteEx(&GdbPortInfo, &Value))
;
while (!KdPortGetByteEx(&GdbPortInfo, &Value)) ;
return Value;
}
@ -145,8 +144,7 @@ GspGetPacket()
while (TRUE)
{
/* wait around for the start character, ignore all other characters */
while ((ch = GdbGetChar()) != '$')
;
while ((ch = GdbGetChar()) != '$') ;
retry:
Checksum = 0;
@ -784,7 +782,6 @@ GspQuery(PCHAR Request)
}
else if (strncmp(Request, "Rcmd,", 5) == 0)
{
;
}
}
@ -943,12 +940,14 @@ GspFindSwBreakpoint(ULONG_PTR Address, PULONG PIndex)
ULONG Index;
for (Index = 0; Index < GspSwBreakpointCount; Index++)
{
if (GspSwBreakpoints[Index].Address == Address)
{
if (PIndex)
*PIndex = Index;
return TRUE;
}
}
return FALSE;
}
@ -1569,7 +1568,7 @@ KdpGdbStubInit(PKD_DISPATCH_TABLE WrapperTable, ULONG BootPhase)
WrapperTable->KdpExceptionRoutine = KdpGdbEnterDebuggerException;
/* Initialize the Port */
KdPortInitializeEx(&GdbPortInfo, 0, 0);
KdPortInitializeEx(&GdbPortInfo, GdbPortNumber);
}
else if (BootPhase == 1)
{

View file

@ -88,12 +88,8 @@
#include <debug.h>
/************************************************************************/
/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
/* at least NUMREGBYTES*2 are needed for register packets */
#define BUFMAX 1000
static BOOLEAN GspInitialized;
static BOOLEAN GspRemoteDebug;
static CONST CHAR HexChars[]="0123456789abcdef";
@ -107,7 +103,14 @@ static FAST_MUTEX GspLock;
extern LIST_ENTRY PsActiveProcessHead;
/* FIXME hardcoded for COM2, 115200 baud */
KD_PORT_INFORMATION GdbPortInfo = { 2, 115200, 0 };
ULONG GdbPortNumber = DEFAULT_DEBUG_PORT;
CPPORT GdbPortInfo = {0, DEFAULT_DEBUG_BAUD_RATE, 0};
/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
/* at least NUMREGBYTES*2 are needed for register packets */
#define BUFMAX 1000
static CHAR GspInBuffer[BUFMAX];
static CHAR GspOutBuffer[BUFMAX];
/* Number of Registers. */
#define NUMREGS 16
@ -149,24 +152,17 @@ LONG
HexValue(CHAR ch)
{
if ((ch >= '0') && (ch <= '9'))
{
return (ch - '0');
}
if ((ch >= 'a') && (ch <= 'f'))
{
return (ch - 'a' + 10);
}
if ((ch >= 'A') && (ch <= 'F'))
{
return (ch - 'A' + 10);
}
return -1;
}
static CHAR GspInBuffer[BUFMAX];
static CHAR GspOutBuffer[BUFMAX];
VOID
GdbPutChar(UCHAR Value)
{
@ -178,9 +174,7 @@ GdbGetChar(VOID)
{
UCHAR Value;
while (!KdPortGetByteEx(&GdbPortInfo, &Value))
;
while (!KdPortGetByteEx(&GdbPortInfo, &Value)) ;
return Value;
}
@ -198,10 +192,9 @@ GspGetPacket()
while (TRUE)
{
/* wait around for the start character, ignore all other characters */
while ((ch = GdbGetChar ()) != '$')
;
while ((ch = GdbGetChar ()) != '$') ;
retry:
retry:
Checksum = 0;
XmitChecksum = -1;
Count = 0;
@ -211,13 +204,11 @@ GspGetPacket()
{
ch = GdbGetChar();
if (ch == '$')
{
goto retry;
}
if (ch == '#')
{
break;
}
Checksum = Checksum + ch;
Buffer[Count] = ch;
Count = Count + 1;
@ -238,7 +229,6 @@ GspGetPacket()
else
{
GdbPutChar('+'); /* successful transfer */
return &Buffer[0];
}
}
@ -323,6 +313,20 @@ GspReadMemSafe(PCHAR Address)
return ch;
}
static CHAR
GspWriteMemSafeGetContent(PVOID Context, ULONG Offset)
{
ASSERT(0 == Offset);
return *((PCHAR) Context);
}
static void
GspWriteMemSafe(PCHAR Address,
CHAR Ch)
{
GspWriteMem(Address, 1, TRUE, GspWriteMemSafeGetContent, &Ch);
}
/* Convert the memory pointed to by Address into hex, placing result in Buffer */
/* Return a pointer to the last char put in Buffer (null) */
/* If MayFault is TRUE, then we should set GspMemoryError in response to
@ -342,10 +346,8 @@ GspMem2Hex(PCHAR Address,
{
ch = GspReadMemSafe(Address);
if (GspMemoryError)
{
return Buffer;
}
}
else
{
ch = *Address;
@ -398,25 +400,22 @@ GspWriteMem(PCHAR Address,
ch = (*GetContent)(Context, Current - Address);
if (MayFault)
{
GspAccessLocation = Current;
}
*Current = ch;
if (MayFault)
{
GspAccessLocation = NULL;
}
Current++;
}
if (MayFault)
{
MmSetPageProtect(NULL, Page, OldProt);
if (GspMemoryError)
{
return Current - Address;
}
}
}
return Current - Address;
}
@ -437,25 +436,9 @@ GspHex2Mem(PCHAR Buffer,
BOOLEAN MayFault)
{
Count = GspWriteMem(Address, Count, MayFault, GspHex2MemGetContent, Buffer);
return Buffer + 2 * Count;
}
static CHAR
GspWriteMemSafeGetContent(PVOID Context, ULONG Offset)
{
ASSERT(0 == Offset);
return *((PCHAR) Context);
}
static void
GspWriteMemSafe(PCHAR Address,
CHAR Ch)
{
GspWriteMem(Address, 1, TRUE, GspWriteMemSafeGetContent, &Ch);
}
/* This function takes the 386 exception vector and attempts to
translate this number into a unix compatible signal value */
@ -469,22 +452,27 @@ GspComputeSignal(NTSTATUS ExceptionCode)
case STATUS_INTEGER_DIVIDE_BY_ZERO:
SigVal = 8; /* divide by zero */
break;
case STATUS_SINGLE_STEP:
case STATUS_BREAKPOINT:
SigVal = 5; /* breakpoint */
break;
case STATUS_INTEGER_OVERFLOW:
case STATUS_ARRAY_BOUNDS_EXCEEDED:
SigVal = 16; /* bound instruction */
break;
case STATUS_ILLEGAL_INSTRUCTION:
SigVal = 4; /* Invalid opcode */
break;
case STATUS_STACK_OVERFLOW:
case STATUS_DATATYPE_MISALIGNMENT:
case STATUS_ACCESS_VIOLATION:
SigVal = 11; /* access violation */
break;
default:
SigVal = 7; /* "software generated" */
}
@ -1640,15 +1628,11 @@ GspBreakIn(PKINTERRUPT Interrupt,
while (KdPortGetByteEx(&GdbPortInfo, &Value))
{
if (Value == 0x03)
{
DoBreakIn = TRUE;
}
}
if (!DoBreakIn)
{
return TRUE;
}
KeRaiseIrql(HIGH_LEVEL, &OldIrql);
@ -1678,9 +1662,7 @@ KdpGdbStubInit(PKD_DISPATCH_TABLE WrapperTable,
ULONG BootPhase)
{
if (!KdDebuggerEnabled || !KdpDebugMode.Gdb)
{
return;
}
if (BootPhase == 0)
{
@ -1692,9 +1674,8 @@ KdpGdbStubInit(PKD_DISPATCH_TABLE WrapperTable,
WrapperTable->KdpExceptionRoutine = KdpGdbEnterDebuggerException;
/* Initialize the Port */
KdPortInitializeEx(&GdbPortInfo, 0, 0);
KdpPort = GdbPortInfo.ComPort;
KdPortInitializeEx(&GdbPortInfo, GdbPortNumber);
// KdpPort = GdbPortInfo.ComPort;
}
else if (BootPhase == 1)
{