cpu: Change cpu_single_step() argument to CPUState

Use CPUState::env_ptr for now.

Needed for GdbState::c_cpu.

Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
Andreas Färber 2013-06-24 18:41:06 +02:00
parent 5ca666c765
commit 3825b28ff1
4 changed files with 20 additions and 12 deletions

4
exec.c
View File

@ -585,10 +585,10 @@ void cpu_breakpoint_remove_all(CPUArchState *env, int mask)
/* enable or disable single step mode. EXCP_DEBUG is returned by the /* enable or disable single step mode. EXCP_DEBUG is returned by the
CPU loop after each instruction */ CPU loop after each instruction */
void cpu_single_step(CPUArchState *env, int enabled) void cpu_single_step(CPUState *cpu, int enabled)
{ {
#if defined(TARGET_HAS_ICE) #if defined(TARGET_HAS_ICE)
CPUState *cpu = ENV_GET_CPU(env); CPUArchState *env = cpu->env_ptr;
if (cpu->singlestep_enabled != enabled) { if (cpu->singlestep_enabled != enabled) {
cpu->singlestep_enabled = enabled; cpu->singlestep_enabled = enabled;

View File

@ -2154,7 +2154,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
s->c_cpu = env; s->c_cpu = env;
} }
if (res == 's') { if (res == 's') {
cpu_single_step(s->c_cpu, sstep_flags); cpu_single_step(ENV_GET_CPU(s->c_cpu), sstep_flags);
} }
s->signal = res_signal; s->signal = res_signal;
gdb_continue(s); gdb_continue(s);
@ -2182,7 +2182,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)
addr = strtoull(p, (char **)&p, 16); addr = strtoull(p, (char **)&p, 16);
gdb_set_cpu_pc(s, addr); gdb_set_cpu_pc(s, addr);
} }
cpu_single_step(s->c_cpu, sstep_flags); cpu_single_step(ENV_GET_CPU(s->c_cpu), sstep_flags);
gdb_continue(s); gdb_continue(s);
return RS_IDLE; return RS_IDLE;
case 'F': case 'F':
@ -2570,7 +2570,7 @@ send_packet:
put_packet(s, buf); put_packet(s, buf);
/* disable single step if it was enabled */ /* disable single step if it was enabled */
cpu_single_step(env, 0); cpu_single_step(cpu, 0);
} }
#endif #endif
@ -2763,6 +2763,7 @@ gdb_queuesig (void)
int int
gdb_handlesig(CPUArchState *env, int sig) gdb_handlesig(CPUArchState *env, int sig)
{ {
CPUState *cpu = ENV_GET_CPU(env);
GDBState *s; GDBState *s;
char buf[256]; char buf[256];
int n; int n;
@ -2773,7 +2774,7 @@ gdb_handlesig(CPUArchState *env, int sig)
} }
/* disable single step if it was enabled */ /* disable single step if it was enabled */
cpu_single_step(env, 0); cpu_single_step(cpu, 0);
tb_flush(env); tb_flush(env);
if (sig != 0) { if (sig != 0) {

View File

@ -428,12 +428,6 @@ int cpu_watchpoint_remove(CPUArchState *env, target_ulong addr,
void cpu_watchpoint_remove_by_ref(CPUArchState *env, CPUWatchpoint *watchpoint); void cpu_watchpoint_remove_by_ref(CPUArchState *env, CPUWatchpoint *watchpoint);
void cpu_watchpoint_remove_all(CPUArchState *env, int mask); void cpu_watchpoint_remove_all(CPUArchState *env, int mask);
#define SSTEP_ENABLE 0x1 /* Enable simulated HW single stepping */
#define SSTEP_NOIRQ 0x2 /* Do not use IRQ while single stepping */
#define SSTEP_NOTIMER 0x4 /* Do not Timers while single stepping */
void cpu_single_step(CPUArchState *env, int enabled);
#if !defined(CONFIG_USER_ONLY) #if !defined(CONFIG_USER_ONLY)
/* Return the physical page corresponding to a virtual one. Use it /* Return the physical page corresponding to a virtual one. Use it

View File

@ -510,6 +510,19 @@ void cpu_resume(CPUState *cpu);
*/ */
void qemu_init_vcpu(CPUState *cpu); void qemu_init_vcpu(CPUState *cpu);
#define SSTEP_ENABLE 0x1 /* Enable simulated HW single stepping */
#define SSTEP_NOIRQ 0x2 /* Do not use IRQ while single stepping */
#define SSTEP_NOTIMER 0x4 /* Do not Timers while single stepping */
/**
* cpu_single_step:
* @cpu: CPU to the flags for.
* @enabled: Flags to enable.
*
* Enables or disables single-stepping for @cpu.
*/
void cpu_single_step(CPUState *cpu, int enabled);
#ifdef CONFIG_SOFTMMU #ifdef CONFIG_SOFTMMU
extern const struct VMStateDescription vmstate_cpu_common; extern const struct VMStateDescription vmstate_cpu_common;
#else #else