libunwind-devel
[Top][All Lists]
Advanced

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

Re: [Libunwind-devel] libunwind and windows


From: Dave Watson
Subject: Re: [Libunwind-devel] libunwind and windows
Date: Mon, 14 Aug 2017 07:15:48 -0700
User-agent: Mutt/1.6.0 (2016-04-01)

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

> 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.

> 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).

Good luck!



reply via email to

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