From patchwork Sat Jun 29 20:01:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 255761 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2DBA02C029E for ; Sun, 30 Jun 2013 06:08:11 +1000 (EST) Received: from localhost ([::1]:33295 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ut1RI-0003kU-0P for incoming@patchwork.ozlabs.org; Sat, 29 Jun 2013 16:08:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ut1M6-0006L5-D8 for qemu-devel@nongnu.org; Sat, 29 Jun 2013 16:02:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ut1M2-0005Nf-OQ for qemu-devel@nongnu.org; Sat, 29 Jun 2013 16:02:46 -0400 Received: from cantor2.suse.de ([195.135.220.15]:57973 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ut1M2-0005Na-Fs for qemu-devel@nongnu.org; Sat, 29 Jun 2013 16:02:42 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id EE4B2A52C6; Sat, 29 Jun 2013 22:02:41 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Sat, 29 Jun 2013 22:01:43 +0200 Message-Id: <1372536117-28167-28-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1372536117-28167-1-git-send-email-afaerber@suse.de> References: <1372536117-28167-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: jan.kiszka@web.de, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH RFC qom-cpu 27/41] cpu: Change cpu_single_step() argument to CPUState X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Use CPUState::env_ptr for now. Needed for GdbState::c_cpu. Signed-off-by: Andreas Färber --- exec.c | 4 ++-- gdbstub.c | 9 +++++---- include/exec/cpu-all.h | 6 ------ include/qom/cpu.h | 6 ++++++ 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/exec.c b/exec.c index f2d848c..56a1d84 100644 --- a/exec.c +++ b/exec.c @@ -581,10 +581,10 @@ void cpu_breakpoint_remove_all(CPUArchState *env, int mask) /* enable or disable single step mode. EXCP_DEBUG is returned by the 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) - CPUState *cpu = ENV_GET_CPU(env); + CPUArchState *env = cpu->env_ptr; if (cpu->singlestep_enabled != enabled) { cpu->singlestep_enabled = enabled; diff --git a/gdbstub.c b/gdbstub.c index ede5cb1..17da380 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2153,7 +2153,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) s->c_cpu = env; } 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; gdb_continue(s); @@ -2181,7 +2181,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) addr = strtoull(p, (char **)&p, 16); 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); return RS_IDLE; case 'F': @@ -2568,7 +2568,7 @@ send_packet: put_packet(s, buf); /* disable single step if it was enabled */ - cpu_single_step(env, 0); + cpu_single_step(cpu, 0); } #endif @@ -2761,6 +2761,7 @@ gdb_queuesig (void) int gdb_handlesig(CPUArchState *env, int sig) { + CPUState *cpu = ENV_GET_CPU(env); GDBState *s; char buf[256]; int n; @@ -2771,7 +2772,7 @@ gdb_handlesig(CPUArchState *env, int sig) } /* disable single step if it was enabled */ - cpu_single_step(env, 0); + cpu_single_step(cpu, 0); tb_flush(env); if (sig != 0) { diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 6499cd0..1f3c002 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -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_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) /* Return the physical page corresponding to a virtual one. Use it diff --git a/include/qom/cpu.h b/include/qom/cpu.h index a02b142..cd10b1d 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -482,6 +482,12 @@ void cpu_resume(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 */ + +void cpu_single_step(CPUState *cpu, int enabled); + #ifdef CONFIG_SOFTMMU extern const struct VMStateDescription vmstate_cpu_common; #else