From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFPYg-0006hm-Q0 for qemu-devel@nongnu.org; Mon, 17 Feb 2014 09:52:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFPYY-0007V9-U0 for qemu-devel@nongnu.org; Mon, 17 Feb 2014 09:52:34 -0500 Received: from server.galauner.de ([144.76.20.253]:46661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFPYY-0007Uq-OE for qemu-devel@nongnu.org; Mon, 17 Feb 2014 09:52:26 -0500 Received: from [172.23.22.2] (static-87-79-236-180.netcologne.de [87.79.236.180]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: andreas@galauner.de) by server.galauner.de (Postfix) with ESMTPSA id 33D4A4005D for ; Mon, 17 Feb 2014 15:52:25 +0100 (CET) Message-ID: <53022228.3000201@galauner.de> Date: Mon, 17 Feb 2014 15:52:24 +0100 From: Andreas Galauner MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Cortex-M3: reading NVIC registers causes segfaults List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi qemu developers, I'm currently trying to emulate an ARM Cortex-M3 and I need to debug the system using GDB and IDA Pro. The platform is an STM32 and I'm using a port from github [1] based on qemu 1.5.1 for that. I ported the custom STM32 code to qemu 1.7.0 to have a more recent version to work with. During a debug session, I'm experiencing segfaults in armv7m_nvic.c when reading the CPUID and Vector base registers (lines 176 and 212), because ARM_CPU(current_cpu) returns a NULL-pointer. IDA seems to do that quite regularly. Debugging with GDB works until you try to read the mentioned registers by hand like this: > (gdb) target remote :1234 > Remote debugging using :1234 > 0x08005d1c in ?? () > (gdb) x/x *0xE000ED00 > Remote connection closed The original STM32-port was based on qemu 1.5.1 and the behaviour was the same. That was the reason why I ported all that stuff over to 1.7.0 which unfortunately didn't solve the problem. Is this a known bug? Any hints on how I could possibly solve that problem? - Andy [1]: https://github.com/beckus/qemu_stm32