FPC Debug line numbers

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

FPC Debug line numbers

Zaaphod
I've noticed that line numbers are sometimes off, sometimes quite a bit when I receive a run-time error.  I had one today, it specified the correct function that was responsible for generating the error,  however the line number was way off,  it reported line 1463 but the entire function in question goes from line 708 to line 785.  There is nothing remotely related at line 1463,  it's a completely unrelated procedure that could not have possibly been called at the point the runtime error was received.    The list of procedure/function calls was accurate, just not the line number, which makes it very difficult to figure out exactly what part of the function had the problem.

I am using FPC 3.0.4rc1, compiling with the text IDE and I have option "Generate also backtrace line information" selected.

Does anyone know what might cause the line numbers to be incorrect?

James

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC Debug line numbers

Graeme Geldenhuys-6
On 2017-11-06 21:49, James Richters wrote:
> Does anyone know what might cause the line numbers to be incorrect?

I don't know what causes it, but I can confirm I have seen this too on
one of my systems.

Regards,
   Graeme

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC Debug line numbers

etrusco
In reply to this post by Zaaphod
2017-11-06 19:49 GMT-02:00 James Richters <[hidden email]>:
> I've noticed that line numbers are sometimes off, sometimes quite a bit when I receive a run-time error.  I had one today, it specified the correct function that was responsible for generating the error,  however the line number was way off,  it reported line 1463 but the entire function in question goes from line 708 to line 785.  There is nothing remotely related at line 1463,  it's a completely unrelated procedure that could not have possibly been called at the point the runtime error was received.    The list of procedure/function calls was accurate, just not the line number, which makes it very difficult to figure out exactly what part of the function had the problem.
>
> I am using FPC 3.0.4rc1, compiling with the text IDE and I have option "Generate also backtrace line information" selected.
>
> Does anyone know what might cause the line numbers to be incorrect?

Didn't the unit have any include file?

-Flávio
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC Debug line numbers

el_es
In reply to this post by Zaaphod
On 06/11/17 21:49, James Richters wrote:

> I've noticed that line numbers are sometimes off, sometimes quite a
> bit when I receive a run-time error.  I had one today, it specified
> the correct function that was responsible for generating the error,
> however the line number was way off,  it reported line 1463 but the
> entire function in question goes from line 708 to line 785.  There is
> nothing remotely related at line 1463,  it's a completely unrelated
> procedure that could not have possibly been called at the point the
> runtime error was received.    The list of procedure/function calls
> was accurate, just not the line number, which makes it very difficult
> to figure out exactly what part of the function had the problem.
>
> I am using FPC 3.0.4rc1, compiling with the text IDE and I have
> option "Generate also backtrace line information" selected.
>
> Does anyone know what might cause the line numbers to be incorrect?
>
> James
>
>
I vaguely recall reading something to the sense of:
this could be related to the optimization level used;

I can't remember where I read that;

-l.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC Debug line numbers

Zaaphod
In reply to this post by etrusco
>Didn't the unit have any include file?
My doesn't have any include files.  It's just a collection of procedure and functions that I use in many different programs.. but the unit also uses a lot of other units, some are more of my own, others are standard FPC units.

>I vaguely recall reading something to the sense of:
>this could be related to the optimization level used;
I have it set to optimization target processor and code generation target processor both set to 80386

I have some programs that produce a runtime error that is exact, but others are way off.  I have not figured out what causes it to be anything but exact yet.

James


-----Original Message-----
From: fpc-pascal [mailto:[hidden email]] On Behalf Of Flávio Etrusco
Sent: Monday, November 06, 2017 8:10 PM
To: FPC-Pascal users discussions <[hidden email]>
Subject: Re: [fpc-pascal] FPC Debug line numbers

2017-11-06 19:49 GMT-02:00 James Richters <[hidden email]>:
> I've noticed that line numbers are sometimes off, sometimes quite a bit when I receive a run-time error.  I had one today, it specified the correct function that was responsible for generating the error,  however the line number was way off,  it reported line 1463 but the entire function in question goes from line 708 to line 785.  There is nothing remotely related at line 1463,  it's a completely unrelated procedure that could not have possibly been called at the point the runtime error was received.    The list of procedure/function calls was accurate, just not the line number, which makes it very difficult to figure out exactly what part of the function had the problem.
>
> I am using FPC 3.0.4rc1, compiling with the text IDE and I have option "Generate also backtrace line information" selected.
>
> Does anyone know what might cause the line numbers to be incorrect?

Didn't the unit have any include file?

-Flávio
_______________________________________________
fpc-pascal maillist  -  [hidden email] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FPC Debug line numbers

Adriaan van Os-2
In reply to this post by Zaaphod
James Richters wrote:
> I've noticed that line numbers are sometimes off, sometimes quite a bit when I receive a run-time error.  I had one today, it specified the correct function that was responsible for generating the error,  however the line number was way off,  it reported line 1463 but the entire function in question goes from line 708 to line 785.  There is nothing remotely related at line 1463,  it's a completely unrelated procedure that could not have possibly been called at the point the runtime error was received.    The list of procedure/function calls was accurate, just not the line number, which makes it very difficult to figure out exactly what part of the function had the problem.

One situation where this happens, is when line-endings are inconsistent (e.g. on Mac OS X, CR
instead of LF on some lines).

Regards,

Adriaan van Os

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal