<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">You have found a bug. It should be reporting this correctly but it isn’t. I verified it fails on MacOSX.<div class=""><br class=""></div><div class="">Greg Clayton</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 5, 2017, at 1:19 PM, Roman Popov via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hello,</div><div class="">I'm observing very strange LLDB behavior: it does not always shows a correct dynamic type when I ask for.</div><div class=""><br class=""></div><div class="">Originally I was working with LLDB 3.9, but it looks like trunk version behaves the same strange way. </div><div class=""><br class=""></div><div class="">I was able to capture this behavior in a small code snippet: <br class=""></div><div class=""><br class=""></div><div class=""><font face="monospace, monospace" class="">#include <iostream></font></div><div class=""><font face="monospace, monospace" class="">#include <typeinfo></font></div><div class=""><font face="monospace, monospace" class=""><br class=""></font></div><div class=""><font face="monospace, monospace" class="">using namespace std;</font></div><div class=""><font face="monospace, monospace" class=""><br class=""></font></div><div class=""><font face="monospace, monospace" class="">struct base_type { virtual ~base_type(){} };</font></div><div class=""><font face="monospace, monospace" class=""><br class=""></font></div><div class=""><font face="monospace, monospace" class="">template <class T1, class T2, unsigned SIZE></font></div><div class=""><font face="monospace, monospace" class="">struct derived0 : base_type {};</font></div><div class=""><font face="monospace, monospace" class=""><br class=""></font></div><div class=""><font face="monospace, monospace" class="">template <class T1, class T2></font></div><div class=""><font face="monospace, monospace" class="">struct derived1 : base_type {};</font></div><div class=""><font face="monospace, monospace" class=""><br class=""></font></div><div class=""><font face="monospace, monospace" class="">int main(int argc, char ** argv) {</font></div><div class=""><font face="monospace, monospace" class=""><br class=""></font></div><div class=""><font face="monospace, monospace" class=""> base_type * bptr0 = new derived0<int, int, 1024>();</font></div><div class=""><font face="monospace, monospace" class=""> base_type * bptr1 = new derived1<int, int >();</font></div><div class=""><font face="monospace, monospace" class=""><br class=""></font></div><div class=""><font face="monospace, monospace" class=""> cout << typeid(*bptr0).name() << endl;</font></div><div class=""><font face="monospace, monospace" class=""> cout << typeid(*bptr1).name() << endl;</font></div><div class=""><font face="monospace, monospace" class=""><br class=""></font></div><div class=""><font face="monospace, monospace" class=""> return 0;</font></div><div class=""><font face="monospace, monospace" class="">}</font></div><div class=""><br class=""></div><div class=""><div class=""><br class=""></div><div class="">lldb --version</div><div class="">lldb version 5.0.0 (<a href="http://llvm.org/svn/llvm-project/lldb/trunk" class="">http://llvm.org/svn/llvm-project/lldb/trunk</a> revision 293398)</div><div class=""> clang revision 293398</div><div class=""> llvm revision 293398</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Testing in LLDB:</div><div class="">(lldb) break set --file main.cpp --line 22</div><div class=""><br class=""></div><div class="">(lldb) expression -d no-run -- bptr1</div><div class="">(derived1<int, int> *) $2 = 0x0000000000614c40</div><div class=""><br class=""></div><div class="">(lldb) expression -d no-run -- bptr0</div><div class=""><b class="">(base_type *) $3 = 0x0000000000614c20</b></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Can someone explain me why for bptr0 I dont get a <span style="font-family:monospace,monospace" class="">derived0<int, int, 1024> * as I expected?</span></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Roman</div></div>
_______________________________________________<br class="">lldb-dev mailing list<br class=""><a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev<br class=""></div></blockquote></div><br class=""></div></body></html>