From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5977 invoked by alias); 15 Feb 2011 22:45:08 -0000 Received: (qmail 5927 invoked by uid 22791); 15 Feb 2011 22:45:04 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FSL_RU_URL,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-fx0-f41.google.com (HELO mail-fx0-f41.google.com) (209.85.161.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Feb 2011 22:44:57 +0000 Received: by fxm12 with SMTP id 12so770868fxm.0 for ; Tue, 15 Feb 2011 14:44:55 -0800 (PST) Received: by 10.223.83.199 with SMTP id g7mr5731322fal.97.1297809895260; Tue, 15 Feb 2011 14:44:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.55.154 with HTTP; Tue, 15 Feb 2011 14:44:34 -0800 (PST) In-Reply-To: <4D5ACDF2.20904@redhat.com> References: <4D5ABAB2.2000405@redhat.com> <4D5ACDF2.20904@redhat.com> From: =?UTF-8?B?UGV0ciBIbHV6w61u?= Date: Tue, 15 Feb 2011 22:45:00 -0000 Message-ID: Subject: Re: [avr] gas support for cfi info To: Richard Henderson Cc: Anitha Boyapati , binutils@sourceware.org, gdb@sourceware.org, GCC Patches , chertykov@gmail.com, aesok@post.ru, eric.weddington@atmel.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-02/txt/msg00184.txt.bz2 On 15 February 2011 20:03, Richard Henderson wrote: > On 02/15/2011 09:41 AM, Richard Henderson wrote: >> On 02/13/2011 07:10 AM, Petr Hluz=C3=ADn wrote: >>> http://xfree86.cygwin.ru/ml/binutils/2010-08/msg00109.html >> >> I'll agree that a better error message would be helpful. >> >> To answer a question within that message: >> >>> By the way: Why AVR target does not understand CFI? What needs to be >>> done in binutils? And in GDB? >> >> =C2=A0 TARGET_USE_CFIPOP >> =C2=A0 DWARF2_DEFAULT_RETURN_COLUMN >> =C2=A0 DWARF2_CIE_DATA_ALIGNMENT >> =C2=A0 DWARF2_LINE_MIN_INSN_LENGTH >> >> are the macros that need to be defined, >> >> =C2=A0 tc_cfi_frame_initial_instructions >> >> may be required depending on what the state of the unwind >> info incoming to a function. =C2=A0Have a look at tc-i386.c, >> tc_x86_frame_initial_instructions for a typical stack-based >> call mechanism. >> >> For the nearly related task of dwarf2 line numbers, you need >> a call to dwarf2_emit_insn emitted immediately before each >> insn is added to the frags. =C2=A0Again, see tc-i386.c for ideas. > > To follow up on myself, it appears as if avr already has dwarf2 > line number support, and only needs a few things in order to > enable cfi support. > > CC'd to gcc and gdb because the dwarf2 register numbers for SP > and the return address column need to be coordinated. =C2=A0This is > part of the target's ABI. In avr-tdep.c [1] near avr_dwarf_reg_to_regnum(): /* Unfortunately dwarf2 register for SP is 32. */ (I can't help you with the value for #define DWARF2_DEFAULT_RETURN_COLUMN = 36) AFAIK there is no written ABI. Only the calling convention is documented (and only the easy cases), the rest is in gdb/gcc/binutils sources and people's heads. > I've left a ??? marker for when AVR_3_BYTE_PC would be true in > gcc; I haven't tracked down how that maps into the assembler, > or even if there is a simple mapping. In avr_gdbarch_init() in avr-tdep.c [1]: /* Avr-6 call instructions save 3 bytes. */ switch (info.bfd_arch_info->mach) ... case bfd_mach_avr6: call_length =3D 3; break; [1] http://sourceware.org/cgi-bin/cvsweb.cgi/~checkout~/src/gdb/avr-tdep.c?= rev=3D1.128&content-type=3Dtext/plain&cvsroot=3Dsrc --=20 Petr Hluzin