Recent

Author Topic: Win32 exception question.  (Read 1689 times)

parcel

  • Full Member
  • ***
  • Posts: 135
Win32 exception question.
« on: November 23, 2013, 03:14:19 am »
I recently apply win32 SEH(per thread) work RTL level on FPC 2.7.1, but no success.

Install handler at set_jmp function, and removes fpc_popaddrstack.
handler place on system.pp at win32 folder.
I got error on compiling RTL.  :'(

I hard to understand original FPC exception handler's behavier.

Code: [Select]
pushaddrstack(...); push exception handler
 set_jmp(frame); // return result 0(eax)
return_address_from_exception_handler: // this address stored in exception frame.
 push eax ; <= return value?
 if eax=0 then
   protected_codes
 else
  ??;
 popAddrstack; // removes handler from linked list.
 pop eax
Is pushed eax value return from exception handler?


( Sorry for my poor English.  :-[ )

p.s.

ah, It's setjmp/longjmp.  %)
« Last Edit: November 23, 2013, 04:33:22 am by parcel »

parcel

  • Full Member
  • ***
  • Posts: 135
finally I make win32 SEH per thread patch ;D
« Reply #1 on: November 24, 2013, 11:09:07 am »
Much of time spended  :-[
I did make it.  :)

now catch dll exception and more.  8)
'-dwin32_seh' switch need with this patch.

Happy coding!  :D

parcel

  • Full Member
  • ***
  • Posts: 135
Re: Win32 exception question.
« Reply #2 on: November 25, 2013, 04:08:08 am »
There is a missing part and made new patch.  :-[

p.s.
newfix uploaded. one bugs are there, fixed.  :-[

(update)
revert back to first method. now working properly.  %)

(update)
Made with compiler classes. n386flw.pas in compiler/i386 folder. 
update too many, and it works :'(
« Last Edit: November 26, 2013, 02:18:27 am by parcel »