ghc.git
12 years agoAvoid segfault when ticky file argument is stderr
Tim Chevalier [Thu, 26 Apr 2007 19:18:57 +0000 (19:18 +0000)] 
Avoid segfault when ticky file argument is stderr

If you compiled a program with -ticky and ran it with:
./foo +RTS -rstderr -RTS
the result would be a segfault. This was because the RTS interprets stderr to
mean "use debugBelch to print out messages," and sets the ticky file pointer
to NULL as a result, but PrintTickyInfo (the function in Ticky.c that prints
out the ticky report) wasn't checking for NULL.

I changed PrintTickyInfo to check whether the ticky file pointer is NULL and
output to stderr if so.

Also removed an unused import from CodeOutput.lhs.

12 years agoDont tidy up tyvars after :print type reconstruction
Pepe Iborra [Thu, 26 Apr 2007 16:35:40 +0000 (16:35 +0000)] 
Dont tidy up tyvars after :print type reconstruction

I introduced a bug yesterday when I changed the way tidying up was performed.
As a result of tidying,  cvObtainTerm could be returning types
with regular tyvars inside, which never should.

But actually, it's better if we do not do the tidying up, in order to
keep the tyvar names from the environment.
New names will be introduced only when an existential is found, which
is not so common. In this case the user will see a funny name.
Is that really an issue?

12 years agofix scoping issues with mdo (test dynbrk004)
Simon Marlow [Thu, 26 Apr 2007 15:16:15 +0000 (15:16 +0000)] 
fix scoping issues with mdo (test dynbrk004)

12 years agoFormatting and minor changes in the ghci debugger section
Pepe Iborra [Thu, 26 Apr 2007 10:30:51 +0000 (10:30 +0000)] 
Formatting and minor changes in the ghci debugger section

12 years agoUpdate an example on the ghci debugger section
Pepe Iborra [Thu, 26 Apr 2007 10:30:14 +0000 (10:30 +0000)] 
Update an example on the ghci debugger section

12 years agoWe don't have -fdebugging anymore, and fine tuning is not really necessary now
Pepe Iborra [Thu, 26 Apr 2007 10:18:53 +0000 (10:18 +0000)] 
We don't have -fdebugging anymore, and fine tuning is not really necessary now

12 years agoNew section on debugging lambdas in the ghci user guide
Pepe Iborra [Thu, 26 Apr 2007 09:37:19 +0000 (09:37 +0000)] 
New section on debugging lambdas in the ghci user guide

12 years agoUnbreak the users_guide
Pepe Iborra [Thu, 26 Apr 2007 09:23:42 +0000 (09:23 +0000)] 
Unbreak the users_guide

12 years ago:force is not unsupported anymore
Pepe Iborra [Thu, 26 Apr 2007 09:11:09 +0000 (09:11 +0000)] 
:force is not unsupported anymore

12 years agoAttach free variables rather than in-scope variables to breakpoints
Simon Marlow [Thu, 26 Apr 2007 10:11:27 +0000 (10:11 +0000)] 
Attach free variables rather than in-scope variables to breakpoints
This speeds up the debugger quite a bit, we're now only about 30%
slower than ordinary GHCi, and still adding breakpoints to every
sub-expression.  Also we now get to see the free variables in
recursive bindings, which wasn't working properly before.

12 years agogetRdrNamesInScope: return interactively-bound names too
Simon Marlow [Thu, 26 Apr 2007 08:39:02 +0000 (08:39 +0000)] 
getRdrNamesInScope: return interactively-bound names too
so completion can now complete names of local bindings

12 years agounused import
Simon Marlow [Thu, 26 Apr 2007 08:37:13 +0000 (08:37 +0000)] 
unused import

