OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [testsuite/] [gdb.hp/] [gdb.objdbg/] [objdbg03.exp] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
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}/objdbg03
12
set objdbgdir ${objdir}/${subdir}/objdbg03
13
set binfile ${objdbgdir}/${testfile}
14
set toolssubdir ${srcdir}/${subdir}/tools
15
if [istarget "hppa2.0w-*-*"] {
16
  set symaddrfile ${toolssubdir}/symaddr.pa64
17
} else {
18
  set symaddrfile ${toolssubdir}/symaddr
19
}
20
 
21
if { [gdb_compile "${toolssubdir}/test-objdbg.cc" "${objdbgdir}/test-objdbg.o" object "debug c++ {additional_flags=-I${toolssubdir} +objdebug}"] != "" } {
22
    gdb_suppress_entire_file "WARNING: +objdebug option is not supported in this compiler version, test ignored."
23
}
24
 
25
if { [gdb_compile "${srcsubdir}/x1.cc" "${objdbgdir}/x1.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
26
    perror "Couldn't compile x1.cc"
27
    return -1
28
}
29
 
30
if { [gdb_compile "${srcsubdir}/x2.cc" "${objdbgdir}/x2.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
31
    perror "Couldn't compile x2.cc"
32
    return -1
33
}
34
 
35
if { [gdb_compile "${srcsubdir}/x3.cc" "${objdbgdir}/x3.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
36
    perror "Couldn't compile x3.cc"
37
    return -1
38
}
39
 
40
if { [gdb_compile "${objdbgdir}/x1.o ${objdbgdir}/x2.o ${objdbgdir}/x3.o" "${binfile}" executable "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
41
    perror "Couldn't compile ${binfile}"
42
    return -1
43
}
44
 
45
#
46
# Test some normal commons
47
#
48
 
49
# Print the types
50
 
51
gdb_exit
52
gdb_start
53
gdb_reinitialize_dir ${srcsubdir}
54
gdb_load ${binfile}
55
 
56
gdb_test "ptype common1" "type = int"
57
gdb_test "ptype common2" "type = int"
58
gdb_test "ptype common3" "type = int"
59
gdb_test "ptype data1" "type = int"
60
gdb_test "ptype data2" "type = int"
61
gdb_test "ptype data3" "type = int"
62
gdb_test "ptype common11" "type = int"
63
gdb_test "ptype common10" "type = int"
64
gdb_test "ptype data10" "type = int"
65
gdb_test "ptype data11" "type = int"
66
 
67
# Print the values
68
 
69
gdb_exit
70
gdb_start
71
gdb_reinitialize_dir ${srcsubdir}
72
gdb_load ${binfile}
73
 
74
gdb_test "b main" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file ..*/x1.cc, line 11."
75
gdb_test "run" "Starting program:.*Breakpoint \[0-9\]+, main .*/x1.cc:11.*"
76
gdb_test "p data1" "..* = 1"
77
gdb_test "p data2" "..* = 2"
78
gdb_test "p data3" "..* = 3"
79
gdb_test "p data10" "..* = 10"
80
gdb_test "p data11" "..* = 11"
81
gdb_test "n" ".*12.*"
82
gdb_test "p common11" "..* = 11"
83
 
84
gdb_test "s 1" "foo .*/x3.cc:15.*"
85
gdb_test "s 4" ".*20.*"
86
gdb_test "p data4" "..* = 4"
87
gdb_test "p common4" "..* = 4"
88
gdb_test "n" ".*21.*"
89
 
90
gdb_test "n" "main .*/x1.cc:14.*"
91
gdb_test "p common1" "..* = 1"
92
gdb_test "p common2" "..* = 2"
93
gdb_test "p common3" "..* = 3"
94
 
95
# Verify that addresses match those in the executable
96
 
97
gdb_exit
98
gdb_start
99
gdb_reinitialize_dir ${srcsubdir}
100
gdb_load ${binfile}
101
 
102
set exec_output_data1 [lindex [remote_exec build "${symaddrfile} ${binfile} data1"] 1]
103
regsub -all "\[\r\n\]" ${exec_output_data1} "" exec_output_data1
104
 
105
set exec_output_data2 [lindex [remote_exec build "${symaddrfile} ${binfile} data2"] 1]
106
regsub -all "\[\r\n\]" ${exec_output_data2} "" exec_output_data2
107
 
108
set exec_output_data3 [lindex [remote_exec build "${symaddrfile} ${binfile} data3"] 1]
109
regsub -all "\[\r\n\]" ${exec_output_data3} "" exec_output_data3
110
 
111
set exec_output_data10 [lindex [remote_exec build "${symaddrfile} ${binfile} data10"] 1]
112
regsub -all "\[\r\n\]" ${exec_output_data10} "" exec_output_data10
113
 
114
set exec_output_data11 [lindex [remote_exec build "${symaddrfile} ${binfile} data11"] 1]
115
regsub -all "\[\r\n\]" ${exec_output_data11} "" exec_output_data11
116
 
117
set exec_output_common1 [lindex [remote_exec build "${symaddrfile} ${binfile} common1"] 1]
118
regsub -all "\[\r\n\]" ${exec_output_common1} "" exec_output_common1
119
 
120
set exec_output_common2 [lindex [remote_exec build "${symaddrfile} ${binfile} common2"] 1]
121
regsub -all "\[\r\n\]" ${exec_output_common2} "" exec_output_common2
122
 
123
set exec_output_common3 [lindex [remote_exec build "${symaddrfile} ${binfile} common3"] 1]
124
regsub -all "\[\r\n\]" ${exec_output_common3} "" exec_output_common3
125
 
126
set exec_output_common10 [lindex [remote_exec build "${symaddrfile} ${binfile} common10"] 1]
127
regsub -all "\[\r\n\]" ${exec_output_common10} "" exec_output_common10
128
 
129
set exec_output_common11 [lindex [remote_exec build "${symaddrfile} ${binfile} common11"] 1]
130
regsub -all "\[\r\n\]" ${exec_output_common11} "" exec_output_common11
131
 
132
if [istarget "hppa2.0w-*-*"] {
133
    gdb_test "p &data1" "..* = \\(int \[*\]\\) ${exec_output_data1}"
134
    gdb_test "p &data2" "..* = \\(int \[*\]\\) ${exec_output_data2}"
135
    gdb_test "p &data3" "..* = \\(int \[*\]\\) ${exec_output_data3}"
136
    gdb_test "p &data10" "..* = \\(int \[*\]\\) ${exec_output_data10}"
137
    gdb_test "p &data11" "..* = \\(int \[*\]\\) ${exec_output_data11}"
138
    gdb_test "p &common1" "..* = \\(int \[*\]\\) ${exec_output_common1}"
139
    gdb_test "p &common2" "..* = \\(int \[*\]\\) ${exec_output_common2}"
140
    gdb_test "p &common3" "..* = \\(int \[*\]\\) ${exec_output_common3}"
141
    gdb_test "p &common10" "..* = \\(int \[*\]\\) ${exec_output_common10}"
142
    gdb_test "p &common11" "..* = \\(int \[*\]\\) ${exec_output_common11}"
143
} else {
144
    gdb_test "p &data1" "..* = \\(int \[*\]\\) 0x${exec_output_data1}"
145
    gdb_test "p &data2" "..* = \\(int \[*\]\\) 0x${exec_output_data2}"
146
    gdb_test "p &data3" "..* = \\(int \[*\]\\) 0x${exec_output_data3}"
147
    gdb_test "p &data10" "..* = \\(int \[*\]\\) 0x${exec_output_data10}"
148
    gdb_test "p &data11" "..* = \\(int \[*\]\\) 0x${exec_output_data11}"
149
    gdb_test "p &common1" "..* = \\(int \[*\]\\) 0x${exec_output_common1}"
150
    gdb_test "p &common2" "..* = \\(int \[*\]\\) 0x${exec_output_common2}"
151
    gdb_test "p &common3" "..* = \\(int \[*\]\\) 0x${exec_output_common3}"
152
    gdb_test "p &common10" "..* = \\(int \[*\]\\) 0x${exec_output_common10}"
153
    gdb_test "p &common11" "..* = \\(int \[*\]\\) 0x${exec_output_common11}"
154
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.