summaryrefslogtreecommitdiff
path: root/include/exec/gdbstub.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/exec/gdbstub.h')
-rw-r--r--include/exec/gdbstub.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index 668de66000..49231feb29 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -35,7 +35,8 @@ static inline int cpu_index(CPUArchState *env)
#if defined(CONFIG_USER_ONLY) && defined(CONFIG_USE_NPTL)
return env->host_tid;
#else
- return env->cpu_index + 1;
+ CPUState *cpu = ENV_GET_CPU(env);
+ return cpu->cpu_index + 1;
#endif
}