On 13/06/2012 14:12, Jonas Maebe wrote:

Antonio Fortuny wrote on Wed, 13 Jun 2012:

I can see the memory leak I have generated (read below) but no refecence to the line itself. Instead I receive the reference lines before and after the memory leak creation inside the rtl.

The reason is that the RTL itself is compiled with optimisations. This means that sometimes no stack frame is generated for such routines. As a result, when crawling the stack, you will not see the *caller* of such routines in the stack trace. The only way to work around this is to recompile the RTL without optimisations.

Out of interest. I reproduced this myself. And I found that while fpc is omitting some frames, if I run in gdb and step into reallocmem, then gdb is able to show the stack.

So it appears, that it is possible. Though I do not know if GDB does this by analysing the stack only, or gdb also uses knowledge from disassembling the function headers....

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to