public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/18112] New: -feliminate-dwarf2-dups produces debug entries in wrong scope
@ 2004-10-22 14:25 nikolay at etnus dot com
2004-10-22 17:31 ` [Bug debug/18112] " pinskia at gcc dot gnu dot org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: nikolay at etnus dot com @ 2004-10-22 14:25 UTC (permalink / raw)
To: gcc-bugs
Consider this program, compiled with -feliminate-dwarf2-dups
----------------------------
#include <iostream>
#include <string>
using namespace std;
int main(){
string s1 = "Hello";
}
-----------------------------
readelf -wi produces:
<0><103c>: Abbrev Number: 91 (DW_TAG_compile_unit)
DW_AT_stmt_list : 712
DW_AT_producer : (indirect string, offset: 0xff3): GNU C++ 3.4.1
DW_AT_language : 4 (C++)
DW_AT_name : ../../src/tx_ttf_string.cxx
DW_AT_comp_dir :
/home/nikolay/builds/xander-linux-x86/totalview/debugger/src/tests/bld/gcc_3.4.1_32
.........................
<1><2153>: Abbrev Number: 119 (DW_TAG_subprogram)
DW_AT_sibling : <2186>
DW_AT_external : 1
DW_AT_name : main
DW_AT_decl_file : 54
DW_AT_decl_line : 8
DW_AT_type : <10b6>
DW_AT_low_pc : 0x8048970 134515056
DW_AT_high_pc : 0x80489f3 134515187
DW_AT_frame_base : 1 byte block: 55 (DW_OP_reg5; )
<2><216e>: Abbrev Number: 116 (DW_TAG_lexical_block)
DW_AT_low_pc : 0x804898d 134515085
DW_AT_high_pc : 0x80489e9 134515177
<3><2177>: Abbrev Number: 120 (DW_TAG_variable)
DW_AT_name : s1
DW_AT_decl_file : 54
DW_AT_decl_line : 9
DW_AT_type : <#a92e>
DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24; )
Notice, that variable s1 is of type <#a92e>,
The problem is, that type <#a92e> is defined as typedef in different CU
(which is fine) and inside the scope of some "arbitrary" structure (which is
wrong).
Effectively type of s1 is not visible (out of scope) in main and is reported as
<void> by the debugger.
--
Summary: -feliminate-dwarf2-dups produces debug entries in wrong
scope
Product: gcc
Version: 3.4.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: nikolay at etnus dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18112
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug debug/18112] -feliminate-dwarf2-dups produces debug entries in wrong scope
2004-10-22 14:25 [Bug debug/18112] New: -feliminate-dwarf2-dups produces debug entries in wrong scope nikolay at etnus dot com
@ 2004-10-22 17:31 ` pinskia at gcc dot gnu dot org
2004-10-22 17:40 ` nikolay at etnus dot com
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-22 17:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-22 17:31 -------
This is what I get one the mainline:
<1><c33f>: Abbrev Number: 120 (DW_TAG_subprogram)
DW_AT_sibling : <c368>
DW_AT_external : 1
DW_AT_name : main
DW_AT_decl_file : 2
DW_AT_decl_line : 6
DW_AT_type : <86>
DW_AT_low_pc : 0x8048748
DW_AT_high_pc : 0x80487cb
DW_AT_frame_base : 1 byte block: 55 (DW_OP_reg5)
<2><c35a>: Abbrev Number: 121 (DW_TAG_variable)
DW_AT_name : s1
DW_AT_decl_file : 2
DW_AT_decl_line : 7
DW_AT_type : <af69>
DW_AT_location : 2 byte block: 91 74 (DW_OP_fbreg: -12)
....
<2><af69>: Abbrev Number: 5 (DW_TAG_typedef)
DW_AT_name : string
DW_AT_decl_file : 32
DW_AT_decl_line : 60
DW_AT_type : <60a3>
And some huge number of debuggin data (namespaces and such).
--
What |Removed |Added
----------------------------------------------------------------------------
Summary| -feliminate-dwarf2-dups |-feliminate-dwarf2-dups
|produces debug entries in |produces debug entries in
|wrong scope |wrong scope
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18112
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug debug/18112] -feliminate-dwarf2-dups produces debug entries in wrong scope
2004-10-22 14:25 [Bug debug/18112] New: -feliminate-dwarf2-dups produces debug entries in wrong scope nikolay at etnus dot com
2004-10-22 17:31 ` [Bug debug/18112] " pinskia at gcc dot gnu dot org
@ 2004-10-22 17:40 ` nikolay at etnus dot com
2004-10-22 17:43 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: nikolay at etnus dot com @ 2004-10-22 17:40 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From nikolay at etnus dot com 2004-10-22 17:40 -------
Subject: Re: -feliminate-dwarf2-dups produces debug entries
in wrong scope
You need to use -feliminate-dwarf2-dups flag during compilation.
Nikolay
pinskia at gcc dot gnu dot org wrote:
>------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-22 17:31 -------
>This is what I get one the mainline:
> <1><c33f>: Abbrev Number: 120 (DW_TAG_subprogram)
> DW_AT_sibling : <c368>
> DW_AT_external : 1
> DW_AT_name : main
> DW_AT_decl_file : 2
> DW_AT_decl_line : 6
> DW_AT_type : <86>
> DW_AT_low_pc : 0x8048748
> DW_AT_high_pc : 0x80487cb
> DW_AT_frame_base : 1 byte block: 55 (DW_OP_reg5)
> <2><c35a>: Abbrev Number: 121 (DW_TAG_variable)
> DW_AT_name : s1
> DW_AT_decl_file : 2
> DW_AT_decl_line : 7
> DW_AT_type : <af69>
> DW_AT_location : 2 byte block: 91 74 (DW_OP_fbreg: -12)
>
>....
> <2><af69>: Abbrev Number: 5 (DW_TAG_typedef)
> DW_AT_name : string
> DW_AT_decl_file : 32
> DW_AT_decl_line : 60
> DW_AT_type : <60a3>
>
>And some huge number of debuggin data (namespaces and such).
>
>
>
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18112
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug debug/18112] -feliminate-dwarf2-dups produces debug entries in wrong scope
2004-10-22 14:25 [Bug debug/18112] New: -feliminate-dwarf2-dups produces debug entries in wrong scope nikolay at etnus dot com
2004-10-22 17:31 ` [Bug debug/18112] " pinskia at gcc dot gnu dot org
2004-10-22 17:40 ` nikolay at etnus dot com
@ 2004-10-22 17:43 ` pinskia at gcc dot gnu dot org
2004-10-22 18:17 ` nikolay at etnus dot com
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-22 17:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-22 17:43 -------
Complation of libstdc++ or the small program (you did not say), I did it with the small program and
got that output.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18112
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug debug/18112] -feliminate-dwarf2-dups produces debug entries in wrong scope
2004-10-22 14:25 [Bug debug/18112] New: -feliminate-dwarf2-dups produces debug entries in wrong scope nikolay at etnus dot com
` (2 preceding siblings ...)
2004-10-22 17:43 ` pinskia at gcc dot gnu dot org
@ 2004-10-22 18:17 ` nikolay at etnus dot com
2004-10-22 18:22 ` pinskia at gcc dot gnu dot org
2004-10-22 18:39 ` nikolay at etnus dot com
5 siblings, 0 replies; 7+ messages in thread
From: nikolay at etnus dot com @ 2004-10-22 18:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From nikolay at etnus dot com 2004-10-22 18:16 -------
Subject: Re: -feliminate-dwarf2-dups produces debug entries
in wrong scope
This is what I did:
*** Compiling ../../src/tx_ttf_string.cxx ***
/home/compilers/gnu/gcc/3.4.1/i386-linux/bin/g++ -MD -g
-feliminate-dwarf2-dups \
-c ../../src/tx_ttf_string.cxx -o tx_ttf_string.o
*** Linking program tx_ttf_string ***
/home/compilers/gnu/gcc/3.4.1/i386-linux/bin/g++
-Wl,-rpath,/home/compilers/gnu/gcc/3.4.1/i386-linux/lib:/home/compilers/gnu/gcc/3.4.1/i386-linux/lib
-g -feliminate-dwarf2-dups
-Wl,-rpath,/home/compilers/gnu/gcc/3.4.1/i386-linux/lib:/home/compilers/gnu/gcc/3.4.1/i386-linux/lib
-L/nfs/xander/u1/home/nikolay/totalview/debugger/../tools/lib
-llinux-stubs tx_ttf_string.o \
-o tx_ttf_string
pinskia at gcc dot gnu dot org wrote:
>------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-22 17:43 -------
>Complation of libstdc++ or the small program (you did not say), I did it with the small program and
>got that output.
>
>
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18112
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug debug/18112] -feliminate-dwarf2-dups produces debug entries in wrong scope
2004-10-22 14:25 [Bug debug/18112] New: -feliminate-dwarf2-dups produces debug entries in wrong scope nikolay at etnus dot com
` (3 preceding siblings ...)
2004-10-22 18:17 ` nikolay at etnus dot com
@ 2004-10-22 18:22 ` pinskia at gcc dot gnu dot org
2004-10-22 18:39 ` nikolay at etnus dot com
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-22 18:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-22 18:22 -------
Note I could not reproduce it at all with the mainline GCC or mainline GDB or GCC 3.4.0. Note the older
versions of gdb don't understand the dwarf2 which is outputted by GCC with -feliminate-dwarf2-dups.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18112
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug debug/18112] -feliminate-dwarf2-dups produces debug entries in wrong scope
2004-10-22 14:25 [Bug debug/18112] New: -feliminate-dwarf2-dups produces debug entries in wrong scope nikolay at etnus dot com
` (4 preceding siblings ...)
2004-10-22 18:22 ` pinskia at gcc dot gnu dot org
@ 2004-10-22 18:39 ` nikolay at etnus dot com
5 siblings, 0 replies; 7+ messages in thread
From: nikolay at etnus dot com @ 2004-10-22 18:39 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From nikolay at etnus dot com 2004-10-22 18:39 -------
Subject: Re: -feliminate-dwarf2-dups produces debug entries
in wrong scope
<2><af69>: Abbrev Number: 5 (DW_TAG_typedef)
DW_AT_name : string
DW_AT_decl_file : 32
DW_AT_decl_line : 60
DW_AT_type : <60a3>
-----------------------------------------------------
In what scope is this typedef nested?
Nikolay
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18112
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-10-22 18:39 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-22 14:25 [Bug debug/18112] New: -feliminate-dwarf2-dups produces debug entries in wrong scope nikolay at etnus dot com
2004-10-22 17:31 ` [Bug debug/18112] " pinskia at gcc dot gnu dot org
2004-10-22 17:40 ` nikolay at etnus dot com
2004-10-22 17:43 ` pinskia at gcc dot gnu dot org
2004-10-22 18:17 ` nikolay at etnus dot com
2004-10-22 18:22 ` pinskia at gcc dot gnu dot org
2004-10-22 18:39 ` nikolay at etnus dot com
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).