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 # Create and source the file that provides information about the compiler
18 # used to
compile the test case.
19 if [get_compiler_info $
{binfile
}] {
23 if {!$hp_aCC_compiler
&& !$hp_cc_compiler
} {
27 if { [gdb_compile
"${toolssubdir}/test-objdbg.cc" "${objdbgdir}/test-objdbg.o" object "debug c++ {additional_flags=-I${toolssubdir} +objdebug}"] != "" } {
28 gdb_suppress_entire_file
"WARNING: +objdebug option is not supported in this compiler version, test ignored."
31 if { [gdb_compile
"${srcsubdir}/x1.cc" "${objdbgdir}/x1.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
32 perror
"Couldn't compile x1.cc"
36 if { [gdb_compile
"${srcsubdir}/x2.cc" "${objdbgdir}/x2.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
37 perror
"Couldn't compile x2.cc"
41 if { [gdb_compile
"${objdbgdir}/x1.o ${objdbgdir}/x2.o" "${binfile}0" executable "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
42 perror
"Couldn't compile x1.cc"
46 if { [gdb_compile
"${objdbgdir}/x2.o ${objdbgdir}/x1.o" "${binfile}1" executable "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
47 perror
"Couldn't compile x1.cc"
51 # Test two executables. The first has x1.cc linked first
, the second
52 # has x2.cc linked first. The difference is which COMDAT section was
55 for {set filenum
0} {$filenum
< 2} {incr filenum
1} {
58 gdb_reinitialize_dir $
{srcsubdir
}
59 gdb_load $
{binfile
}$
{filenum
}
61 gdb_test
"ptype Adder" "type = template <class T> (class |)Adder {..*T val.*;.*}(.*template instantiations:.*Adder<int>|)"
62 gdb_test
"ptype Adder<int>" "type = (class |)Adder<int> {.*private:.*int val;.*public:.*void set( |)\\(int\\);.*int get( |)\\(void\\);.*int add( |)\\(int\\);.*}"
63 gdb_test
"ptype Adder" "type = template <class T> (class |)Adder {..*T val.*;.*}(.*template instantiations:.*Adder<int>|)"