libunwind-devel
[Top][All Lists]
Advanced

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

Re: [libunwind] Changing the value of "gp"


From: Praveen Vegulla
Subject: Re: [libunwind] Changing the value of "gp"
Date: Wed, 22 Jan 2003 14:07:45 -0800 (PST)

Thank you very much David for patiently looking into
this.

The problem that I see with the exception table
mechanism is that it might become very complex.
Assuming 3 functions setup an exception handler for
the same exception E1, then the table would look like:

Func1, E1, jmpbuf1
Func2, E1, jmpbuf2
Func3, E1, jmpbuf3

If E1 is to be raised from FuncXYZ(), then the I need
to check for the correct IP range before using the
jmpbuf. This will get very tricky if the functions
were inlined by the compiler.

The above example used only one exception. If a
function was to have a handler for many types of
exceptions, the table might get very large if the task
is long running and goes thru many code paths (i.e,
going thru many function sequences, each setting its
exception handler).

Unfortunately, I'm porting our code (a very huge code
base) to linux ia64, so can't switch languages :-(

You mentioned in your earlier mail that I could write
my own stub to correct the "gp". Could you please give
any pointers to that (reading material, anything).

I'll spend some more time to see if the exception
table mechanism is something I can implement as well,
without doing a major surgery to the existing code.

Thank you,
Praveen

--- David Mosberger <address@hidden> wrote:
> Praveen,
> 
> I realized that you can't really replace the longjmp
> with
> unw_resume(), because you may be restarting
> execution at some place
> other than the last call-site of a function.  The
> 2nd scheme I
> proposed should still work, except that you'd also
> have to use
> setjmp() in SETUP_EXC(), would raise the exception
> with longjmp(), and
> would use libunwind only to locate the appropriate
> exception handler.
> 
> Of course, using a language that natively supports
> exception handling
> might be a better choice, alltogether. ;-)
> 
>       --david
> _______________________________________________
> libunwind mailing list
> address@hidden
>
http://linux.hpl.hp.com/cgi-bin/mailman/listinfo/libunwind


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]