* [PATCH] gdbstub: Have syscall_complete/[gs]et_reg to target agnostic typedefs
@ 2022-12-14 14:36 Philippe Mathieu-Daudé
2022-12-14 14:40 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-14 14:36 UTC (permalink / raw)
To: qemu-devel; +Cc: Alex Bennée, Philippe Mathieu-Daudé
Prototypes using gdb_syscall_complete_cb() or gdb_?et_reg_cb()
don't depend on "cpu.h", thus are not target-specific.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/exec/gdbstub.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index f667014888..1636fb3841 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -71,9 +71,6 @@ struct gdb_timeval {
uint64_t tv_usec; /* microsecond */
} QEMU_PACKED;
-#ifdef NEED_CPU_H
-#include "cpu.h"
-
typedef void (*gdb_syscall_complete_cb)(CPUState *cpu, uint64_t ret, int err);
/**
@@ -126,6 +123,7 @@ int gdb_handlesig(CPUState *, int);
void gdb_signalled(CPUArchState *, int);
void gdbserver_fork(CPUState *);
#endif
+
/* Get or set a register. Returns the size of the register. */
typedef int (*gdb_get_reg_cb)(CPUArchState *env, GByteArray *buf, int reg);
typedef int (*gdb_set_reg_cb)(CPUArchState *env, uint8_t *buf, int reg);
@@ -133,6 +131,9 @@ void gdb_register_coprocessor(CPUState *cpu,
gdb_get_reg_cb get_reg, gdb_set_reg_cb set_reg,
int num_regs, const char *xml, int g_pos);
+#ifdef NEED_CPU_H
+#include "cpu.h"
+
/*
* The GDB remote protocol transfers values in target byte order. As
* the gdbstub may be batching up several register values we always
--
2.38.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] gdbstub: Have syscall_complete/[gs]et_reg to target agnostic typedefs
2022-12-14 14:36 [PATCH] gdbstub: Have syscall_complete/[gs]et_reg to target agnostic typedefs Philippe Mathieu-Daudé
@ 2022-12-14 14:40 ` Philippe Mathieu-Daudé
2022-12-14 15:24 ` Richard Henderson
2022-12-14 16:09 ` Alex Bennée
0 siblings, 2 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-14 14:40 UTC (permalink / raw)
To: qemu-devel; +Cc: Alex Bennée
On 14/12/22 15:36, Philippe Mathieu-Daudé wrote:
> Prototypes using gdb_syscall_complete_cb() or gdb_?et_reg_cb()
> don't depend on "cpu.h", thus are not target-specific.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/exec/gdbstub.h | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
Subject should be:
"gdbstub: Make syscall_complete/[gs]et_reg target-agnostic typedefs"
> diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
> index f667014888..1636fb3841 100644
> --- a/include/exec/gdbstub.h
> +++ b/include/exec/gdbstub.h
> @@ -71,9 +71,6 @@ struct gdb_timeval {
> uint64_t tv_usec; /* microsecond */
> } QEMU_PACKED;
>
> -#ifdef NEED_CPU_H
> -#include "cpu.h"
> -
> typedef void (*gdb_syscall_complete_cb)(CPUState *cpu, uint64_t ret, int err);
>
> /**
> @@ -126,6 +123,7 @@ int gdb_handlesig(CPUState *, int);
> void gdb_signalled(CPUArchState *, int);
> void gdbserver_fork(CPUState *);
> #endif
> +
> /* Get or set a register. Returns the size of the register. */
> typedef int (*gdb_get_reg_cb)(CPUArchState *env, GByteArray *buf, int reg);
> typedef int (*gdb_set_reg_cb)(CPUArchState *env, uint8_t *buf, int reg);
> @@ -133,6 +131,9 @@ void gdb_register_coprocessor(CPUState *cpu,
> gdb_get_reg_cb get_reg, gdb_set_reg_cb set_reg,
> int num_regs, const char *xml, int g_pos);
>
> +#ifdef NEED_CPU_H
> +#include "cpu.h"
> +
> /*
> * The GDB remote protocol transfers values in target byte order. As
> * the gdbstub may be batching up several register values we always
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gdbstub: Have syscall_complete/[gs]et_reg to target agnostic typedefs
2022-12-14 14:40 ` Philippe Mathieu-Daudé
@ 2022-12-14 15:24 ` Richard Henderson
2022-12-14 16:09 ` Alex Bennée
1 sibling, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2022-12-14 15:24 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Alex Bennée
On 12/14/22 08:40, Philippe Mathieu-Daudé wrote:
> On 14/12/22 15:36, Philippe Mathieu-Daudé wrote:
>> Prototypes using gdb_syscall_complete_cb() or gdb_?et_reg_cb()
>> don't depend on "cpu.h", thus are not target-specific.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> include/exec/gdbstub.h | 7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> Subject should be:
> "gdbstub: Make syscall_complete/[gs]et_reg target-agnostic typedefs"
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gdbstub: Have syscall_complete/[gs]et_reg to target agnostic typedefs
2022-12-14 14:40 ` Philippe Mathieu-Daudé
2022-12-14 15:24 ` Richard Henderson
@ 2022-12-14 16:09 ` Alex Bennée
1 sibling, 0 replies; 4+ messages in thread
From: Alex Bennée @ 2022-12-14 16:09 UTC (permalink / raw)
To: Philippe Mathieu-Daudé; +Cc: qemu-devel
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> On 14/12/22 15:36, Philippe Mathieu-Daudé wrote:
>> Prototypes using gdb_syscall_complete_cb() or gdb_?et_reg_cb()
>> don't depend on "cpu.h", thus are not target-specific.
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> include/exec/gdbstub.h | 7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> Subject should be:
> "gdbstub: Make syscall_complete/[gs]et_reg target-agnostic typedefs"
Queued to gdbstub/next, thanks.
>
>> diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
>> index f667014888..1636fb3841 100644
>> --- a/include/exec/gdbstub.h
>> +++ b/include/exec/gdbstub.h
>> @@ -71,9 +71,6 @@ struct gdb_timeval {
>> uint64_t tv_usec; /* microsecond */
>> } QEMU_PACKED;
>> -#ifdef NEED_CPU_H
>> -#include "cpu.h"
>> -
>> typedef void (*gdb_syscall_complete_cb)(CPUState *cpu, uint64_t ret, int err);
>> /**
>> @@ -126,6 +123,7 @@ int gdb_handlesig(CPUState *, int);
>> void gdb_signalled(CPUArchState *, int);
>> void gdbserver_fork(CPUState *);
>> #endif
>> +
>> /* Get or set a register. Returns the size of the register. */
>> typedef int (*gdb_get_reg_cb)(CPUArchState *env, GByteArray *buf, int reg);
>> typedef int (*gdb_set_reg_cb)(CPUArchState *env, uint8_t *buf, int reg);
>> @@ -133,6 +131,9 @@ void gdb_register_coprocessor(CPUState *cpu,
>> gdb_get_reg_cb get_reg, gdb_set_reg_cb set_reg,
>> int num_regs, const char *xml, int g_pos);
>> +#ifdef NEED_CPU_H
>> +#include "cpu.h"
>> +
>> /*
>> * The GDB remote protocol transfers values in target byte order. As
>> * the gdbstub may be batching up several register values we always
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-12-14 16:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-14 14:36 [PATCH] gdbstub: Have syscall_complete/[gs]et_reg to target agnostic typedefs Philippe Mathieu-Daudé
2022-12-14 14:40 ` Philippe Mathieu-Daudé
2022-12-14 15:24 ` Richard Henderson
2022-12-14 16:09 ` Alex Bennée
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).