12 years agoGive a better error message when we try to print a value of unknown type
Simon Marlow [Thu, 26 Apr 2007 08:36:57 +0000 (08:36 +0000)] 
Give a better error message when we try to print a value of unknown type

  Stopped at ../Test3.hs:(1,0)-(2,30)
  _result :: [a]
  [../Test3.hs:(1,0)-(2,30)] *Main> _result

  <interactive>:1:0:
      Ambiguous type variable `a' in the constraint:
        `Show a' arising from a use of `print' at <interactive>:1:0-6
      Cannot resolve unkonwn runtime types: a
      Use :print or :force to determine these types

12 years agoDrop newtypes before computing the refinement substitution after :print type reconstr...
Pepe Iborra [Wed, 25 Apr 2007 19:40:48 +0000 (19:40 +0000)] 
Drop newtypes before computing the refinement substitution after :print type reconstruction

12 years agofix :print reconstructing too many types in environment bindings
Pepe Iborra [Wed, 25 Apr 2007 17:02:10 +0000 (17:02 +0000)] 
fix :print reconstructing too many types in environment bindings

For more details, see test print019

12 years agoFix some corner cases in :print after the recent changes
Pepe Iborra [Wed, 25 Apr 2007 16:21:20 +0000 (16:21 +0000)] 
Fix some corner cases in :print after the recent changes

12 years agoUpdate the users_guide regarding list notation in :print
Pepe Iborra [Wed, 25 Apr 2007 09:58:29 +0000 (09:58 +0000)] 
Update the users_guide regarding list notation in :print

12 years agoTidy types of free vars at a breakpoint
Simon Marlow [Wed, 25 Apr 2007 15:42:35 +0000 (15:42 +0000)] 
Tidy types of free vars at a breakpoint
Also share the code that extends the InteractiveContext between
tcRnStmt and GHC.extendEnvironment.

12 years agothe Unknown types aren't required now
Simon Marlow [Wed, 25 Apr 2007 14:52:07 +0000 (14:52 +0000)] 
the Unknown types aren't required now

12 years agoremember the type of _result
Simon Marlow [Wed, 25 Apr 2007 14:50:25 +0000 (14:50 +0000)] 
remember the type of _result

12 years agoforce APs, AP_STACKs and ThunkSelectors in :force
Simon Marlow [Wed, 25 Apr 2007 14:29:45 +0000 (14:29 +0000)] 
force APs, AP_STACKs and ThunkSelectors in :force

12 years agouse Any as the HValue type, this should be a bit safer than forall a.a
Simon Marlow [Wed, 25 Apr 2007 14:29:14 +0000 (14:29 +0000)] 
use Any as the HValue type, this should be a bit safer than forall a.a

12 years agounused exports
Simon Marlow [Wed, 25 Apr 2007 13:24:55 +0000 (13:24 +0000)] 
unused exports

12 years agounused import
Simon Marlow [Wed, 25 Apr 2007 13:24:33 +0000 (13:24 +0000)] 
unused import

12 years agorefactor: move pprintClosureCommand out of the GHCi monad
Simon Marlow [Wed, 25 Apr 2007 13:17:26 +0000 (13:17 +0000)] 
refactor: move pprintClosureCommand out of the GHCi monad
Strictly speaking most of pprintClosureCommand should be exported by
the GHC API, but this is a step in the right direction.

12 years agoKeep track of free type variables in the interactive bindings
Simon Marlow [Wed, 25 Apr 2007 13:03:32 +0000 (13:03 +0000)] 
Keep track of free type variables in the interactive bindings

Now, the type checker won't attempt to generalise over the skolem
variables in the interactive bindings.  If we end up trying to show
one of these types, there will be an unresolved predicate 'Show t'
which causes a type error (albeit a strange one, I'll fix that
later).

12 years agoSome tyvars were being introduced in the environment via the thunk bindings '_ti...
Pepe Iborra [Tue, 24 Apr 2007 17:04:46 +0000 (17:04 +0000)] 
Some tyvars were being introduced in the environment via the thunk bindings '_ti' in :print

