This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: [PATCH] Set correct source location for deallocator calls
- From: Dehao Chen <dehao at google dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Andrew Pinski <pinskia at gmail dot com>, Mark Wielaard <mark at klomp dot org>, Bryce McKinlay <bmckinlay at gmail dot com>, Andrew Haley <aph at redhat dot com>, Richard Henderson <rth at redhat dot com>, Jason Merrill <jason at redhat dot com>, Richard Guenther <richard dot guenther at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, David Li <davidxl at google dot com>, java at gcc dot gnu dot org
- Date: Sun, 16 Sep 2012 06:03:24 +0800
- Subject: Re: [PATCH] Set correct source location for deallocator calls
- References: <CAO2gOZXfnETUe4wqjT7p6fd61hXreu9PDfqKxNz+HxpE0E7K0g@mail.gmail.com> <50243480.7090803@redhat.com> <CAO2gOZURCuWUk2MVwCwmwrijNzWxJt3q=HUpU7=Qv6zB9e-uqA@mail.gmail.com> <50254A50.8070208@redhat.com> <CAO2gOZXhHuFGJ0z=jvkYKZ84EoDaPSYVjxS7QzGore56SyhWyQ@mail.gmail.com> <50255B35.9020705@redhat.com> <CAO2gOZWe+qMrVyvOoo7Ek-di0NKZxxU4Z=pqrDCqqCCAfctZOw@mail.gmail.com> <50258712.4070002@redhat.com> <CAO2gOZUQQjmKtooyXXAfgFoNVbeNwtT+P=E7pQ6jC=e07Nsr2g@mail.gmail.com> <CAO2gOZX-Gn+b6LEzps5zxhgmwQWcJ-zFqG=a7hesW6fbVyxZYQ@mail.gmail.com> <502E6774.8050609@redhat.com> <CAO2gOZWhueDAShNLbNcJpkHA6QqXk1LNZhEMFvfT77aTZTCH9w@mail.gmail.com> <503F7876.7030606@redhat.com> <503F84A9.8010504@redhat.com> <503F95D8.5010506@redhat.com> <CAO2gOZUxD9-Y3O6iS22HNEHUWaH=0Cm97FZ+KHmhkLmCzahVAA@mail.gmail.com> <CALUNu-qXtr3pSTa8j60nD4Y4QK6VNAEOaPh34RRd4qt671gzkA@mail.gmail.com> <CALUNu-p2-rvGCLYn9s1gy-rGOq+cOwZCw9S1Twbjcba0dVKTfQ@mail.gmail.com> <50463661.1020303@redhat.com> <CALUNu-oP9dqG63EHyN18gYj4P3gwrrJcp4Zgrz-pABNxabmsCg@mail.gmail.com> <1346839095.9368.1.camel@springer.wildebeest.org> <CAO2gOZVhW2+VfKU8+n2qrcKr9fgM1G4bRyUTUB_0DATH9eEW6w@mail.gmail.com> <CAMe9rOqpzNa-u7b-nUfeBkpSed5Fkh16tzw4_uyptpMpKfhUfA@mail.gmail.com> <CA+=Sn1=OrqyrGCA-nY1bTpHLc68=q0QGU1t0dsZpA3meLhy0tg@mail.gmail.com> <CAMe9rOpNE0j2eGJDe9PwQg_6JevLVfKCoviVGAwUVCieUMVhFQ@mail.gmail.com> <CAO2gOZUaAjLSmOj-TfSxgVEwxgN349SgePyJaxWhnJqF7iUxuw@mail.gmail.com> <CAMe9rOoKO3rohszZ8KnZKxVADLXQvddeAronnL=J655T4_Lx8Q@mail.gmail.com>
Yeah, in dwarf2out.c:
4590 add_AT_low_high_pc (dw_die_ref die, const char *lbl_low, const
char *lbl_high,
......
4604 if (dwarf_version < 4)
4605 attr.dw_attr_val.val_class = dw_val_class_lbl_id;
4606 else
4607 attr.dw_attr_val.val_class = dw_val_class_high_pc;
.
dw_val_class_lbl_id is handled:
7984 case dw_val_class_lbl_id:
7985 dw2_asm_output_addr (DWARF2_ADDR_SIZE, AT_lbl (a), "%s", name);
7986 break;
dw_val_class_high_pc is handled:
8027 case dw_val_class_high_pc:
8028 dw2_asm_output_delta (DWARF2_ADDR_SIZE, AT_lbl (a),
8029 get_AT_low_pc (die), "DW_AT_high_pc");
8030 break;
The dwarf4 specification says:
If the value of the DW_AT_high_pc is of class address, it is the
relocated address of the first location past the last instruction
associated with the entity; if it is of class constant, the value is
an unsigned integer offset which when added to the low PC gives the
address of the first location past the last instruction associated
with the entity.
However, I'm not sure how to tell how the DW_AT_high_pc's class is
represented...
Maybe it's the bug in the gcc dwarf implementation?
Dehao
On Sun, Sep 16, 2012 at 2:06 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sat, Sep 15, 2012 at 9:09 AM, Dehao Chen <dehao@google.com> wrote:
>> I tried the up-to-date addr2line on any "gcc -g" generated code, it
>> does not work either. This is because in the new dwarf, the
>> DW_AT_high_pc now actually means the size. e.g.
>>
>> <1><9b>: Abbrev Number: 2 (DW_TAG_subprogram)
>> <9c> DW_AT_external : 1
>> <9c> DW_AT_name : bar
>> <a0> DW_AT_decl_file : 1
>> <a1> DW_AT_decl_line : 8
>> <a2> DW_AT_linkage_name: (indirect string, offset: 0x7b): _Z3barv
>> <a6> DW_AT_type : <0x8d>
>> <aa> DW_AT_low_pc : 0x400583
>> <b2> DW_AT_high_pc : 0x37 0x0
>> <ba> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa)
>> <bc> DW_AT_GNU_all_call_sites: 1
>> <bc> DW_AT_sibling : <0xff>
>>
>> However, addr2line still thinks DW_AT_high_pc means "high_pc". I think
>> we should wait for binutil to catch up with gcc.
>>
>
> So, the meaning of DW_AT_high_pc in DWARF4 is different
> from DWARF3?
>
> --
> H.J.