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-6.8/] [pre-binutils-2.20.1-sync/] [gdb/] [testsuite/] [gdb.threads/] [killed.exp] - Diff between revs 157 and 223

Only display areas with differences | Details | Blame | View Log

Rev 157 Rev 223
# Copyright 2002, 2003, 2005, 2007, 2008 Free Software Foundation, Inc.
# Copyright 2002, 2003, 2005, 2007, 2008 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see .
# along with this program.  If not, see .
# Please email any bugs, comments, and/or additions to this file to:
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@gnu.org
# bug-gdb@gnu.org
# This is a regression test for gdb/568 in the sources.redhat.com
# This is a regression test for gdb/568 in the sources.redhat.com
# GNATS database.  As of early June 2002, GDB could get sort of wedged
# GNATS database.  As of early June 2002, GDB could get sort of wedged
# debugging the program `killed.c':
# debugging the program `killed.c':
#
#
# $ $D6/gdb/gdb -nw killed
# $ $D6/gdb/gdb -nw killed
# GNU gdb 2002-06-11-cvs
# GNU gdb 2002-06-11-cvs
# Copyright 2002 Free Software Foundation, Inc.
# Copyright 2002 Free Software Foundation, Inc.
# GDB is free software, covered by the GNU General Public License, and you are
# GDB is free software, covered by the GNU General Public License, and you are
# welcome to change it and/or distribute copies of it under certain conditions.
# welcome to change it and/or distribute copies of it under certain conditions.
# Type "show copying" to see the conditions.
# Type "show copying" to see the conditions.
# There is absolutely no warranty for GDB.  Type "show warranty" for details.
# There is absolutely no warranty for GDB.  Type "show warranty" for details.
# This GDB was configured as "i686-pc-linux-gnu"...
# This GDB was configured as "i686-pc-linux-gnu"...
# (gdb) run
# (gdb) run
# Starting program: /home/jimb/foo/play/killed
# Starting program: /home/jimb/foo/play/killed
# [New Thread 1024 (LWP 6487)]
# [New Thread 1024 (LWP 6487)]
# [New Thread 2049 (LWP 6488)]
# [New Thread 2049 (LWP 6488)]
# [New Thread 1026 (LWP 6489)]
# [New Thread 1026 (LWP 6489)]
# Cannot find user-level thread for LWP 6487: generic error
# Cannot find user-level thread for LWP 6487: generic error
# (gdb) quit
# (gdb) quit
# The program is running.  Exit anyway? (y or n) y
# The program is running.  Exit anyway? (y or n) y
# Cannot find thread 2049: generic error
# Cannot find thread 2049: generic error
# (gdb) kill
# (gdb) kill
# Kill the program being debugged? (y or n) y
# Kill the program being debugged? (y or n) y
# Cannot find thread 2049: generic error
# Cannot find thread 2049: generic error
# (gdb) The program is running.  Exit anyway? (y or n) y
# (gdb) The program is running.  Exit anyway? (y or n) y
# Cannot find thread 2049: generic error
# Cannot find thread 2049: generic error
# (gdb)
# (gdb)
# [7]+  Stopped                 $D6/gdb/gdb -nw killed
# [7]+  Stopped                 $D6/gdb/gdb -nw killed
# $ kill %7
# $ kill %7
#
#
# [7]+  Stopped                 $D6/gdb/gdb -nw killed
# [7]+  Stopped                 $D6/gdb/gdb -nw killed
# $ kill -9 %7
# $ kill -9 %7
#
#
# [7]+  Stopped                 $D6/gdb/gdb -nw killed
# [7]+  Stopped                 $D6/gdb/gdb -nw killed
# $
# $
# [7]+  Killed                  $D6/gdb/gdb -nw killed
# [7]+  Killed                  $D6/gdb/gdb -nw killed
# $
# $
if $tracelevel then {
if $tracelevel then {
        strace $tracelevel
        strace $tracelevel
}
}
set prms_id 0
set prms_id 0
set bug_id 0
set bug_id 0
set testfile "killed"
set testfile "killed"
set srcfile ${testfile}.c
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
set binfile ${objdir}/${subdir}/${testfile}
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
    return -1
    return -1
}
}
gdb_start
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
gdb_load ${binfile}
gdb_run_cmd
gdb_run_cmd
gdb_expect {
gdb_expect {
  -re "$gdb_prompt $" {
  -re "$gdb_prompt $" {
    pass "run program to completion"
    pass "run program to completion"
  }
  }
  timeout {
  timeout {
    fail "run program to completion (timeout)"
    fail "run program to completion (timeout)"
  }
  }
}
}
# Try to quit.
# Try to quit.
send_gdb "quit\n"
send_gdb "quit\n"
gdb_expect {
gdb_expect {
    -re "The program is running.  Exit anyway\\? \\(y or n\\) $" {
    -re "The program is running.  Exit anyway\\? \\(y or n\\) $" {
        send_gdb "y\n"
        send_gdb "y\n"
        exp_continue
        exp_continue
    }
    }
    eof {
    eof {
        pass "GDB exits after multi-threaded program exits messily"
        pass "GDB exits after multi-threaded program exits messily"
    }
    }
    -re "Cannot find thread ${decimal}: generic error\[\r\n\]*$gdb_prompt $" {
    -re "Cannot find thread ${decimal}: generic error\[\r\n\]*$gdb_prompt $" {
        kfail "gdb/568" "GDB exits after multi-threaded program exits messily"
        kfail "gdb/568" "GDB exits after multi-threaded program exits messily"
    }
    }
    timeout {
    timeout {
        fail "GDB exits after multi-threaded program exits messily (timeout)"
        fail "GDB exits after multi-threaded program exits messily (timeout)"
    }
    }
}
}
 
 

powered by: WebSVN 2.1.0

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