Opened 6 months ago

Last modified 2 months ago

#8429 new feature request

GHC.Base.{breakpoint, breakpointCond} do nothing

Reported by: refold Owned by: iand675
Priority: normal Milestone: 7.10.1
Component: Compiler Version: 7.6.3
Keywords: Cc: simonmar, jkarni@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets: 1377

Description

The GHC.Exts module exports functions breakpoint and breakpointCond. Right now they are no-ops, but apparently at some point in the past could be used to set breakpoints programmatically. From my reading of the source code, this feature was removed (either accidentally or on purpose) when the implementation of breakpoints was reworked.

Relevant commits:

Initially reported here.

Change History (9)

comment:2 Changed 6 months ago by simonpj

  • Cc simonmar added

Adding Simon M in cc, who was involved in adding breakpoint support, and committed the last of the three patches above with title "Re-working of the breakpoint support".

Simon

comment:3 follow-up: Changed 6 months ago by simonmar

Yes, it looks like all of GHC.Exts.{breakpoint,breakpointCond,Opaque} are dead code, as are these in PrelNames:

breakpointName    = varQual gHC_BASE (fsLit "breakpoint") breakpointIdKey
breakpointCondName= varQual gHC_BASE (fsLit "breakpointCond") breakpointCondIdKey
breakpointAutoName= varQual gHC_BASE (fsLit "breakpointAuto") breakpointAutoIdKey
opaqueTyConName   = tcQual  gHC_BASE (fsLit "Opaque")   opaqueTyConKey

Would someone like to go ahead and remove them?

comment:4 in reply to: ↑ 3 ; follow-up: Changed 6 months ago by refold

Replying to simonmar:

Would someone like to go ahead and remove them?

Would it be possible to make them work again? I'm willing to write a patch if someone gives me advice on where to start.

comment:5 in reply to: ↑ 4 Changed 6 months ago by ntc2

Replying to refold:

Replying to simonmar:

Would someone like to go ahead and remove them?

Would it be possible to make them work again? I'm willing to write a patch if someone gives me advice on where to start.

That would be great! I've summarized some workarounds here, but they're not very good.

comment:6 follow-up: Changed 6 months ago by simonmar

  • Milestone set to 7.10.1
  • Type changed from bug to feature request

To make them work, you would need to treat them as magic identifiers that get recognised by the desugarer and replaced with actual breakpoints. This probably wouldn't be too hard. The module that inserts breakpoints is compiler/deSugar/Coverage.hs, and what we want to do is something similar to the way that {-# SCC #-} is handled, in compiler/deSugar/DsExpr.lhs.

comment:7 in reply to: ↑ 6 Changed 6 months ago by refold

Replying to simonmar:

Thanks, will try to implement this.

comment:8 Changed 4 months ago by iand675

  • Owner set to iand675

comment:9 Changed 2 months ago by jkarni

  • Cc jkarni@… added
Note: See TracTickets for help on using tickets.