Debugging

Help
2012-05-05
2012-12-06
  • Graham Berks
    Graham Berks
    2012-05-05

    Hi, new to haskell.

    Trying to set a breakpoint and debug a file but i'm not really clear on what i'm meant to be doing.

    Any instructions around ? Or is is it more learning ghci ?

    Thanks

     
  • Graham Berks
    Graham Berks
    2012-05-06

    Tried adding to other modules in the cabal file with no luck.

    When I attempt to debug from main I get

    Prelude Main> module 'Chapter1' is not interpreted; try ':add *Chapter1' first
    Prelude Main> module 'Chapter1' is not interpreted; try ':add *Chapter1' first

    With the breakpoints set in Chapter1, but I'm obviously doing something wrong.
    Do an explicit add in ghci make no diff.

     
  • JP Moresmau
    JP Moresmau
    2012-05-06

    First get ghci to run your project without error. If everything compiles, you should be able to launch your top level module from GHCi from inside EclipseFP, and see all the modules loading. Then you can set breakpoints on files. Is Chapter1 references in the cabal file?

     
  • Graham Berks
    Graham Berks
    2012-05-06

    Thanks, stuck some info in https://gist.github.com/2624358

    I did manage to get it to work once in the debugger but can't really replicate how I did it.

    As you can see from the gist it seems to ignore the debug ???

     
  • Graham Berks
    Graham Berks
    2012-05-06

    Actually it does work as expected if I directly invoke a function in Chapter1 with a breakpoint. But doesn't ifI invoke main.

     
  • Graham Berks
    Graham Berks
    2012-05-09

    Is this expected ? eg. not being able to run from an external function to the break point ?

    Thanks

     
  • JP Moresmau
    JP Moresmau
    2012-05-09

    No, it should work, it doesn't matter if you start a different function than the one you put breakpoints in.