From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7506 invoked by alias); 26 May 2005 14:59:14 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 7474 invoked by uid 22791); 26 May 2005 14:59:06 -0000 Received: from miranda.se.axis.com (HELO miranda.se.axis.com) (193.13.178.8) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 26 May 2005 14:59:06 +0000 Received: from [10.92.19.1] (ironmaiden.se.axis.com [10.92.19.1]) by miranda.se.axis.com (8.12.9/8.12.9/Debian-5local0.1) with ESMTP id j4QEx3Nc006070 for ; Thu, 26 May 2005 16:59:03 +0200 Message-ID: <4295E439.7070104@axis.com> Date: Thu, 26 May 2005 15:24:00 -0000 From: Orjan Friberg User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: Dwarf-2 unwinding vs. manual prologue analysis Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-05/txt/msg00558.txt.bz2 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