From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14500 invoked by alias); 3 Aug 2007 15:51:54 -0000 Received: (qmail 14491 invoked by uid 22791); 3 Aug 2007 15:51:53 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 03 Aug 2007 15:51:50 +0000 Received: (qmail 17929 invoked from network); 3 Aug 2007 15:51:49 -0000 Received: from unknown (HELO localhost) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 Aug 2007 15:51:49 -0000 Date: Fri, 03 Aug 2007 15:51:00 -0000 From: Nathan Froyd To: gcc-patches@gcc.gnu.org Subject: [PATCH] output INCOMING_RETURN_ADDR_RTX in debug info Message-ID: <20070803155148.GA6839@sparrowhawk.codesourcery.com> Mail-Followup-To: gcc-patches@gcc.gnu.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="wac7ysb48OaltWcw" Content-Disposition: inline User-Agent: Mutt/1.4.1i X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-08/txt/msg00190.txt.bz2 --wac7ysb48OaltWcw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1366 When PR 24444 was fixed, recording the initial location of the return address in debug info was made dependent on whether DWARF2_UNWIND_INFO was defined and was true at runtime. On targets where DWARF2_UNWIND_INFO is defined to 0, this was a change in behavior from the previous method, which was to output the initial location of the return address if DWARF2_UNWIND_INFO was simply defined. The current behaviour is inconvenient for the debugger on platforms where DWARF2_UNWIND_INFO is 0, but INCOMING_RETURN_ADDR_RTX is defined. (Since the debugger now has to guess where the return address is, whereas the compiler could have simply told it.) On such platforms (e.g. vxworks targets), we already record register saves in the prologue in the debug info; we might as well record where the return address is too. The attached patch changes things to record the initial location of the return address if INCOMING_RETURN_ADDR_RTX is defined. I don't see a reason to make this information conditional on DWARF2_UNWIND_INFO--but I am also not a debug info expert. Clarifications/corrections welcome! Bootstrapped and tested on i586-wrs-vxworks. OK to commit? :ADDPATCH dwarf2: -Nathan 2007-08-03 Nathan Froyd gcc/ * dwarf2out.c (dwarf2out_frame_init): Make saving INCOMING_RETURN_ADDR_RTX dependent on whether it is defined. --wac7ysb48OaltWcw Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dwarf2-retaddr.patch" Content-length: 555 Index: gcc/dwarf2out.c =================================================================== --- gcc/dwarf2out.c (revision 178052) +++ gcc/dwarf2out.c (working copy) @@ -2612,9 +2612,8 @@ dwarf2out_frame_init (void) /* On entry, the Canonical Frame Address is at SP. */ dwarf2out_def_cfa (NULL, STACK_POINTER_REGNUM, INCOMING_FRAME_SP_OFFSET); -#ifdef DWARF2_UNWIND_INFO - if (DWARF2_UNWIND_INFO) - initial_return_save (INCOMING_RETURN_ADDR_RTX); +#ifdef INCOMING_RETURN_ADDR_RTX + initial_return_save (INCOMING_RETURN_ADDR_RTX); #endif } --wac7ysb48OaltWcw--