OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gdb-7.2/] [gdb-7.2-or32-1.0rc1/] [gdb/] [testsuite/] [gdb.threads/] [killed.exp] - Blame information for rev 341

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 330 jeremybenn
# Copyright 2002, 2003, 2005, 2007, 2008, 2009, 2010
2
# Free Software Foundation, Inc.
3
 
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 3 of the License, or
7
# (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License
15
# along with this program.  If not, see .
16
 
17
# Please email any bugs, comments, and/or additions to this file to:
18
# bug-gdb@gnu.org
19
 
20
# This is a regression test for gdb/568 in the sources.redhat.com
21
# GNATS database.  As of early June 2002, GDB could get sort of wedged
22
# debugging the program `killed.c':
23
#
24
# $ $D6/gdb/gdb -nw killed
25
# GNU gdb 2002-06-11-cvs
26
# Copyright 2002 Free Software Foundation, Inc.
27
# GDB is free software, covered by the GNU General Public License, and you are
28
# welcome to change it and/or distribute copies of it under certain conditions.
29
# Type "show copying" to see the conditions.
30
# There is absolutely no warranty for GDB.  Type "show warranty" for details.
31
# This GDB was configured as "i686-pc-linux-gnu"...
32
# (gdb) run
33
# Starting program: /home/jimb/foo/play/killed
34
# [New Thread 1024 (LWP 6487)]
35
# [New Thread 2049 (LWP 6488)]
36
# [New Thread 1026 (LWP 6489)]
37
# Cannot find user-level thread for LWP 6487: generic error
38
# (gdb) quit
39
# The program is running.  Exit anyway? (y or n) y
40
# Cannot find thread 2049: generic error
41
# (gdb) kill
42
# Kill the program being debugged? (y or n) y
43
# Cannot find thread 2049: generic error
44
# (gdb) The program is running.  Exit anyway? (y or n) y
45
# Cannot find thread 2049: generic error
46
# (gdb)
47
# [7]+  Stopped                 $D6/gdb/gdb -nw killed
48
# $ kill %7
49
#
50
# [7]+  Stopped                 $D6/gdb/gdb -nw killed
51
# $ kill -9 %7
52
#
53
# [7]+  Stopped                 $D6/gdb/gdb -nw killed
54
# $
55
# [7]+  Killed                  $D6/gdb/gdb -nw killed
56
# $
57
 
58
if $tracelevel then {
59
        strace $tracelevel
60
}
61
 
62
 
63
set testfile "killed"
64
set srcfile ${testfile}.c
65
set binfile ${objdir}/${subdir}/${testfile}
66
 
67
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
68
    return -1
69
}
70
 
71
 
72
gdb_start
73
gdb_reinitialize_dir $srcdir/$subdir
74
gdb_load ${binfile}
75
 
76
gdb_run_cmd
77
gdb_expect {
78
  -re "$gdb_prompt $" {
79
    pass "run program to completion"
80
  }
81
  timeout {
82
    fail "run program to completion (timeout)"
83
  }
84
}
85
 
86
# Try to quit.
87
send_gdb "quit\n"
88
gdb_expect {
89
    -re "Quit anyway\\? \\(y or n\\) $" {
90
        send_gdb "y\n"
91
        exp_continue
92
    }
93
    eof {
94
        pass "GDB exits after multi-threaded program exits messily"
95
    }
96
    -re "Cannot find thread ${decimal}: generic error\[\r\n\]*$gdb_prompt $" {
97
        kfail "gdb/568" "GDB exits after multi-threaded program exits messily"
98
    }
99
    timeout {
100
        fail "GDB exits after multi-threaded program exits messily (timeout)"
101
    }
102
}

powered by: WebSVN 2.1.0

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