Bug 55665 - [4.8 Regression] Missing DW_TAG_lexical_block PC range
Summary: [4.8 Regression] Missing DW_TAG_lexical_block PC range
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: 4.8.0
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-12 14:21 UTC by Jan Kratochvil
Modified: 2012-12-13 16:02 UTC (History)
1 user (show)

See Also:
Host:
Target: x86_64-unknown-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-12-12 00:00:00


Attachments
gdb.cp/abstract-origin.cc from FSF GDB tree, for -O0 -g. (558 bytes, text/plain)
2012-12-12 16:00 UTC, Jan Kratochvil
Details
gcc48-pr55665.patch (945 bytes, patch)
2012-12-12 17:47 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2012-12-12 14:21:57 UTC
This is a regression for GDB gdb.cp/abstract-origin.exp.

PASS: gcc (GCC) 4.7.3 20121212 (prerelease)
FAIL: gcc (GCC) 4.8.0 20121212 (experimental)
(regression sometimes in ~ the last month)

PASS was:
 <1><9e>: Abbrev Number: 14 (DW_TAG_subprogram)
    <9f>   DW_AT_abstract_origin: <0x5a>
    <a3>   DW_AT_linkage_name: (indirect string, offset: 0xac): _ZN1AC2Ei
[...]
 <2><d1>: Abbrev Number: 16 (DW_TAG_lexical_block)
    <d2>   DW_AT_low_pc      : 0x40081e
    <da>   DW_AT_high_pc     : 0x400891
 <3><e2>: Abbrev Number: 17 (DW_TAG_variable)
    <e3>   DW_AT_abstract_origin: <0x7c>
and above:
 <2><7b>: Abbrev Number: 11 (DW_TAG_lexical_block)
 <3><7c>: Abbrev Number: 12 (DW_TAG_variable)
    <7d>   DW_AT_name        : (indirect string, offset: 0x51): problem
[...]

BTW <d1> was missing DW_AT_abstract_origin <0x7b>; but GDB works with that.

FAIL is:
 <1><9e>: Abbrev Number: 14 (DW_TAG_subprogram)
    <9f>   DW_AT_abstract_origin: <0x5a>
    <a3>   DW_AT_linkage_name: (indirect string, offset: 0xa9): _ZN1AC2Ei
[...]
<nothing for DW_TAG_variable>

This means GDB correctly inherits the DIE from inherited DIE tree:
 <2><7b>: Abbrev Number: 11 (DW_TAG_lexical_block)
 <3><7c>: Abbrev Number: 12 (DW_TAG_variable)
    <7d>   DW_AT_name        : (indirect string, offset: 0x97): problem
[...]

But that DW_TAG_lexical_block has no DW_AT_low/high_pc (it cannot have as it is not the concrete instance) which is a regression.
GDB currently ignores DW_TAG_lexical_block without DW_AT_low/high_pc/range.

While GDB could recognize DW_TAG_lexical_block without DW_AT_low/high_pc it would be still a debug info quality regression as the GCC-4.7 range there is more narrow than the DW_TAG_subprogram PC range.
Comment 1 Jan Kratochvil 2012-12-12 16:00:45 UTC
Created attachment 28936 [details]
gdb.cp/abstract-origin.cc from FSF GDB tree, for -O0 -g.
Comment 2 Jakub Jelinek 2012-12-12 16:58:15 UTC
Caused by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193595
Trying to spot the difference.
Comment 3 Jakub Jelinek 2012-12-12 17:47:28 UTC
Created attachment 28937 [details]
gcc48-pr55665.patch

Untested fix.
Comment 4 Jakub Jelinek 2012-12-12 23:19:38 UTC
Author: jakub
Date: Wed Dec 12 23:19:32 2012
New Revision: 194461

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194461
Log:
	PR debug/55665
	* tree-inline.c (remap_decls): Change nonlocalized_list
	to pointer to pointer to vector from pointer to vector.
	(remap_block): Pass address of BLOCK_NONLOCALIZED_VARS.

	* g++.dg/guality/pr55665.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/guality/pr55665.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-inline.c
Comment 5 Jakub Jelinek 2012-12-12 23:20:51 UTC
Fixed.
Comment 6 Jan Kratochvil 2012-12-13 16:02:48 UTC
Confirming the GDB regression is fixed in the today's results, thanks!