diff mbox series

[v2,17/21] gdbstub: fix address type of gdb_set_cpu_pc

Message ID 20230105164320.2164095-18-alex.bennee@linaro.org
State Superseded
Headers show
Series gdbstub: re-organise to for better compilation behaviour | expand

Commit Message

Alex Bennée Jan. 5, 2023, 4:43 p.m. UTC
The underlying call uses vaddr and the comms API uses unsigned long
long which will always fit. We don't need to deal in target_ulong
here.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 gdbstub/gdbstub.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Philippe Mathieu-Daudé Jan. 5, 2023, 5:26 p.m. UTC | #1
On 5/1/23 17:43, Alex Bennée wrote:
> The underlying call uses vaddr and the comms API uses unsigned long
> long which will always fit. We don't need to deal in target_ulong
> here.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   gdbstub/gdbstub.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Yay \o/

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Richard Henderson Jan. 6, 2023, 11:19 p.m. UTC | #2
On 1/5/23 08:43, Alex Bennée wrote:
> The underlying call uses vaddr and the comms API uses unsigned long
> long which will always fit. We don't need to deal in target_ulong
> here.
> 
> Signed-off-by: Alex Bennée<alex.bennee@linaro.org>
> ---
>   gdbstub/gdbstub.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index c293b8e43c..4547ca3367 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -535,7 +535,7 @@  static void gdb_process_breakpoint_remove_all(GDBProcess *p)
 }
 
 
-static void gdb_set_cpu_pc(target_ulong pc)
+static void gdb_set_cpu_pc(vaddr pc)
 {
     CPUState *cpu = gdbserver_state.c_cpu;
 
@@ -1289,7 +1289,7 @@  static void handle_file_io(GArray *params, void *user_ctx)
 static void handle_step(GArray *params, void *user_ctx)
 {
     if (params->len) {
-        gdb_set_cpu_pc((target_ulong)get_param(params, 0)->val_ull);
+        gdb_set_cpu_pc(get_param(params, 0)->val_ull);
     }
 
     cpu_single_step(gdbserver_state.c_cpu, gdbserver_state.sstep_flags);