From: "Petr Hluzín" <petr.hluzin@gmail.com>
To: Richard Henderson <rth@redhat.com>
Cc: Anitha Boyapati <anitha.boyapati@gmail.com>,
binutils@sourceware.org, gdb@sourceware.org,
GCC Patches <gcc-patches@gcc.gnu.org>,
chertykov@gmail.com, aesok@post.ru, eric.weddington@atmel.com
Subject: Re: [avr] gas support for cfi info
Date: Tue, 15 Feb 2011 22:45:00 -0000 [thread overview]
Message-ID: <AANLkTinco6ZrrBGYh3ipDzPmw8D3jt5_KjfJF1xvE4WM@mail.gmail.com> (raw)
In-Reply-To: <4D5ACDF2.20904@redhat.com>
On 15 February 2011 20:03, Richard Henderson <rth@redhat.com> wrote:
> On 02/15/2011 09:41 AM, Richard Henderson wrote:
>> On 02/13/2011 07:10 AM, Petr Hluzín 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?
>>
>> TARGET_USE_CFIPOP
>> DWARF2_DEFAULT_RETURN_COLUMN
>> DWARF2_CIE_DATA_ALIGNMENT
>> DWARF2_LINE_MIN_INSN_LENGTH
>>
>> are the macros that need to be defined,
>>
>> tc_cfi_frame_initial_instructions
>>
>> may be required depending on what the state of the unwind
>> info incoming to a function. Have 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. Again, 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. This 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 = 3;
break;
[1] http://sourceware.org/cgi-bin/cvsweb.cgi/~checkout~/src/gdb/avr-tdep.c?rev=1.128&content-type=text/plain&cvsroot=src
--
Petr Hluzin
next prev parent reply other threads:[~2011-02-15 22:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AANLkTim6hyXysiV-025BDgNJ84qaqTnkRdHi+e7bF2gx@mail.gmail.com>
[not found] ` <AANLkTi=Rnu-wb2W8FejN=XQHmHuTq7rZovKuDdO-QLwi@mail.gmail.com>
[not found] ` <AANLkTimOXF1V__SSFs1gtqJh5nc183EdeHm5NoeU6YXs@mail.gmail.com>
[not found] ` <AANLkTike2osnZS=sUphuN_=oFQLCDUs54uuGCWL6cLVQ@mail.gmail.com>
2011-02-15 17:41 ` Testing Call frame information in .debug_frame section Richard Henderson
2011-02-15 18:02 ` Richard Henderson
2011-02-15 22:13 ` Petr Hluzín
2011-02-16 16:51 ` Richard Henderson
2011-02-15 18:09 ` Anitha Boyapati
2011-02-15 18:48 ` Richard Henderson
2011-02-15 19:15 ` Anitha Boyapati
2011-02-15 19:03 ` [avr] gas support for cfi info Richard Henderson
2011-02-15 22:45 ` Petr Hluzín [this message]
2011-02-16 17:59 ` Richard Henderson
2011-02-16 22:49 ` Petr Hluzín
2011-02-17 16:12 ` Richard Henderson
2011-02-17 16:16 ` Tristan Gingold
2011-02-17 15:35 ` Anitha Boyapati
2011-02-17 16:05 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTinco6ZrrBGYh3ipDzPmw8D3jt5_KjfJF1xvE4WM@mail.gmail.com \
--to=petr.hluzin@gmail.com \
--cc=aesok@post.ru \
--cc=anitha.boyapati@gmail.com \
--cc=binutils@sourceware.org \
--cc=chertykov@gmail.com \
--cc=eric.weddington@atmel.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gdb@sourceware.org \
--cc=rth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).