<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On 12 Sep 2014, at 23:38, Robinson, Paul <<a href="mailto:Paul_Robinson@playstation.sony.com" class="">Paul_Robinson@playstation.sony.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">-----Original Message-----<br class="">From:<span class="Apple-converted-space"> </span><a href="mailto:llvm-commits-bounces@cs.uiuc.edu" class="">llvm-commits-bounces@cs.uiuc.edu</a><span class="Apple-converted-space"> </span>[mailto:llvm-commits-<br class=""><a href="mailto:bounces@cs.uiuc.edu" class="">bounces@cs.uiuc.edu</a>] On Behalf Of Frédéric Riss<br class="">Sent: Tuesday, September 09, 2014 6:19 AM<br class="">To:<span class="Apple-converted-space"> </span><a href="mailto:jingham@apple.com" class="">jingham@apple.com</a><br class="">Cc:<span class="Apple-converted-space"> </span><a href="mailto:lldb-dev@cs.uiuc.edu" class="">lldb-dev@cs.uiuc.edu</a>; llvm-commits; Greg Clayton<br class="">Subject: Re: [lldb-dev] [RFC][PATCH] Keep un-canonicalized template types<br class="">in the debug information<br class=""><br class=""><br class=""><blockquote type="cite" class="">On 09 Sep 2014, at 00:01, <a href="mailto:jingham@apple.com" class="">jingham@apple.com</a> wrote:<br class=""><br class="">From the debugger's standpoint, the functional concern is that if you do<br class=""></blockquote>something more real, like:<br class=""><blockquote type="cite" class=""><br class="">typedef int A;<br class="">template <typename T><br class="">struct S<br class="">{<br class="">T my_t;<br class="">};<br class=""><br class="">I want to make sure that the type of my_t is given as "A" not as "int".<br class=""></blockquote>The reason for that is that it is not uncommon to have data formatters<br class="">that trigger off the typedef name.  This happens when you use some common<br class="">underlying type like "int" but the value has some special meaning when it<br class="">is formally an "A", and you want to use the data formatters to give it an<br class="">appropriate presentation. Since the data formatters work by matching type<br class="">name, starting from the most specific on down, it is important that the<br class="">typedef name be preserved.<br class=""><blockquote type="cite" class=""><br class="">However, it would be really odd to see:<br class=""><br class="">(lldb) expr -T -- my_s<br class="">(S<int>) $1 = {<br class="">(A) my_t = 5<br class="">}<br class=""><br class="">instead of:<br class=""><br class="">(lldb) expr -T -- my_s<br class="">(S<A>) $1 = {<br class="">(A) my_t = 5<br class="">}<br class=""><br class="">so I am in favor of presenting the template parameter type with the most<br class=""></blockquote>specific name it was given in the overall template type name.<br class=""><br class="">OK, we get this wrong today. I’ll try to look into it.<br class=""><br class="">What’s your take on the debug info representation for the templated class<br class="">type? The tentative patch introduces a typedef that declares S<A> as a<br class="">typedef for S<int>. The typedef doesn’t exist in the code, thus I find it<br class="">a bit of a lie to the debugger. I was more in favour of something like :<br class=""><br class="">DW_TAG_variable<br class="">DW_AT_type: -> DW_TAG_structure_type<br class="">              DW_AT_name: S<A><br class="">              DW_AT_specification: -> DW_TAG_structure_type<br class="">                                        DW_AT_name: S<int><br class=""><br class="">This way the canonical type is kept in the debug information, and the<br class="">declaration type is a real class type aliasing the canonical type. But I’m<br class="">not sure debuggers can digest this kind of aliasing.<br class=""><br class="">Fred<br class=""></blockquote><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Why introduce the extra typedef? S<A> should have a template parameter</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">entry pointing to A which points to int.  The info should all be there</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">without any extra stuff.  Or if you think something is missing, please</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">provide a more complete example.</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>The template type information is stored in 2 places:</div><div> - In the template argument DIEs that you mention (I didn’t touch to this one)</div><div> - In the name of the template type (this is the one the patch is modifying)</div><div><br class=""></div><div>It is my understanding that the debugger will use the latter more than the template argument DIE. Thus my goal is to register both S<A> and S<int> as valid types so that we don’t lose any information compared to what was there before.</div><div><br class=""></div><div>Fred</div><div><br class=""></div></div></body></html>