Unfortunately, libunwind is very poorly arranged for such cases,
where two ports can share the bulk of the code. So I've been
rearranging it. What I have is currently in an intermediate
state that does not compile, but as soon as I have something, I
will check it in to the frysk repository.
There are also some nasty details too. For example, the user context
and dwarf CFI are both complex data structure. Both of them have some
important information about the registers. The context contain the
value of each registers at some point. And the CFI tells how to save
and restore registers when one function call another. How to get these
register values? How are these registers ordered? The numbering
sequence? How to map the register in context structure to these in
CFI information? All these should be in the questions to be answered.
How do you do all these for x86 and x86_64?
What is needed here is familiarity with the dwarf3 spec, and the
ELF spec for ppc64. There is existing code in gcc to perform the
same operations, but only within the local process. But it is
still helpful for understanding.