Solved

Overriding Delphi's exception handler

Posted on 2001-07-21
3
1,470 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
[X]
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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 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