<?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 unable to display array contained in derived type in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Debugger-unable-to-display-array-contained-in-derived-type/m-p/1083927#M80271</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I did post this some time ago on the Intel Visual Fortran forum, but I go&amp;nbsp;no answer so far. I hope I will have more success on this forum.&lt;/P&gt;

&lt;P&gt;Since months debugging has been a hell because of a bug in the Intel Compiler and/or debugger integration: basically most (but not all) arrays are displayed with the length 0 in the debugger, and their content cannot be shown. The bug happens with allocatable arrays, pointers or static arrays. Of course it makes debugging pretty impossible, and I have&amp;nbsp;to use WRITE statements... For instance the debugger shows&amp;nbsp;me this:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2016-09-09%2009-27-40.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/9122i620975831B38C7AE/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="2016-09-09%2009-27-40.png" alt="2016-09-09%2009-27-40.png" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;whereas the array ARR has the size 2!&lt;/P&gt;

&lt;P&gt;I finally succeeded to reproduce the bug with a simple program:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;PROGRAM Console
&amp;nbsp; USE m1
&amp;nbsp; IMPLICIT NONE
&amp;nbsp; TYPE(TypeBase) :: ObjectBase
&amp;nbsp; TYPE(TypeExt)&amp;nbsp; :: ObjectExt
&amp;nbsp; WRITE(*,*) 'Set a breakpoint here =&amp;gt; debugger shows ObjectBase%Arr with length 0!!!'
END PROGRAM

&lt;/PRE&gt;

&lt;P&gt;and the module M1 is:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;MODULE M1
&amp;nbsp; IMPLICIT NONE
&amp;nbsp; PRIVATE
&amp;nbsp; TYPE, PUBLIC :: TypeBase
&amp;nbsp;&amp;nbsp;&amp;nbsp; REAL :: Arr(2) = 0.0
&amp;nbsp; CONTAINS
&amp;nbsp;&amp;nbsp;&amp;nbsp; PROCEDURE :: AFunction
&amp;nbsp; END TYPE
&amp;nbsp; TYPE, PUBLIC, EXTENDS(TypeBase) :: TypeExt
&amp;nbsp; END TYPE
CONTAINS
FUNCTION AFunction(this) RESULT(Res)
&amp;nbsp; CLASS(TypeBase), INTENT(IN) :: this
&amp;nbsp; TYPE(TypeBase)&amp;nbsp; :: Res
END FUNCTION
END MODULE 
&lt;/PRE&gt;

&lt;P&gt;As you can see it needs a tricky combination:&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;If you comment the declaration of the variable ObjectExt in the program, it works as expected (debugger displays correct length and content)&lt;/LI&gt;
	&lt;LI&gt;If the function AFunction is not type bound anymore, it works as expected&lt;/LI&gt;
	&lt;LI&gt;If AFunction is made a subroutine, it works as expected&lt;/LI&gt;
	&lt;LI&gt;If one removes the type extension, it works as expected&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;So it seems that using a combination of type-bound functions&amp;nbsp;and type extension prevents the debugger (or the Fortran expression evaluator FEE)&amp;nbsp;to show the length and content of arrays&amp;nbsp;contained in derived types. I tried to play with debugger options in Visual Studio, and also with compiler settings, without success.&lt;/P&gt;

&lt;P&gt;I am using Visual Studio 2015. I had the problem with the VS 2015 Update 2, and now Update 3, and with both Intel Visual Fortran 2016 and 2017.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Sep 2016 12:55:49 GMT</pubDate>
    <dc:creator>Hervé_Martin</dc:creator>
    <dc:date>2016-09-20T12:55:49Z</dc:date>
    <item>
      <title>Debugger unable to display array contained in derived type</title>
      <link>https://community.intel.com/t5/Software-Archive/Debugger-unable-to-display-array-contained-in-derived-type/m-p/1083927#M80271</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I did post this some time ago on the Intel Visual Fortran forum, but I go&amp;nbsp;no answer so far. I hope I will have more success on this forum.&lt;/P&gt;

&lt;P&gt;Since months debugging has been a hell because of a bug in the Intel Compiler and/or debugger integration: basically most (but not all) arrays are displayed with the length 0 in the debugger, and their content cannot be shown. The bug happens with allocatable arrays, pointers or static arrays. Of course it makes debugging pretty impossible, and I have&amp;nbsp;to use WRITE statements... For instance the debugger shows&amp;nbsp;me this:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2016-09-09%2009-27-40.png"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/9122i620975831B38C7AE/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="2016-09-09%2009-27-40.png" alt="2016-09-09%2009-27-40.png" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;whereas the array ARR has the size 2!&lt;/P&gt;

&lt;P&gt;I finally succeeded to reproduce the bug with a simple program:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;PROGRAM Console
&amp;nbsp; USE m1
&amp;nbsp; IMPLICIT NONE
&amp;nbsp; TYPE(TypeBase) :: ObjectBase
&amp;nbsp; TYPE(TypeExt)&amp;nbsp; :: ObjectExt
&amp;nbsp; WRITE(*,*) 'Set a breakpoint here =&amp;gt; debugger shows ObjectBase%Arr with length 0!!!'
END PROGRAM

&lt;/PRE&gt;

&lt;P&gt;and the module M1 is:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;MODULE M1
&amp;nbsp; IMPLICIT NONE
&amp;nbsp; PRIVATE
&amp;nbsp; TYPE, PUBLIC :: TypeBase
&amp;nbsp;&amp;nbsp;&amp;nbsp; REAL :: Arr(2) = 0.0
&amp;nbsp; CONTAINS
&amp;nbsp;&amp;nbsp;&amp;nbsp; PROCEDURE :: AFunction
&amp;nbsp; END TYPE
&amp;nbsp; TYPE, PUBLIC, EXTENDS(TypeBase) :: TypeExt
&amp;nbsp; END TYPE
CONTAINS
FUNCTION AFunction(this) RESULT(Res)
&amp;nbsp; CLASS(TypeBase), INTENT(IN) :: this
&amp;nbsp; TYPE(TypeBase)&amp;nbsp; :: Res
END FUNCTION
END MODULE 
&lt;/PRE&gt;

&lt;P&gt;As you can see it needs a tricky combination:&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;If you comment the declaration of the variable ObjectExt in the program, it works as expected (debugger displays correct length and content)&lt;/LI&gt;
	&lt;LI&gt;If the function AFunction is not type bound anymore, it works as expected&lt;/LI&gt;
	&lt;LI&gt;If AFunction is made a subroutine, it works as expected&lt;/LI&gt;
	&lt;LI&gt;If one removes the type extension, it works as expected&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;So it seems that using a combination of type-bound functions&amp;nbsp;and type extension prevents the debugger (or the Fortran expression evaluator FEE)&amp;nbsp;to show the length and content of arrays&amp;nbsp;contained in derived types. I tried to play with debugger options in Visual Studio, and also with compiler settings, without success.&lt;/P&gt;

&lt;P&gt;I am using Visual Studio 2015. I had the problem with the VS 2015 Update 2, and now Update 3, and with both Intel Visual Fortran 2016 and 2017.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2016 12:55:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Debugger-unable-to-display-array-contained-in-derived-type/m-p/1083927#M80271</guid>
      <dc:creator>Hervé_Martin</dc:creator>
      <dc:date>2016-09-20T12:55:49Z</dc:date>
    </item>
    <item>
      <title>Hello,</title>
      <link>https://community.intel.com/t5/Software-Archive/Debugger-unable-to-display-array-contained-in-derived-type/m-p/1083928#M80272</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;at first glance it looked like you're right here since you use the debugger. So I checked with our FEE engineers and they confirmed the issue. However, it's compiler related since the debug information seems to be faulty in that exact case.&lt;/P&gt;

&lt;P&gt;As a result I've filed an internal ticket (DPD200588188) to improve the debug information generation of the Intel Fortran Compiler. As soon as this is fixed, I'll let you know.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;

&lt;P&gt;Georg Zitzlsberger&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 10:04:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Debugger-unable-to-display-array-contained-in-derived-type/m-p/1083928#M80272</guid>
      <dc:creator>Georg_Z_Intel</dc:creator>
      <dc:date>2016-09-21T10:04:20Z</dc:date>
    </item>
    <item>
      <title>Hi Georg,</title>
      <link>https://community.intel.com/t5/Software-Archive/Debugger-unable-to-display-array-contained-in-derived-type/m-p/1083929#M80273</link>
      <description>&lt;P&gt;Hi Georg,&lt;/P&gt;

&lt;P&gt;That's great news. I hope it will be fixed soon, at the moment debugging is almost impossible...&lt;/P&gt;

&lt;P&gt;Best regards&lt;/P&gt;

&lt;P&gt;Hervé&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 06:29:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Debugger-unable-to-display-array-contained-in-derived-type/m-p/1083929#M80273</guid>
      <dc:creator>Hervé_Martin</dc:creator>
      <dc:date>2016-09-22T06:29:45Z</dc:date>
    </item>
  </channel>
</rss>

