*** 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

@ -13,7 +13,7 @@ PYINCLUDE = -I/usr/local/include/python2.0
TCLINCLUDE = -I/usr/local/include TCLINCLUDE = -I/usr/local/include
# Location of your Perl installation # Location of your Perl installation
PERLINCLUDE = -I/usr/lib/perl5/5.00503/i386-linux/CORE PERLINCLUDE = -I/usr/perl5/5.00503/sun4-solaris/CORE
all: wad python tcl perl all: wad python tcl perl

View file

@ -82,7 +82,7 @@ platform directory and type 'make install'.
Notes: Notes:
- The Sun version of WAD has only been tested when compiled with the - The Sun version of WAD has only been tested when compiled with the
Sun Workshop C/C++ compilers. Although WAD works with other programs Sun Workshop C/C++ compilers. However WAD works with other programs
that have been compiled with gcc. If gcc is installed on your that have been compiled with gcc. If gcc is installed on your
machine, you may want to set the following environment variables machine, you may want to set the following environment variables
before running configure: before running configure:
@ -127,7 +127,7 @@ For scripting languages, WAD works in a similar manner--simply link
your scripting language extension module with the appropriate WAD library your scripting language extension module with the appropriate WAD library
(wadpy, wadtcl, wadpl). For example: (wadpy, wadtcl, wadpl). For example:
% cc pymodule.o -lwadpy % ld -G $(OBJS) -lwadpy -o pymodule.so
When the scripting module is loaded into the interpreter, WAD should When the scripting module is loaded into the interpreter, WAD should
automatically initialize. automatically initialize.

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

View file

@ -14,20 +14,21 @@
static char linux_firstsegment[1024]; static char linux_firstsegment[1024];
static int linux_first = 1; static int linux_first = 1;
static FILE * static int
segment_open() { segment_open() {
FILE *f; FILE *f;
f = fopen("/proc/self/maps", "r"); f = fopen("/proc/self/maps", "r");
linux_first =1; linux_first =1;
return f; return (int) f;
} }
static int static int
segment_read(FILE *fs, WadSegment *s) segment_read(int fd, WadSegment *s)
{ {
char pbuffer[1024]; char pbuffer[1024];
char *c; char *c;
int len; int len;
FILE *fs = (FILE *) fd;
c = fgets(pbuffer,1024,fs); c = fgets(pbuffer,1024,fs);
if (!c) return 0; 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 and frame pointer. Returns a pointer to a wad exception frame structure
which is actually a large memory mapped file. */ which is actually a large memory mapped file. */
static char framefile[256];
WadFrame * WadFrame *
wad_stack_trace(unsigned long pc, unsigned long sp, unsigned long fp) { wad_stack_trace(unsigned long pc, unsigned long sp, unsigned long fp) {
WadSegment *ws, *segments; WadSegment *ws, *segments;
@ -64,7 +66,7 @@ wad_stack_trace(unsigned long pc, unsigned long sp, unsigned long fp) {
WadDebug wd; WadDebug wd;
WadSymbol wsym; WadSymbol wsym;
int nlevels; int nlevels;
char framefile[256];
int ffile; int ffile;
unsigned long p_pc; unsigned long p_pc;
unsigned long p_sp; unsigned long p_sp;
@ -80,7 +82,7 @@ wad_stack_trace(unsigned long pc, unsigned long sp, unsigned long fp) {
segments = wad_segment_read(); segments = wad_segment_read();
/* Open the frame file for output */ /* Open the frame file for output */
sprintf(framefile,"/tmp/wad.%d", getpid()); tmpnam(framefile);
ffile = open(framefile, O_CREAT | O_TRUNC | O_WRONLY, 0644); ffile = open(framefile, O_CREAT | O_TRUNC | O_WRONLY, 0644);
if (ffile < 0) { if (ffile < 0) {
printf("can't open %s\n", framefile); 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() { void wad_release_trace() {
char name[256]; char name[256];
munmap(trace_addr, trace_len); munmap(trace_addr, trace_len);
sprintf(name,"/tmp/wad.%d", getpid()); unlink(framefile);
unlink(name);
trace_addr = 0; trace_addr = 0;
trace_len = 0; trace_len = 0;
} }