From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6771 invoked by alias); 20 Jan 2010 20:49:53 -0000 Received: (qmail 6761 invoked by uid 22791); 20 Jan 2010 20:49:52 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-fx0-f221.google.com (HELO mail-fx0-f221.google.com) (209.85.220.221) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Jan 2010 20:49:50 +0000 Received: by fxm21 with SMTP id 21so577327fxm.13 for ; Wed, 20 Jan 2010 12:49:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.239.130.209 with SMTP id 17mr61427hbk.186.1264020587291; Wed, 20 Jan 2010 12:49:47 -0800 (PST) Date: Wed, 20 Jan 2010 20:49:00 -0000 Message-ID: Subject: Custom call frame description From: Mitar To: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-01/txt/msg00168.txt.bz2 Hi! I am writing a simple compiler for a custom/learning language on the ARM platform. It is written in Java and outputs assembler code which is then assembled with GNU assembler. As sometimes things do not work as planned I would like to be able to use gdb to debug them, especially stack, but as I have a custom call frame format gdb is unable to unwind/read a stack trace. I have tried to get through DWARF specification but I could not really manage how to specify frame format in a simple way. I have checked GCC's source code but I got lost in DWARF versions. DWARF Tutorial was useful but had no examples for call frame. So I am a bit lost how to proceed. What should I write to a assembler file so that resulting object file would have a call frame description? My compiler does not optimise anything and everything (return addresses and arguments - they are always passed over the stack) are all nicely stored in the stack. So by reading stack I could easily debug output of my compiler. So I would ask for advice and/or some example of an assembler code for DWARF call frame description. My frame looks like this (all values are 32 bit): static link (frame pointer points here and where is return value stored after current function call) local variables (some number of them) old frame pointer return address temporary variables (where I store registers when there is not enough of them) function arguments for next call Mitar