qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] gdbstub:Return non-zero value for thread-id in user


From: Bhushan Attarde
Subject: [Qemu-devel] [PATCH] gdbstub:Return non-zero value for thread-id in user mode
Date: Tue, 30 Jun 2015 11:25:19 +0530

When client requests the stop information by sending ? packet, the gdbstub
replies with stop info packet which includes thread-id of the stopped thread.
In user mode this thread-id is given by cpu->host_tid, which could be zero.
Some clients treats thread-id zero as invalid thread-id.

This patch ensures that in user mode, gdbstub returns non-zero value for
thread-id in stop reply packet.

Signed-off-by: Bhushan Attarde <address@hidden>
---
 include/exec/gdbstub.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index a608a26..3e6114c 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -33,7 +33,7 @@ void gdb_register_coprocessor(CPUState *cpu,
 static inline int cpu_index(CPUState *cpu)
 {
 #if defined(CONFIG_USER_ONLY)
-    return cpu->host_tid;
+    return cpu->host_tid ? cpu->host_tid : 1;
 #else
     return cpu->cpu_index + 1;
 #endif
-- 
2.4.4




reply via email to

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