On 03/22/2011 10:01 PM, H.J. Lu wrote:
>>> Will there be a case where 2 copies of unwind-dw2.c are within the same
>>> process?
>>
>> Sure, that's easy.  I think what you are really asking is: will there be
>> a case where we could call functions from one copy and then pass the
>> context to the functions from a different copy.  I don't know the answer
>> to that, but it doesn't seem impossible.

It really shouldn't be, but judging from the existance of 
_Unwind_IsExtendedContext
it appears that it really is.  Which, frankly, I assume is some sort of strange
packaging problem between glibc and libgcc_s.so.

Jakub, do you recall anything more specific about this?

2007-01-03  Jakub Jelinek  <ja...@redhat.com>

        * unwind-dw2.c (SIGNAL_FRAME_BIT, EXTENDED_CONTEXT_BIT): Define.
        (struct _Unwind_Context): Rename args_size to flags, remove
        signal_frame field, add a new args_size field and version field.
        (_Unwind_IsSignalFrame, _Unwind_SetSignalFrame,
        _Unwind_IsExtendedContext): New inline functions.
        (_Unwind_GetGR, _Unwind_SetGR, _Unwind_GetGRPtr, _Unwind_SetGRPtr):
        Assume by_value array is only present if _Unwind_IsExtendedContext.
        (_Unwind_GetIPInfo, execute_cfa_program, uw_frame_state_for): Use
        _Unwind_IsSignalFrame.
        ...

> Then. will this be acceptable?

No.

Ideally we'd remove the by_value array, but I guess that's now versioned
so it'll have to stay even though unused.

Add a new

        _Unwind_Word data[DWARF_FRAME_REGISTERS+1];

at the end.  Increment the context version number.  If the version is
sufficiently high, implement _Unwind_SetGRValue via

        context->data[index] = val;
        context->reg[index] = &context->data[index];

and do not set by_value at all.


r~

Reply via email to