1 |
106 |
markom |
# Test reading debug information from in object files.
|
2 |
|
|
|
3 |
|
|
if { [skip_hp_tests] } { continue }
|
4 |
|
|
|
5 |
|
|
if { ![istarget "hppa*-*-hpux*"] } {
|
6 |
|
|
verbose "HPUX test ignored for non-hppa targets."
|
7 |
|
|
return 0
|
8 |
|
|
}
|
9 |
|
|
|
10 |
|
|
set testfile "test"
|
11 |
|
|
set srcsubdir ${srcdir}/${subdir}/objdbg02
|
12 |
|
|
set objdbgdir ${objdir}/${subdir}/objdbg02
|
13 |
|
|
set binfile ${objdbgdir}/${testfile}
|
14 |
|
|
set toolssubdir ${srcdir}/${subdir}/tools
|
15 |
|
|
|
16 |
|
|
if { [gdb_compile "${toolssubdir}/test-objdbg.cc" "${objdbgdir}/test-objdbg.o" object "debug c++ {additional_flags=-I${toolssubdir} +objdebug}"] != "" } {
|
17 |
|
|
gdb_suppress_entire_file "WARNING: +objdebug option is not supported in this compiler version, test ignored."
|
18 |
|
|
}
|
19 |
|
|
|
20 |
|
|
if { [gdb_compile "${srcsubdir}/x1.cc" "${objdbgdir}/x1.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
|
21 |
|
|
perror "Couldn't compile x1.cc"
|
22 |
|
|
return -1
|
23 |
|
|
}
|
24 |
|
|
|
25 |
|
|
if { [gdb_compile "${srcsubdir}/x2.cc" "${objdbgdir}/x2.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
|
26 |
|
|
perror "Couldn't compile x2.cc"
|
27 |
|
|
return -1
|
28 |
|
|
}
|
29 |
|
|
|
30 |
|
|
if { [gdb_compile "${srcsubdir}/x3.cc" "${objdbgdir}/x3.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
|
31 |
|
|
perror "Couldn't compile x3.cc"
|
32 |
|
|
return -1
|
33 |
|
|
}
|
34 |
|
|
|
35 |
|
|
remote_exec build "rm -f ${objdbgdir}/test.a"
|
36 |
|
|
set status [remote_exec build "ar cr ${objdbgdir}/test.a ${objdbgdir}/x2.o ${objdbgdir}/x3.o"]
|
37 |
|
|
if { [lindex $status 0] != 0 } {
|
38 |
|
|
perror "Couldn't compile test.a"
|
39 |
|
|
return -1
|
40 |
|
|
}
|
41 |
|
|
remote_exec build "rm -f ${objdbgdir}/x2.o ${objdbgdir}/x3.o"
|
42 |
|
|
|
43 |
|
|
if { [gdb_compile "${objdbgdir}/x1.o ${objdbgdir}/test.a" "$binfile" executable "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
|
44 |
|
|
perror "Couldn't compile ${binfile}"
|
45 |
|
|
return -1
|
46 |
|
|
}
|
47 |
|
|
|
48 |
|
|
# Test loading debug information from an archive file
|
49 |
|
|
|
50 |
|
|
gdb_exit
|
51 |
|
|
gdb_start
|
52 |
|
|
gdb_reinitialize_dir ${srcsubdir}
|
53 |
|
|
gdb_load ${binfile}
|
54 |
|
|
|
55 |
|
|
gdb_test "b main" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file ..*/x1.cc, line 12."
|
56 |
|
|
gdb_test "run" "Starting program:.*Breakpoint \[0-9\]+, main .*/x1.cc:12.*"
|
57 |
|
|
gdb_test "s 1" ".*13.*"
|
58 |
|
|
gdb_test "s 1" "foo1 .*/x2.cc:15.*"
|
59 |
|
|
gdb_test "s 1" ".*16.*"
|
60 |
|
|
gdb_test "s 1" "foo2 .*/x2.cc:10.*"
|
61 |
|
|
gdb_test "s 1" ".*11.*"
|
62 |
|
|
gdb_test "s 1" "foo1 .*/x2.cc:17.*"
|
63 |
|
|
gdb_test "s 1" "main .*/x1.cc:14.*"
|
64 |
|
|
gdb_test "s 1" "foo3 .*/x3.cc:5.*"
|
65 |
|
|
gdb_test "s 1" ".*6.*"
|
66 |
|
|
gdb_test "s 1" "main .*/x1.cc:15.*"
|
67 |
|
|
gdb_test "s 1" ".*16.*"
|
68 |
|
|
if [istarget "hppa2.0w-*-*"] {
|
69 |
|
|
gdb_test "s 1" "0x\[0-9a-f\]+ in .*START.*"
|
70 |
|
|
gdb_test "c" ".*Program exited normally.*"
|
71 |
|
|
} else {
|
72 |
|
|
gdb_test "s 1" "0x\[0-9a-f\]+ in _start .*"
|
73 |
|
|
gdb_test "s 1" ".*Program exited normally.*"
|
74 |
|
|
}
|
75 |
|
|
|