From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23565 invoked by alias); 28 Jun 2006 13:29:23 -0000 Received: (qmail 23556 invoked by uid 22791); 28 Jun 2006 13:29:22 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 28 Jun 2006 13:29:20 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 35127544001; Wed, 28 Jun 2006 15:29:18 +0200 (CEST) Date: Wed, 28 Jun 2006 13:29:00 -0000 From: Corinna Vinschen To: gdb-patches@sourceware.org Subject: [PATCH] m32c-tdep.c: Add virtual_frame_pointer function Message-ID: <20060628132918.GD24606@calimero.vinschen.de> Reply-To: gdb-patches@sourceware.org Mail-Followup-To: gdb-patches@sourceware.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00388.txt.bz2 Hi, the below patch adds a virtual_frame_pointer function to m32c-tdep.c, to avoid that legacy_virtual_frame_pointer is called from tracepoint.c, function encode_actions(). The legacy function either expects a DEPRECATED_FP_REGNUM function, or it expects SP_REGNUM <= NUM_REGS, which is not the case for the m32c code which includes serious register banking. The patch avoids all GDB internal errors in the gdb.trace testsuite and allows to return PASSes for all these testcases, except a single one (FAIL: gdb.trace/packetlen.exp: setup collect actions). Ok to apply? Thanks, Corinna * m32c-tdep.c (m32c_virtual_frame_pointer): New function. (m32c_gdbarch_init): Add set_gdbarch_virtual_frame_pointer call. Index: m32c-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/m32c-tdep.c,v retrieving revision 1.1 diff -u -p -r1.1 m32c-tdep.c --- m32c-tdep.c 20 Apr 2006 23:18:48 -0000 1.1 +++ m32c-tdep.c 28 Jun 2006 13:20:38 -0000 @@ -2475,6 +2475,14 @@ m32c_m16c_pointer_to_address (struct typ return ptr; } +void +m32c_virtual_frame_pointer (CORE_ADDR pc, + int *frame_regnum, + LONGEST *frame_offset) +{ + *frame_regnum = SP_REGNUM; + *frame_offset = 0; +} /* Initialization. */ @@ -2539,6 +2547,8 @@ m32c_gdbarch_init (struct gdbarch_info i /* Trampolines. */ set_gdbarch_skip_trampoline_code (arch, m32c_skip_trampoline_code); + set_gdbarch_virtual_frame_pointer (arch, m32c_virtual_frame_pointer); + return arch; } -- Corinna Vinschen Cygwin Project Co-Leader Red Hat