Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2018-07

How __FPC_specific_handler() is invoked

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Matias Vara

Hello,

I am writing my own __FPC_specific_handler() but I can't figure out when this function is registered. I guess this function is registered to the OS to be invoked when an exception happens. In the assembler code I have something like:

.seh_handler __FPC_specific_handler,@unwind

But I am puzzled by "@unwind". How is __FPC_specific_handler() invoked?

Matias

Reply by email

Sven Barth
to Matias Vara

Matias Vara schrieb am Di., 24. Juli 2018, 11:04:

Show quoted text 11 lines
Hello, I am writing my own __FPC_specific_handler() but I can't figure out when this function is registered. I guess this function is registered to the OS to be invoked when an exception happens. In the assembler code I have something like: .seh_handler __FPC_specific_handler,@unwind But I am puzzled by "@unwind". How is __FPC_specific_handler() invoked

To understand the .seh_*-pseudo instructions it's probably best to look at their initial check-in in the GNU assembler:
https://sourceware.org/ml/binutils/2009-08/msg00193.html

The handler function is invoked by Windows when an exception happens inside the code that is governed by the surrounding (implicit) .seh_(end)proc directives.

Why are you writing your own handler?

Regards,
Sven

Reply by email

Matias Vara
to Sven Barth

El mar., 24 jul. 2018 a las 13:57, Sven Barth via fpc-pascal (<

Show quoted text 27 lines
) escribió: Matias Vara schrieb am Di., 24. Juli 2018, 11:04: > Hello, > > I am writing my own __FPC_specific_handler() but I can't figure out when > this function is registered. I guess this function is registered to the OS > to be invoked when an exception happens. In the assembler code I have > something like: > > .seh_handler __FPC_specific_handler,@unwind > > But I am puzzled by "@unwind". How is __FPC_specific_handler() invoked > To understand the .seh_*-pseudo instructions it's probably best to look at their initial check-in in the GNU assembler: https://sourceware.org/ml/binutils/2009-08/msg00193.html The handler function is invoked by Windows when an exception happens inside the code that is governed by the surrounding (implicit) .seh_(end)proc directives. Why are you writing your own handler?

Thanks for the answer, I am trying to make work the exceptions handling in Toro kernel. Currently Toro is based on Win64 rtl. I think I will give up with the Win64 RTL and move to a simpler RTL.

Matias

Show quoted text 6 lines
Regards, Sven > _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Sven Barth
to Matias Vara

Matias Vara schrieb am Mi., 25. Juli 2018, 12:55:

Show quoted text 33 lines
El mar., 24 jul. 2018 a las 13:57, Sven Barth via fpc-pascal (< >) escribió: > Matias Vara schrieb am Di., 24. Juli 2018, 11:04: > >> Hello, >> >> I am writing my own __FPC_specific_handler() but I can't figure out when >> this function is registered. I guess this function is registered to the OS >> to be invoked when an exception happens. In the assembler code I have >> something like: >> >> .seh_handler __FPC_specific_handler,@unwind >> >> But I am puzzled by "@unwind". How is __FPC_specific_handler() invoked >> > > To understand the .seh_*-pseudo instructions it's probably best to look > at their initial check-in in the GNU assembler: > https://sourceware.org/ml/binutils/2009-08/msg00193.html > > The handler function is invoked by Windows when an exception happens > inside the code that is governed by the surrounding (implicit) > .seh_(end)proc directives. > > Why are you writing your own handler? > > Thanks for the answer, I am trying to make work the exceptions handling in Toro kernel. Currently Toro is based on Win64 rtl. I think I will give up with the Win64 RTL and move to a simpler RTL.

I think I suggested some time ago already that you should use the embedded targets for writing a kernel. That's what they're there for after all.

Regards,
Sven

Reply by email

Matias Vara
to Sven Barth

El mié., 25 jul. 2018 a las 14:33, Sven Barth via fpc-pascal (<

Show quoted text 43 lines
) escribió: Matias Vara schrieb am Mi., 25. Juli 2018, 12:55: > > El mar., 24 jul. 2018 a las 13:57, Sven Barth via fpc-pascal (< > >) escribió: > >> Matias Vara schrieb am Di., 24. Juli 2018, >> 11:04: >> >>> Hello, >>> >>> I am writing my own __FPC_specific_handler() but I can't figure out >>> when this function is registered. I guess this function is registered to >>> the OS to be invoked when an exception happens. In the assembler code I >>> have something like: >>> >>> .seh_handler __FPC_specific_handler,@unwind >>> >>> But I am puzzled by "@unwind". How is __FPC_specific_handler() invoked >>> >> >> To understand the .seh_*-pseudo instructions it's probably best to look >> at their initial check-in in the GNU assembler: >> https://sourceware.org/ml/binutils/2009-08/msg00193.html >> >> The handler function is invoked by Windows when an exception happens >> inside the code that is governed by the surrounding (implicit) >> .seh_(end)proc directives. >> >> Why are you writing your own handler? >> >> > Thanks for the answer, I am trying to make work the exceptions handling > in Toro kernel. Currently Toro is based on Win64 rtl. I think I will give > up with the Win64 RTL and move to a simpler RTL. > I think I suggested some time ago already that you should use the embedded targets for writing a kernel. That's what they're there for after all.

You are right but I was a bit strong headed.

Thanks

Show quoted text 5 lines
Regards, Sven _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email