Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Orjan Friberg <orjan.friberg@axis.com>
To: gdb-patches@sources.redhat.com
Subject: Dwarf-2 unwinding vs. manual prologue analysis
Date: Thu, 26 May 2005 15:24:00 -0000	[thread overview]
Message-ID: <4295E439.7070104@axis.com> (raw)

When adding the CRISv32 support, it seemed like a good idea to avoid having to 
do manual prologue analysis to determine where registers are saved, figuring out 
the return address etc.  For some reason I imagined I wouldn't have to do this 
if I could use the Dwarf-2 frame sniffer (because all code would have Dwarf-2 
CFI).  I hooked in the Dwarf-2 frame sniffer and everything ran fine, and it 
wasn't until just recently that I discovered (to my horror) that the prologue 
scanner (meant for CRISv10 only; the ISAs are not compatible) was not only 
called when debugging CRISv32, but simple things like 'next' broke in various 
places in the testsuite when I didn't do it.

I do feel a bit embarrased asking this, as one would think I'd know this 
already.  Since I obviously don't, here we go:

Do I need to able to do manual prologue analysis when there's Dwarf-2 CFI 
available?  If so, is there a set of minimum requirements for what that analysis 
must be able figure out?


For the record: I created a minimal prologue scanner for CRISv32 by using the 
time-honoured method of gradually stripping away stuff from the CRISv10 version 
until things stopped working.  This is what I ended up with:

   frame_unwind_unsigned_register (next_frame, SP_REGNUM, &this_base);
   info->base = this_base;
   info->prev_sp = this_base;

   /* The PC is found in SRP (the actual register or located on the stack).  */
   info->saved_regs[PC_REGNUM] = info->saved_regs[SRP_REGNUM];


-- 
Orjan Friberg
Axis Communications


             reply	other threads:[~2005-05-26 14:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-26 15:24 Orjan Friberg [this message]
2005-05-26 20:40 ` Daniel Jacobowitz
     [not found]   ` <4296F9B6.10500@axis.com>
2005-05-28  8:58     ` Orjan Friberg

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=4295E439.7070104@axis.com \
    --to=orjan.friberg@axis.com \
    --cc=gdb-patches@sources.redhat.com \
    /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