[fpc-pascal] How to get to Range Check Error location

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Oct 2 15:45:51 CEST 2010


On 02 Oct 2010, at 15:07, Juha Manninen (gmail) wrote:

> On Saturday 02 October 2010 12:21:20 Jonas Maebe wrote:
>> Compile with -gl, or set a breakpoint on FPC_RANGEERROR
> 
> Forgot to tell, I compiled with "-gw -gh".
> "-gw" should be as good as "-gl".

It has nothing to do with being "as good as", they do different things (just like "-gw" and "-gh" do different things).

> Now I tried with -gl but no luck. I get an Assembly window:
>  http://koti.phnet.fi/juhamann/Lazarus/AssemblyRangeCheck.jpg
> but no source lines.

-gl shows the source code lines next to the hexadecimal addresses when a backtrace is printed to the console. The assembly window in that screenshot is completely unrelated.

> Should I build the compiler with debug info?

That is not required.
> 
> In any case FPC should give better feedback to the user about range check 
> errors. A RunError and an Assembly window are quite useless.

FPC nor the RTL ever show assembly an window. That is something Lazarus-specific. And when Lazarus shows an assembly window, it presumably can also show a callstack window.

> Because of "-gh" I am getting the following output always when closing 
> Lazarus. Only the numbers change with Lazarus versions and compile options.
> 
> Likely it is not a "real" error. Vincent Snijders suspected it is a bug in the 
> way heaptrc does its counting in a 64-bit system. In a 32-bit system it works.

As long as it says "0 unfreed memory blocks : 0", there is no problem.


Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20101002/77e64ac2/attachment.html>


More information about the fpc-pascal mailing list