[fpc-devel]heaptrc: web bug 2632

Marco van de Voort marcov at stack.nl
Thu Sep 11 18:10:55 CEST 2003


> >I added an extra local variable to hold the previous bp and the loop now
> >looks like this:
> >   bp:=get_caller_frame(get_frame);
> >   for i:=1 to tracesize do
> >    begin
> >      pheap_mem_info(p)^.calls[i]:=get_caller_addr(bp);
> >      oldbp := bp;
> >      bp:=get_caller_frame(bp);
> >      if (bp<oldbp) then
> >        bp:= 0;
> >    end;
> >
> >I recompiled the rtl and run several test programs and the programs
> >didn't crash anymore.
> >The check on the frame pointer could be more sophisticated if I knew a
> >way to find out what the top of the stack is, so I could check if the
> >frame pointer is in stack.
> 
> Thanks, i've applied the patch

Peter: We could save the initial stackptr in the initcode?




More information about the fpc-devel mailing list