<br><br><div class="gmail_quote">2010/1/22 Garrison Venn <span dir="ltr"><<a href="mailto:gvenn.cfe.dev@gmail.com">gvenn.cfe.dev@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="word-wrap: break-word;">Yes. The issue here, as you pointed out, is that your personality function is not called at all.<div>Even if you did nothing in the personality function, associated with the setup caused by</div>
<div>llvm.eh.selector, but returned _URC_CONTINUE_UNWIND (8), it should still be called.</div><div>Your results are acting like either dwarf exception header info is not emitted (llvm::DwarfExceptionHandling = true; </div>
<div>not executed could affect this), _Unwind_RaiseException(...) is not being called, or the default or another personality </div><div>function (_gcc_personality_v0(...)) is called instead by the unwind infrastructure. Although you implied you </div>
<div>dumped the exception headers and found your personality function, I can if you wish instead given you breaks for </div><div>gbd so you can see if lvm.eh.selector is correctly prepping your personality function for eventual dwarf emission.</div>
</div></blockquote><div><br>Yes - sorry I was unclear. I have pruned everything down to a pretty minimal test:<br>- LLVM 2.6 compiled from source<br>- A slightly modified version of Duncan's example ll assembly posted earlier<br>
- A minimal personality function (just a call to fprintf()) in a separate C file compiled with gcc-llvm<br>- A single C++ function in a third file that simply does "throw 1;" compiled with g++-llvm<br>- I can definitely see the personality function in the exception headers and it's definitely not being called. <br>
- If i replace "throw 1" with "result = _Unwind_RaiseException" then result is 5 - i.e. END_OF_STACK. <br><br>-- James<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="word-wrap: break-word;"><div><br></div><font color="#888888"><div>Garrison</div></font><div><div></div><div class="h5"><div> </div><div><div><div>On Jan 22, 2010, at 8:06, James Williams wrote:</div><br><blockquote type="cite">
<br><br><div class="gmail_quote">2010/1/22 Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Garrison,<div><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
%7 = invoke i8* (...)* bitcast (i32 (%struct._Unwind_Exception*)* @_Unwind_RaiseException to i8* (...)*)(i64* %6)<br>
to label %8 unwind label %.finally_pad ; <i8*> [#uses=0]<br>
<br>
I am not sure this is going to work, at least from the way I've played with the system. In my examples the _Unwind_RaiseException(...) is called from a frame (function) called via<br>
the invoke instruction, not from a frame that contains the invoke instruction.<br>
</blockquote>
<br></div>
I'm pretty sure this doesn't matter. It seems to me more likely that the<br>
exception object was not initialized properly.<br></blockquote><div>Hmm. I've tried a bunch of different ways of creating the exception including calling a C++ function that then does a throw. If I understand right, the personality function should still be offered the foreign exception so it has a chance to call cleanups?<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Ciao,<br><font color="#888888">
<br>
Duncan.<br>
<br>
</font></blockquote></div><br>
</blockquote></div><br></div></div></div></div></blockquote></div><br>