hi,

on the recent 4.5 branch i have a problems with dwarf4 and pretty printers.
here's steps to reproduce:

$ make
/local/devel/toolchain45/x86_64-gnu-linux.mt_alloc/bin/x86_64-gnu-linux-g++
t.cpp -gdwarf-3 -g2 -o t-dw3
/local/devel/toolchain45/x86_64-gnu-linux.mt_alloc/bin/x86_64-gnu-linux-g++
t.cpp -gdwarf-4 -g2 -o t-dw4

$ gdb ./t-dw3
(gdb) r
Breakpoint 1, main () at t.cpp:4
4               std::string s( "foo" );
(gdb) n
5               s.size();
(gdb) p s
$1 = "foo"

$ gdb ./t-dw4
(gdb) r
Breakpoint 1, main () at t.cpp:4
4               std::string s( "foo" );
(gdb) n
5               s.size();
(gdb) p s
$1 = Traceback (most recent call last):
  File
"/local/devel/toolchain45/x86_64-gnu-linux.mt_alloc/share/gcc-4.5.2/python/libstdcxx/v6/printers.py",
line 547, in to_string
    reptype = gdb.lookup_type (str (realtype) + '::_Rep').pointer ()
RuntimeError: No type named std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_Rep.

$ readelf --debug-dump=pubtypes t-dw3                                           
Contents of the .debug_pubtypes section:

  Length:                              443
  Version:                             2
  Offset into .debug_info section:     0x0
  Size of area in .debug_info section: 13545

    Offset      Name
    2d          ptrdiff_t
    3f          size_t
    6bf         __FILE
    6ca         __va_list_tag
    709         wint_t
    770         mbstate_t
    fa4         char_traits
    121c        __pthread_internal_list
    1243        __pthread_list_t
    12ed        __compar_fn_t
    b99         tm
    161c        __gthread_mutex_t
    1627        _Atomic_word
    163a        __pool_base
    17c5        __pool
    1998        __mt_alloc_base
    1a8e        __common_pool
    1adb        __common_pool_base
    1b2f        __common_pool_policy
    1b57        __mt_alloc
    1c62        allocator
    1cf0        lconv
    1e5c        __numeric_traits_integer
    1ecc        basic_string
    3293        _Rep_base
    32c4        _Rep

$ readelf --debug-dump=pubtypes t-dw4
Contents of the .debug_pubtypes section:

  Length:                              394
  Version:                             2
  Offset into .debug_info section:     0x0
  Size of area in .debug_info section: 3926

    Offset      Name
    2d          ptrdiff_t
    3f          size_t
    41e         __FILE
    25          __va_list_tag
    42b         wint_t
    43e         mbstate_t
    34          char_traits
    25          __pthread_internal_list
    b7f         __compar_fn_t
    25          tm
    34          __pool_base
    34          __pool
    34          __mt_alloc_base
    34          __common_pool
    34          __common_pool_base
    34          __common_pool_policy
    34          __mt_alloc
    34          allocator
    25          lconv
    34          __numeric_traits_integer
    25          rebind
    34          basic_string
    34          _Rep_base
    34          _Rep

as you can see few types have the same "offset 34". looks like a bug.


-- 
           Summary: broken debuginfo with dwarf4?
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net
 GCC build triplet: x86_64-gnu-linux
  GCC host triplet: x86_64-gnu-linux
GCC target triplet: x86_64-gnu-linux


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

Reply via email to