12 years agoWhen a type is refined after :print, propagate the substitution to all the interactiv...
Pepe Iborra [Tue, 24 Apr 2007 11:19:26 +0000 (11:19 +0000)] 
When a type is refined after :print, propagate the substitution to all the interactive environment

12 years agoconvert type variables to TcTyVars, otherwise the typechecker gets confused
Simon Marlow [Tue, 24 Apr 2007 14:18:47 +0000 (14:18 +0000)] 
convert type variables to TcTyVars, otherwise the typechecker gets confused

12 years agoDebuggerTys doesn't exist any more
Simon Marlow [Tue, 24 Apr 2007 14:18:06 +0000 (14:18 +0000)] 
DebuggerTys doesn't exist any more

12 years agoBreakpoints: get the names of the free variables right
Simon Marlow [Tue, 24 Apr 2007 11:32:02 +0000 (11:32 +0000)] 
Breakpoints: get the names of the free variables right

Previously we relied on the names of the Ids attached to a tick being
the same as the names of the original variables in the source code.
Sometimes this worked, sometimes it didn't because the simplifier
would inline away the Id.  So now we do this properly and retain the
original OccNames from the source code for each breakpoint, and use
these to construct the new Ids when we stop.

Doing this involved moving the tracking of in-scope variables from the
desugarer to the coverage pass.

12 years agoWe no longer instantiate tyvars to Unknown types in the :print mechanism
Pepe Iborra [Tue, 24 Apr 2007 10:23:13 +0000 (10:23 +0000)] 
We no longer instantiate tyvars to Unknown types in the :print mechanism

Instead, we keep the original tyvars.
The plan is to exploit type relationships among closures to recover more types.

12 years agoremove unused imports
Simon Marlow [Tue, 24 Apr 2007 11:14:18 +0000 (11:14 +0000)] 
remove unused imports

12 years agoadd comments
Simon Marlow [Tue, 24 Apr 2007 10:31:25 +0000 (10:31 +0000)] 
add comments

12 years agoTweak darcs-all script
Ian Lynagh [Wed, 25 Apr 2007 12:46:20 +0000 (12:46 +0000)] 
Tweak darcs-all script
If you got darcs by SSH without specifying a username then the script
would break.

12 years agoOnly haddock a package if it is buildable; spotted by Claus Reinke
Ian Lynagh [Wed, 25 Apr 2007 11:10:39 +0000 (11:10 +0000)] 
Only haddock a package if it is buildable; spotted by Claus Reinke

12 years agoGenerating synonym instance representation tycons
Manuel M T Chakravarty [Wed, 25 Apr 2007 09:16:46 +0000 (09:16 +0000)] 
Generating synonym instance representation tycons
- Type synonym instances are turned into representation synonym tycons
- They are entered into the pool of family instances (FamInst environments)
  in the same way as data/newtype instances
- Still missing is writing the parent tycon information into ifaces and
  various well-formedness checks.

12 years agoAdd -fwarn-monomorphism-restriction (on by default) to warn when the MR is used
simonpj@microsoft.com [Wed, 25 Apr 2007 10:18:32 +0000 (10:18 +0000)] 
Add -fwarn-monomorphism-restriction (on by default) to warn when the MR is used

Users often trip up on the Dreaded Monomorphism Restriction.  This
warning flag tells you when the MR springs into action.

Currently it's on by default, but we could change that.

12 years agoRetain inline-pragma information on unfoldings in interface files
simonpj@microsoft.com [Wed, 25 Apr 2007 07:49:24 +0000 (07:49 +0000)] 
Retain inline-pragma information on unfoldings in interface files

WARNING: this patch changes interface-file formats slightly
   you will need to recompile your libraries

Duncan Coutts wanted to export a function that has a NOINLNE pragma
in a local let-defintion.  This works fine within a module, but was
not surviving across the interface-file serialisation.

http://www.haskell.org/pipermail/glasgow-haskell-users/2007-March/012171.html

