Sign in Join

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

Mailing lists / fpc-pascal / 2004-11

Find error?

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

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

Alan Mead

Turbo Pascal used to have a "find error" function... Is there a similar function in Free Pascal (I'm using 1.9.4)? I compiled the executable with -gl but I get the below:

An unhandled exception occurred at 0x08071049 :
EOutOfMemory : Out of memory
$08071049
$080705FD
$08068B2A
$08068E30
$4D664F74 P$LSA2_finalize_implicit, line 683 of lsa2.pas

-Alan

Peter Vreman
to Alan Mead
Show quoted text 11 lines
Turbo Pascal used to have a "find error" function... Is there a similar function in Free Pascal (I'm using 1.9.4)? I compiled the executable with -gl but I get the below: An unhandled exception occurred at 0x08071049 : EOutOfMemory : Out of memory $08071049 $080705FD $08068B2A $08068E30 $4D664F74 P$LSA2_finalize_implicit, line 683 of lsa2.pas

You can load the execute in gdb and use 'info line 0x08071049^'

David Emerson

When you compile with -gl you need to make sure that you recompile all the units, as well as the main program, with the -gl flag. Passing a -B flag will recompile all units (whose sources are found in the path), so: fpc -gl -B myprogram

If, after doing so, you still lack line info, it's probably because it's hitting an error in the rtl or some other part of the fpc system, in which case you ought to be able to trace the erroneous call back to the last call made by your code.

If you'll be running in debug mode for any appreciable length of time, you might consider putting -gl in your fpc.cfg, so fpc will always compile all your programs with the line info. The drawback is that the executables are bigger; I don't know if there are any speed considerations.

Of course, as Peter suggested, you could also use the IDE or Lazarus or some other gdb-supporting editor, which can take you straight to the error from the address, rather than needing the line info in english.

~David.

Earlier message 23 lines
-------- Original Message -------- > From: Alan Mead > Sent: Tuesday, November 09, 2004 8:58 AM > To: free pascal > Subject: [fpc-pascal] Find error? > > Turbo Pascal used to have a "find error" function... Is there a > similar function in Free Pascal (I'm using 1.9.4)? I compiled the > executable with -gl but I get the below: > > An unhandled exception occurred at 0x08071049 : > EOutOfMemory : Out of memory > $08071049 > $080705FD > $08068B2A > $08068E30 > $4D664F74 P$LSA2_finalize_implicit, line 683 of lsa2.pas > > -Alan > > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Alan Mead
to David Emerson: When you compile with -gl you need to make sure that you recompile all the units, as well…

Thanks David, Pete amd Florian,

When I try Peter's advice, I get

(gdb) info line 0x08071049^
Function "0x08071049" not defined.

I found the section of the FPC User's Manual that talks about gdb and I assumed that I hadn't used the '-g' option ... but now I'm wondering if '-gl' should allow gdb debugging? The docs on gdb seem pretty volumnous but I didn't see 'info' as a command...

Regarding the EOutOfMemory exception, is that thrown only when all (physical+virtual) memory is exhausted? Or is it also possible to try to allocate too big a chunk (say, a chunk that exceeds physical but not physical+virtual)? I'm running FC1 with the 2.4 kernel (although I may upgrade to FC2 with the 2.6 kernel).

-Alan

--- David Emerson wrote 57 lines
When you compile with -gl you need to make sure that you recompile all the units, as well as the main program, with the -gl flag. Passing a -B flag will recompile all units (whose sources are found in the path), so: fpc -gl -B myprogram If, after doing so, you still lack line info, it's probably because it's hitting an error in the rtl or some other part of the fpc system, in which case you ought to be able to trace the erroneous call back to the last call made by your code. If you'll be running in debug mode for any appreciable length of time, you might consider putting -gl in your fpc.cfg, so fpc will always compile all your programs with the line info. The drawback is that the executables are bigger; I don't know if there are any speed considerations. Of course, as Peter suggested, you could also use the IDE or Lazarus or some other gdb-supporting editor, which can take you straight to the error from the address, rather than needing the line info in english. ~David. -------- Original Message -------- > From: Alan Mead > Sent: Tuesday, November 09, 2004 8:58 AM > To: free pascal > Subject: [fpc-pascal] Find error? > > Turbo Pascal used to have a "find error" function... Is there a > similar function in Free Pascal (I'm using 1.9.4)? I compiled the > executable with -gl but I get the below: > > An unhandled exception occurred at 0x08071049 : > EOutOfMemory : Out of memory > $08071049 > $080705FD > $08068B2A > $08068E30 > $4D664F74 P$LSA2_finalize_implicit, line 683 of lsa2.pas > > -Alan > > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal