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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [gdb/] [testsuite/] [gdb.hp/] [gdb.objdbg/] [objdbg02.exp] - Blame information for rev 307

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

Line No. Rev Author Line
1 24 jeremybenn
# 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
# Create and source the file that provides information about the compiler
17
# used to compile the test case.
18
if [get_compiler_info ${binfile}] {
19
    return -1
20
}
21
 
22
if {!$hp_aCC_compiler && !$hp_cc_compiler} {
23
  return 0
24
}
25
 
26
if { [gdb_compile "${toolssubdir}/test-objdbg.cc" "${objdbgdir}/test-objdbg.o" object "debug c++ {additional_flags=-I${toolssubdir} +objdebug}"] != "" } {
27
    untested objdbg02.exp
28
    return -1
29
}
30
 
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"
33
    return -1
34
}
35
 
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"
38
    return -1
39
}
40
 
41
if { [gdb_compile "${srcsubdir}/x3.cc" "${objdbgdir}/x3.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
42
    perror "Couldn't compile x3.cc"
43
    return -1
44
}
45
 
46
remote_exec build "rm -f ${objdbgdir}/test.a"
47
set status [remote_exec build "ar cr ${objdbgdir}/test.a ${objdbgdir}/x2.o ${objdbgdir}/x3.o"]
48
if { [lindex $status 0] != 0 } {
49
    perror "Couldn't compile test.a"
50
    return -1
51
}
52
remote_exec build "rm -f ${objdbgdir}/x2.o ${objdbgdir}/x3.o"
53
 
54
if { [gdb_compile "${objdbgdir}/x1.o ${objdbgdir}/test.a" "$binfile" executable "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
55
    perror "Couldn't compile ${binfile}"
56
    return -1
57
}
58
 
59
# Test loading debug information from an archive file
60
 
61
gdb_exit
62
gdb_start
63
gdb_reinitialize_dir ${srcsubdir}
64
gdb_load ${binfile}
65
 
66
gdb_test "b main" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file ..*/x1.cc, line 12."
67
gdb_test "run" "Starting program:.*Breakpoint \[0-9\]+, main .*/x1.cc:12.*"
68
gdb_test "s 1" ".*13.*"
69
gdb_test "s 1" "foo1 .*/x2.cc:15.*"
70
gdb_test "s 1" ".*16.*"
71
gdb_test "s 1" "foo2 .*/x2.cc:10.*"
72
gdb_test "s 1" ".*11.*"
73
gdb_test "s 1" "foo1 .*/x2.cc:17.*"
74
gdb_test "s 1" "main .*/x1.cc:14.*"
75
gdb_test "s 1" "foo3 .*/x3.cc:5.*"
76
gdb_test "s 1" ".*6.*"
77
gdb_test "s 1" "main .*/x1.cc:15.*"
78
gdb_test "s 1" ".*16.*"
79
if [istarget "hppa64-*-*"] {
80
    gdb_test "s 1" "0x\[0-9a-f\]+ in .*START.*"
81
    gdb_test "c" ".*Program exited normally.*"
82
} else {
83
    gdb_test "s 1" "0x\[0-9a-f\]+ in _start .*"
84
    gdb_test "s 1" ".*Program exited normally.*"
85
}
86
 

powered by: WebSVN 2.1.0

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