<div dir="ltr">Yes, that was my thought. <div><br><div>FYI, checked in GDB: it's working correctly on this testcase showing correct dynamic type in both cases.<div class="gmail_extra"><br><div class="gmail_quote">2017-02-06 9:48 GMT-08:00 Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">You have found a bug. It should be reporting this correctly but it isn’t. I verified it fails on MacOSX.<div><br></div><div>Greg Clayton</div><div><br><div><blockquote type="cite"><div><div class="h5"><div>On Feb 5, 2017, at 1:19 PM, Roman Popov via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:</div><br class="m_-2367537013708510783Apple-interchange-newline"></div></div><div><div><div class="h5"><div dir="ltr"><div>Hello,</div><div>I'm observing very strange LLDB behavior: it does not always shows a correct dynamic type when I ask for.</div><div><br></div><div>Originally I was working with LLDB 3.9, but it looks like trunk version behaves the same strange way. </div><div><br></div><div>I was able to capture this behavior in a small code snippet: <br></div><div><br></div><div><font face="monospace, monospace">#include <iostream></font></div><div><font face="monospace, monospace">#include <typeinfo></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">using namespace std;</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">struct base_type { virtual ~base_type(){} };</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">template <class T1, class T2, unsigned SIZE></font></div><div><font face="monospace, monospace">struct derived0 : base_type {};</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">template <class T1, class T2></font></div><div><font face="monospace, monospace">struct derived1 : base_type {};</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">int main(int argc, char ** argv) {</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> base_type * bptr0 = new derived0<int, int, 1024>();</font></div><div><font face="monospace, monospace"> base_type * bptr1 = new derived1<int, int >();</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> cout << typeid(*bptr0).name() << endl;</font></div><div><font face="monospace, monospace"> cout << typeid(*bptr1).name() << endl;</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"> return 0;</font></div><div><font face="monospace, monospace">}</font></div><div><br></div><div><div><br></div><div>lldb --version</div><div>lldb version 5.0.0 (<a href="http://llvm.org/svn/llvm-project/lldb/trunk" target="_blank">http://llvm.org/svn/llvm-<wbr>project/lldb/trunk</a> revision 293398)</div><div> clang revision 293398</div><div> llvm revision 293398</div></div><div><br></div><div><br></div><div>Testing in LLDB:</div><div>(lldb) break set --file main.cpp --line 22</div><div><br></div><div>(lldb) expression -d no-run -- bptr1</div><div>(derived1<int, int> *) $2 = 0x0000000000614c40</div><div><br></div><div>(lldb) expression -d no-run -- bptr0</div><div><b>(base_type *) $3 = 0x0000000000614c20</b></div><div><br></div><div><br></div><div>Can someone explain me why for bptr0 I dont get a <span style="font-family:monospace,monospace">derived0<int, int, 1024> * as I expected?</span></div><div><br></div><div><br></div><div>Thanks,</div><div>Roman</div></div></div></div>
______________________________<wbr>_________________<br>lldb-dev mailing list<br><a href="mailto:lldb-dev@lists.llvm.org" target="_blank">lldb-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/lldb-dev</a><br></div></blockquote></div><br></div></div></blockquote></div><br></div></div></div></div>