@@ -102,6 +102,8 @@ typedef struct SizedBuf {
buf.size = 0; \
} while (false)
+void kd_api_unsupported(CPUState *cpu, PacketData *pd);
+
SizedBuf kd_gen_exception_sc(CPUState *cpu);
SizedBuf kd_gen_load_symbols_sc(CPUState *cpu);
@@ -30,6 +30,16 @@ typedef struct KDData {
static KDData *kd;
+void kd_api_unsupported(CPUState *cpu, PacketData *pd)
+{
+ WINDBG_ERROR("Catched unimplemented api %s",
+ KD_API_NAME(pd->m64.ApiNumber));
+ pd->m64.ReturnStatus = STATUS_UNSUCCESSFUL;
+ pd->extra_size = 0;
+
+ exit(1);
+}
+
static void kd_breakpoint_remove_range(CPUState *cpu, target_ulong base,
target_ulong limit)
{}
@@ -123,7 +123,26 @@ static void windbg_vm_stop(void)
}
static void windbg_process_manipulate_packet(ParsingContext *ctx)
-{}
+{
+ CPUState *cpu;
+
+ ctx->data.extra_size = ctx->packet.ByteCount - M64_SIZE;
+ ctx->data.m64.ReturnStatus = STATUS_SUCCESS;
+
+ cpu = qemu_get_cpu(ctx->data.m64.Processor);
+
+ switch (ctx->data.m64.ApiNumber) {
+
+ default:
+ kd_api_unsupported(cpu, &ctx->data);
+ break;
+ }
+
+ ctx->data.m64.ReturnStatus = ldl_p(&ctx->data.m64.ReturnStatus);
+
+ windbg_send_data_packet(ctx->data.buf, ctx->data.extra_size + M64_SIZE,
+ ctx->packet.PacketType);
+}
static void windbg_process_data_packet(ParsingContext *ctx)
{