Opened 11 years ago

Closed 9 years ago

Last modified 9 years ago

#911 closed feature request (fixed)

Better information about the location of exceptions

Reported by: simonmar Owned by:
Priority: normal Milestone:
Component: Runtime System Version: 6.4.2
Keywords: Cc: frederik@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

From Frederik Eaton, on glasgow-haskell-bugs:

I think it would be a good idea to print instructions for getting more information when a program fails with a pattern match or other error.

Rather than

foo: Prelude.undefined

it should say

foo: Prelude.undefined
For information about the location of this error, recompile with "-prof -auto-all" and run with "+RTS -xc -RTS"

Also, maybe these instructions aren't enough? When I do the above, it just prints

<GHC.Err.CAF><GHC.Err.CAF><GHC.Err.CAF><GHC.Err.CAF>foo: Prelude.undefined

which isn't what I was looking for... Am I forgetting an option or something?

Change History (5)

comment:1 Changed 11 years ago by ekarttun

The new ghci debugging stuff could help with locating the error.

The user's guide should probably have a note on locating failed pattern matches.

comment:2 Changed 10 years ago by igloo

Milestone: _|_

comment:3 Changed 9 years ago by simonmar

Resolution: fixed
Status: newclosed

The User's Guide has a section on "Debugging Exceptions".

I also improved the entry in the FAQ about "head []" to point to the relevant part of the docs.

comment:4 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:5 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple
Note: See TracTickets for help on using tickets.