Skip to content

Commit

Permalink
Libunwind readme
Browse files Browse the repository at this point in the history
  • Loading branch information
charlieMonroe committed Sep 6, 2013
1 parent adb678c commit 9021e8b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Libunwind for (FreeBSD) kernel

### About

This is project was started in order to bring libunwind to the FreeBSD kernel. Why would you want libunwind in the kernel? To support no-cost exception handling in Objective-C (see https://github.com/charlieMonroe/libobjc-kern).

### Source code

Simply modifying the libunwind code is almost impossible. Hence only relevant parts have been taken and put together in this project - most of the remote-related code has been removed (though some might have been left there) and generally only the x86-64-related code has been left.

### Obstacles

Unfortunately, this project isn't finished - it compiles and runs as a separate kernel module, can create backtraces, but cannot unwind stack. This is because it fails to find sufficient data in the `.eh_frame` section and ends up guessing the stack pointer based on `rsb`, which results in a very wrong value most of the time.

If you want to go have a whack at it, the relevant code is in the `Gfind_proc_info-lsb.c`, where the `linear_search` function fails finding the needed info.

0 comments on commit 9021e8b

Please sign in to comment.