<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — Problem with Simply Fortran 2 Debugger]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=229&amp;type=atom" />
	<updated>2013-08-03T22:20:04Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=229</id>
		<entry>
			<title type="html"><![CDATA[Re: Problem with Simply Fortran 2 Debugger]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=903#p903" />
			<content type="html"><![CDATA[<p>Jeff,</p><p>Thank you -- I look forward to the update.</p><p>When the function/subroutine is a system one then the warning of missing source should be skipped if possible. Also a step in should be treated as a step over (or you can immediately step out as you say).</p><p>One thing I have just found out is that if I add -O0 to the compiler options, I don&#039;t get this error as often (just occassionally).</p><p>Perhaps -O0 should be set whenever &quot;Debug&quot; is ticked and the options list is empty.</p><p>Since &quot;Debug&quot; is ticked by default and the options list is empty on new projects, this means the default optimization would also be -O0.</p><p>Of course, the user would still be free to debug at level 1 or 2 or whatever, but they would have to manually edit the options to do that.</p>]]></content>
			<author>
				<name><![CDATA[davidb]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3463</uri>
			</author>
			<updated>2013-08-03T22:20:04Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=903#p903</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem with Simply Fortran 2 Debugger]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=901#p901" />
			<content type="html"><![CDATA[<p>Stepping <em>over</em> code using your example, I don&#039;t seem to have any problem.&nbsp; However, when I step <em>in</em> rather than step <em>over</em>, I do get the error popup you&#039;re seeing.&nbsp; However, all is not lost.&nbsp; You should be able to go to the debugger Stack view to see that you&#039;ve entered <strong>__powidf2</strong>, a function in the C runtime library indicating you&#039;re raising a float to an integer power.&nbsp; If you were to step <em>out</em> at that point, you should return to the calling function just fine.</p><p>You are, however, completely right in that the system should step over when it can&#039;t find a file.&nbsp; I&#039;ll proceed with changing the logic such that, if a file cannot be found, it will still display a warning (maybe check first if it&#039;s a runtime library function) and immediately step out of the function back to the caller.</p><p>I would assume that it doesn&#039;t happen on a square call because the compiler has optimized it to a simple multiply operation.&nbsp; There might be some advantage to calling the runtime function when you get to cubes or higher.&nbsp; Such are the decisions that compilers often secretly make.</p><p>Just for your own information, the debugger is looking for something in &quot;C:\workspace&quot; because the compiler was originally built in said directory.&nbsp; Our build server constructs GCC that directory when compiling itself.&nbsp; GCC and GNU Fortran, however, retain memories of where they were built originally, and the library is telling the debugger that its source file is still in the build server&#039;s directory.&nbsp; I find this property of GCC frustrating, especially since there were an assortment of issues when Simply Fortran switched to 64-bit.&nbsp; Specifically, it was previously being built on an F: drive on the build server.&nbsp; On certain systems, it was looking for F: and announcing odd errors on computers where F: was or had been a drive at some point. </p><p>I&#039;m working on a few minor fixes, so I&#039;ll throw a fix for what you&#039;ve described into the next build.&nbsp; It should be available on Monday at the latest.&nbsp; Thanks for your patience and the report of the error.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2013-08-03T20:12:30Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=901#p901</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem with Simply Fortran 2 Debugger]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=900#p900" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>JohnWasilewski wrote:</cite><blockquote><p>Hope Jeff and you can solve it.<br />J.</p></blockquote></div><p>Well I am hoping that Jeff will solve it. I would like to purchase a licence for SF2 but this is such a serious issue it is putting me off to be honest.</p><p>When I debug these using the Insight debugger in SF1.45 the debugger opens an assembly window at this point. I don&#039;t think gfortran evaluates x**3 as just x*x*x but calls a library routine.</p><p>There isn&#039;t a problem with x**2.</p><p>One possible issue is that the new debugger doesn&#039;t show assembly listings in such cases. I would have through that &quot;stepping in&quot; on a system routine whould just do a &quot;step over&quot; but apparently not.</p><p>Can you try the last code I posted to see if the error is repeatable.</p>]]></content>
			<author>
				<name><![CDATA[davidb]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3463</uri>
			</author>
			<updated>2013-08-03T19:51:10Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=900#p900</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem with Simply Fortran 2 Debugger]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=899#p899" />
			<content type="html"><![CDATA[<p>The error even occurs with this code:</p><div class="codebox"><pre><code>program anon

   integer, parameter :: dp = kind(1.0d0)

   real(dp) :: x, f

   x = 0.2_dp
   f = x**3

   print *, f

end program anon</code></pre></div>]]></content>
			<author>
				<name><![CDATA[davidb]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3463</uri>
			</author>
			<updated>2013-08-03T19:49:05Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=899#p899</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem with Simply Fortran 2 Debugger]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=897#p897" />
			<content type="html"><![CDATA[<p>Further suggestion for a temp work-around:</p><p>Write a function for cubing stuff.<br />Use search-and-replace.</p><p>A nuisance, though.<br />Hope Jeff and you can solve it.<br />-- <br />J.</p>]]></content>
			<author>
				<name><![CDATA[JohnWasilewski]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=102</uri>
			</author>
			<updated>2013-08-03T19:30:53Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=897#p897</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem with Simply Fortran 2 Debugger]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=896#p896" />
			<content type="html"><![CDATA[<p>John, I know I can re-factor this line, and then I can step over it. </p><p>But my code has a number of places where this occurs which are not so easy to dismiss.</p><p>Jeff, </p><p>Below is a complete program where I get the same error message. Occasionally I can step over the offending line, but in these cases the program doesn&#039;t terminate properly and I am unable to run it again without quitting from Simply Fortran 2, deleting the executable, re-running Simply Fortran 2 and re-building.</p><p>Most times, when I press F9 on the line which assigns to f I get the error message posted earlier.</p><p>What puzzles me is not why its looking for this file, but why its looking in c:\workspace when I don&#039;t have such a directory on this PC.</p><p>I am running on 32 bit Windows Vista.</p><div class="codebox"><pre><code>program anon

   integer, parameter :: dp = kind(1.0d0)

   real(dp) :: x, f

   type packet_t
      real(dp) :: a
      real(dp) :: b
      real(dp) :: c
   end type packet_t

   type (packet_t) :: p

   p = packet_t(1.0_dp, 2.0_dp, 3.0_dp)

   x = 0.2_dp
   f = p%a*x**3

   print *, f

end program anon</code></pre></div>]]></content>
			<author>
				<name><![CDATA[davidb]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3463</uri>
			</author>
			<updated>2013-08-03T19:19:11Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=896#p896</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem with Simply Fortran 2 Debugger]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=895#p895" />
			<content type="html"><![CDATA[<p>Well, I don&#039;t have a direct answer for you at the moment.&nbsp; The error you&#039;re receiving is because the debugger is attempting to display a location in the C runtime library (which the Fortran code calls into from time to time).&nbsp; The error itself doesn&#039;t overly concern me because it can&#039;t find a source file.&nbsp; I&#039;m not exactly sure why the debugger would want to look for such a file, though.</p><p>The issue is two-fold: why is the debugger requesting that file, and why does the debugging session freeze up afterwards.&nbsp; I&#039;ll try to debug what&#039;s occurring on my end.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2013-08-03T17:13:52Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=895#p895</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem with Simply Fortran 2 Debugger]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=892#p892" />
			<content type="html"><![CDATA[<p>I&#039;m sure Jeff will give you a swift answer as soon as he sees your post but how about making a temporary substitution of the following, just so that you can continue evaluation whilst waiting for Jeff&#039;s response?</p><p>79&nbsp; &nbsp; &nbsp; &nbsp;fun = (packet%a * X&nbsp; &nbsp;+&nbsp; &nbsp;packet%b) *X *X&nbsp; &nbsp;+&nbsp; &nbsp;packet%c</p><br /><p>--- <br />John</p>]]></content>
			<author>
				<name><![CDATA[JohnWasilewski]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=102</uri>
			</author>
			<updated>2013-08-03T14:42:59Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=892#p892</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Problem with Simply Fortran 2 Debugger]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=891#p891" />
			<content type="html"><![CDATA[<p>I downloaded SF 2 alongside my registered 1.45 to evaluate it.</p><p>I am particularly keen to see the improved debugging facilities and am certainly looking to upgrade to SF 2 as soon as I can because the Insight debugger never worked properly for me.</p><p>However, I am having problems debugging my code with SF 2. I get the following error on one particular line, line 79. Although the box heading says this is a warning, clicking OK doesn&#039;t allow the debugging session to continue.</p><p>I have posted the code separately since the error box obscures some of it. However, it might not mean much out of context.</p><p>The error seems to always occur when I step over a line containing the Fortran exponentiation operator **.</p><p>Obviously I would like this fixing before I could upgrade. As it is I can&#039;t make much progress evaluating SF2 and its debugger because I am stuck at this point.</p><p><span class="postimg"><img src="http://i41.tinypic.com/259cr50.jpg" alt="error" /></span></p><div class="codebox"><pre><code>   subroutine solve_func1(x,data, fun, der)
      use kinds, only: DP

      real (kind=dp), intent (in) :: x
      integer, intent(in):: data(:)
      real (kind=dp), intent(out) :: fun, der

      type (packet_ptr_type) :: packet_ptr
      type (packet_type), pointer :: packet

      packet_ptr = transfer(data, packet_ptr)
      packet =&gt; packet_ptr%p

      fun = packet%a*x**3 + packet%b*x**2 + packet%c
      der = 3.0_DP*packet%a*x**2 + 2.0_DP*packet%b*x

   end subroutine solve_func1</code></pre></div>]]></content>
			<author>
				<name><![CDATA[davidb]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3463</uri>
			</author>
			<updated>2013-08-03T08:31:25Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=891#p891</id>
		</entry>
</feed>
