[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libunwind-devel] libunwind and windows
From: |
Vincent Torri |
Subject: |
Re: [Libunwind-devel] libunwind and windows |
Date: |
Tue, 15 Aug 2017 07:14:39 +0200 |
*hello
On Mon, Aug 14, 2017 at 4:15 PM, Dave Watson <address@hidden> wrote:
> On 08/12/17 07:21 AM, Vincent Torri wrote:
>> Hello
>>
>> i am planning to work a bit on porting libunwind on Windows. Note that
>> i don't know the internal of libunwind so my questions in that thread
>> could be naive.
>
> Are you planning on writing full SEH support? For reference, libgcc's
> unwind support for windows is here:
>
> https://github.com/gcc-mirror/gcc/blob/master/libgcc/unwind-seh.c
>
> vs. the equivalent dwarf that libunwind currently supports:
>
> https://github.com/gcc-mirror/gcc/blob/master/libgcc/unwind-dw2-fde.c
i am only interested in having dwarf unwind with libunwind
>> Running make, the first error is the ucontext.h header file which is
>> not found. Normal.
>>
>> After some grep, it appears that you call only getcontext() function.
>> On Windows, the equivalent of ucontext_t type is the CONTEXT type and
>> getcontext() equivalent is GetThreadContext() on the current thread.
>
> As far as I know, we only use the ucontext_t, so that we can be
> comatible with the system getcontext() and setcontext(), the system
> versions aren't actually called, and most platforms implement their
> own, see the getcontext.S, etc.
is there a reason to not use the system functions ?
>> I can add a typedef for unw_tdep_context_t in libunwind-x86_64.h and
>> port getcontext() somewhere to change at least as possible the current
>> code.
>>
>> question: In which file should I put this getcontext() port ?
>
> Os-specific stuff goes in src/os-windows.c or arch & os specific in
> src/arch/Gos-windows.c (either of which you'd have to create).
if I use the system function, it's only os-specific.
thank you
Vincent Torri
> Good luck!