<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Courier;
panose-1:2 7 4 9 2 2 5 2 4 4;}
@font-face
{font-family:Courier;
panose-1:2 7 4 9 2 2 5 2 4 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Christian,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I suspect that at least some of the details depend on what platform you’re working on. I believe that MCJIT attempts to register eh frame information for either
MachO or ELF objects (though for some ELF platforms nothing actually happens). What happens to it after that is a darker area, at least for me.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Apparently there was a GDB command that did just what you want -- “info catch” -- but I had never used it and it has been removed. It’s too bad because it
sounds like a nice feature. It was supposed to dump a list of catch handlers for whatever frame you’re looking at. I suspect, however, that it would have just confirmed that your catch handler isn’t properly hooked up without being helpful in figuring out
why.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">You could try debugging the RuntimeDyld code that registers eh frames and see if that looks right. RuntimeDyld::registerEHFrames() might be a helpful starting
point.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">-Andy<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> llvmdev-bounces@cs.uiuc.edu [mailto:llvmdev-bounces@cs.uiuc.edu]
<b>On Behalf Of </b>Christian Schafmeister<br>
<b>Sent:</b> Wednesday, April 08, 2015 10:09 PM<br>
<b>To:</b> LLVM Developers Mailing List<br>
<b>Subject:</b> [LLVMdev] Looking for advice on how to debug a problem with C++ style exception handling code that my compiler generates.<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Hi,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I’m looking for advice on how to debug a problem with my exception handling code. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I’m asking a specific question here - but general advice on how to debug something like this would be greatly appreciated.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">Is there any way to get a list of landing pad clauses that are active at a particular point in a program?<br>
I'd like to get something like a backtrace but listing all active landing pad clauses. The typeids of the C++ types <br>
I'm trying to debug a problem where an exception that I'm throwing is not being caught. <o:p></o:p></p>
<div>
<p class="MsoNormal">I'm generating JITed code with LLVM and landing pads and I've got shared libraries - lots of things going on that could potentially be going wrong.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">A list of the pointer values like @_ZTIN4core9DynamicGoE is what I’m looking for. Then I could compare that to the typeids that I know should be in that list.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:Courier">"(TRY-0).landing-pad": ; preds = %"(TRY-0).normal-dest14", %"(TRY-0).tagbody-B-1", %"(TRY-0).normal-dest10", %"(TRY-0).normal-dest9", %"(TRY-0).normal-dest8", %"(TRY-0).normal-dest",
%"(TRY-0).tagbody-#:G1621-0"</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Courier"> %14 = landingpad { i8*, i32 } personality i32 (...)* @__gxx_personality_v0</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Courier"> catch i8* @_ZTIN4core9DynamicGoE</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Courier"> catch i8* @_ZTIN4core10ReturnFromE, !dbg !26</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Courier"> %15 = extractvalue { i8*, i32 } %14, 0, !dbg !26</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Courier"> %16 = extractvalue { i8*, i32 } %14, 1, !dbg !26</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Courier"> %17 = call i32 @llvm.eh.typeid.for(i8* @_ZTIN4core9DynamicGoE), !dbg !26</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Courier"> %18 = icmp eq i32 %16, %17, !dbg !26</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Courier"> br i1 %18, label %"(TRY-0).handler-block14470", label %"(TRY-0).dispatch-header19", !dbg !26</span><o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">I’m getting this error when I throw a core::Unwind exception and I’m certain that there is a landing pad with that clause.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:Courier">libc++abi.dylib: terminating with uncaught exception of type core::Unwind</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Courier">../../src/gctools/<a href="http://memoryManagement.cc">memoryManagement.cc</a>:75 Trapped SIGABRT - starting debugger</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Courier">ABORT was called!!!!!!!!!!!!</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Courier"><o:p> </o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I’ve written a Common Lisp compiler that uses LLVM as the backend and it interoperates with C++ code and I use C++ exception handling for non-local exits.<o:p></o:p></p>
</div>
</div>
</body>
</html>