Added a test case for unique types. In the test case there are two std::vector

types that have different contents. Currently LLDB is incorrectly uniquing,
on MacOSX, the std::vector _VectorImpl class from the two different vector
templates. The DWARF looks like:

0x0000008e:         DW_TAG_structure_type [7] *
                     DW_AT_name( "_Vector_base<int,std::allocator<int> >" )
                     DW_AT_declaration( 0x01 )
                     DW_AT_sibling( {0x00000103} )

0x00000098:             DW_TAG_structure_type [8] *
                         DW_AT_name( "_Vector_impl" )
                         DW_AT_byte_size( 0x18 )
                         DW_AT_decl_file( "/usr/include/c++/4.2.1/bits/stl_vector.h" )
                         DW_AT_decl_line( 83 )

0x000000a0:                 DW_TAG_inheritance [9]  
                             DW_AT_type( {0x000006fa} ( allocator<int> ) )
                             DW_AT_data_member_location( +0 )
                             DW_AT_accessibility( DW_ACCESS_public )



0x0000011b:         DW_TAG_structure_type [7] *
                     DW_AT_name( "_Vector_base<short int,std::allocator<short int> >" )
                     DW_AT_declaration( 0x01 )
                     DW_AT_sibling( {0x00000190} )

0x00000125:             DW_TAG_structure_type [8] *
                         DW_AT_name( "_Vector_impl" )
                         DW_AT_byte_size( 0x18 )
                         DW_AT_decl_file( "/usr/include/c++/4.2.1/bits/stl_vector.h" )
                         DW_AT_decl_line( 83 )

0x0000012d:                 DW_TAG_inheritance [9]  
                             DW_AT_type( {0x00000f75} ( allocator<short int> ) )
                             DW_AT_data_member_location( +0 )
                             DW_AT_accessibility( DW_ACCESS_public )


In this case it using DIE 0x00000098 for both 0x00000098 and 0x00000125.

This test will help detect this issue once I have a fix for it. I have a fix
that I am testing.

llvm-svn: 127660
This commit is contained in:
Greg Clayton 2011-03-15 04:25:12 +00:00
parent 616f490777
commit 8f67fd10e9
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,5 @@
LEVEL = ../make
CXX_SOURCES := main.cpp
include $(LEVEL)/Makefile.rules

View File

@ -0,0 +1,16 @@
#include <vector>
#include <stdio.h>
#include <stdint.h>
int main (int argc, char const *argv[], char const *envp[])
{
std::vector<int> ints;
std::vector<short> shorts;
for (int i=0; i<12; i++)
{
ints.push_back(i);
shorts.push_back((short)i);
}
return 0;
}