* [Qemu-devel] [PATCH 10/11 v10] make gdb_id() generally avialable
@ 2012-03-20 3:56 Wen Congyang
2012-03-23 10:03 ` HATAYAMA Daisuke
0 siblings, 1 reply; 2+ messages in thread
From: Wen Congyang @ 2012-03-20 3:56 UTC (permalink / raw)
To: qemu-devel, Jan Kiszka, Luiz Capitulino, Anthony Liguori,
Dave Anderson, HATAYAMA Daisuke, Eric Blake
The following patch also needs this API, so make it generally avialable
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
gdbstub.c | 9 ---------
gdbstub.h | 9 +++++++++
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
index f4e97f7..7f8ac2f 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -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;
diff --git a/gdbstub.h b/gdbstub.h
index b44e275..f82ec70 100644
--- a/gdbstub.h
+++ b/gdbstub.h
@@ -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
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH 10/11 v10] make gdb_id() generally avialable
2012-03-20 3:56 [Qemu-devel] [PATCH 10/11 v10] make gdb_id() generally avialable Wen Congyang
@ 2012-03-23 10:03 ` HATAYAMA Daisuke
0 siblings, 0 replies; 2+ messages in thread
From: HATAYAMA Daisuke @ 2012-03-23 10:03 UTC (permalink / raw)
To: wency; +Cc: aliguori, jan.kiszka, qemu-devel, lcapitulino, anderson, eblake
From: Wen Congyang <wency@cn.fujitsu.com>
Subject: [PATCH 10/11 v10] make gdb_id() generally avialable
Date: Tue, 20 Mar 2012 11:56:38 +0800
> The following patch also needs this API, so make it generally avialable
>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> ---
> gdbstub.c | 9 ---------
> gdbstub.h | 9 +++++++++
> 2 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/gdbstub.c b/gdbstub.c
> index f4e97f7..7f8ac2f 100644
> --- a/gdbstub.c
> +++ b/gdbstub.c
> @@ -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;
> diff --git a/gdbstub.h b/gdbstub.h
> index b44e275..f82ec70 100644
> --- a/gdbstub.h
> +++ b/gdbstub.h
> @@ -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
> +}
> +
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-23 10:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-20 3:56 [Qemu-devel] [PATCH 10/11 v10] make gdb_id() generally avialable Wen Congyang
2012-03-23 10:03 ` HATAYAMA Daisuke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).