<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Sep 19, 2007, at 5:41 PM, Devang Patel wrote:</DIV><BLOCKQUOTE type="cite"><DIV><DIV>On Sep 19, 2007, at 4:48 PM, Bill Wendling wrote:</DIV><BR></DIV><DIV>In llvm-backend.cpp  :</DIV><DIV><BR></DIV><DIV><DIV><FONT class="Apple-style-span" face="Courier">1086</FONT><SPAN class="Apple-tab-span" style="white-space:pre"><FONT class="Apple-style-span" face="Courier">        </FONT></SPAN><FONT class="Apple-style-span" face="Courier">        if (GV->getName() != Name) {</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier">1087</FONT><SPAN class="Apple-tab-span" style="white-space:pre"><FONT class="Apple-style-span" face="Courier">   </FONT></SPAN><FONT class="Apple-style-span" face="Courier">          Function *F = TheModule->getFunction(Name);</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier">1088</FONT><SPAN class="Apple-tab-span" style="white-space:pre"><FONT class="Apple-style-span" face="Courier">  </FONT></SPAN><FONT class="Apple-style-span" face="Courier">          assert(F && F->isDeclaration() && "A function turned into a global?");</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier">1089</FONT><SPAN class="Apple-tab-span" style="white-space:pre"><FONT class="Apple-style-span" face="Courier">     </FONT></SPAN><FONT class="Apple-style-span" face="Courier">          </FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier">1090</FONT><SPAN class="Apple-tab-span" style="white-space:pre"><FONT class="Apple-style-span" face="Courier">        </FONT></SPAN><FONT class="Apple-style-span" face="Courier">          // Replace any uses of "F" with uses of GV.</FONT></DIV><DIV><FONT class="Apple-style-span" face="Courier">1091</FONT><SPAN class="Apple-tab-span" style="white-space:pre"><FONT class="Apple-style-span" face="Courier">   </FONT></SPAN><FONT class="Apple-style-span" face="Courier">          Value *FInNewType = ConstantExpr::getBitCast(GV, F->getType());</FONT></DIV><BR><BR class="webkit-block-placeholder"></DIV><DIV><DIV>(gdb) p Name</DIV><DIV>$3 = 0x41819430 "\001L_OBJC_PROTOCOL_$_CPTransferThreadObserving"</DIV><BR>However  <FONT class="Apple-style-span" face="Courier">TheModule->getFunction(Name)</FONT> returns NULL and you get ICE at <FONT class="Apple-style-span" face="Courier">F->getType(</FONT>) #1091. I'll let you investigate this further ...   :)</DIV><DIV> </DIV></BLOCKQUOTE>How were you able to get gdb to work with this?!<BR></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-bw</DIV><BR></BODY></HTML>