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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gdb-7.2/] [gdb/] [testsuite/] [gdb.multi/] [bkpt-multi-exec.exp] - Blame information for rev 330

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

Line No. Rev Author Line
1 330 jeremybenn
# Copyright 2009, 2010 Free Software Foundation, Inc.
2
 
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 3 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program.  If not, see .
15
 
16
if { [is_remote target] || ![isnative] } then {
17
    continue
18
}
19
 
20
set testfile "bkpt-multi-exec"
21
 
22
set exec1 "bkpt-multi-exec"
23
set srcfile1 ${exec1}.c
24
set binfile1 ${objdir}/${subdir}/${exec1}
25
 
26
set exec2 "crashme"
27
set srcfile2 ${exec2}.c
28
set binfile2 ${objdir}/${subdir}/${exec2}
29
 
30
if { [prepare_for_testing ${testfile}.exp ${exec1} "${srcfile1}" {debug nowarnings}] } {
31
    return -1
32
}
33
 
34
if { [prepare_for_testing ${testfile}.exp ${exec2} "${srcfile2}" {debug nowarnings}] } {
35
    return -1
36
}
37
# Until "catch exec" is implemented on other targets...
38
#
39
if {![istarget "hppa*-hp-hpux*"] && ![istarget "*-linux*"]} then {
40
    continue
41
}
42
 
43
# Start with a fresh gdb
44
 
45
clean_restart ${exec1}
46
 
47
# Start the program running, and stop at main.
48
#
49
if ![runto_main] then {
50
    perror "Couldn't run ${binfile1}"
51
    return
52
}
53
 
54
delete_breakpoints
55
 
56
# continuing should exec and trigger the bug
57
gdb_test "continue" "SIGSEGV.*"
58
 
59
# Start over, but this time, set a breakpoint before the app crashes.
60
 
61
clean_restart ${exec1}
62
 
63
gdb_test "add-inferior -exec ${binfile2}" \
64
    "Added inferior 2.*" \
65
    "add inferior 2 with -exec ${exec2}"
66
 
67
set bp_location [gdb_get_line_number "set breakpoint here" ${srcfile2}]
68
 
69
gdb_test "inferior 2"
70
gdb_test "break ${srcfile2}:${bp_location}" ".*"
71
 
72
# Start the program running, and stop at main.
73
#
74
gdb_test "inferior 1"
75
 
76
# Now run to the breakpoint.  This should cross the exec, and stop at
77
# the breakpoint before the crash.
78
gdb_test "run" "${srcfile2}:${bp_location}.*set breakpoint here.*"
79
 
80
return 0

powered by: WebSVN 2.1.0

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