X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fdrivers%2Fbase%2Fkdgdb%2Fgdb_send.c;h=87aeca160c4d064b42af6cc4e0ef1f7ef2c62488;hp=4e64495467ee08c7de45a7050ef605823bdaa1f5;hb=31965e9804622cc653d51980092e3418a93f42e6;hpb=9cc2b4e75ceb47dbcd02f175df089cf309fb2433 diff --git a/reactos/drivers/base/kdgdb/gdb_send.c b/reactos/drivers/base/kdgdb/gdb_send.c index 4e64495467e..87aeca160c4 100644 --- a/reactos/drivers/base/kdgdb/gdb_send.c +++ b/reactos/drivers/base/kdgdb/gdb_send.c @@ -168,17 +168,12 @@ gdb_send_exception(void) { char gdb_out[1024]; char* ptr = gdb_out; - DBGKM_EXCEPTION64* Exception = NULL; - - if (CurrentStateChange.NewState == DbgKdExceptionStateChange) - Exception = &CurrentStateChange.u.Exception; + DBGKM_EXCEPTION64* Exception = &CurrentStateChange.u.Exception; /* Report to GDB */ *ptr++ = 'T'; - if (Exception) - ptr = exception_code_to_gdb(Exception->ExceptionRecord.ExceptionCode, ptr); - else - ptr += sprintf(ptr, "05"); + + ptr = exception_code_to_gdb(Exception->ExceptionRecord.ExceptionCode, ptr); ptr += sprintf(ptr, "thread:p%p.%p;", PsGetThreadProcessId((PETHREAD)(ULONG_PTR)CurrentStateChange.Thread), PsGetThreadId((PETHREAD)(ULONG_PTR)CurrentStateChange.Thread)); @@ -186,35 +181,14 @@ gdb_send_exception(void) send_gdb_packet(gdb_out); } -#ifdef KDDEBUG -ULONG KdpDbgPrint(const char* Format, ...) +void +send_gdb_ntstatus( + _In_ NTSTATUS Status) { - va_list ap; - CHAR Buffer[512]; - struct _STRING Str; - int Length; - - va_start(ap, Format); - Length = _vsnprintf(Buffer, sizeof(Buffer), Format, ap); - va_end(ap); - - /* Check if we went past the buffer */ - if (Length == -1) - { - /* Terminate it if we went over-board */ - Buffer[sizeof(Buffer) - 1] = '\n'; - - /* Put maximum */ - Length = sizeof(Buffer); - } - - Str.Buffer = Buffer; - Str.Length = Length; - Str.MaximumLength = sizeof(Buffer); - - gdb_send_debug_io(&Str); - - return 0; + /* Just build a EXX packet and send it */ + char gdb_out[4]; + gdb_out[0] = 'E'; + exception_code_to_gdb(Status, &gdb_out[1]); + gdb_out[3] = '\0'; + send_gdb_packet(gdb_out); } -#endif -