<div dir="ltr">2015-08-25 15:59 GMT-04:00 jacob navia via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span>:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Then, I could follow ALL the process of calling __register_frame(); and that function works. It expects an FDE (not a CIE as I thought) but reads the CIE using the CIE pointer in the given FDE for each FDE.</blockquote><div><br></div><div>This is what I found out when I ported a Linux program using gcc_eh to Mac using libunwind. gcc_eh also supports FDE input. </div><div><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
This is just a quick description. I do not speak about all the wrong starts, the dead ends, the sheer frustration at the lack of docs, etc. This is the result of this part of the compiler being very complex by design (DWARF is incredibly complex), and a total lack of documentation. For instance the entry for __register_frame_info in GNU docs is just:<br>
<br>
"DOCUMENT THIS!"<br></blockquote><div><br class="">There's almost no documentation with these unwind functions, probably because very few people use them ("document me!" at <a href="https://gcc.gnu.org/onlinedocs/gccint/Exception-handling-routines.html#Exception-handling-routines">https://gcc.gnu.org/onlinedocs/gccint/Exception-handling-routines.html#Exception-handling-routines</a>). So I ended up with opening both libunwind code and client code and made sure the format of the FDE and CIE was what libunwind wanted. If I saw your email earlier, I could have been replied you.</div><div><br></div><div>I read the libunwind code in the llvm project because it's cleaner and also works on Mac.</div><div><br></div><div><a href="http://llvm.org/viewvc/llvm-project/libunwind/trunk/">http://llvm.org/viewvc/llvm-project/libunwind/trunk/</a><br></div></div><br></div><div class="gmail_extra">-Jingyi</div></div>