*** empty log message ***
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@1218 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
d194c494f3
commit
0db13bddea
6 changed files with 111 additions and 17 deletions
|
|
@ -1,3 +1,9 @@
|
|||
WAD 0.2 - June 24, 2001
|
||||
|
||||
- Minor changes. Added the wadtrace file
|
||||
|
||||
- Put everything under the LGPL.
|
||||
|
||||
WAD 0.1 - March 23, 2001
|
||||
|
||||
- Extensive changes to WAD core. WAD now builds an exception
|
||||
|
|
|
|||
|
|
@ -202,6 +202,8 @@ extern void wad_stack_debug(WadFrame *f);
|
|||
|
||||
extern char *wad_strip_dir(char *);
|
||||
extern void wad_default_callback(int signo, WadFrame *frame, char *ret);
|
||||
extern void wad_dump_trace(int fd, int signo, WadFrame *frame, char *ret);
|
||||
|
||||
extern void wad_set_callback(void (*h)(int, WadFrame *, char *));
|
||||
extern char *wad_load_source(char *, int line);
|
||||
extern void wad_release_source();
|
||||
|
|
|
|||
|
|
@ -329,7 +329,8 @@ The scripts debug.py, debug.tcl, debug.pl can be used to test these extensions.
|
|||
|
||||
No official documentation exists at this time. However, the Papers
|
||||
directory contains two conference papers that describe WAD's design
|
||||
and high-level operation. Slides from the Python9 talk are also included.
|
||||
and high-level operation. Slides from the Python9 talk are also
|
||||
included.
|
||||
|
||||
9. To-Do
|
||||
|
||||
|
|
@ -369,4 +370,4 @@ ways to contribute. Here is the short to-do list:
|
|||
Please contact me if you are interested in working on any of these projects.
|
||||
|
||||
Dave Beazley (beazley@cs.uchicago.edu)
|
||||
March 23, 2001
|
||||
June 24, 2001
|
||||
|
|
|
|||
65
Tools/WAD/Test/death.tcl
Normal file
65
Tools/WAD/Test/death.tcl
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
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"
|
||||
|
||||
|
|
@ -255,31 +255,30 @@ wad_debug_make_strings(WadFrame *f) {
|
|||
}
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Default callback
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void wad_default_callback(int signo, WadFrame *f, char *ret) {
|
||||
/* Dump trace to a file */
|
||||
void wad_dump_trace(int fd, int signo, WadFrame *f, char *ret) {
|
||||
static char buffer[128];
|
||||
char *srcstr = 0;
|
||||
|
||||
switch(signo) {
|
||||
case SIGSEGV:
|
||||
fprintf(stderr,"WAD: Segmentation fault.\n");
|
||||
write(fd,"WAD: Segmentation fault.\n", 25);
|
||||
break;
|
||||
case SIGBUS:
|
||||
fprintf(stderr,"WAD: Bus error.\n");
|
||||
write(fd,"WAD: Bus error.\n",17);
|
||||
break;
|
||||
case SIGABRT:
|
||||
fprintf(stderr,"WAD: Abort.\n");
|
||||
write(fd,"WAD: Abort.\n",12);
|
||||
break;
|
||||
case SIGFPE:
|
||||
fprintf(stderr,"WAD: Floating point exception.\n");
|
||||
write(fd,"WAD: Floating point exception.\n", 31);
|
||||
break;
|
||||
case SIGILL:
|
||||
fprintf(stderr,"WAD: Illegal instruction.\n");
|
||||
write(fd,"WAD: Illegal instruction.\n", 26);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"WAD: Signal %d\n", signo);
|
||||
sprintf(buffer,"WAD: Signal %d\n", signo);
|
||||
write(fd,buffer,strlen(buffer));
|
||||
break;
|
||||
}
|
||||
/* Find the last exception frame */
|
||||
|
|
@ -289,16 +288,24 @@ void wad_default_callback(int signo, WadFrame *f, char *ret) {
|
|||
}
|
||||
|
||||
while (f) {
|
||||
fputs(f->debug_str, stderr);
|
||||
write(fd,f->debug_str,strlen(f->debug_str));
|
||||
if (f->debug_srcstr) {
|
||||
srcstr = f->debug_srcstr;
|
||||
}
|
||||
f = f->prev;
|
||||
}
|
||||
if (srcstr) {
|
||||
fputs("\n", stderr);
|
||||
fputs(srcstr,stderr);
|
||||
fputs("\n", stderr);
|
||||
write(fd,"\n",1);
|
||||
write(fd,srcstr,strlen(srcstr));
|
||||
write(fd,"\n",1);
|
||||
}
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Default callback
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
void wad_default_callback(int signo, WadFrame *f, char *ret) {
|
||||
wad_dump_trace(2,signo,f,ret);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -401,6 +401,19 @@ void wad_signalhandler(int sig, siginfo_t *si, void *vcontext) {
|
|||
wad_string_debug();
|
||||
wad_memory_debug();
|
||||
|
||||
/* Before we do anything with callbacks, we are going
|
||||
to attempt to dump a wad-core */
|
||||
|
||||
{
|
||||
int fd;
|
||||
static int already = 0;
|
||||
fd = open("wadtrace",O_WRONLY | O_CREAT | (already*O_APPEND) | ((already==0)*O_TRUNC),0666);
|
||||
if (fd > 0) {
|
||||
wad_dump_trace(fd,sig,origframe,retname);
|
||||
close(fd);
|
||||
already=1;
|
||||
}
|
||||
}
|
||||
|
||||
if (sig_callback) {
|
||||
(*sig_callback)(sig,origframe,retname);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue