1 # Test reading debug information from in object files.
3 if { [skip_hp_tests] } { continue }
5 if { ![istarget "hppa*-*-hpux*"] } {
6 verbose "HPUX test ignored for non-hppa targets."
11 set srcsubdir ${srcdir}/${subdir}/objdbg04
12 set objdbgdir ${objdir}/${subdir}/objdbg04
13 set binfile ${objdbgdir}/${testfile}
14 set toolssubdir ${srcdir}/${subdir}/tools
15 set symaddrfile ${toolssubdir}/symaddr
17 if { [gdb_compile "${toolssubdir}/test-objdbg.cc" "${objdbgdir}/test-objdbg.o" object "debug c++ {additional_flags=-I${toolssubdir} +objdebug}"] != "" } {
18 gdb_suppress_entire_file "WARNING: +objdebug option is not supported in this compiler version, test ignored."
21 if { [gdb_compile "${srcsubdir}/x1.cc" "${objdbgdir}/x1.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
22 perror "Couldn't compile x1.cc"
26 if { [gdb_compile "${srcsubdir}/x2.cc" "${objdbgdir}/x2.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
27 perror "Couldn't compile x2.cc"
31 if { [gdb_compile "${objdbgdir}/x1.o ${objdbgdir}/x2.o" "${binfile}0" executable "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
32 perror "Couldn't compile x1.cc"
36 if { [gdb_compile "${objdbgdir}/x2.o ${objdbgdir}/x1.o" "${binfile}1" executable "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
37 perror "Couldn't compile x1.cc"
41 # Test two executables. The first has x1.cc linked first, the second
42 # has x2.cc linked first. The difference is which COMDAT section was
45 for {set filenum 0} {$filenum < 2} {incr filenum 1} {
48 gdb_reinitialize_dir ${srcsubdir}
49 gdb_load ${binfile}${filenum}
51 gdb_test "ptype Adder" "type = template <class T> (class |)Adder {..*T val.*;.*}(.*template instantiations:.*Adder<int>|)"
52 gdb_test "ptype Adder<int>" "type = (class |)Adder<int> {.*private:.*int val;.*public:.*void set( |)\\(int\\);.*int get( |)\\(void\\);.*int add( |)\\(int\\);.*}"
53 gdb_test "ptype Adder" "type = template <class T> (class |)Adder {..*T val.*;.*}(.*template instantiations:.*Adder<int>|)"