I have a console application written in Free Pascal that, like most major applications, sometimes crashes. Since this application works live, I usually ask people to write me to the stack trace when it crashes - I distribute it with both debug and lineinfo. However, the application uses the FPC video.pas output, and sometimes stacktrace text output is not displayed.
Is there a way to intercept text that is written on unhandled exceptions with a stack, so I can write it to a file? I can’t just pass the standard error to a file, because the FPC video somehow doesn’t work with this, and I would also like people to just run the executable, not the batch or shell file.
As an example, I would like to catch this in a file or other output source:
ERangeError : Range check error∙
$0048C0EA TCELLS__GETCELL, line 104 of dfmap.pas
$004AD133 TDOOMGENERATOR__GENERATECITYDUNGEON, line 397 of dfdungen.pas
$004AF87D TDOOMGENERATOR__GENERATE, line 760 of dfdungen.pas
$0041293B TDOOM__RUN, line 354 of doombase.pas
$00401CD6 main, line 51 of doomrl.pas
Any opportunity to make it clean?
source
share