[KDGDB]
[reactos.git] / reactos / drivers / base / kdgdb / gdb_send.c
index 980498e..87aeca1 100644 (file)
@@ -168,20 +168,27 @@ gdb_send_exception(void)
 {
     char gdb_out[1024];
     char* ptr = gdb_out;
 {
     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';
 
     /* 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));
     ptr += sprintf(ptr, "core:%x;", CurrentStateChange.Processor);
     send_gdb_packet(gdb_out);
 }
     ptr += sprintf(ptr, "thread:p%p.%p;",
         PsGetThreadProcessId((PETHREAD)(ULONG_PTR)CurrentStateChange.Thread),
         PsGetThreadId((PETHREAD)(ULONG_PTR)CurrentStateChange.Thread));
     ptr += sprintf(ptr, "core:%x;", CurrentStateChange.Processor);
     send_gdb_packet(gdb_out);
 }
+
+void
+send_gdb_ntstatus(
+    _In_ NTSTATUS Status)
+{
+    /* 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);
+}