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 debug/51873] New: stringstream is opaque with g++


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51873

             Bug #: 51873
           Summary: stringstream is opaque with g++
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: nikolay@totalviewtech.com


Consider this example:
----------------------------
#include <iostream>
#include <sstream>
using namespace std;

int main()
{

std::stringstream msg;
char ch;

  msg << "hello";

  for (int n = 0; n < 4; n++)
  {
    msg >> ch;
    cout << ch << endl;
  }

 return 0;
}
-----------------------------
If you compile it with -g and try to debug it msg variable is reported as
opaque.
13        for (int n = 0; n < 4; n++)
(gdb) p msg
$1 = <incomplete type>
(gdb) 

Same in Totalview.

Here is a dwarf:
<2><acb>: Abbrev Number: 12 (DW_TAG_structure_type)
     DW_AT_name        :
basic_stringstream<char,std::char_traits<char>,std::allocator<char> >    
     DW_AT_declaration : 1    
.....
<2><5dd2>: Abbrev Number: 7 (DW_TAG_typedef)
     DW_AT_name        : stringstream    
     DW_AT_decl_file   : 26    
     DW_AT_decl_line   : 143    
     DW_AT_type        : <acb>    
 <2><5de6>: Abbrev Number: 103 (DW_TAG_variable)
     DW_AT_name        : msg    
     DW_AT_decl_file   : 2    
     DW_AT_decl_line   : 8    
     DW_AT_type        : <5dd2>    
     DW_AT_location    : 3 byte block: 91 e0 7c     (DW_OP_fbreg: -416)

There is only declaration of stringstream and no definition.


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