From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L9T1T-0004SE-Fi for qemu-devel@nongnu.org; Sun, 07 Dec 2008 18:26:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L9T1T-0004Rn-0n for qemu-devel@nongnu.org; Sun, 07 Dec 2008 18:26:47 -0500 Received: from [199.232.76.173] (port=39326 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L9T1S-0004Rg-PC for qemu-devel@nongnu.org; Sun, 07 Dec 2008 18:26:46 -0500 Received: from hall.aurel32.net ([88.191.82.174]:47432) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L9T1S-0006N0-D4 for qemu-devel@nongnu.org; Sun, 07 Dec 2008 18:26:46 -0500 Received: from volta.aurel32.net ([2002:52e8:2fb:1:21e:8cff:feb0:693b]) by hall.aurel32.net with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1L9T1Q-0000p5-TB for qemu-devel@nongnu.org; Mon, 08 Dec 2008 00:26:45 +0100 Received: from aurel32 by volta.aurel32.net with local (Exim 4.69) (envelope-from ) id 1L9T1Q-0003wX-Dd for qemu-devel@nongnu.org; Mon, 08 Dec 2008 00:26:44 +0100 Date: Mon, 8 Dec 2008 00:26:44 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [patch] gdb-stub support for Alpha Message-ID: <20081207232644.GA27433@volta.aurel32.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Thu, Dec 04, 2008 at 12:25:58AM -0500, Vince Weaver wrote: > > Here's an updated version of the patch. It fixes floating point support. > > It still double-steps after a branch for some reason though. > > Vince Thanks applied. > Index: target-alpha/translate.c > =================================================================== > --- target-alpha/translate.c (revision 5854) > +++ target-alpha/translate.c (working copy) > @@ -2407,10 +2407,15 @@ > * generation > */ > if (((ctx.pc & (TARGET_PAGE_SIZE - 1)) == 0) || > - (env->singlestep_enabled) || > num_insns >= max_insns) { > break; > } > + > + if (env->singlestep_enabled) { > + gen_excp(&ctx, EXCP_DEBUG, 0); > + break; > + } > + > #if defined (DO_SINGLE_STEP) > break; > #endif > Index: gdbstub.c > =================================================================== > --- gdbstub.c (revision 5854) > +++ gdbstub.c (working copy) > @@ -990,6 +990,56 @@ > > return 4; > } > +#elif defined (TARGET_ALPHA) > + > +#define NUM_CORE_REGS 65 > + > +static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n) > +{ > + if (n < 31) { > + GET_REGL(env->ir[n]); > + } > + else if (n == 31) { > + GET_REGL(0); > + } > + else if (n<63) { > + uint64_t val; > + > + val=*((uint64_t *)&env->fir[n-32]); > + GET_REGL(val); > + } > + else if (n==63) { > + GET_REGL(env->fpcr); > + } > + else if (n==64) { > + GET_REGL(env->pc); > + } > + else { > + GET_REGL(0); > + } > + > + return 0; > +} > + > +static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n) > +{ > + target_ulong tmp; > + tmp = ldtul_p(mem_buf); > + > + if (n < 31) { > + env->ir[n] = tmp; > + } > + > + if (n > 31 && n < 63) { > + env->fir[n - 32] = ldfl_p(mem_buf); > + } > + > + if (n == 64 ) { > + env->pc=tmp; > + } > + > + return 8; > +} > #else > > #define NUM_CORE_REGS 0 > @@ -1277,6 +1327,8 @@ > s->c_cpu->active_tc.PC = addr; > #elif defined (TARGET_CRIS) > s->c_cpu->pc = addr; > +#elif defined (TARGET_ALPHA) > + s->c_cpu->pc = addr; > #endif > } > gdb_continue(s); > @@ -1313,6 +1365,8 @@ > s->c_cpu->active_tc.PC = addr; > #elif defined (TARGET_CRIS) > s->c_cpu->pc = addr; > +#elif defined (TARGET_ALPHA) > + s->c_cpu->pc = addr; > #endif > } > cpu_single_step(s->c_cpu, sstep_flags); > > > > -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net