Regardless of whether or not he's doing something sensible, it seems
reasonable to try to retain local-binder IdInfo across interface files.
This initial patch just retains inline-pragma info, on the grounds that
other IdInfo can be re-inferred at the inline site.

Interface files get a tiny bit bigger, but it seesm slight.

12 years agoFix comments about data constructors
simonpj@microsoft.com [Wed, 25 Apr 2007 07:48:42 +0000 (07:48 +0000)] 
Fix comments about data constructors

12 years agoGive the inferred type when warning of a missing type-signature (Trac #1256)
simonpj@microsoft.com [Wed, 25 Apr 2007 07:47:19 +0000 (07:47 +0000)] 
Give the inferred type when warning of a missing type-signature (Trac #1256)

12 years agoMake ticky work, at least partly, on 64-bit machines
simonpj@microsoft.com [Tue, 24 Apr 2007 13:30:11 +0000 (13:30 +0000)] 
Make ticky work, at least partly, on 64-bit machines

The ticky StgEntCounter structure was trying to be clever by using a
fixed-width 32-bit field for the registeredp value.  But the code generators
are not up to handling structures packed tightly like this (on a 64-bit
architecture); result seg-fault on 64-bit.

Really there should be some complaint from the code generators, not simply
a seg fault.

Anyway I switched to using native words for StgEntCounter fields, and
now at least it works.

12 years agoAdd WAY_debug_t_NAME and WAY_debug_t_HC_OPTS
simonpj@microsoft.com [Tue, 24 Apr 2007 13:29:18 +0000 (13:29 +0000)] 
Add WAY_debug_t_NAME and WAY_debug_t_HC_OPTS

12 years agoFix bug in boxySplitTyConApp
simonpj@microsoft.com [Tue, 24 Apr 2007 12:43:34 +0000 (12:43 +0000)] 
Fix bug in boxySplitTyConApp

Merge to STABLE branch

This bug was discovered by Nicolas Frisby.  It's an egregious missing guard
in boxySplitTyConApp.

Test is tcfail180

12 years agorevert previous fix until I can find out why it was wrong
Simon Marlow [Mon, 23 Apr 2007 13:05:45 +0000 (13:05 +0000)] 
revert previous fix until I can find out why it was wrong
should fix recent GHCi problems in the HEAD

12 years agoFixes to datacon wrappers for indexed data types
simonpj@microsoft.com [Sun, 22 Apr 2007 21:35:03 +0000 (21:35 +0000)] 
Fixes to datacon wrappers for indexed data types

nominolo@gmail.com pointed out (Trac #1204) that indexed data types
aren't quite right. I investigated and found that the wrapper
functions for indexed data types, generated in MkId, are really very
confusing.  In particular, we'd like these combinations to work
newtype + indexed data type
GADT + indexted data type
The wrapper situation gets a bit complicated!

I did a bit of refactoring, and improved matters, I think.  I am not
certain that I have gotten it right yet, but I think it's better.
I'm committing it now becuase it's been on my non-backed-up laptop for
a month and I want to get it into the repo. I don't think I've broken
anything, but I don't regard it as 'done'.

12 years agoPart 2 of: Fix corner case of useless constraint in SPECIALISE pragma
simonpj@microsoft.com [Sun, 22 Apr 2007 21:32:23 +0000 (21:32 +0000)] 
Part 2 of: Fix corner case of useless constraint in SPECIALISE pragma

MERGE TO STABLE

I forgot to include this in the previous patch and Darcs
crashes if I try 'amend-record' or 'unrecord' because I
have a partial repo.  Sigh.

12 years agoFix corner case of useless constraint in SPECIALISE pragma
simonpj@microsoft.com [Sun, 22 Apr 2007 21:29:11 +0000 (21:29 +0000)] 
Fix corner case of useless constraint in SPECIALISE pragma

MERGE TO STABLE

This patch fixes Trac #1287.

The problem is described in Note [Unused spec binders] in DsBinds.

At the same time I realised that the error messages in DsBinds.dsPrag
were being given the location of the *binding* not the *pragma*.
So I've fixed that too.

12 years agoWarning police
simonpj@microsoft.com [Sun, 22 Apr 2007 21:19:37 +0000 (21:19 +0000)] 
Warning police

12 years agoPut the default value for -dppr-user-length in the manual
simonpj@microsoft.com [Sun, 22 Apr 2007 21:14:42 +0000 (21:14 +0000)] 
Put the default value for -dppr-user-length in the manual

MERGE TO STABLE

Incidentally, this flag should probably be renamed -dppr-user-depth

12 years agoImprove depth-cutoff for printing HsSyn in error messages
simonpj@microsoft.com [Sun, 22 Apr 2007 21:10:49 +0000 (21:10 +0000)] 
Improve depth-cutoff for printing HsSyn in error messages

MERGE TO STABLE

The "user style" in Outputable allows us to elide large expressions
when printing HsSyn, printing "..." instead.  This is done by calling
Outputable.pprDeeper.

But there was no mechanism for trimming very long lists, which
occur when using do-notation or explicit lists.  This patch fixes
the problem, by adding Outputable.pprDeeperList.

I also made some of the pretty-printing in HsExpr rather more
vigorous about increasing the depth; in particular, pprParendExpr.
This should make debug prints shorter.

12 years agoComments only (concerning rewrite rules)
simonpj@microsoft.com [Sun, 22 Apr 2007 21:06:14 +0000 (21:06 +0000)] 
Comments only (concerning rewrite rules)

12 years agoFix the GHC.Base.inline builtin rule
simonpj@microsoft.com [Fri, 20 Apr 2007 21:10:23 +0000 (21:10 +0000)] 
Fix the GHC.Base.inline builtin rule

The BuiltIn rule for GHC.Base.inline wasn't working for two reasons:

 a) inlineIdName wasn't in basicKnownKeyNames
 b) The rule function wasn't taking into account the type argument

Thanks to Brian Alliet for spotting this bug.

12 years agoHaskell list syntax for the :print command
Pepe Iborra [Fri, 20 Apr 2007 17:02:06 +0000 (17:02 +0000)] 
Haskell list syntax for the :print command

I did quite a bit of clean up in the Term pretty printer code too.
Support for infix constructors is still on the TODO list

12 years agoOutputable.cparen
Pepe Iborra [Fri, 20 Apr 2007 16:18:28 +0000 (16:18 +0000)] 
Outputable.cparen

12 years agowibbles
Pepe Iborra [Fri, 20 Apr 2007 16:15:31 +0000 (16:15 +0000)] 
wibbles

12 years agobreakpoints: fix the in-scope set for 'where' clauses
Simon Marlow [Fri, 20 Apr 2007 14:53:54 +0000 (14:53 +0000)] 
breakpoints: fix the in-scope set for 'where' clauses

12 years agoremove unused imports
Simon Marlow [Fri, 20 Apr 2007 10:55:48 +0000 (10:55 +0000)] 
remove unused imports

12 years agoremove a ToDo
Simon Marlow [Fri, 20 Apr 2007 10:35:23 +0000 (10:35 +0000)] 
remove a ToDo

12 years agonew commnad :abandon, discards the current computation (used to be :break stop)
Simon Marlow [Fri, 20 Apr 2007 10:35:16 +0000 (10:35 +0000)] 
new commnad :abandon, discards the current computation (used to be :break stop)

12 years agosplit off :ctags and :etags support into a separate file
Simon Marlow [Fri, 20 Apr 2007 10:25:36 +0000 (10:25 +0000)] 
split off :ctags and :etags support into a separate file

12 years agoexport SrcSpan & utils from GHC
Simon Marlow [Fri, 20 Apr 2007 10:25:11 +0000 (10:25 +0000)] 
export SrcSpan & utils from GHC

12 years agoThe prompt now shows the current breakpoint
Simon Marlow [Thu, 19 Apr 2007 15:20:13 +0000 (15:20 +0000)] 
The prompt now shows the current breakpoint

when stopped at a breakpoint we now get:

  [Test3.hs:2:17-30] *Main>

when there is a stack of breakpoints, we get:

  ... [Test3.hs:2:17-30] *Main>

showing just the topmost one.  Better suggestions are welcome, but
this seems not too bad to me.

12 years agofix padding calculation in listAround
Simon Marlow [Thu, 19 Apr 2007 14:40:05 +0000 (14:40 +0000)] 
fix padding calculation in listAround

12 years agoimprove the heuristics to pick the best breakpoint on a given line
Simon Marlow [Thu, 19 Apr 2007 14:39:54 +0000 (14:39 +0000)] 
improve the heuristics to pick the best breakpoint on a given line

12 years agoMore debugger improvements
Simon Marlow [Thu, 19 Apr 2007 14:23:58 +0000 (14:23 +0000)] 
More debugger improvements

":list" shows the code around the current breakpoint.  Also it
highlights the current expression in bold (the bold/unbold codes are
hardwired to the ANSI codes right now, I'll provide a way to change
them later).

":set stop <cmd>" causes <cmd> to be run each time we stop at a
breakpoint.  In particular, ":set stop :list" is particularly useful.

12 years agowe weren't adding breakpoints on parenthesised expressions
Simon Marlow [Thu, 19 Apr 2007 14:19:05 +0000 (14:19 +0000)] 
we weren't adding breakpoints on parenthesised expressions

12 years agoGet the InteractiveContext right when stopped at a breakpoint
Simon Marlow [Thu, 19 Apr 2007 09:49:09 +0000 (09:49 +0000)] 
Get the InteractiveContext right when stopped at a breakpoint
we shouldn't be binding 'it' until the computation has actually finished.

12 years agomore layering cleanup: BreakArray should come from GHC
Simon Marlow [Thu, 19 Apr 2007 09:48:06 +0000 (09:48 +0000)] 
more layering cleanup: BreakArray should come from GHC

12 years agoupdate the help text
Simon Marlow [Wed, 18 Apr 2007 14:42:01 +0000 (14:42 +0000)] 
update the help text

12 years agoadd some DEBUG assertions
Pepe Iborra [Thu, 19 Apr 2007 11:53:37 +0000 (11:53 +0000)] 
add some DEBUG assertions

12 years agoWhen possible, replace unification by matching in the RTTI steps
Pepe Iborra [Thu, 19 Apr 2007 11:52:20 +0000 (11:52 +0000)] 
When possible, replace unification by matching in the RTTI steps
(RTTI is used in the :print command)
This gives a decent efficiency improvement

12 years ago:print command - Do not compute all the custom printers, only the first one matching
Pepe Iborra [Sat, 14 Apr 2007 17:30:46 +0000 (17:30 +0000)] 
:print command - Do not compute all the custom printers, only the first one matching

12 years agoAdd GhciMonad to the package.conf.in Modules list
Pepe Iborra [Fri, 30 Mar 2007 09:19:18 +0000 (09:19 +0000)] 
Add GhciMonad to the package.conf.in Modules list

When I factored the GhciMonad out of InteractiveUI.hs, I forgot to expose it in the ghc package

12 years agoFix bat-script generation for MSys
simonpj@microsoft.com [Wed, 18 Apr 2007 16:05:19 +0000 (16:05 +0000)] 
Fix bat-script generation for MSys

The bat-script generation was using the wrong paths, in
ghc-inplace
ghc-pkg
hsc2hs
plus there was a double-backslah in the latter two which was wrong.
This patch fixes both.  See "MSys Note 3" in compiler/Makefile

12 years agoPass configure arguments to the library configure scripts
Ian Lynagh [Wed, 18 Apr 2007 15:55:22 +0000 (15:55 +0000)] 
Pass configure arguments to the library configure scripts

12 years agoAdd support for breaking by function name: ':break foo'
Simon Marlow [Wed, 18 Apr 2007 14:22:17 +0000 (14:22 +0000)] 
Add support for breaking by function name: ':break foo'
This is a bit hacky; it grabs the source location from the Name and
tries to set a breakpoint at that location, which in most cases
should be the breakpoint covering the whole definition.

12 years agoimprove completion for debugger commands
Simon Marlow [Wed, 18 Apr 2007 14:20:36 +0000 (14:20 +0000)] 
improve completion for debugger commands

12 years agounused import
Simon Marlow [Wed, 18 Apr 2007 14:20:08 +0000 (14:20 +0000)] 
unused import

12 years agoRestore the interactive context when resuming a breakpoint
Simon Marlow [Wed, 18 Apr 2007 13:41:16 +0000 (13:41 +0000)] 
Restore the interactive context when resuming a breakpoint
So that we don't accumulate bindings from previous breakpoints, which
could lead to a space leak.

12 years agoremove dead code
Simon Marlow [Wed, 18 Apr 2007 13:40:51 +0000 (13:40 +0000)] 
remove dead code

12 years agoadd ':show context' which lists the current stack of breakpoint contexts
Simon Marlow [Wed, 18 Apr 2007 13:38:56 +0000 (13:38 +0000)] 
add ':show context' which lists the current stack of breakpoint contexts

12 years agohandle out-of-range lines in :break more gracefully
Simon Marlow [Wed, 18 Apr 2007 13:38:24 +0000 (13:38 +0000)] 
handle out-of-range lines in :break more gracefully

12 years agosmall cleanup: showForUser -> printForUser, eliminate some duplicate code
Simon Marlow [Wed, 18 Apr 2007 12:49:48 +0000 (12:49 +0000)] 
small cleanup: showForUser -> printForUser, eliminate some duplicate code

12 years agoCheck we have all the corelibs when we boot
Ian Lynagh [Wed, 18 Apr 2007 12:45:36 +0000 (12:45 +0000)] 
Check we have all the corelibs when we boot

12 years agoadd missing module
Simon Marlow [Wed, 18 Apr 2007 12:41:24 +0000 (12:41 +0000)] 
add missing module

12 years agoVarious cleanups and improvements to the breakpoint support
Simon Marlow [Wed, 18 Apr 2007 11:47:00 +0000 (11:47 +0000)] 
Various cleanups and improvements to the breakpoint support

  - move parts of the debugger implementation below the GHC API where
    they belong.  There is still more in Debugger that violates the
    layering, hopefully I'll get to that later.

  - instead of returning an IO action from runStmt for resuming,
    return a ResumeHandle that is passed to GHC.resume.

  - breakpoints now return [Name] which is displayed in the same
    way as when a binding statement is executed.

  - :load, :add, :reload now clear the active breakpoints and context

  - :break gives a sensible error when used on a non-interpreted module

  - export breakpoint-related types from GHC

  - remove a bunch of layer-violating imports from InteractiveUI

  - remove some more vestiges of the old breakpoint code (topLevel in
    the GHCi state).

  - remove TickTree and use a simple array instead, cached per module

12 years agoadd module header
Simon Marlow [Wed, 18 Apr 2007 11:25:11 +0000 (11:25 +0000)] 
add module header

12 years agoremove extraneous "+1"; column numbers start at zero
Simon Marlow [Tue, 17 Apr 2007 14:35:12 +0000 (14:35 +0000)] 
remove extraneous "+1"; column numbers start at zero

12 years agoAdd distclean target for libraries/ (== clean target)
Ian Lynagh [Wed, 18 Apr 2007 11:31:22 +0000 (11:31 +0000)] 
Add distclean target for libraries/ (== clean target)

12 years agoDistinguish between userError (i.e., deliberate failure) and other immediate and...
Tyson Whitehead [Tue, 10 Apr 2007 14:17:09 +0000 (14:17 +0000)] 
Distinguish between userError (i.e., deliberate failure) and other immediate and embedded exceptions for TH splices for trac #1265

12 years agoRe-working of the breakpoint support
Simon Marlow [Tue, 17 Apr 2007 14:24:58 +0000 (14:24 +0000)] 
Re-working of the breakpoint support

This is the result of Bernie Pope's internship work at MSR Cambridge,
with some subsequent improvements by me.  The main plan was to

 (a) Reduce the overhead for breakpoints, so we could enable
     the feature by default without incurrent a significant penalty
 (b) Scatter more breakpoint sites throughout the code

Currently we can set a breakpoint on almost any subexpression, and the
overhead is around 1.5x slower than normal GHCi.  I hope to be able to
get this down further and/or allow breakpoints to be turned off.

This patch also fixes up :print following the recent changes to
constructor info tables.  (most of the :print tests now pass)

We now support single-stepping, which just enables all breakpoints.

  :step <expr>     executes <expr> with single-stepping turned on
  :step            single-steps from the current breakpoint

The mechanism is quite different to the previous implementation.  We
share code with the HPC (haskell program coverage) implementation now.
The coverage pass annotates source code with "tick" locations which
are tracked by the coverage tool.  In GHCi, each "tick" becomes a
potential breakpoint location.

Previously breakpoints were compiled into code that magically invoked
a nested instance of GHCi.  Now, a breakpoint causes the current
thread to block and control is returned to GHCi.

See the wiki page for more details and the current ToDo list:

  http://hackage.haskell.org/trac/ghc/wiki/NewGhciDebugger

12 years agoremove the ITBL_SIZE constants which were wrong, but fortunately unused
Simon Marlow [Tue, 17 Apr 2007 09:25:59 +0000 (09:25 +0000)] 
remove the ITBL_SIZE constants which were wrong, but fortunately unused

12 years agocon_desc should be an OFFSET_FIELD
Simon Marlow [Tue, 17 Apr 2007 09:25:26 +0000 (09:25 +0000)] 
con_desc should be an OFFSET_FIELD

12 years agofix building with pre-6.4
Simon Marlow [Mon, 16 Apr 2007 08:27:32 +0000 (08:27 +0000)] 
fix building with pre-6.4

12 years agoChange tabs to spaces in string literals
Ian Lynagh [Mon, 16 Apr 2007 21:13:42 +0000 (21:13 +0000)] 
Change tabs to spaces in string literals

12 years agoRemove whitespace, mostly tabs, from string literals
Ian Lynagh [Mon, 16 Apr 2007 19:15:24 +0000 (19:15 +0000)] 
Remove whitespace, mostly tabs, from string literals

12 years agoMERGE: another attempt at a workaround for #1110 (Vista bug)
Simon Marlow [Mon, 16 Apr 2007 14:22:23 +0000 (14:22 +0000)] 
MERGE: another attempt at a workaround for #1110 (Vista bug)
now instead of setting GCC_EXEC_PREFIX, we just add the appropriate
gcc-lib directory to the front of PATH before invoking gcc.

12 years agoMERGE: Fix a few uses of the wrong return convention for the scheduler
Simon Marlow [Mon, 16 Apr 2007 14:19:02 +0000 (14:19 +0000)] 
MERGE: Fix a few uses of the wrong return convention for the scheduler
We changed the convention a while ago so that BaseReg is returned to
the scheduler in R1, because BaseReg may change during the run of a
thread, e.g. during a foreign call.  A few places got missed,
mostly for very rare events.

Should fix concprog001, although I'm not able to reliably reproduce
the failure.

12 years agostm doesn't need to be a core-package
Ian Lynagh [Mon, 16 Apr 2007 13:24:21 +0000 (13:24 +0000)] 
stm doesn't need to be a core-package