Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 515099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:35:35+00:00 2026-05-13T07:35:35+00:00

I have a console application written in Free Pascal, that like most larger applications

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:35:36+00:00Added an answer on May 13, 2026 at 7:35 am

    There are two (system unit) procedure variables involved:

    • Exceptproc which handles the exception
    • and backtracestrfunc that handles address to lineinfo retrieval.

    The current handling iirc is layered

    • the system unit only terminates with an error but defines above procedure variables to override this.
    • the sysutils unit converts RTEs to an language exception and overrides exceptproc with a default language exception handler (sysutils.catchunhandledexception)
    • the lineinfo (for stabs) or the linfodward (dwarf, 2.4.0+) units override the backtracestrfunc procedure variable to provide the lineinfo.

    So in short:

    • copy the sysutils.catchunhandledexception routine to your own code.
    • only modify the way the copy does output in some way that you like, and make it rock solid (since exceptions during exceptions are confusing and annoying)
    • assign the functionanme of the copy to exceptproc

    Note that the lineinfo unit is implicitely included when you do -gl

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a console application in Delphi that queries information from several locations.
I have written a little console application that uses s#arp. I can create an
I have a console application written in C# that is scheduled to run every
I have a console application written in C#. This application copies e mails from
I have a console application written in C#/.NET that I want to run from
I have written a C# console application that uses the Interop.domino.dll assembly to interact
I have written a console application in C# /VS2008. In that I have multiple
I have a small application written in c# as a console app that I
I have a console application written in Delphi. I saw that I can have
I have a written a Visual C++ console application (i.e. subsystem:console) that prints useful

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.