From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7alt-0002CS-KL for qemu-devel@nongnu.org; Tue, 23 Jun 2015 22:50:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7alp-0000fY-FE for qemu-devel@nongnu.org; Tue, 23 Jun 2015 22:50:41 -0400 Received: from mail-yk0-f179.google.com ([209.85.160.179]:33589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7alp-0000fD-9t for qemu-devel@nongnu.org; Tue, 23 Jun 2015 22:50:37 -0400 Received: by ykdt186 with SMTP id t186so16830692ykd.0 for ; Tue, 23 Jun 2015 19:50:36 -0700 (PDT) MIME-Version: 1.0 Sender: peter.crosthwaite@petalogix.com In-Reply-To: <5588466A.1030902@suse.de> References: <00c96d447252bc1333e14e626611f4f5a58f9bf5.1434432813.git.crosthwaite.peter@gmail.com> <5588466A.1030902@suse.de> Date: Tue, 23 Jun 2015 19:50:36 -0700 Message-ID: From: Peter Crosthwaite Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 2/4] gdbstub: Use cpu_set_pc helper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Andreas_F=C3=A4rber?= Cc: Peter Maydell , Peter Crosthwaite , Peter Crosthwaite , "qemu-devel@nongnu.org Developers" , "Edgar E. Iglesias" On Mon, Jun 22, 2015 at 10:31 AM, Andreas F=C3=A4rber wr= ote: > Am 16.06.2015 um 07:46 schrieb Peter Crosthwaite: >> Use the cpu_set_pc helper which will take care of CPUClass retrieval >> for us. >> >> Signed-off-by: Peter Crosthwaite >> --- >> gdbstub.c | 5 +---- >> 1 file changed, 1 insertion(+), 4 deletions(-) >> >> diff --git a/gdbstub.c b/gdbstub.c >> index 75563db..ceb60ac 100644 >> --- a/gdbstub.c >> +++ b/gdbstub.c >> @@ -754,12 +754,9 @@ static void gdb_breakpoint_remove_all(void) >> static void gdb_set_cpu_pc(GDBState *s, target_ulong pc) >> { >> CPUState *cpu =3D s->c_cpu; >> - CPUClass *cc =3D CPU_GET_CLASS(cpu); >> >> cpu_synchronize_state(cpu); >> - if (cc->set_pc) { >> - cc->set_pc(cpu, pc); >> - } >> + cpu_set_pc(cpu, pc, NULL); > > I believe this argument will probably go away; otherwise this should've > been &error_abort or something instead of NULL. > I'm not sure. As I don't see what is catching the case of a gdb 'c' packet for a CPU that doesn't implement set_pc. I'd rather preserve the existing behaviour, and have the qom wrapper do nothing if it is not implemented. Regards, Peter > Regards, > Andreas > >> } >> >> static CPUState *find_cpu(uint32_t thread_id) >> > > > -- > SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany > GF: Felix Imend=C3=B6rffer, Jane Smithard, Dilip Upmanyu, Graham Norton; = HRB > 21284 (AG N=C3=BCrnberg) >