Commit a050a0f8 authored by mnislaih's avatar mnislaih
Browse files

Add two new tests for the debuggger involving .boot modules

parent 1e8d4f86
......@@ -51,6 +51,7 @@ test('break018', normal, ghci_script, ['break018.script'])
test('break019', normal, ghci_script, ['break019.script'])
test('break020', normal, ghci_script, ['break020.script'])
test('break021', normal, ghci_script, ['break021.script'])
# continue with break024
test('dynbrk001', normal, ghci_script, ['dynbrk001.script'])
test('dynbrk002', normal, ghci_script, ['dynbrk002.script'])
......
module A where
import {-# SOURCE #-} B
a x = b x
\ No newline at end of file
module B where
import A
b x = x
\ No newline at end of file
module B where
b :: a -> a
\ No newline at end of file
TOP=../../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
# trac #1545: GHCi debugger doesn't work on an unregisterised compiler
def f(opts):
if config.unregisterised:
opts.skip = 1
setTestOpts(f)
setTestOpts(extra_run_opts('-ignore-dot-ghci'))
test('break022', normal, ghci_script, ['break022.script'])
-- We have this structure of modules:
-- A (imports B.boot)
-- B (imports A)
-- B.boot (imports A)
-- C (imports A and B)
-- And we load C, to debug some function in A which enters B.
-- But first we touch A, and reload. B.boot will be reloaded, but not B, which will end up with an empty modbreaks. When we :step into B, ghci will die with an out of bounds access in B's break array.
-- The effect we want is B.boot being reloaded while B is not.
:l C
:! touch A.hs
:r
:break a
a ()
:st
:st
:st -- here we step into B, and produce the exception
\ No newline at end of file
module B where
import A
b x = x
\ No newline at end of file
module B where
b :: a -> a
\ No newline at end of file
TOP=../../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
# trac #1545: GHCi debugger doesn't work on an unregisterised compiler
def f(opts):
if config.unregisterised:
opts.skip = 1
setTestOpts(f)
setTestOpts(extra_run_opts('-ignore-dot-ghci'))
test('break023', normal, ghci_script, ['break023.script'])
-- We have this structure of modules:
-- A (imports B.boot)
-- B (imports A)
-- B.boot (imports A)
-- C (imports A and B)
-- And we load C, to debug some function called b in B.
-- But first we touch A, and reload. B.boot will be reloaded, but not B, which will end up with an empty modbreaks. We can no longer set a breakpoint in B.b
-- The effect we want is B.boot being reloaded while B is not.
:l C
:break b -- it works ok at this point
:! touch A.hs
:r
:break b -- it does not work anymore
Breakpoint 0 activated at B.hs:5:0-6
Breakpoint 0 activated at B.hs:5:0-6
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment