Announcement

Collapse
No announcement yet.

Apple Open-Sources Its Unwinder For LLVM

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Am i the only one who doesn't know what an unwinder does?

    Comment


    • #3
      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.

      Comment


      • #4
        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.

        Comment


        • #5
          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.

          Comment


          • #6
            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++.

            Comment


            • #7
              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/

              Comment


              • #8
                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.

                Comment


                • #9
                  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>

                  Comment


                  • #10
                    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

                    .

                    Comment

                    Working...
                    X