mirror of
https://github.com/reactos/reactos.git
synced 2024-07-12 07:35:10 +00:00
[KDGDB]
- Add a ugly and grotesque hack to give "o" back to RtlAssert so that we actually break on ASSERTs - Check for the breakpoint instruction for deciding when to move forward the ProgramCounter. This is OK since KD removes all breakpoints set when hitting a soft BP svn path=/trunk/; revision=72467
This commit is contained in:
parent
2e18c7a3cf
commit
c0b63bd391
|
@ -830,7 +830,7 @@ handle_gdb_c(
|
||||||
|
|
||||||
/* See if we should update the program counter */
|
/* See if we should update the program counter */
|
||||||
if (Exception && (Exception->ExceptionRecord.ExceptionCode == STATUS_BREAKPOINT)
|
if (Exception && (Exception->ExceptionRecord.ExceptionCode == STATUS_BREAKPOINT)
|
||||||
&& ProgramCounter == KdDebuggerDataBlock->BreakpointWithStatus.Pointer)
|
&& ((*(KD_BREAKPOINT_TYPE*)ProgramCounter) == KD_BREAKPOINT_VALUE))
|
||||||
{
|
{
|
||||||
/* We must get past the breakpoint instruction */
|
/* We must get past the breakpoint instruction */
|
||||||
KdpSetContextPc(&CurrentContext, ProgramCounter + KD_BREAKPOINT_SIZE);
|
KdpSetContextPc(&CurrentContext, ProgramCounter + KD_BREAKPOINT_SIZE);
|
||||||
|
|
|
@ -121,7 +121,9 @@ extern void gdb_send_registers(void);
|
||||||
((Context)->Eip)
|
((Context)->Eip)
|
||||||
# define KdpSetContextPc(Context, ProgramCounter) \
|
# define KdpSetContextPc(Context, ProgramCounter) \
|
||||||
((Context)->Eip = (ProgramCounter))
|
((Context)->Eip = (ProgramCounter))
|
||||||
|
# define KD_BREAKPOINT_TYPE UCHAR
|
||||||
# define KD_BREAKPOINT_SIZE sizeof(UCHAR)
|
# define KD_BREAKPOINT_SIZE sizeof(UCHAR)
|
||||||
|
# define KD_BREAKPOINT_VALUE 0xCC
|
||||||
/* Single step mode */
|
/* Single step mode */
|
||||||
# define KdpSetSingleStep(Context) \
|
# define KdpSetSingleStep(Context) \
|
||||||
((Context)->EFlags |= EFLAGS_TF)
|
((Context)->EFlags |= EFLAGS_TF)
|
||||||
|
|
|
@ -183,6 +183,7 @@ send_kd_debug_io(
|
||||||
switch (DebugIO->ApiNumber)
|
switch (DebugIO->ApiNumber)
|
||||||
{
|
{
|
||||||
case DbgKdPrintStringApi:
|
case DbgKdPrintStringApi:
|
||||||
|
case DbgKdGetStringApi:
|
||||||
gdb_send_debug_io(String, TRUE);
|
gdb_send_debug_io(String, TRUE);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -362,21 +363,22 @@ KdReceivePacket(
|
||||||
_Out_ PULONG DataLength,
|
_Out_ PULONG DataLength,
|
||||||
_Inout_ PKD_CONTEXT KdContext)
|
_Inout_ PKD_CONTEXT KdContext)
|
||||||
{
|
{
|
||||||
DBGKD_MANIPULATE_STATE64* State;
|
|
||||||
|
|
||||||
/* Special handling for breakin packet */
|
|
||||||
if (PacketType == PACKET_TYPE_KD_POLL_BREAKIN)
|
if (PacketType == PACKET_TYPE_KD_POLL_BREAKIN)
|
||||||
{
|
{
|
||||||
return KdpPollBreakIn();
|
return KdpPollBreakIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PacketType != PACKET_TYPE_KD_STATE_MANIPULATE)
|
if (PacketType == PACKET_TYPE_KD_DEBUG_IO)
|
||||||
{
|
{
|
||||||
/* What should we do ? */
|
/* HACK ! RtlAssert asks for (boipt), always say "o" --> break once. */
|
||||||
while (1);
|
MessageData->Length = 1;
|
||||||
|
MessageData->Buffer[0] = 'o';
|
||||||
|
return KdPacketReceived;
|
||||||
}
|
}
|
||||||
|
|
||||||
State = (DBGKD_MANIPULATE_STATE64*)MessageHeader->Buffer;
|
if (PacketType == PACKET_TYPE_KD_STATE_MANIPULATE)
|
||||||
|
{
|
||||||
|
DBGKD_MANIPULATE_STATE64* State = (DBGKD_MANIPULATE_STATE64*)MessageHeader->Buffer;
|
||||||
|
|
||||||
/* Maybe we are in a send<->receive loop that GDB doesn't need to know about */
|
/* Maybe we are in a send<->receive loop that GDB doesn't need to know about */
|
||||||
if (KdpManipulateStateHandler != NULL)
|
if (KdpManipulateStateHandler != NULL)
|
||||||
|
@ -384,6 +386,11 @@ KdReceivePacket(
|
||||||
|
|
||||||
/* Receive data from GDB and interpret it */
|
/* Receive data from GDB and interpret it */
|
||||||
return gdb_receive_and_interpret_packet(State, MessageData, DataLength, KdContext);
|
return gdb_receive_and_interpret_packet(State, MessageData, DataLength, KdContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* What should we do ? */
|
||||||
|
while (1);
|
||||||
|
return KdPacketNeedsResend;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
Loading…
Reference in a new issue