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.
Thanks,
Dehao
On Sat, Sep 15, 2012 at 8:55 PM, H.J. Lu <[email protected]> wrote:
> On Fri, Sep 14, 2012 at 9:27 PM, Andrew Pinski <[email protected]> wrote:
>> On Fri, Sep 14, 2012 at 9:25 PM, H.J. Lu <[email protected]> wrote:
>>> On Sat, Sep 8, 2012 at 2:42 PM, Dehao Chen <[email protected]> wrote:
>>>> Hi,
>>>>
>>>> I've added a libjava unittest which verifies that this patch will not
>>>> break Java debug info. I've also incorporated Richard's review in the
>>>> previous mail. Attached is the new patch, which passed bootstrap and
>>>> all gcc/libjava testsuites on x86.
>>>>
>>>> Is it ok for trunk?
>>>>
>>>> Thanks,
>>>> Dehao
>>>>
>>>> gcc/ChangeLog:
>>>> 2012-09-08 Dehao Chen <[email protected]>
>>>>
>>>> * tree-eh.c (goto_queue_node): New field.
>>>> (record_in_goto_queue): New parameter.
>>>> (record_in_goto_queue_label): New parameter.
>>>> (lower_try_finally_dup_block): New parameter.
>>>> (maybe_record_in_goto_queue): Update source location.
>>>> (lower_try_finally_copy): Likewise.
>>>> (honor_protect_cleanup_actions): Likewise.
>>>> * gimplify.c (gimplify_expr): Reset the location to unknown.
>>>>
>>>> gcc/testsuite/ChangeLog:
>>>> 2012-09-08 Dehao Chen <[email protected]>
>>>>
>>>> * g++.dg/debug/dwarf2/deallocator.C: New test.
>>>>
>>>> libjava/ChangeLog:
>>>> 2012-09-08 Dehao Chen <[email protected]>
>>>>
>>>> * testsuite/libjava.lang/sourcelocation.java: New cases.
>>>> * testsuite/libjava.lang/sourcelocation.out: New cases.
>>>
>>> On Linux/x86, I got
>>>
>>> FAIL: sourcelocation -O3 -findirect-dispatch output - source compiled test
>>> FAIL: sourcelocation -O3 output - source compiled test
>>> FAIL: sourcelocation -findirect-dispatch output - source compiled test
>>> FAIL: sourcelocation output - source compiled test
>>>
>>> spawn [open ...]^M
>>> -1
>>> -1
>>> -1
>>> PASS: sourcelocation -findirect-dispatch execution - source compiled test
>>> FAIL: sourcelocation -findirect-dispatch output - source compiled test
>>
>> I bet you have an older addr2line installed.
>>
>
> I am using addr2line from binutils 20120914.
>
>
> --
> H.J.