<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 14.07.2011, at 20:09, Enrico Granata wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Andrey,</div><div>You might be pleased to know that this bug is fixed in the latest LLDB.</div><div><br></div><div>What follows is an LLDB session printout, with the interesting lines bolded</div><div><br></div><div>da0603a-dhcp151:Debug egranata$ ./lldb andrey</div><div>Current executable set to 'andrey' (x86_64).</div><div>(lldb) b main</div><div>runbreakpoint set --name 'main'</div><div>Breakpoint created: 1: name = 'main', locations = 1</div><div>(lldb) run</div><div>Process 71825 launched: '/Volumes/work/egranata/lldb/build/Debug/andrey' (x86_64)</div><div>Process 71825 stopped</div><div>* thread #1: tid = 0x2e03, 0x0000000100000d94 andrey`main + 4 at andrey.m:18, stop reason = breakpoint 1.1</div><div>  frame #0: 0x0000000100000d94 andrey`main + 4 at andrey.m:18</div><div>   15  <span class="Apple-tab-span" style="white-space:pre">    </span></div><div>   16  <span class="Apple-tab-span" style="white-space:pre">       </span>int main()</div><div>   17  <span class="Apple-tab-span" style="white-space:pre">     </span>{</div><div>-> 18  <span class="Apple-tab-span" style="white-space:pre">     </span>    Item *itm = [[Item alloc] init];</div><div>   19  <span class="Apple-tab-span" style="white-space:pre"> </span>    </div><div>   20  <span class="Apple-tab-span" style="white-space:pre"> </span>    itm.title = @"Hello world";</div><div>   21  <span class="Apple-tab-span" style="white-space:pre">    </span>    </div><div>(lldb) n</div><div>Process 71825 stopped</div><div>* thread #1: tid = 0x2e03, 0x0000000100000ddb andrey`main + 75 at andrey.m:20, stop reason = step over</div><div>  frame #0: 0x0000000100000ddb andrey`main + 75 at andrey.m:20</div><div>   17  <span class="Apple-tab-span" style="white-space:pre">       </span>{</div><div>   18  <span class="Apple-tab-span" style="white-space:pre">      </span>    Item *itm = [[Item alloc] init];</div><div>   19  <span class="Apple-tab-span" style="white-space:pre"> </span>    </div><div>-> 20  <span class="Apple-tab-span" style="white-space:pre">        </span>    itm.title = @"Hello world";</div><div>   21  <span class="Apple-tab-span" style="white-space:pre">    </span>    </div><div>   22  <span class="Apple-tab-span" style="white-space:pre"> </span>    itm.title = @"Try again";</div><div>   23  <span class="Apple-tab-span" style="white-space:pre">      </span>    </div><div>(lldb) n</div><div>Process 71825 stopped</div><div>* thread #1: tid = 0x2e03, 0x0000000100000e00 andrey`main + 112 at andrey.m:22, stop reason = step over</div><div>  frame #0: 0x0000000100000e00 andrey`main + 112 at andrey.m:22</div><div>   19  <span class="Apple-tab-span" style="white-space:pre">     </span>    </div><div>   20  <span class="Apple-tab-span" style="white-space:pre"> </span>    itm.title = @"Hello world";</div><div>   21  <span class="Apple-tab-span" style="white-space:pre">    </span>    </div><div>-> 22  <span class="Apple-tab-span" style="white-space:pre">        </span>    itm.title = @"Try again";</div><div>   23  <span class="Apple-tab-span" style="white-space:pre">      </span>    </div><div>   24  <span class="Apple-tab-span" style="white-space:pre"> </span>    return 0;</div><div>   25</div><div><b>(lldb) expr (char*)[[itm title] UTF8String]</b></div><div><b>(char *) $0 = 0x000000010010cdc0 "Hello world"</b></div><div><br></div><div><div>You can get the latest LLDB source from the project website and build it yourself. This should be enough to solve your crash</div><div><br></div><div>Thanks for your interest in LLDB :-)</div><div><br></div><div>On Jul 14, 2011, at 5:32 AM, Andrey Zaytsev wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>I've got crash when was trying to call GetNumChildren of value which I got from EvaluateExpression method.<br><br>We have class:<br><br>@interface Item : NSObject {<br>@private<br>    NSString *title;<br>    NSString *type;<br>}<br><br>@property(retain)NSString* title;<br>//... and some other stupid stuff<br>@end<br><br>I'm trying to evaluate expression "[item title]"<br>Value is ok. But when GetNumChildren is invoked i've got crash: <br>ClangASTContext.cpp:<br><br>static bool<br>GetCompleteQualType (clang::ASTContext *ast, clang::QualType qual_type) {<br>//......<br><br>case clang::Type::ObjCInterface:<br>        {<br>            const clang::ObjCObjectType *objc_class_type = dyn_cast<clang::ObjCObjectType>(qual_type);<br>            if (objc_class_type)<br>            {<br>                clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();<br>                // We currently can't complete objective C types through the newly added ASTContext<br>                // because it only supports TagDecl objects right now...<br>                bool is_forward_decl = class_interface_decl->isForwardDecl();  // !! <----- crashed here. class_interface_decl == NULL<br><br>Sorry for screenshot instead of normal crash dump. =( I just was not able to get it.<br><br><span><Screen shot 2011-07-14 at 15.55.09.png></span><br><br>CFBundleVersion of LLDB is 63.<br><br>I couldn't reproduce it with Xcode (just because of "Evaluate expression" doesn't work at all with message "Invalid expression")<br><br>Please please please fix it! <br>Thank you._______________________________________________<br>lldb-dev mailing list<br><a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a></div></blockquote></div></div></blockquote><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br></div></blockquote><br></div><div>Hi, Enrico!</div><div>Thank you for consideration of my problem. </div><div>But your listing doesn't show described problem because "<b>expr (char*)[[itm title] UTF8String]</b>" doesn't invoke GetNumChildren method of SBValue. But if you do it (e.g. from python script) you'll get the crash.</div><div>It's reproduced with latest sources. (tried right now)</div><div><br></div><div>Fixing this problem will make this feature work:</div><div><br></div><div><img id="91c3ca5f-55bd-496f-89f8-8b5742092c98" height="545" width="657" apple-width="yes" apple-height="yes" src="cid:F2DDEDAB-5FD1-482F-9193-A29C83E75870@Labs.IntelliJ.Net"></div><div><br></div><div>Xcode have the similar one in the variables view. But it doesn't work. And if Xcode team will fix that issue with "Invalid expression" they will face the described one =(</div><div>Thank you for consideration.</div><div><br></div><div><br></div><br></body></html>