This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [4/7] v7: Update DWARF2
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, rguenther at suse dot de, Joey Ye <joey dot ye at intel dot com>, "Guo, Xuepeng" <xuepeng dot guo at intel dot com>
- Date: Sun, 6 Jul 2008 08:22:59 -0700
- Subject: Re: [4/7] v7: Update DWARF2
- References: <20080628181944.GE21773@lucon.org> <486ED7D2.3000709@redhat.com> <20080706045055.GB14362@lucon.org> <4870CBE9.8090404@redhat.com>
On Sun, Jul 06, 2008 at 09:43:05AM -0400, Jason Merrill wrote:
> H.J. Lu wrote:
>> Joey, Xuepeng, please correct me if I am wrong. In case of DRAP,
>> FP has aligned SP and CFA is defined with an expression.
>>
>> 0: 8d 4c 24 04 lea 0x4(%esp),%ecx
>> 4: 83 e4 f0 and $0xfffffff0,%esp
>> 7: ff 71 fc pushl -0x4(%ecx)
>> a: 55 push %ebp
>> b: 89 e5 mov %esp,%ebp
>> d: 83 ec 28 sub $0x28,%esp
>> 10: 89 4c 24 1c mov %ecx,0x1c(%esp)
>>
>> we still need to restore SP. Otherwise exceptions won't work.
>
> The CFA value is the old SP, so we can (and typically do) use that to
> find it.
>
That is what we did. The unwind info is:
00000044 00000030 00000000 FDE cie=00000000 pc=00000000..0000004c
DW_CFA_advance_loc: 4 to 00000004
DW_CFA_def_cfa: r1 (ecx) ofs 0
DW_CFA_advance_loc: 7 to 0000000b
DW_CFA_expression: r5 (ebp) (DW_OP_breg5: 0)
DW_CFA_advance_loc: 2 to 0000000d
DW_CFA_register: r4 (esp) in r5 (ebp)
DW_CFA_advance_loc: 7 to 00000014
DW_CFA_def_cfa_expression (DW_OP_breg5: -12; DW_OP_deref)
DW_CFA_advance_loc: 8 to 0000001c
DW_CFA_expression: r6 (esi) (DW_OP_breg5: -4)
DW_CFA_expression: r3 (ebx) (DW_OP_breg5: -8)
DW_CFA_expression: r4 (esp) (DW_OP_breg5: -12)
queue_reg_save in rule 19 leads to
DW_CFA_expression: r4 (esp) (DW_OP_breg5: -12)
H.J.