swig/SWIG/Tools/WAD/Test/death.tcl
Dave Beazley 68b11c4d81 *** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@1218 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2001-06-24 20:01:03 +00:00

65 lines
1.1 KiB
Tcl

load ./debug.so
proc death_by_segmentation { } {
seg_crash
}
proc death_by_bus { } {
bus_crash
}
proc death_by_abort { } {
abort_crash -1
}
proc death_by_math { } {
math_crash 37 0
}
proc death_by_buffer { } {
overflow_crash
}
set method 1
proc death {} {
global method
if { $method == 1 } {
death_by_segmentation
}
if { $method == 2 } {
death_by_abort
}
if { $method == 3 } {
death_by_math
}
if { $method == 4 } {
death_by_bus
}
if { $method == 5 } {
death_by_buffer
}
}
label .l -text "How would you like to die today?"
pack .l
radiobutton .r1 -text "Segmentation fault" -variable method -value 1
pack .r1 -anchor w
radiobutton .r2 -text "Failed assertion" -variable method -value 2
pack .r2 -anchor w
radiobutton .r3 -text "Math error" -variable method -value 3
pack .r3 -anchor w
radiobutton .r4 -text "Bus error" -variable method -value 4
pack .r4 -anchor w
radiobutton .r5 -text "Stack overflow" -variable method -value 5
pack .r5 -anchor w
button .b -text "Die" -command death
pack .b -fill both -expand 1
wm title . "Death Wizard"