*** empty log message ***

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@940 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-11-08 22:08:04 +00:00
commit 3ea5a30534
7 changed files with 99 additions and 230 deletions

View file

@ -32,9 +32,8 @@ static int trace_len = 0;
WadFrame *
wad_stack_trace(unsigned long pc, unsigned long sp, unsigned long fp) {
int i;
WadSegment *ws;
WadObject *wo;
WadSegment *ws, *segments;
WadObjectFile *wo;
WadFrame frame;
WadDebug *wd;
int nlevels;
@ -48,6 +47,10 @@ wad_stack_trace(unsigned long pc, unsigned long sp, unsigned long fp) {
int lastsize = 0;
int firstframe = 1;
/* Read the segments */
segments = wad_segment_read();
/* Open the frame file for output */
sprintf(framefile,"/tmp/wad.%d", getpid());
ffile = open(framefile, O_CREAT | O_TRUNC | O_WRONLY, 0644);
@ -63,12 +66,12 @@ wad_stack_trace(unsigned long pc, unsigned long sp, unsigned long fp) {
while (p_sp) {
/* Add check for stack validity here */
ws = wad_segment_find((char *) p_sp);
ws = wad_segment_find(segments, (void *) p_sp);
if (!ws) {
/* If the stack is bad, we are really hosed here */
break;
}
ws = wad_segment_find((char *) p_pc);
ws = wad_segment_find(segments, (void *) p_pc);
{
int symsize = 0;
int srcsize = 0;
@ -215,7 +218,7 @@ wad_stack_trace(unsigned long pc, unsigned long sp, unsigned long fp) {
lseek(ffile,0,SEEK_SET);
trace_addr = mmap(NULL, trace_len, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, ffile, 0);
close(ffile);
wad_segment_release();
wad_segment_release(segments);
return (WadFrame *) trace_addr;
}