It is essentially a copy of siglongjump (link to OpenBSD source for this
funciton:
http://ftp.asia.edu.tw/OS/OpenBSD/src/lib/libc/arch/amd64/gen/sigsetjmp.S)
with slightly different arguments plus some extra work to restore the
floating-point state. The purpose of this function is to replace all
callee-saved registers with their values at the time they executed the
function call from that stack frame, and ending by replacing the
instruction pointer (eip/rip). This approximately simulates a direct return
from that function. The OS-specific part of it is the execution of the
syscall equivalent to sigprocmask and the restoration of the state for the
floating-point unit. Julia doesn't actually use or need this functionality,
so you can also safely remove it from the final library for your current
purposes.

You can try the OSX unwinder by doing `make -C deps install-osxunwind`
(source code from https://github.com/JuliaLang/libosxunwind) and see if
that gets you any further. I don't know what to expect from that.


On Mon, Sep 7, 2015 at 3:55 AM Maurizio Tomasi <[email protected]> wrote:

> *@Jameson*, I was able to go a little further by modifying libunwind's
> source code in order to include <signal.h> instead of <ucontext.h>.
> However, there is some point where non-trivial assembly code needs to be
> ported:
>
>
> https://github.com/pathscale/libunwind/blob/vanilla_pathscale/src/x86_64/setcontext.S#L95
>
> I haven't the slightest idea of what this code does, so I'm stuck on this
> point.
>
>   Maurizio.
>
>
> On Saturday, September 5, 2015 at 4:38:26 AM UTC+2, Jameson wrote:
>>
>> The libunwind dependency is very shallow, but you would lose backtraces.
>> However, I'm surprised nobody has created that header yet, since the struct
>> that I would expect to be the hard part is required for the sigaction libc
>> function and is defined at
>> http://fxr.watson.org/fxr/source/sys/signal.h?v=OPENBSD#L200
>> <http://www.google.com/url?q=http%3A%2F%2Ffxr.watson.org%2Ffxr%2Fsource%2Fsys%2Fsignal.h%3Fv%3DOPENBSD%23L200&sa=D&sntz=1&usg=AFQjCNH96veTOX30g20SNT2jb6ZaPCi-Fw>
>> .
>>
>>

Reply via email to