I have a console application written in Free Pascal, that like most larger applications sometimes crashes. As this application is live, I usually ask people to write me down the stack-trace on crash -- I distribute it with both debug and lineinfo. However, the application uses FPC video.pas output, and sometimes the text output stacktrace is not visible.
Is there a way to intercept the text that is written on unhandled exceptions WITH the stack trace, so I can write it to file? I can't just pipe standard error to a file, because FPC video somehow doesn't work with that, and also I'd like people just running the executable not a batch or shell file.
As an example, I'd like to catch this to 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 possibility to do that cleanly?