From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2871 invoked by alias); 28 May 2009 10:44:06 -0000 Received: (qmail 2862 invoked by uid 22791); 28 May 2009 10:44:05 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from anchor-post-1.mail.demon.net (HELO anchor-post-1.mail.demon.net) (195.173.77.132) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 May 2009 10:43:59 +0000 Received: from calivar.demon.co.uk ([83.104.54.243] helo=xl5.calivar.com) by anchor-post-1.mail.demon.net with esmtp (Exim 4.69) id 1M9d5Z-0006z7-hy; Thu, 28 May 2009 10:43:57 +0000 Received: from xl5.calivar.com (localhost [127.0.0.1]) by xl5.calivar.com (Postfix) with ESMTP id A2F3B138703; Thu, 28 May 2009 11:43:56 +0100 (BST) To: Stanislav Meduna Cc: ecos-discuss@ecos.sourceware.org References: <4A1E4CEC.8000407@meduna.org> <4A1E5982.1010305@meduna.org> From: Nick Garnett Original-Sender: nickg@ecoscentric.com Date: Thu, 28 May 2009 10:44:00 -0000 In-Reply-To: <4A1E5982.1010305@meduna.org> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Debugging arm-eabi - no stack frame? X-SW-Source: 2009-05/txt/msg00134.txt.bz2 Stanislav Meduna writes: > Nick Garnett wrote: > > >> I am unable to do any backtraces (the emulator barfs > >> at trying to access adresses 0xfffffffc - f). > > > > Exactly how does it barf? > > Bus read error, can not find corresponding bank for addr 0xfffffffc,pc=0x80000dfc > Bus read error, can not find corresponding bank for addr 0xfffffffd,pc=0x80000dfc > Bus read error, can not find corresponding bank for addr 0xfffffffe,pc=0x80000dfc > Bus read error, can not find corresponding bank for addr 0xffffffff,pc=0x80000dfc Presumably these come from skyeye itself. > > I tried to alter values returned by the emulator for invalid memory, > this did not help. > > The access itself is not a problem, the emulator informs > me of it, but does not generate any exception or such, it simply > returns something. Returning zero should cause GDB to eventually stop trying. You could try returning a value that corresponds to a valid address that would be outside your executable. That might also make GDB behave properly. > > > GDB has a somewhat nasty heuristic to try and do backtraces in the > > presence of compiler optimization. To do this it may access memory by > > treating values it finds on the stack and in registers as > > pointers. Sometimes these will point at invalid locations. > > OK, this is certainly a possibility. However, its heuristics > seems to fail: > > (gdb) where > #0 test1 () at nxttests.cxx:34 > #1 0x00000000 in ?? () > > i.e. it does not even know that the test1() was called from main() > The #1 address varies according to what the "invalid" access returns. > > There is no -O in my compilation flags. In my experience of using the same set of tools, albeit mainly for Cortex-M, they seem to generate backtraces correctly. So I'm afraid I'm out of ideas. Perhaps someone else has seen the same problem and can help. -- Nick Garnett eCos Kernel Architect eCosCentric Limited http://www.eCosCentric.com The eCos experts Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571 Registered in England and Wales: Reg No: 4422071 -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss