From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1Dl0-0004Xv-Lp for qemu-devel@nongnu.org; Mon, 22 Jul 2013 06:54:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1Dky-0004Qb-Qk for qemu-devel@nongnu.org; Mon, 22 Jul 2013 06:54:22 -0400 Received: from cantor2.suse.de ([195.135.220.15]:45736 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1Dky-0004Q1-Hn for qemu-devel@nongnu.org; Mon, 22 Jul 2013 06:54:20 -0400 Message-ID: <51ED0F57.9000605@suse.de> Date: Mon, 22 Jul 2013 12:54:15 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1374470667-14586-1-git-send-email-jcmvbkbc@gmail.com> In-Reply-To: <1374470667-14586-1-git-send-email-jcmvbkbc@gmail.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] gdbstub: fix sThreadInfo handler List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Filippov Cc: Paolo Bonzini , Richard Henderson , qemu-devel@nongnu.org, Peter Maydell Am 22.07.2013 07:24, schrieb Max Filippov: > After the commit 182735e cpu: Make first_cpu and next_cpu CPUState > we can no longer blindly use cpu->next_cpu->env_ptr to get CPUArchState > of the next CPU, as the next_cpu is NULL in the last CPU. >=20 > This fixes segfault caused by gdb command 'info threads'. >=20 > Signed-off-by: Max Filippov This should be obsoleted by the patch on qom-cpu that I pointed you to, no? I so far didn't send a pull for that alone since I was hoping to get more gdbstub patches in - I added a comment explaining vaddr type as requested by Peter, so a Reviewed-by/Acked-by for the modified Xtensa subclasses would help push that forward, and no one bothered to review the ..._read_register() changes yet IIRC, split up on rth's request. I could just apply the initial set_pc stuff of course and wait some longer with the rest. Andreas > --- > gdbstub.c | 5 +++-- > 1 files changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/gdbstub.c b/gdbstub.c > index 0ee82a9..deb8159 100644 > --- a/gdbstub.c > +++ b/gdbstub.c > @@ -2406,10 +2406,11 @@ static int gdb_handle_packet(GDBState *s, const= char *line_buf) > } else if (strcmp(p,"sThreadInfo") =3D=3D 0) { > report_cpuinfo: > if (s->query_cpu) { > + CPUState *cpu =3D ENV_GET_CPU(s->query_cpu); > snprintf(buf, sizeof(buf), "m%x", > - cpu_index(ENV_GET_CPU(s->query_cpu))); > + cpu_index(cpu)); > put_packet(s, buf); > - s->query_cpu =3D ENV_GET_CPU(s->query_cpu)->next_cpu->= env_ptr; > + s->query_cpu =3D cpu->next_cpu ? cpu->next_cpu->env_pt= r : NULL; > } else > put_packet(s, "l"); > break; >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg