blob: 5086f4c31929461bd373ffa256362256dcf4a314 [file] [log] [blame]
# Copyright 2002, 2004
# Free Software Foundation, Inc.
# 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
# Do a simple sigtramp backtrace, once with EH frame info, once without.
# This file was written by Jason Molenda (jmolenda@apple.com)
if $tracelevel then {
strace $tracelevel
}
set timeout 30
set prms_id 0
set bug_id 0
set testfile "sigtramp"
set binfile ${objdir}/${subdir}/${testfile}
set srcfile ${srcdir}/${subdir}/${testfile}.c
if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
# Start with a fresh gdb
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_test "set use-eh-frame-info 1" "" "Use eh-frame info"
gdb_file_cmd "${binfile}"
gdb_test "b myhandler" "Breakpoint 1 at $hex: file .*sigtramp.c.*" "Set breakpoint on myhandler"
gdb_test "run" \
"Starting program: $binfile.*Breakpoint 1, myhandler.*sigtramp.c.*\[ \r\]*" "continue to myhandler bp"
gdb_test "bt" "myhandler.*sigtramp.*main.*" "backtrace through to main"
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_test "set use-eh-frame-info 0" "" "Do not eh-frame info"
gdb_file_cmd "${binfile}"
gdb_test "b myhandler" "Breakpoint 1 at $hex: file .*sigtramp.c.*" "Set breakpoint on myhandler"
gdb_test "run" \
"Starting program: $binfile.*Breakpoint 1, myhandler.*sigtramp.c.*\[ \r\]*" "continue to myhandler bp"
gdb_test "bt" "myhandler.*sigtramp.*main.*" "backtrace through to main"
gdb_exit
return 0