*** empty log message ***

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@985 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2001-01-03 14:18:47 +00:00
commit abefb95101
5 changed files with 19 additions and 17 deletions

View file

@ -56,6 +56,8 @@ static int trace_len = 0;
and frame pointer. Returns a pointer to a wad exception frame structure
which is actually a large memory mapped file. */
static char framefile[256];
WadFrame *
wad_stack_trace(unsigned long pc, unsigned long sp, unsigned long fp) {
WadSegment *ws, *segments;
@ -64,7 +66,7 @@ wad_stack_trace(unsigned long pc, unsigned long sp, unsigned long fp) {
WadDebug wd;
WadSymbol wsym;
int nlevels;
char framefile[256];
int ffile;
unsigned long p_pc;
unsigned long p_sp;
@ -80,7 +82,7 @@ wad_stack_trace(unsigned long pc, unsigned long sp, unsigned long fp) {
segments = wad_segment_read();
/* Open the frame file for output */
sprintf(framefile,"/tmp/wad.%d", getpid());
tmpnam(framefile);
ffile = open(framefile, O_CREAT | O_TRUNC | O_WRONLY, 0644);
if (ffile < 0) {
printf("can't open %s\n", framefile);
@ -277,8 +279,7 @@ wad_stack_trace(unsigned long pc, unsigned long sp, unsigned long fp) {
void wad_release_trace() {
char name[256];
munmap(trace_addr, trace_len);
sprintf(name,"/tmp/wad.%d", getpid());
unlink(name);
unlink(framefile);
trace_addr = 0;
trace_len = 0;
}