* prevent endless stack dump if an exception occured during the dump itself.

git-svn-id: trunk@1427 -
This commit is contained in:
yury 2005-10-16 17:17:50 +00:00
parent 8af13ed6ae
commit 2332eae403

View File

@ -749,23 +749,27 @@ var
caller_frame, caller_frame,
caller_addr : Pointer; caller_addr : Pointer;
Begin Begin
prevbp:=bp-1; try
i:=0; prevbp:=bp-1;
is_dev:=do_isdevice(textrec(f).Handle); i:=0;
while bp > prevbp Do is_dev:=do_isdevice(textrec(f).Handle);
Begin while bp > prevbp Do
caller_addr := get_caller_addr(bp); Begin
caller_frame := get_caller_frame(bp); caller_addr := get_caller_addr(bp);
if (caller_addr=nil) or caller_frame := get_caller_frame(bp);
(caller_frame=nil) then if (caller_addr=nil) or
break; (caller_frame=nil) then
Writeln(f,BackTraceStrFunc(caller_addr)); break;
Inc(i); Writeln(f,BackTraceStrFunc(caller_addr));
If ((i>max_frame_dump) and is_dev) or (i>256) Then Inc(i);
break; If ((i>max_frame_dump) and is_dev) or (i>256) Then
prevbp:=bp; break;
bp:=caller_frame; prevbp:=bp;
End; bp:=caller_frame;
End;
except
{ prevent endless dump if an exception occured }
end;
End; End;