*** empty log message ***

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@980 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2001-01-02 22:10:07 +00:00
commit 004b7cd877
11 changed files with 243 additions and 47 deletions

View file

@ -17,3 +17,21 @@ INCLUDE = -I../Include
test:
$(CC) -g -DNEED_MAIN debug.c $(INCLUDE) -L.. $(RPATH).. -lwad -o debug
python:
swig -python debug.i
$(CC) $(CCSHARED) -c -g debug.c debug_wrap.c $(PYINCLUDE)
$(LDSHARED) debug.o debug_wrap.o -L.. $(RPATH).. -lwadpy -o debugmodule.so
tcl:
swig -tcl debug.i
$(CC) $(CCSHARED) -c -g debug.c debug_wrap.c $(TCLINCLUDE)
$(LDSHARED) debug.o debug_wrap.o -L.. $(RPATH).. -lwadtcl -o debug.so
perl:
swig -perl5 debug.i
$(CC) $(CCSHARED) -c -Dbool=char -g debug.c debug_wrap.c $(PERLINCLUDE)
$(LDSHARED) debug.o debug_wrap.o -L.. $(RPATH).. -lwadpl -o debug.so
clean:
rm -f *.so *.o

View file

@ -0,0 +1,11 @@
%module debug
extern int seg_crash();
extern int bus_crash();
extern int blowheap_crash();
extern int overflow_crash();
extern int abort_crash(int);
extern int math_crash(int x, int y);

View file

@ -0,0 +1,32 @@
# WAD debugging module for python
import debug
import sys
try:
name = sys.argv[1]
except:
print """
usage: debug.py test
seg - Segmentation fault due to uninitialized pointer.
bus - Bus error.
abort - Failed assertion.
math - Math error.
heap - Blown heap.
overflow - Buffer overflow.
"""
sys.exit(1)
if name == "seg":
debug.seg_crash()
elif name == "bus":
debug.bus_crash()
elif name == "abort":
debug.abort_crash(-2)
elif name == "math":
debug.math_crash(3,0)
elif name == "heap":
debug.blowheap_crash()
elif name == "overflow":
debug.overflow_crash()

View file

@ -0,0 +1,21 @@
# WAD debugging module for Tcl. This should be executed with wish
load ./debug.so
button .b1 -text "Segmentation fault" -command "seg_crash"
button .b2 -text "Bus error" -command "bus_crash"
button .b3 -text "Abort" -command "abort_crash -1"
button .b4 -text "Math" -command "math_crash 3 0"
button .b5 -text "Blow Heap" -command "blowheap_crash"
button .b6 -text "Buffer overflow" -command "overflow_crash"
button .q -text "Quit" -command "exit"
pack .b1 -fill x
pack .b2 -fill x
pack .b3 -fill x
pack .b4 -fill x
pack .b5 -fill x
pack .b6 -fill x
pack .q -fill x