Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2005-10

Runetime errors

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Carsten Bager

When a runtime error happens, I would like to display all possible information
The compiler we are using today can give a message like this
Runtime error 27
Index out of range
The value -4 is not in the range o 0 .. 3000.
Near line 103
Procedure Test

Would it be possible to do something like this if I write a new exit procedure?

If this is not possible how about the Turbo Pascal way using the map file to track the Procedure Name and the source code line number. I do not think this is possible with FPC because of the separate assembler and linker, but maybe there is a way around this.
I am running the FPC code on an embedded ARM platform without any operating system.

Carsten Bager Bøvlingbjerg El-automatik Brørupvænget 10 7650 Bøvlingbjerg Tlf. +4597885222 Fax +4597885434 http://www.beas.dk
David Emerson

Put into your fpc.cfg file:

-gl

to generate the line numbers (that's the really relevant one, right?) It will also say what procedure it's inside, as well as a backtrace of calling procedures, and their line numbers.

You can also find in fpc.cfg a number of other flags to generate debugging info.

I don't know if it's possible to generate a line like "the number -4 is not between 0 and 3000" ... although that would be kind of nice, come to think of it.

~David.

Earlier message 37 lines
-------- Original Message -------- > From: "Carsten Bager" > Sent: Wednesday, October 05, 2005 8:13 AM > To: FPC-Pascal users discussions > Subject: [fpc-pascal] Runetime errors > > When a runtime error happens, I would like to display all > possible information > The compiler we are using today can give a message like > this > Runtime error 27 > Index out of range > The value -4 is not in the range o 0 .. 3000. > Near line 103 > Procedure Test > > Would it be possible to do something like this if I write a new > exit procedure? > > If this is not possible how about the Turbo Pascal way using the > map file to track the Procedure Name and the source code line > number. I do not think this is possible with FPC because of the > separate assembler and linker, but maybe there is a way around > this. > I am running the FPC code on an embedded ARM platform > without any operating system. > -- > Carsten Bager > Bøvlingbjerg El-automatik > Brørupvænget 10 > 7650 Bøvlingbjerg > Tlf. +4597885222 Fax +4597885434 > http://www.beas.dk > > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal