mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[KDGDB] Allow kdgdb to continue when hit by a first-chance exception.
When gdb receives a fault, it converts it to "signal", and send "C" command to server to transfer the signal it couldn't handle. On ReactOS (and Windows ?) side, we tell KD API that we continue with an error code, so the exception handler can be called. This is useful when playing with gflags, especially +soe, with KDGDB.
This commit is contained in:
parent
7f6246e660
commit
309e9c13e1
1 changed files with 29 additions and 0 deletions
|
@ -902,6 +902,32 @@ handle_gdb_c(
|
|||
return ContinueManipulateStateHandler(State, MessageData, MessageLength, KdContext);
|
||||
}
|
||||
|
||||
static
|
||||
KDSTATUS
|
||||
handle_gdb_C(
|
||||
_Out_ DBGKD_MANIPULATE_STATE64* State,
|
||||
_Out_ PSTRING MessageData,
|
||||
_Out_ PULONG MessageLength,
|
||||
_Inout_ PKD_CONTEXT KdContext)
|
||||
{
|
||||
KDSTATUS Status;
|
||||
|
||||
/* Tell GDB everything is fine, we will handle it */
|
||||
Status = send_gdb_packet("OK");
|
||||
if (Status != KdPacketReceived)
|
||||
return Status;
|
||||
|
||||
if (CurrentStateChange.NewState == DbgKdExceptionStateChange)
|
||||
{
|
||||
/* Debugger didn't handle the exception, report it back to the kernel */
|
||||
State->u.Continue2.ContinueStatus = CurrentStateChange.u.Exception.ExceptionRecord.ExceptionCode;
|
||||
State->ApiNumber = DbgKdContinueApi2;
|
||||
return KdPacketReceived;
|
||||
}
|
||||
/* We should never reach this ? */
|
||||
return ContinueManipulateStateHandler(State, MessageData, MessageLength, KdContext);
|
||||
}
|
||||
|
||||
static
|
||||
KDSTATUS
|
||||
handle_gdb_s(
|
||||
|
@ -982,6 +1008,9 @@ gdb_receive_and_interpret_packet(
|
|||
case 'c':
|
||||
Status = handle_gdb_c(State, MessageData, MessageLength, KdContext);
|
||||
break;
|
||||
case 'C':
|
||||
Status = handle_gdb_C(State, MessageData, MessageLength, KdContext);
|
||||
break;
|
||||
case 'g':
|
||||
Status = LOOP_IF_SUCCESS(gdb_send_registers());
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue