Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Overriding Delphi's exception handler

Posted on 2001-07-21
3
1,467 Views
Last Modified: 2012-05-05
Hello,

I need to override Delphi's exception handler.
I don't want the trick with Application.OnException it is not what i need.

I'd like to set my own unhandled exception handler, in order to generate a stack dump, etc.
(using SetUnhandledExceptionFilter)

The problem is i can do what i want, setting a new exception handler doesn't override delphi's one !
I still get it's messages like "Exception EAccessViolation at adress xxx. Read at adress xxx."

I found that the exception handler is located in system.pas. Perhaps it will help...

Any idea ?

Thanks !
Bertrand
0
Comment
Question by:hobiecat16
3 Comments
 
LVL 9

Expert Comment

by:ITugay
ID: 6304554
Hi hobiecat16,

did you try your app without Delphi IDE? Usually Delphi shows any exeption message first, and then your own message while IDE is running.

-----
Igor.
0
 
LVL 1

Author Comment

by:hobiecat16
ID: 6304562
Yes, unfortunately this isn't the problem, i tried to run it w/o delphi's debugger and i still have the default exception handler.

Is there another way to do a stack dump than to override the exception handler ? I have an access to the exception address, perhaps i can deal with virtualProtect and ReadPhysicalMemory to read the stack ?

Any suggestion...
0
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 200 total points
ID: 6304840
Get the Jedi Code Library. JclDebug is what you need.
http://www.delphi-jedi.org/Jedi:CODELIBJCL
There is also an IDE extension to compile your program with compressed MAP file included so the exception can show line numbers.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question