Sign in Join

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

Mailing lists / fpc-devel / 2010-11

crash report for constructor may point to destructor

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Martin

If a constructor crashes, the the object that it was constructing will be destroyed. (fpc inserts an exception frame to ensure that).

So far so good, all correct.

But if the destructor (e.g Destroy) also crashes, then if you have -gl it will dump the stack for the destructor.
The stack for the constructor is never there a way to make it dump the constructor crash as well (maybe before calling destroy)?

fpc trunk (yesterday) / -gl -gw / w32

Martin

Reply by email

Jonas Maebe
to Martin
Martin wrote
But if the destructor (e.g Destroy) also crashes, then if you have - gl it will dump the stack for the destructor. The stack for the constructor is never 's because backtraces are only dumped when an exception is not

caught. Otherwise you'd probably see a lot backtrace being printed during an average Lazarus run.

Is there a way to make it dump the constructor crash as well (maybe before calling destroy)?

By adding your own try/except code and manually dumping the backtrace.

Jonas

Reply by email

Paul Ishenin
to Jonas Maebe
Jonas Maebe wrote
> Is there a way to make it dump the constructor crash as well (maybe > before calling destroy)? By adding your own try/except code and manually dumping the backtrace.

As I remember D2007 has a new feature to store inner exception inside the try-except block.

If you want I can search for the references.

Best regards,
Paul Ishenin.

Reply by email