 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Sun Jul 09, 2006 8:17 pm Post subject: Help Debugging a Delphi Program |
|
|
I'm currently investigating an odd problem in a commercial program
written in Delphi. What is happening is that a Delphi exception gets
thrown, and then the Delphi exception handler tells Windows to continue
execution at the faulting instruction (a Windows structured exception
handling thing). As this is a noncontinuable exception thrown by the
Delphi RTL, the process then falls over and dies. The code from the
exception handler is this:
00f24c64 mov eax,[esp+0x4]
00f24c68 test dword ptr [eax+0x4],0x6
00f24c6f jne COMCAS_1+0x4cfe (00f24cfe)
00f24c75 cmp byte ptr [COMCAS_1!DllUnregisterServer+0xc76c8
(0108c028)],0x0
00f24c7c ja COMCAS_1+0x4c8d (00f24c8d)
00f24c7e lea eax,[esp+0x4]
00f24c82 push eax
00f24c83 call COMCAS_1+0x1340 (00f21340)
00f24c88 cmp eax,0x0
00f24c8b jz COMCAS_1+0x4cfe (00f24cfe)
....do a bunch of stuff that checks for exception code 0x0eedfade, and
results in the program being terminated with an error message...
00f24cfe xor eax,eax
00f24d00 ret
That call is to UnhandledExceptionFilter. It sure looks like whoever
wrote this code is mistaking the return value of
UnhandledExceptionFilter (EXCEPTION_CONTINUE_SEARCH) for the return
value of the exception handler (ExceptionContinueExecution, which has
the same number value as EXCEPTION_CONTINUE_SEARCH, although the
functions return different types). This would suggest that somebody has
hand-coded this exception handler and made a mistake.
I should note that this exception handler is different than all the
others I looked at in that program - all the others don't call
UnhandledExceptionFilter, nor do they return ExceptionContinueExecution
in any code path I observed. It's possible this is the top-level
exception handler, although that certainly doesn't explain why it's
returning ExceptionContinueExecution.
So, I'm looking for a few pieces of information from a skilled Delphi
programmer (I'm not a Delphi programmer). Is it possible to have Delphi
continue execution from an exception handler? Is it possible to code an
exception handler for a Delphi program in C/assembly? Has anyone else
seen this kind of thing in their own programs (is it an mistake in
Delphi?)? If none of the above, do any of you have any idea what might
be going on here, from the description of the problem?
Oh, and I should mention that I'm mainly curious as to why the
exception handler is returning ExceptionContinueExecution. I already
know why it's throwing the exception (it's rather idiotic), and I'm
aware that the coder should have caught the exception themselves. |
|
| Back to top |
|
 |
Riki Wiki Guest
|
Posted: Wed Jul 12, 2006 2:48 am Post subject: Re: Help Debugging a Delphi Program |
|
|
Hoi Justin
Your question is more fitting for the newsgroup b.p.d.language.basm, try to
repost the question there, and do the repost to the Borland news server to
make everybody see your message.
How to post to Delphi newsgroups:
<http://delphi.wikia.com/wiki/Delphi_Newsgroups> |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|