Ladi Prosek писал 2017-11-28 15:44:
On Tue, Nov 21, 2017 at 3:11 PM, Mihail Abakumov
<mikhail.abaku...@ispras.ru> wrote:
[...]
diff --git a/windbgstub.c b/windbgstub.c
index 36372c0ea5..3bcf6a8cbb 100755
--- a/windbgstub.c
+++ b/windbgstub.c
@@ -224,6 +224,14 @@ static void windbg_process_manipulate_packet(ParsingContext *ctx)
         kd_api_query_memory(cpu, &ctx->data);
         break;

+    case DbgKdGetContextExApi:
+        kd_api_get_context_ex(cpu, &ctx->data);
+        break;
+
+    case DbgKdSetContextExApi:
+        kd_api_set_context_ex(cpu, &ctx->data);
+        break;
+
     default:
         kd_api_unsupported(cpu, &ctx->data);
         break;
@@ -262,12 +270,12 @@ static void windbg_process_control_packet(ParsingContext *ctx)

     case PACKET_TYPE_KD_RESET:
     {
-        SizedBuf buf = kd_gen_load_symbols_sc(qemu_get_cpu(0));
+        windbg_send_control_packet(ctx->packet.PacketType);
+        windbg_state->ctrl_packet_id = INITIAL_PACKET_ID;

You didn't mention it in the cover email so I'd like to be sure. This
is what fixed the initial handshake so it works without -b now, is
that correct? Thanks!

Yes. It seems for me more logical to send a response first, then a state packet. Apparently, before that I made a typo. Now Windbg connects immediately, and for stopping it is necessary to press ctrl+break. But now the option '-b' does
not work in the old version.

+        SizedBuf buf = kd_gen_load_symbols_sc(qemu_get_cpu(0));
         windbg_send_data_packet(buf.data, buf.size,
                                 PACKET_TYPE_KD_STATE_CHANGE64);
-        windbg_send_control_packet(ctx->packet.PacketType);
-        windbg_state->ctrl_packet_id = INITIAL_PACKET_ID;
         SBUF_FREE(buf);
         break;
     }




Reply via email to