Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Mitar <mmitar@gmail.com>
To: gdb@sourceware.org
Subject: Custom call frame description
Date: Wed, 20 Jan 2010 20:49:00 -0000	[thread overview]
Message-ID: <f63c4b2d1001201249p13c9b99bu480052da4857629@mail.gmail.com> (raw)

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


             reply	other threads:[~2010-01-20 20:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20 20:49 Mitar [this message]
2010-01-22 16:42 ` Tom Tromey
2010-01-25  9:33   ` Mitar
2010-01-26  8:31     ` Mitar
2010-01-27 15:23       ` Mitar
2010-01-27 15:58         ` Tom Tromey
2010-01-27 19:33           ` Mitar
2010-01-27 19:39             ` Tom Tromey
2010-01-27 19:39             ` Daniel Jacobowitz
2010-01-27 21:07               ` Mitar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f63c4b2d1001201249p13c9b99bu480052da4857629@mail.gmail.com \
    --to=mmitar@gmail.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox