Sign in Join

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

Mailing lists / fpc-pascal / 2008-08

Question on exceptions

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

John Youngquist

When you enable things like range checking. How do you identify when an exception has occurred and what it means?

I see messages like "Unhandled exception occurred at $hex address" then a bunch more $hex address'

I don't know what to do with these numbers.

JY

leledumbo
to John Youngquist
John Youngquist wrote
When you enable things like range checking. How do you identify when an exception has occurred and what it means?

AFAIK a checking code is generated for every error-possible code. That's why it seems a little slower when you compile programs with checkings enabled. You can try to get the assembler output by specifying -a<lnrt> compiler option. Try program below and check it.

var
  i: Byte;
begin
  i:=0;
  repeat
    Inc(i);
  until i>255;
end.
John Youngquist wrote 6 lines
I see messages like "Unhandled exception occurred at $hex address" then a bunch more $hex address' I don't know what to do with these numbers.

I usually use that for low level debugging. That it, to get what kind of instruction happen at that address that cause the exception.

View this message in context: http://www.nabble.com/Question-on-exceptions-tp19137422p19139221.html Sent from the Free Pascal - General mailing list .
Jonas Maebe
to John Youngquist: When you enable things like range checking. How do you identify when an exception has…
John Youngquist wrote
When you enable things like range checking. How do you identify when an exception has occurred and what it means?

Compile the program with -gl (and all of its units with -g or -gl) to see source information next to the addresses. If that does not work (- gl is not supported for all combinations of debug information and target platforms), run the program in a debugger, set a breakpoint on FPC_BREAK_ERROR, run, and perform a backtrace when the breakpoint is hit.

Jonas

John Youngquist
to Jonas Maebe

I tried the -gl and it works this will be a big help.!!!!

thank you very much

JY

Jonas Maebe wrote 22 lines
On 25 Aug 2008, at 04:37, John Youngquist wrote: > When you enable things like range checking. How do you identify > when an exception has occurred and what it means? Compile the program with -gl (and all of its units with -g or -gl) to see source information next to the addresses. If that does not work (- gl is not supported for all combinations of debug information and target platforms), run the program in a debugger, set a breakpoint on FPC_BREAK_ERROR, run, and perform a backtrace when the breakpoint is hit. Jonas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal .