Skip to contentSkip to conversation

make gdb_id() generally avialable

PATCH Superseded Wen Congyang 2 participants 2 messages Mar 20, 2012 – Mar 23, 2012

v10 of 15 Superseded Latest is v15 →

lore
Share & tools
lore
#0 lore raw

PATCH v10 10/11 make gdb_id() generally avialable

The following patch also needs this API, so make it generally avialable

---
 gdbstub.c |    9 ---------
 gdbstub.h |    9 +++++++++
 2 files changed, 9 insertions(+), 9 deletions(-)
gdbstub.c +0 -9
index f4e97f7..7f8ac2f 100644
@@ -1939,15 +1939,6 @@ static void gdb_set_cpu_pc(GDBState *s, target_ulong pc)
 #endif
 }
 
-static inline int gdb_id(CPUArchState *env)
-{
-#if defined(CONFIG_USER_ONLY) && defined(CONFIG_USE_NPTL)
-    return env->host_tid;
-#else
-    return env->cpu_index + 1;
-#endif
-}
-
 static CPUArchState *find_cpu(uint32_t thread_id)
 {
     CPUArchState *env;
gdbstub.h +9 -0
index b44e275..f82ec70 100644
@@ -30,6 +30,15 @@ void gdb_register_coprocessor(CPUArchState *env,
                               gdb_reg_cb get_reg, gdb_reg_cb set_reg,
                               int num_regs, const char *xml, int g_pos);
 
+static inline int gdb_id(CPUArchState *env)
+{
+#if defined(CONFIG_USER_ONLY) && defined(CONFIG_USE_NPTL)
+    return env->host_tid;
+#else
+    return env->cpu_index + 1;
+#endif
+}
+
 #endif
 
 #ifdef CONFIG_USER_ONLY
Signature · 1 line
1.7.1
#1 lore raw

From: Wen Congyang <[email protected]>
Subject: [PATCH 10/11 v10] make gdb_id() generally avialable
Date: Tue, 20 Mar 2012 11:56:38 +0800

Quoted 35 lines

The following patch also needs this API, so make it generally avialable

---
 gdbstub.c |    9 ---------
 gdbstub.h |    9 +++++++++
 2 files changed, 9 insertions(+), 9 deletions(-)
gdbstub.c +0 -9
index f4e97f7..7f8ac2f 100644
@@ -1939,15 +1939,6 @@ static void gdb_set_cpu_pc(GDBState *s, target_ulong pc)
 #endif
 }
 
-static inline int gdb_id(CPUArchState *env)
-{
-#if defined(CONFIG_USER_ONLY) && defined(CONFIG_USE_NPTL)
-    return env->host_tid;
-#else
-    return env->cpu_index + 1;
-#endif
-}
-
 static CPUArchState *find_cpu(uint32_t thread_id)
 {
     CPUArchState *env;
gdbstub.h +0 -0
index b44e275..f82ec70 100644
@@ -30,6 +30,15 @@ void gdb_register_coprocessor(CPUArchState *env,
                               gdb_reg_cb get_reg, gdb_reg_cb set_reg,
                               int num_regs, const char *xml, int g_pos);

gdbstub.h void gdb_register_coprocessor(CPUArchState *env, · line 41

Quoted 10 lines
gdbstub.h +9 -0
 
+static inline int gdb_id(CPUArchState *env)
+{
+#if defined(CONFIG_USER_ONLY) && defined(CONFIG_USE_NPTL)
+    return env->host_tid;
+#else
+    return env->cpu_index + 1;
+#endif
+}
+

It seems to me more reasonable to newly introduce helper function cpu_index(), then use it in gdb_id() and in qemu dump.

Thanks.
HATAYAMA, Daisuke