<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Björn<br>
<br>
To first answer your questionin the subject: For x86
registerEHFrames() is only a stub. For x86_64 registerEHFrames()
is implemented properly in RuntimeDyldCOFFX86_64, calling
MemMgr.registerEHFrames() for each EH frame section. It should be
called and work out of the box without your involvement, but
unfortunately it won't solve your issue. All the essential
information is there in the comments, just check the base classes.<br>
<br>
This thread from last year helps with your unresolved symbol:<br>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/pipermail/llvm-dev/2016-October/106458.html">http://lists.llvm.org/pipermail/llvm-dev/2016-October/106458.html</a><br>
<br>
Back then I tried to solve a related issue: SEH exceptions thrown
from code loaded with RuntimeDyld had to be caught in statically
compiled code. It turned out Windows explicitly prohibits this. I
got in touch with Microsoft people and IIRC it's due to security
concerns.<br>
<br>
Depending on your specific case, you may want to fall back to <span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">vectored
exception handling. In my experience this was a dead end though.
If you need a solution for arbitrary situations, you just can't
jump back to a "safe" place to continue execution. I tried
setjump (on each entry point to the dynamically loaded code) / </span><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">longjmp</span>
(</span><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">in
the </span><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">vectored
exception handler</span></span>), but the address was
invalidated when I accessed it. I suspect it's kind of undefined
behavior to call longjmp outside a child frame of the function
that called setjmp. Anyway it turned </span><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">all
far too</span> hacky.</span><br>
<br>
If you are willing to do research, compare implementations and
behavior with the MachO and ELF versions. At least one of them
works, just not on Windows ;)<br>
Also check the LLILC project: <a class="moz-txt-link-freetext" href="https://github.com/dotnet/llilc">https://github.com/dotnet/llilc</a> I
heard about some solution that uses trampolines to push exceptions
back to dynamically loaded code and handle them there.<br>
<br>
AND disclaimer: I did not follow recent developments in this area.
If there's news please let me know!<br>
<br>
Cheers & Good Luck!<br>
Stefan<br>
</p>
Am 25.09.17 um 11:31 schrieb via llvm-dev:<br>
<blockquote type="cite"
cite="mid:OF0CC41E4A.E39D36F9-ONC12581A6.003419A5-C12581A6.0034595C@smtpgw.horiba.co.jp"><font
face="sans-serif" size="2">Hello friendly LLVM-World,</font>
<br>
<br>
<font face="sans-serif" size="2">because I don't know if I had
send my
problem to the correct Mailing-List, I will send my problem to
this address
too. I'm not subscribed to this list, so please add my in CC if
you response.</font>
<br>
<br>
<font face="sans-serif" size="2">Kind regards</font>
<br>
<font face="sans-serif" size="2">Björn</font>
<br>
<br>
<br>
<font face="sans-serif" size="1" color="#5f5f5f">From:
</font><font face="sans-serif" size="1">Bjoern Gaier/HE/HORIBA</font>
<br>
<font face="sans-serif" size="1" color="#5f5f5f">To:
</font><font face="sans-serif" size="1">Clang Dev
<a class="moz-txt-link-rfc2396E" href="mailto:cfe-dev@lists.llvm.org"><cfe-dev@lists.llvm.org></a>,
"cfe-dev" <a class="moz-txt-link-rfc2396E" href="mailto:cfe-dev-bounces@lists.llvm.org"><cfe-dev-bounces@lists.llvm.org></a></font>
<br>
<font face="sans-serif" size="1" color="#5f5f5f">Date:
</font><font face="sans-serif" size="1">19.09.2017 08:05</font>
<br>
<font face="sans-serif" size="1" color="#5f5f5f">Subject:
</font><font face="sans-serif" size="1">Clang/LLVM JIT
- When to use "registerEHFrames()"</font>
<br>
<hr noshade="noshade">
<br>
<br>
<font face="sans-serif" size="2">Hello friendly Clang-World,</font>
<br>
<br>
<font face="sans-serif" size="2">I was experimenting with Clang
and the
JIT capabilities of LLVM. Most of my attempts were successfully
but, I
still fail miserably at exceptions. Doing research I found the
function
"registerEHFrames()" which should assist me supporting
exceptions
- but sadly the documentation I found wasn't helpful.</font>
<br>
<font face="sans-serif" size="2">I looked at into the
"notifyObjectLoaded"
function and discovered that there appear some symbol names
starting with
"$" - I expected them to be connected to my try and catch block.
But what now? As usually, at this point I have there names, but
can't get
there address to register them with the "registerEHFrames()"
function. Also the JITTER still wants an address for
"??_7type_info@@6B@"
which is the virtual table of the type_info struct.</font>
<br>
<br>
<font face="sans-serif" size="2">Confusing! So friendly
Clang-World,
could you please help? </font>
<br>
<br>
<font face="sans-serif" size="2">Not so important - but has the
dragon
which decorates clang and LLVM a name?</font>
<br>
<br>
<font face="sans-serif" size="2">Kind regards</font>
<br>
<font face="sans-serif" size="2">Björn</font>
<br>
<font face="sans-serif" size="2"><br>
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB
9816, USt.ID-Nr.
DE 114 165 789<br>
Geschäftsführer: Hiroshi Kawamura, Dr Hiroshi Nakamura, Markus
Bode, Heiko
Lampert, Takashi Nagano, Takeshi Fukushima.</font>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="https://weliveindetail.github.io/blog/">https://weliveindetail.github.io/blog/</a>
<a class="moz-txt-link-freetext" href="https://cryptup.org/pub/stefan.graenitz@gmail.com">https://cryptup.org/pub/stefan.graenitz@gmail.com</a></pre>
</body>
</html>