Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Apple Open-Sources Its Unwinder For LLVM

  1. #1
    Join Date
    Jan 2007
    Posts
    14,638

    Default Apple Open-Sources Its Unwinder For LLVM

    Phoronix: Apple Open-Sources Its Unwinder For LLVM

    Earlier this week there was the news of Intel contributing their OpenMP Runtime to LLVM in order to advance the open-source compiler project. Now to end off the week is news that Apple, who continues to invest significantly into LLVM and employs many of the key contributors, has open-sourced their stack unwinder for the project...

    http://www.phoronix.com/vr.php?view=MTQ4Mzk

  2. #2
    Join Date
    Sep 2011
    Posts
    684

    Default

    Am i the only one who doesn't know what an unwinder does?

  3. #3
    Join Date
    Oct 2008
    Posts
    3,102

    Default

    Quote Originally Posted by AJenbo View Post
    Am i the only one who doesn't know what an unwinder does?
    From the link, this is used for c++ exception handling:

    Most architectures now use "zero cost" exceptions for C++. The zero cost means there are no extra instructions executed if no exceptions are thrown. But if an exception is thrown, the runtime must consult side tables and figure out how to restore registers and "unwind" from the current stack frame to the catch clause. That ability to modify the stack frames and cause the thread to resume in a catch clause with all registers restored properly is the main purpose of libunwind.
    "Unwinding" in general means going back up the stack trace and properly setting up everything - in a debugger, for example, you can go back up the stack trace to see where code is being called from, and at each point you can see local variables that are set in that function rather than what is set at the point where your breakpoint is at.

  4. #4
    Join Date
    Sep 2011
    Posts
    684

    Default

    Quote Originally Posted by smitty3268 View Post
    From the link, this is used for c++ exception handling:



    "Unwinding" in general means going back up the stack trace and properly setting up everything - in a debugger, for example, you can go back up the stack trace to see where code is being called from, and at each point you can see local variables that are set in that function rather than what is set at the point where your breakpoint is at.
    Thanks, i had a feeling it was about debuggin but how was unclear to me.

  5. #5
    Join Date
    Nov 2007
    Posts
    1,024

    Default

    Quote Originally Posted by AJenbo View Post
    Thanks, i had a feeling it was about debuggin but how was unclear to me.
    This isn't about debugging. Walking the stack and unwinding the stack are completely different. This library is not used for walking or inspecting the stack. Unwinding is _not_ required to inspect variables in other stack frames; the debugging information (full DWARF sections) are required for that. Unwinding the stack is a runtime thing languages like C++ need to support catching exceptions efficiently. Unwinding the stack is done is when the runtime invokes local variables' destructors up until the frame containing the invoked exception handler.

  6. #6
    Join Date
    Aug 2011
    Posts
    516

    Default

    Quote Originally Posted by AJenbo View Post
    Thanks, i had a feeling it was about debuggin but how was unclear to me.
    It is a bit harder to understand the purpose if you have no experience with exceptions and/or C++.

  7. #7
    Join Date
    Sep 2010
    Posts
    76

    Default

    Quote Originally Posted by phoronix View Post
    Phoronix: Apple Open-Sources Its Unwinder For LLVM

    Earlier this week there was the news of Intel contributing their OpenMP Runtime to LLVM in order to advance the open-source compiler project. Now to end off the week is news that Apple, who continues to invest significantly into LLVM and employs many of the key contributors, has open-sourced their stack unwinder for the project...

    http://www.phoronix.com/vr.php?view=MTQ4Mzk
    It was made open source many years ago, I don't undrestand what the new is.

    Here are the sources :
    http://opensource.apple.com/tarballs/libunwind/

  8. #8
    Join Date
    Oct 2012
    Location
    Washington State
    Posts
    441

    Default

    Quote Originally Posted by rafirafi View Post
    It was made open source many years ago, I don't undrestand what the new is.

    Here are the sources :
    http://opensource.apple.com/tarballs/libunwind/
    Most certainly it is a complete rewrite and may compliant for C++ 2011/2014 specs within the LLVM/Clang project for all platforms to leverage.

  9. #9
    Join Date
    Nov 2007
    Posts
    1,024

    Default

    Quote Originally Posted by Marc Driftmeyer View Post
    Most certainly it is a complete rewrite and may compliant for C++ 2011/2014 specs within the LLVM/Clang project for all platforms to leverage.
    Yeah, frpm the article:

    Apple's unwind code uses the same low-level APIs for the unwind functions but do not share code with the old libunwind. Apple pushed their unwinder code into the LLVM libcxxabi sub-project and is under the LLVM and MIT licenses.
    Must be a typo, though, since everyone knows that companies never contribute to BSD-licensed code.</sarcasm>

  10. #10
    Join Date
    Sep 2010
    Posts
    76

    Default

    Quote Originally Posted by Marc Driftmeyer View Post
    Most certainly it is a complete rewrite and may compliant for C++ 2011/2014 specs within the LLVM/Clang project for all platforms to leverage.
    Thanks for the answer.
    But it's far from a complete rewrite, in fact if I understand correctly, the only new thing is that Apple has agreed to dual license the code so it can be included in the LLVM's libcxxabi project... but it was already opensource, so this is:

    Apple double license Its already opensourced Unwinder For LLVM

    .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •