<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Debugger does not show internal lambda's variables. in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Debugger-does-not-show-internal-lambda-s-variables/m-p/1327057#M1671</link>
    <description>&lt;P&gt;Program compiled by Intel oneApi DPC++ compiler, integrated in Visual Studio IDE.&lt;BR /&gt;Visual Studio debugger does not show values of internal variables in lambda functions.&lt;BR /&gt;It is not critical error, but annoing...&lt;/P&gt;
&lt;P&gt;My system is: Windows 20h2 + VisualStudio 16.11.5.+ Intel oneApi DPC++ (from w_BaseKit_p_2021.4.0.3421_offline)&lt;BR /&gt;Create DPCPPConsoleApplication, put following program:&lt;/P&gt;
&lt;P&gt;//CppCon 2015: Arthur O'Dwyer “Lambdas from First Principles: A Whirlwind Tour of C++"” Puzzle #3&lt;BR /&gt;//&lt;A href="https://youtu.be/WXeu4fj3zOs?t=1985" target="_blank"&gt;https://youtu.be/WXeu4fj3zOs?t=1985&lt;/A&gt;&lt;BR /&gt;#include &amp;lt;iostream&amp;gt;&lt;BR /&gt;auto make_kitten(int c) {&lt;BR /&gt;static int a = 0;&lt;BR /&gt;return [=](int d) {&lt;BR /&gt;static int b = 0;&lt;BR /&gt;return (a++) + (b++) + c + d;// BREAKPOINT&lt;BR /&gt;};&lt;BR /&gt;}&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;auto k1 = make_kitten(1), k2 = make_kitten(2);&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "(21) k1(20)=" &amp;lt;&amp;lt; k1(20) &amp;lt;&amp;lt; " (33) k1(30)=" &amp;lt;&amp;lt; k1(30) &amp;lt;&amp;lt; std::endl;&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "(26) k2(20)=" &amp;lt;&amp;lt; k2(20) &amp;lt;&amp;lt; " (38) k2(30)=" &amp;lt;&amp;lt; k2(30) &amp;lt;&amp;lt; std::endl;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Make breakpoint at line "return (a++) + (b++) + c + d;// BREAKPOINT" and start program.&lt;BR /&gt;Reaching the breakpoint, the debugger shows correctly only the variable "с". Other variables "a", "b" and "d" are marked as "identifier "a" ("b", "d") is undefined." &lt;BR /&gt;But after switching compiler from Intel to Microsoft, all variables "a", "b", "c" and "d" are visible correctly in debugger. (VisualStudio menu - Project - Intel Compiler - Use Visual C++).&lt;BR /&gt;Then switch back to Intel compiler, rebuild solution, run program till the breakpoint - again three variables a,b and d are "undefined".&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This example, shown by Arthur O'Dwyer, was chosen by me because each variable was created in a different way:&lt;BR /&gt;"a" - static outside the lambda&lt;BR /&gt;"b" - static inside the lambda &lt;BR /&gt;"c" - captured by value&lt;BR /&gt;"d" - the lambda's own argument&lt;/P&gt;
&lt;P&gt;To get more info I put following diagnostics code before the breakpoint line "return (a++) + (b++) + c + d;// BREAKPOINT":&lt;BR /&gt;#if defined(__INTEL_LLVM_COMPILER)&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "Intel compiler=" &amp;lt;&amp;lt; __INTEL_LLVM_COMPILER &amp;lt;&amp;lt; std::endl;;&lt;BR /&gt;puts(__PRETTY_FUNCTION__); puts(__FUNCDNAME__);&lt;BR /&gt;#else&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "MS compiler=" &amp;lt;&amp;lt; _MSC_FULL_VER &amp;lt;&amp;lt; std::endl;;&lt;BR /&gt;puts(__FUNCSIG__); puts(__FUNCDNAME__);&lt;BR /&gt;#endif&lt;/P&gt;
&lt;P&gt;Intel compiler prints diagnostics:&lt;BR /&gt;Intel compiler=20210400&lt;BR /&gt;auto make_kitten(int)::(anonymous class)::operator()(int) const&lt;BR /&gt;??R&amp;lt;lambda_0&amp;gt;@?0??make_kitten@@YA?A?&amp;lt;auto&amp;gt;@@H@Z@QEBA?A?2@H@Z&lt;/P&gt;
&lt;P&gt;Visual C++ compiler prints:&lt;BR /&gt;MS compiler=192930136&lt;BR /&gt;auto __cdecl make_kitten::&amp;lt;lambda_be3af9280098e242fa98aeb8533f2dca&amp;gt;::operator ()(int) const&lt;BR /&gt;??R&amp;lt;lambda_be3af9280098e242fa98aeb8533f2dca&amp;gt;@@QEBA@H@Z&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Nov 2021 23:16:49 GMT</pubDate>
    <dc:creator>SergOvcharenko</dc:creator>
    <dc:date>2021-11-03T23:16:49Z</dc:date>
    <item>
      <title>Debugger does not show internal lambda's variables.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Debugger-does-not-show-internal-lambda-s-variables/m-p/1327057#M1671</link>
      <description>&lt;P&gt;Program compiled by Intel oneApi DPC++ compiler, integrated in Visual Studio IDE.&lt;BR /&gt;Visual Studio debugger does not show values of internal variables in lambda functions.&lt;BR /&gt;It is not critical error, but annoing...&lt;/P&gt;
&lt;P&gt;My system is: Windows 20h2 + VisualStudio 16.11.5.+ Intel oneApi DPC++ (from w_BaseKit_p_2021.4.0.3421_offline)&lt;BR /&gt;Create DPCPPConsoleApplication, put following program:&lt;/P&gt;
&lt;P&gt;//CppCon 2015: Arthur O'Dwyer “Lambdas from First Principles: A Whirlwind Tour of C++"” Puzzle #3&lt;BR /&gt;//&lt;A href="https://youtu.be/WXeu4fj3zOs?t=1985" target="_blank"&gt;https://youtu.be/WXeu4fj3zOs?t=1985&lt;/A&gt;&lt;BR /&gt;#include &amp;lt;iostream&amp;gt;&lt;BR /&gt;auto make_kitten(int c) {&lt;BR /&gt;static int a = 0;&lt;BR /&gt;return [=](int d) {&lt;BR /&gt;static int b = 0;&lt;BR /&gt;return (a++) + (b++) + c + d;// BREAKPOINT&lt;BR /&gt;};&lt;BR /&gt;}&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;auto k1 = make_kitten(1), k2 = make_kitten(2);&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "(21) k1(20)=" &amp;lt;&amp;lt; k1(20) &amp;lt;&amp;lt; " (33) k1(30)=" &amp;lt;&amp;lt; k1(30) &amp;lt;&amp;lt; std::endl;&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "(26) k2(20)=" &amp;lt;&amp;lt; k2(20) &amp;lt;&amp;lt; " (38) k2(30)=" &amp;lt;&amp;lt; k2(30) &amp;lt;&amp;lt; std::endl;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Make breakpoint at line "return (a++) + (b++) + c + d;// BREAKPOINT" and start program.&lt;BR /&gt;Reaching the breakpoint, the debugger shows correctly only the variable "с". Other variables "a", "b" and "d" are marked as "identifier "a" ("b", "d") is undefined." &lt;BR /&gt;But after switching compiler from Intel to Microsoft, all variables "a", "b", "c" and "d" are visible correctly in debugger. (VisualStudio menu - Project - Intel Compiler - Use Visual C++).&lt;BR /&gt;Then switch back to Intel compiler, rebuild solution, run program till the breakpoint - again three variables a,b and d are "undefined".&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This example, shown by Arthur O'Dwyer, was chosen by me because each variable was created in a different way:&lt;BR /&gt;"a" - static outside the lambda&lt;BR /&gt;"b" - static inside the lambda &lt;BR /&gt;"c" - captured by value&lt;BR /&gt;"d" - the lambda's own argument&lt;/P&gt;
&lt;P&gt;To get more info I put following diagnostics code before the breakpoint line "return (a++) + (b++) + c + d;// BREAKPOINT":&lt;BR /&gt;#if defined(__INTEL_LLVM_COMPILER)&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "Intel compiler=" &amp;lt;&amp;lt; __INTEL_LLVM_COMPILER &amp;lt;&amp;lt; std::endl;;&lt;BR /&gt;puts(__PRETTY_FUNCTION__); puts(__FUNCDNAME__);&lt;BR /&gt;#else&lt;BR /&gt;std::cout &amp;lt;&amp;lt; "MS compiler=" &amp;lt;&amp;lt; _MSC_FULL_VER &amp;lt;&amp;lt; std::endl;;&lt;BR /&gt;puts(__FUNCSIG__); puts(__FUNCDNAME__);&lt;BR /&gt;#endif&lt;/P&gt;
&lt;P&gt;Intel compiler prints diagnostics:&lt;BR /&gt;Intel compiler=20210400&lt;BR /&gt;auto make_kitten(int)::(anonymous class)::operator()(int) const&lt;BR /&gt;??R&amp;lt;lambda_0&amp;gt;@?0??make_kitten@@YA?A?&amp;lt;auto&amp;gt;@@H@Z@QEBA?A?2@H@Z&lt;/P&gt;
&lt;P&gt;Visual C++ compiler prints:&lt;BR /&gt;MS compiler=192930136&lt;BR /&gt;auto __cdecl make_kitten::&amp;lt;lambda_be3af9280098e242fa98aeb8533f2dca&amp;gt;::operator ()(int) const&lt;BR /&gt;??R&amp;lt;lambda_be3af9280098e242fa98aeb8533f2dca&amp;gt;@@QEBA@H@Z&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 23:16:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Debugger-does-not-show-internal-lambda-s-variables/m-p/1327057#M1671</guid>
      <dc:creator>SergOvcharenko</dc:creator>
      <dc:date>2021-11-03T23:16:49Z</dc:date>
    </item>
    <item>
      <title>Re:Debugger does not show internal lambda's variables.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Debugger-does-not-show-internal-lambda-s-variables/m-p/1327515#M1672</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for reaching out to us.&lt;/P&gt;&lt;P&gt;We are also able to reproduce the issue from our end. &lt;/P&gt;&lt;P&gt;We are looking into it. We will get back to you soon.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Noorjahan&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Nov 2021 11:43:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Debugger-does-not-show-internal-lambda-s-variables/m-p/1327515#M1672</guid>
      <dc:creator>NoorjahanSk_Intel</dc:creator>
      <dc:date>2021-11-05T11:43:34Z</dc:date>
    </item>
    <item>
      <title>Re:Debugger does not show internal lambda's variables.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Debugger-does-not-show-internal-lambda-s-variables/m-p/1328362#M1690</link>
      <description>&lt;P&gt;This issue has been escalated to our developers. We'll work on it internally and come back with update. &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Nov 2021 07:32:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Debugger-does-not-show-internal-lambda-s-variables/m-p/1328362#M1690</guid>
      <dc:creator>Alex_Y_Intel</dc:creator>
      <dc:date>2021-11-09T07:32:09Z</dc:date>
    </item>
  </channel>
</rss>

