<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 Feb 9, 2015, at 11:44 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; 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 class="gmail_quote" style="font-family: Helvetica; font-size: 12px; 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;">On Mon, Feb 9, 2015 at 11:28 AM, Frédéric Riss<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:friss@apple.com" target="_blank" class="">friss@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Feb 9, 2015, at 11:09 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank" class="">dblaikie@gmail.com</a>> wrote:</div><br class=""><div class=""><br class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">On Mon, Feb 9, 2015 at 11:07 AM, Frédéric Riss<span class=""> </span><span dir="ltr" class=""><<a href="mailto:friss@apple.com" target="_blank" class="">friss@apple.com</a>></span><span class=""> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><span class=""><br class="">> On Feb 9, 2015, at 10:47 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank" class="">dblaikie@gmail.com</a>> wrote:<br class="">><br class="">> Author: dblaikie<br class="">> Date: Mon Feb  9 12:47:14 2015<br class="">> New Revision: 228588<br class="">><br class="">> URL:<span class=""> </span><a href="http://llvm.org/viewvc/llvm-project?rev=228588&view=rev" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=228588&view=rev</a><br class="">> Log:<br class="">> DebugInfo: Suppress the location of instructions in aggregate default arguments.<br class="">><br class="">> Matches the existing code for scalar default arguments. Complex default<br class="">> arguments probably need the same handling too (test/fix to that coming<br class="">> next).<br class=""><br class=""></span>What was the behavior before that? Was the location set to the declaration with the default argument description?</blockquote><div class=""><br class="">Yes<br class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">I think I wouldn’t matter my debugger jumping there when the code actually does something non-trivial to initialize the argument(s).<br class=""></blockquote><div class=""><br class="">Perhaps - though it is a bit jarring whenever you step passed a std::string, std::vector, etc ctor and leap into the standard library header to see the Allocator() ctor call, then go back to your code.<br class=""></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">This is true, however from a purely semantic POV I think a ‘step’ should really get you there. I mostly asked out of curiosity, I’m not objecting to the change. I guess people could find it strange and that hiding the initialization is a sane choice (although remembering the developer that something non-trivial is happening here also has its advantages).</div></div></div></blockquote><div class=""><br class="">I'm not sure how to remind the developer in a sufficiently gentle way (perhaps some way we could communicate this to a debugger & come up with an appropriate debugger user experience) - default arguments are /really/ common in C++. If we attributed their location to where the expression was written, it would be very disruptive.<br class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><div class=""><br class=""></div><blockquote type="cite" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class="">I do wonder if maybe the same is_stmt change we're discussing for dtors would be suitable here, so you don't step to it, but it does appear in the backtrace. Still awkward line table entry "foo() : basic_string:20473" or something - "wait, foo isn't in basic_string…".<br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">Not sure I’m totally following here. The basic_string code in foo() should appear as an inlined function, shouldn’t it?</div></div></div></blockquote><div class=""><br class="">It's not the body of basic_string's ctor, it's basic_string's ctor's default argument (changed somewhat in C++14, but prior to that there was no no-args ctor in basic_string, only one that took an Allocator and provided a default value: <a href="http://en.cppreference.com/w/cpp/string/basic_string/basic_string" class="">http://en.cppreference.com/w/cpp/string/basic_string/basic_string</a><span class="Apple-converted-space"> </span>- but you can see the other ctors that have the same default argument post-14, including the common const char* converting ctor)<br class=""><br class="">class basic_string {<br class="">  basic_string(const Allocator &alloc = Allocator());<br class="">  ...<br class="">};<br class=""><br class="">void func() {<br class="">  basic_string s;<br class="">}<br class=""><br class="">In this code, there is a call to "Allocator()" in the body of func() - this is not the inlined body of basic_string, it's not an inlined function of any kind, the C++ language just says, basically, that the default argument expression is evaluated in the context of the call site (modulo some stuff). So the compiler generates that call to Allocator() at every call to basic_string's construction with no args.<br class=""></div></div></div></blockquote><div><br class=""></div><div>Thanks for the detailed example! It helped.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; 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;"><div class="">So nexting through 'func()' would result in you jumping off to where "Allocator()" was written, then jumping back to 'func()’.</div></div></div></blockquote><blockquote type="cite" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; 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;"><div class="">(you can try commenting out the code - refactored in r228589 - and debugging some STL code)<br class=""></div></div></blockquote><div><br class=""></div><div>Now I see where this is coming from. I wholeheartedly agree ‘next’ shouldn’t get you there. I was confused thinking that you changed what ‘step’ might do, but that didn’t make sense. Thanks for taking the time for the detailed answer.</div><div><br class=""></div><div>Fred</div></div></body></html>