Patchwork [RFC,qom-cpu,03/41] gdbstub: Change GDBState::query_cpu to CPUState

login
register
mail settings
Submitter Andreas Färber
Date June 29, 2013, 8:01 p.m.
Message ID <1372536117-28167-4-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/255756/
State New
Headers show

Comments

Andreas Färber - June 29, 2013, 8:01 p.m.
Since first_cpu/next_cpu are CPUState, CPUArchState is no longer needed.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 gdbstub.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
Richard Henderson - July 1, 2013, 5:05 p.m.
On 06/29/2013 01:01 PM, Andreas Färber wrote:
> Since first_cpu/next_cpu are CPUState, CPUArchState is no longer needed.
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  gdbstub.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~
Andreas Färber - July 2, 2013, 10:11 p.m.
Am 01.07.2013 19:05, schrieb Richard Henderson:
> On 06/29/2013 01:01 PM, Andreas Färber wrote:
>> Since first_cpu/next_cpu are CPUState, CPUArchState is no longer needed.
>>
>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>> ---
>>  gdbstub.c | 9 ++++-----
>>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> Reviewed-by: Richard Henderson <rth@twiddle.net>

Thanks, applied to qom-cpu:
https://github.com/afaerber/qemu-cpu/commits/qom-cpu

Andreas

Patch

diff --git a/gdbstub.c b/gdbstub.c
index 5793bcd..4a0d04e 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -289,7 +289,7 @@  enum RSState {
 typedef struct GDBState {
     CPUArchState *c_cpu; /* current CPU for step/continue ops */
     CPUArchState *g_cpu; /* current CPU for other ops */
-    CPUArchState *query_cpu; /* for q{f|s}ThreadInfo */
+    CPUState *query_cpu; /* for q{f|s}ThreadInfo */
     enum RSState state; /* parsing state */
     char line_buf[MAX_PACKET_LENGTH];
     int line_buf_index;
@@ -2399,15 +2399,14 @@  static int gdb_handle_packet(GDBState *s, const char *line_buf)
             put_packet(s, "QC1");
             break;
         } else if (strcmp(p,"fThreadInfo") == 0) {
-            s->query_cpu = first_cpu->env_ptr;
+            s->query_cpu = first_cpu;
             goto report_cpuinfo;
         } else if (strcmp(p,"sThreadInfo") == 0) {
         report_cpuinfo:
             if (s->query_cpu) {
-                snprintf(buf, sizeof(buf), "m%x",
-                         cpu_index(ENV_GET_CPU(s->query_cpu)));
+                snprintf(buf, sizeof(buf), "m%x", cpu_index(s->query_cpu));
                 put_packet(s, buf);
-                s->query_cpu = ENV_GET_CPU(s->query_cpu)->next_cpu->env_ptr;
+                s->query_cpu = s->query_cpu->next_cpu;
             } else
                 put_packet(s, "l");
             break;