qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v3 38/39] windbg: implement kd_api_query_memory


From: Mikhail Abakumov
Subject: [Qemu-devel] [PATCH v3 38/39] windbg: implement kd_api_query_memory
Date: Thu, 06 Dec 2018 15:02:11 +0300
User-agent: StGit/0.17.1-dirty

Signed-off-by: Mikhail Abakumov <address@hidden>
Signed-off-by: Pavel Dovgalyuk <address@hidden>
---
 include/exec/windbgstub-utils.h |    1 +
 windbgstub-utils.c              |   10 ++++++++++
 windbgstub.c                    |    4 ++++
 3 files changed, 15 insertions(+)

diff --git a/include/exec/windbgstub-utils.h b/include/exec/windbgstub-utils.h
index 8192a7b849..bddb52d3db 100644
--- a/include/exec/windbgstub-utils.h
+++ b/include/exec/windbgstub-utils.h
@@ -86,6 +86,7 @@ void kd_api_write_msr(CPUState *cs, PacketData *pd);
 void kd_api_search_memory(CPUState *cs, PacketData *pd);
 void kd_api_clear_all_internal_breakpoints(CPUState *cs, PacketData *pd);
 void kd_api_fill_memory(CPUState *cs, PacketData *pd);
+void kd_api_query_memory(CPUState *cs, PacketData *pd);
 void kd_api_get_context_ex(CPUState *cs, PacketData *pd);
 void kd_api_set_context_ex(CPUState *cs, PacketData *pd);
 void kd_api_unsupported(CPUState *cs, PacketData *pd);
diff --git a/windbgstub-utils.c b/windbgstub-utils.c
index 9b4f6f00b8..799fd95a7a 100644
--- a/windbgstub-utils.c
+++ b/windbgstub-utils.c
@@ -479,6 +479,16 @@ void kd_api_fill_memory(CPUState *cs, PacketData *pd)
     g_free(mem);
 }
 
+void kd_api_query_memory(CPUState *cs, PacketData *pd)
+{
+    DBGKD_QUERY_MEMORY *mem = &pd->m64.u.QueryMemory;
+
+    /* TODO: Needs test memory. */
+    stl_p(&mem->AddressSpace, DBGKD_QUERY_MEMORY_PROCESS);
+    stl_p(&mem->Flags, DBGKD_QUERY_MEMORY_READ | DBGKD_QUERY_MEMORY_WRITE |
+                       DBGKD_QUERY_MEMORY_EXECUTE);
+}
+
 void kd_api_unsupported(CPUState *cs, PacketData *pd)
 {
     WINDBG_ERROR("Caught unimplemented api %s", 
kd_api_name(pd->m64.ApiNumber));
diff --git a/windbgstub.c b/windbgstub.c
index daf6d37aa1..23ad05f12b 100644
--- a/windbgstub.c
+++ b/windbgstub.c
@@ -236,6 +236,10 @@ static void windbg_process_manipulate_packet(WindbgState 
*state)
         kd_api_fill_memory(cs, data);
         break;
 
+    case DbgKdQueryMemoryApi:
+        kd_api_query_memory(cs, data);
+        break;
+
     case DbgKdGetContextExApi:
         kd_api_get_context_ex(cs, data);
         break;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]