<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi GHCi users,<br>
<br>
The example is at the end of this email.<br>
I think it is a bug that the second part (:continue) of the command
`:cmd return "rv\n:continue"' is executed in a different context than
the first part (rv (request for the value of rv variable)). Notice that
we did not stop at breakpoint 1 (line 7). Well, the stop happened but
it continued immediately because of queued :continue command. But the
command was queued in the context of breakpoint 0 and not breakpoint 1.<br>
Is it a feature or a bug?<br>
If it is a feature it is not good for scripting breakpoints :-/ ... and
I do not see an easy way to work around it.<br>
<br>
Thanks,<br>
&nbsp; Peter.<br>
<br>
PS: I owe responses to some of you on this list, but I must check some
docs or do some tests first so I hope I'll answer during weekend at
worst.<br>
<br>
<br>
<tt><b>status:0 peter@metod [716] ~/tmp<br>
%</b> grep -n '^' b.hs<br>
1:fn :: Int -&gt; Int<br>
2:fn x =<br>
3:&nbsp; let rv = add x 1 in<br>
4:&nbsp; rv<br>
5:<br>
6:add :: Int -&gt; Int -&gt; Int<br>
7:add a b = a + b<br>
<b>status:0 peter@metod [717] ~/tmp<br>
%</b> ghci b.hs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>
GHCi, version 6.10.1: <a class="moz-txt-link-freetext" href="http://www.haskell.org/ghc/">http://www.haskell.org/ghc/</a>&nbsp; :? for help<br>
Loading package ghc-prim ... linking ... done.<br>
Loading package integer ... linking ... done.<br>
Loading package base ... linking ... done.<br>
[1 of 1] Compiling Main&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( b.hs, interpreted )<br>
Ok, modules loaded: Main.<br>
*Main&gt; :set stop :list<br>
*Main&gt; :break 4<br>
Breakpoint 0 activated at b.hs:4:2-3<br>
*Main&gt; :break 7<br>
Breakpoint 1 activated at b.hs:7:0-14<br>
*Main&gt; fn 100<br>
Stopped at b.hs:4:2-3<br>
_result :: Int = _<br>
rv :: Int = _<br>
3&nbsp;&nbsp;&nbsp; let rv = add x 1 in<br>
4&nbsp;&nbsp;&nbsp; <b>rv</b><br>
5 &nbsp;<br>
[b.hs:4:2-3] *Main&gt; :cmd return "rv\n:continue"<br>
Stopped at b.hs:7:0-14<br>
_result :: Int = _<br>
6&nbsp; add :: Int -&gt; Int -&gt; Int<br>
7&nbsp; <b>add a b = a + b</b><br>
8 &nbsp;<br>
101<br>
[b.hs:4:2-3] *Main&gt; :continue<br>
101<br>
*Main&gt; :q<br>
Leaving GHCi.<br>
<b>status:0 peter@metod [718] ~/tmp<br>
% </b><br>
</tt><br>
</body>
</html>