*** empty log message ***

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

View file

@ -10,7 +10,7 @@
WADSRCS = return.c default.c stack.c stab.c elf.c object.c init.c segment.c signal.c
WADOBJS = return.o default.o stack.o stab.o elf.o object.o signal.o segment.o init.o
INCLUDE = -I../Include -I. $(SINCLUDE)
WADOPT = -DWAD_LINUX
WADOPT = -DWAD_SOLARIS
# Location of your Python installation
PYINCLUDE = -I/usr/local/include/python2.0
@ -23,21 +23,21 @@ TCLSRCS = wadtcl.cxx
TCLOBJS = wadtcl.o
# Location of your Perl installation
PERLINCLUDE = -I/usr/lib/perl5/5.00503/i386-linux/CORE
PERLINCLUDE = -I/usr/perl5/5.00503/sun4-solaris/CORE
PERLSRCS = wadpl.cxx
PERLOBJS = wadpl.o
# C Compiler
CC = gcc
CFLAGS = #-fpic
CC = cc
CFLAGS = #
# C++ Compiler
CXX = c++
CXXFLAGS = #-fpic
CXX = CC
CXXFLAGS = #-Kpic
# Linking options
CLINK =
CXXLINK = g++ -shared
CXXLINK = CC -G
# Rules for creation of a .o file from .cxx
.SUFFIXES: .cxx

View file

@ -14,20 +14,21 @@
static char linux_firstsegment[1024];
static int linux_first = 1;
static FILE *
static int
segment_open() {
FILE *f;
f = fopen("/proc/self/maps", "r");
linux_first =1;
return f;
return (int) f;
}
static int
segment_read(FILE *fs, WadSegment *s)
segment_read(int fd, WadSegment *s)
{
char pbuffer[1024];
char *c;
int len;
FILE *fs = (FILE *) fd;
c = fgets(pbuffer,1024,fs);
if (!c) return 0;

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;
}