Patchwork [v3,19/39] windbg: implement windbg_process_data_packet

login
register
mail settings
Submitter Mihail Abakumov
Date Dec. 6, 2018, noon
Message ID <154409762494.5432.16305898698915444010.stgit@Misha-PC.lan02.inno>
Download mbox | patch
Permalink /patch/673981/
State New
Headers show

Comments

Mihail Abakumov - Dec. 6, 2018, noon
Signed-off-by: Mikhail Abakumov <mikhail.abakumov@ispras.ru>
Signed-off-by: Pavel Dovgalyuk <dovgaluk@ispras.ru>
---
 windbgstub.c |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

Patch

diff --git a/windbgstub.c b/windbgstub.c
index f13c9a6c1e..8cbece40da 100644
--- a/windbgstub.c
+++ b/windbgstub.c
@@ -134,8 +134,35 @@  static void windbg_vm_stop(void)
     vm_stop(RUN_STATE_PAUSED);
 }
 
+static void windbg_process_manipulate_packet(WindbgState *state)
+{
+}
+
 static void windbg_process_data_packet(WindbgState *state)
 {
+    ParsingContext *ctx = &state->ctx;
+
+    if (state->wait_packet_type == PACKET_TYPE_KD_ACKNOWLEDGE) {
+        /* We received something different */
+        windbg_send_control_packet(state, PACKET_TYPE_KD_RESEND, 0);
+        return;
+    }
+
+    switch (ctx->packet.PacketType) {
+    case PACKET_TYPE_KD_STATE_MANIPULATE:
+        windbg_send_control_packet(state, PACKET_TYPE_KD_ACKNOWLEDGE,
+                                   ctx->packet.PacketId);
+        windbg_process_manipulate_packet(state);
+        state->curr_packet_id &= ~SYNC_PACKET_ID;
+        break;
+
+    default:
+        WINDBG_ERROR("Caught unsupported data packet 0x%x",
+                     ctx->packet.PacketType);
+
+        windbg_send_control_packet(state, PACKET_TYPE_KD_RESEND, 0);
+        break;
+    }
 }
 
 static void windbg_process_control_packet(WindbgState *state)