Ticket #1400 (new bug)

Opened 1 year ago

Last modified 1 year ago

:set +r doesn't work for interpreted modules

Reported by: iampure@gmail.com Assigned to:
Priority: normal Milestone: 6.10 branch
Component: GHCi Version: 6.7
Severity: normal Keywords:
Cc: Difficulty: Moderate (1 day)
Test Case: Architecture: Unknown
Operating System: Unknown

Description

I expect

a = trace "a" 1 

and then evaluating a repeatedly to show: "a" 1

as a result. ghci seems to do this, but with larger programs this doesn't appear to happen.

I guess it's an implementation detail in that expressions don't "need" to be evaluated twice, but for debugging purposes it's vital that it does.

I want that the first run of an algorithm produces the same trace as any subsequent one. Especially when one uses the 6.7 debugger this is an issue. Essentially, I need to load another module first and then the module I am interested in and then set the breakpoints again. This is a UI nightmare.

The option +r "revert top-level expressions after each evaluation" seems to indicate that should do what I want, but it doesn't.

Change History

06/01/07 01:20:58 changed by simonmar

  • priority changed from high to normal.
  • difficulty changed from Unknown to Moderate (1 day).
  • summary changed from Incoherent cache behaviour ghci in combination with Debug.trace to :set +r doesn't work for interpreted modules.
  • component changed from Compiler to GHCi.
  • milestone set to 6.10.

:set +r is supposed to do what you want, but it has never worked for interpreted code, only compiled code (and of course, the debugger only works for interpreted code, so that doesn't really help). I've changed the subject of the bug to reflect this.