From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1321 invoked by alias); 20 May 2009 08:26:31 -0000 Received: (qmail 1309 invoked by uid 22791); 20 May 2009 08:26:29 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,FS_NEW_XXX,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-bw0-f165.google.com (HELO mail-bw0-f165.google.com) (209.85.218.165) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 May 2009 08:26:25 +0000 Received: by bwz9 with SMTP id 9so275132bwz.24 for ; Wed, 20 May 2009 01:26:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.124.17 with SMTP id s17mr657029far.79.1242807982822; Wed, 20 May 2009 01:26:22 -0700 (PDT) In-Reply-To: <1242311828.2994.39.camel@thomas> References: <8502af3c0905140623nece4f1dv1e03c2c841c59e42@mail.gmail.com> <1242311828.2994.39.camel@thomas> Date: Wed, 20 May 2009 08:26:00 -0000 Message-ID: <8502af3c0905200126v68b6d474g9ee399bc163e8b5@mail.gmail.com> Subject: Re: new port From: Florent DEFAY To: jeremy.bennett@embecosm.com Cc: Anthony Berent , gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2009-05/txt/msg00136.txt.bz2 Hi, Jeremy, I try to rewrite my target-tdep.c from the beginning taking or1k-tdep.c as a template. In the function or1k_frame_unwind_cache, you get SP that way: this_sp = or1k_unwind_sp (gdbarch, next_frame); But this function could be called at any step of the prologue. As SP is added the frame size at the beginning of the prologue, I think this_sp is always the good value (the base). But in my case, the prologue begins by pushing saved registers and then SP changes at every step. So if I get SP by doing this_sp = or1k_unwind_sp (gdbarch, next_frame); I get the SP value at this step of the execution, not the final value. (1) So I cannot find the base: trad_frame_set_this_base (info, this_sp); is not correct (the base is the final value, this_sp is not the final value). (2) Plus, I need the SP when entering the called function because this is where PREVIOUS PC is saved. I think of a solution for (2): As I know PC, I can compute how many saved regs pushes have been already done. Then, or1k_unwind_sp (gdbarch, next_frame) + NUM_PUSHES * REG_SIZE gives me the SP when entering the function (falling stack). Do you think this solution is ok? Have you an idea for the issue (1) ? Thank you. Regards. Florent