From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GchV8-0003YV-GU for qemu-devel@nongnu.org; Wed, 25 Oct 2006 08:04:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GchV3-0003U8-Gv for qemu-devel@nongnu.org; Wed, 25 Oct 2006 08:04:54 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GchV2-0003TM-GB for qemu-devel@nongnu.org; Wed, 25 Oct 2006 08:04:48 -0400 Received: from [195.141.71.141] (helo=mail.esmertec.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GchV1-0001Kx-Do for qemu-devel@nongnu.org; Wed, 25 Oct 2006 08:04:47 -0400 Received: from ddenholm by dalmore.esmertec.com with local (Exim 4.50) id 1GchUS-0007io-9Q for qemu-devel@nongnu.org; Wed, 25 Oct 2006 13:04:12 +0100 From: Dave Denholm Date: Wed, 25 Oct 2006 13:04:12 +0100 In-Reply-To: (Dave Denholm's message of "Tue, 10 Oct 2006 13:23:56 +0100") Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] gdb support for qemu-mips (user mode) 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 Hi, user-mode emulation of mips allows gdb to connect and set breakpoints, but when the breakpoint is reached, the emulator bombs out with an unhandled cpu exception 0x10002 (or something like that). I think it's just a missing case EXCP_DEBUG in the mips-specific cpu_loop in linux-user/main.c (around line 1301 in 0.8.2) Since all the other archs do exactly the same thing for EXCP_DEBUG, I just pasted that code into the mips version, and it seemed to work, at least a bit - when I was single-stepping through a fn, gdb got stuck complaining that it couldn't find a fn for a given ip address. dd -- Dave Denholm http://www.esmertec.com --- linux-user/main.c.~1~ 2006-07-22 18:23:34.000000000 +0100 +++ linux-user/main.c 2006-10-25 11:14:30.752887950 +0100 @@ -1350,6 +1350,20 @@ case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ break; + case EXCP_DEBUG: + { + int sig; + + sig = gdb_handlesig (env, TARGET_SIGTRAP); + if (sig) + { + info.si_signo = sig; + info.si_errno = 0; + info.si_code = TARGET_TRAP_BRKPT; + queue_signal(info.si_signo, &info); + } + } + break; default: // error: fprintf(stderr, "qemu: unhandled CPU exception 0x%x - aborting\n",