*** 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:
parent
fc4d95e40b
commit
64fb429e44
5 changed files with 19 additions and 17 deletions
|
|
@ -13,7 +13,7 @@ PYINCLUDE = -I/usr/local/include/python2.0
|
|||
TCLINCLUDE = -I/usr/local/include
|
||||
|
||||
# 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
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ platform directory and type 'make install'.
|
|||
Notes:
|
||||
|
||||
- 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
|
||||
machine, you may want to set the following environment variables
|
||||
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
|
||||
(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
|
||||
automatically initialize.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue