Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Aleksandar Ristovski <aristovski@qnx.com>
To: gdb@sources.redhat.com
Cc: Daniel Jacobowitz <drow@false.org>
Subject: Re: PowerPC prologue analysis
Date: Tue, 29 Jul 2008 14:10:00 -0000	[thread overview]
Message-ID: <488F2040.8040202@qnx.com> (raw)
In-Reply-To: <20080728210800.GA7730@caradoc.them.org>

Daniel Jacobowitz wrote:
> On Mon, Jul 28, 2008 at 04:29:18PM -0400, Aleksandar Ristovski wrote:
>> Thanks for the link! I briefly looked at the patch and it seems to address some of the things I am talking about (r30-r31 issue) but the comment still reads:
>>
>> +     All gpr's from saved_gpr to gpr31 are saved (except during the
>> +     prologue).  */
>>
>> Is that in the ABI? I would think that if it is, then the code I am looking at is not according to it (gcc issue or just me not understanding powerpc assembly?).
> 
> Sorry, I don't know which.
> 

There seems to be no such statement in the PowerPC ABI "all gpr's from saved_gpr to gpr31 are saved" - non-volatile registers do not need to be stored in this manner. For example, a function may save r29 but not r30 and r31. However PPC prologue analysis in gdb will assume there is r31 saved as well which will make unwind_register(r31) fail (fetch bogus value). (Note: I am using gcc 4.2.3).

Another assumption made in gdb code is that if multiple registers are saved by the prologue, they will be saved in the ascending index order - I am not sure this is a requirement stated in the ABI either. (Is it?) I believe there could be cases where registers are saved in different order, e.g. r30, r28, r29, etc... Hopefully this doesn't happen in practise.

I think your patch with gpr_mask covers the first case (not all registers saved) but the second issue (if real issue) is still not handled.



  reply	other threads:[~2008-07-29 13:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-28 20:13 Aleksandar Ristovski
2008-07-28 20:29 ` Daniel Jacobowitz
2008-07-28 21:08   ` Aleksandar Ristovski
2008-07-29  1:46     ` Daniel Jacobowitz
2008-07-29 14:10       ` Aleksandar Ristovski [this message]
2008-07-29 15:42         ` Aleksandar Ristovski
2008-07-29 15:47           ` Daniel Jacobowitz
2008-07-29 16:52             ` Aleksandar Ristovski

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=488F2040.8040202@qnx.com \
    --to=aristovski@qnx.com \
    --cc=drow@false.org \
    --cc=gdb@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