Re: Declaring a function from gcc internals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 31 Mar 2009 07:34:15 -0700, Ian Lance Taylor <iant@xxxxxxxxxx>
wrote:
> "Vincent R." <forumer@xxxxxxxxxxxxxxx> writes:
> 
>> so I was saying we need to parse the __except(easy) and then declare an
>> anonymous function
>> with the instructions hold in the parenthesis and with the return value
>> defined by the last
>> argument in list :
> 
> Do you really need an anonymous function, or do you need an exception
> region?  If the only way that the anonymous function can be called is
> via an exception, then I suspect that you need an exception region.
> 
Actually you are right the only way the function is called is through
exception.
When exception is raised OS with look for some exception information and
jump to that filter function.
Now the question is can we declare a function with an eh region and will it
construct prologue and epilogue ?
Actually the __except keyword can be declared with two flavors :

1) __except( INSA, INSSB, ...) where INSX are instructions 

2) __except( FILTER_FUNC ) where FILTER_FUNC is a function 
    with the following prototype : int (*ptFilter)(unsigned int code,
struct _EXCEPTION_POINTERS *ep);

So in case 1) we need to take instructions inside () and to put them in a
function, it means we need gcc
to construct prologue and epilogue. I suppose eh_region is only used to
mark code and prevent it to be optimized
and discarded but it doesn't solve the fact we need to construt a function.
So we may need to call start_function
anyway, what do you think ?

In the second case we can pass directly a function so this time I suppose
we only need to declare it as
a eh_region. Could you confirm I am understanding well the purpose of
eh_region and tell us 
if  we are looking in the right direction.

Thanks


Vincent R.






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux