From patchwork Mon Jan 10 20:31:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 78204 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 3D31DB6EDF for ; Tue, 11 Jan 2011 07:33:54 +1100 (EST) Received: (qmail 19542 invoked by alias); 10 Jan 2011 20:32:35 -0000 Received: (qmail 19456 invoked by uid 22791); 10 Jan 2011 20:32:32 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (140.186.70.92) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 Jan 2011 20:32:22 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PcOPW-0006w6-Cl for gcc-patches@gcc.gnu.org; Mon, 10 Jan 2011 15:32:21 -0500 Received: from b.mail.sonic.net ([64.142.19.5]:41291) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PcOPW-0006vi-5W for gcc-patches@gcc.gnu.org; Mon, 10 Jan 2011 15:32:14 -0500 Received: from are.twiddle.net (are.twiddle.net [75.101.38.216]) by b.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id p0AKWDbX032101 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 10 Jan 2011 12:32:13 -0800 Received: from anchor.twiddle.home (anchor.twiddle.home [172.31.0.4]) by are.twiddle.net (8.14.4/8.14.4) with ESMTP id p0AKWCew006754; Mon, 10 Jan 2011 12:32:12 -0800 Received: from anchor.twiddle.home (localhost.localdomain [127.0.0.1]) by anchor.twiddle.home (8.14.4/8.14.4) with ESMTP id p0AKWAEv019668; Mon, 10 Jan 2011 12:32:11 -0800 Received: (from rth@localhost) by anchor.twiddle.home (8.14.4/8.14.4/Submit) id p0AKW9Dc019667; Mon, 10 Jan 2011 12:32:09 -0800 From: Richard Henderson To: gcc-patches@gcc.gnu.org Cc: nickc@redhat.com, law@redhat.com, Richard Henderson Subject: [PATCH 05/28] mn10300: Fix debug offsets into the stack frame Date: Mon, 10 Jan 2011 12:31:34 -0800 Message-Id: <1294691517-19580-6-git-send-email-rth@redhat.com> In-Reply-To: <1294691517-19580-1-git-send-email-rth@redhat.com> References: <1294691517-19580-1-git-send-email-rth@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org From: Richard Henderson We were using debugging hooks to semi-correct a mistake in the lack of ARG_POINTER_CFA_OFFSET. --- gcc/config/mn10300/mn10300.h | 29 +++-------------------------- 1 files changed, 3 insertions(+), 26 deletions(-) diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h index 468c031..60d7d43 100644 --- a/gcc/config/mn10300/mn10300.h +++ b/gcc/config/mn10300/mn10300.h @@ -463,6 +463,9 @@ enum reg_class #define FIRST_PARM_OFFSET(FNDECL) 4 +/* But the CFA is at the arg pointer directly, not at the first argument. */ +#define ARG_POINTER_CFA_OFFSET(FNDECL) 0 + #define ELIMINABLE_REGS \ {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ @@ -731,34 +734,8 @@ struct cum_arg #undef PREFERRED_DEBUGGING_TYPE #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG #define DWARF2_DEBUGGING_INFO 1 - #define DWARF2_ASM_LINE_DEBUG_INFO 1 -/* GDB always assumes the current function's frame begins at the value - of the stack pointer upon entry to the current function. Accessing - local variables and parameters passed on the stack is done using the - base of the frame + an offset provided by GCC. - - For functions which have frame pointers this method works fine; - the (frame pointer) == (stack pointer at function entry) and GCC provides - an offset relative to the frame pointer. - - This loses for functions without a frame pointer; GCC provides an offset - which is relative to the stack pointer after adjusting for the function's - frame size. GDB would prefer the offset to be relative to the value of - the stack pointer at the function's entry. Yuk! */ -#define DEBUGGER_AUTO_OFFSET(X) \ - ((GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0) \ - + (frame_pointer_needed \ - ? 0 : - mn10300_initial_offset (FRAME_POINTER_REGNUM, \ - STACK_POINTER_REGNUM))) - -#define DEBUGGER_ARG_OFFSET(OFFSET, X) \ - ((GET_CODE (X) == PLUS ? OFFSET : 0) \ - + (frame_pointer_needed \ - ? 0 : - mn10300_initial_offset (ARG_POINTER_REGNUM, \ - STACK_POINTER_REGNUM))) - /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ #define CASE_VECTOR_MODE Pmode