This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/64912] New: no debug info for struct that pass by reference


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64912

            Bug ID: 64912
           Summary: no debug info for struct that pass by reference
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chihin.ko at oracle dot com

For following t.cc:

extern "C" int printf(const char*, ...);
#include <deque>          
using namespace std;

deque<int> gl_li(5,100);  
int main ()
{                         
    deque<int> tmp_deque(5,200);
    gl_li.assign(tmp_deque.cbegin(),tmp_deque.cend());
    gl_li.assign(tmp_deque.begin(),tmp_deque.end());  
    for ( auto el: gl_li )
    printf("el = %d\n", el);

    return 0;           

} 

/gcc/4.8.1/intel-Linux/bin/g++ -m64 -std=c++11 t.cc -Xlinker
-R/gcc/4.8.1/intel-Linux/lib64      

There is no debug info to indicate struct "_Deque_iterator<int, int&, int*>"
is passed type reference:

< 2><0x000009be>      DW_TAG_structure_type
                        DW_AT_name                  "_Deque_iterator<int, int&,
int*>"
                        DW_AT_byte_size             0x00000020
                        DW_AT_decl_file             0x00000001
/net/dv104/export/tools/gcc/4.8.1/intel-Linux/include/c++/4.8.1/bits/stl_deque.h
                        DW_AT_decl_line             0x0000006a
                        DW_AT_sibling               <0x00000c55>
< 3><0x000009ca>        DW_TAG_member
                          DW_AT_name                  "_M_cur"

===============================================================================
Oracle C++ compiler would generate something like this:
< 2><0x00001bee>      DW_TAG_structure_type
                        DW_AT_name                  "_Deque_iterator<int, int&,
int*>"
                        DW_AT_SUN_link_name        
"_ZSt15_Deque_iteratorIiRiPiE"
                        DW_AT_decl_file             0x00000002
/ws/cia/builds/dodona/latest/inte
l-S2/lib/compilers/CC-gcc/include/c++/4.8.2/bits/stl_deque.h
                        DW_AT_decl_line             0x00000069
                        DW_AT_VMS_rtnbeg_pd_address <0x00001b9f>
                        DW_AT_byte_size             0x00000020
                        DW_AT_SUN_pass_with_const   yes(1)   <=== passed by
reference
                        DW_AT_SUN_return_with_const yes(1)   <=== returned by
reference


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]