summaryrefslogtreecommitdiff
path: root/libraries/base/Debug
Commit message (Collapse)AuthorAgeFilesLines
* Add functions traceWith, traceShowWith, traceEventWith.Philip Hazelden2022-04-091-0/+35
| | | | | As discussed at https://github.com/haskell/core-libraries-committee/issues/36
* Correct doctestsOleg Grenrus2021-01-021-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's simpler to assume that base is NoImplicitPrelude, otherwise running doctest on `GHC.*` modules would be tricky. OTOH, most `GHC.List` (where the most name clashes are) examples could be changed to use `import qualified Data.List as L`. (GHC.List examples won't show for Foldable methods...). With these changes majority of doctest examples are GHCi-"faithful", my WIP GHC-independent doctest runner reports nice summary: Examples: 582; Tried: 546; Skipped: 34; Success: 515; Errors: 33; Property Failures 2 Most error cases are *Hangs forever*. I have yet to figure out how to demonstrate that in GHCi. Some of divergences are actually stack overflows, i.e. caught by runtime. Few errorful cases are examples of infinite output, e.g. >>> cycle [42] [42,42,42,42,42,42,42,42,42,42... while correct, they confuse doctest. Another erroneous cases are where expected output has line comment, like >>> fmap show (Just 1) -- (a -> b) -> f a -> f b Just "1" -- (Int -> String) -> Maybe Int -> Maybe String I think I just have to teach doctest to strip comments from expected output. This is a first patch in a series. There is plenty of stuff already.
* rts: Flush eventlog buffers from flushEventLogBen Gamari2020-11-241-0/+9
| | | | | | | | | | | | As noted in #18043, flushTrace failed flush anything beyond the writer. This means that a significant amount of data sitting in capability-local event buffers may never get flushed, despite the users' pleads for us to flush. Fix this by making flushEventLog flush all of the event buffers before flushing the writer. Fixes #18043.
* Remove redundant "do", "return" and language extensions from baseHécate2020-09-231-1/+1
|
* compiler: Qualify imports of Data.ListBen Gamari2020-02-081-1/+1
|
* Fix haddocks for marker events in Debug.TraceAlp Mestanogullari2019-09-211-1/+1
|
* Update Trac ticket URLs to point to GitLabRyan Scott2019-03-151-1/+1
| | | | | This moves all URL references to Trac tickets to their corresponding GitLab counterparts.
* Fix ambiguous/out-of-scope Haddock identifiersAlec Theriault2018-08-211-2/+3
| | | | | | | | | | | | | | | | | This drastically cuts down on the number of Haddock warnings when making docs for `base`. Plus this means more actual links end up in the docs! Also fixed other small mostly markup issues in the documentation along the way. This is a docs-only change. Reviewers: hvr, bgamari, thomie Reviewed By: thomie Subscribers: thomie, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5055
* Add trace injectionDavid Feuer2017-12-011-0/+76
| | | | | | | | | | | | | | Add support for injecting runtime calls to `trace` in `DsM`. This allows the desugarer to add compile-time information to a runtime trace. Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: carter, thomie, rwbarton Differential Revision: https://phabricator.haskell.org/D4162
* Loads of doc(test)sDavid Luposchainsky2017-08-171-20/+45
|
* fix typoHerbert Valerio Riedel2015-12-181-1/+1
| | | | [skip-ci]
* Document peculiarities of `traceM`.Matthias Fischmann2015-10-021-2/+8
| | | | | | | | | | Reviewers: bgamari, hvr, austin Reviewed By: bgamari, hvr, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1289
* Generalize traceM, traceShowM (fixes #10023)RyanGlScott2015-07-031-6/+6
| | | | | | | | | | | | | | | This generalizes the type signatures of `traceM` and `traceShowM` to use `Applicative` rather than `Monad`. Reviewers: austin, ekmett, hvr, bgamari Reviewed By: ekmett, hvr, bgamari Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1029 GHC Trac Issues: #10023
* Fix typo in `traceShowM` haddock comment (#10392)Thomas Miedema2015-06-121-2/+2
| | | | [skip ci]
* Move comments about evaluating the message to the top of the moduleSimon Peyton Jones2015-02-151-5/+5
| | | | The remarks apply equally to all the functions here (Trac #9795)
* Improve documentation of 'trace'Simon Peyton Jones2015-02-131-0/+4
| | | | See Trac #9795.
* Convert `/Since: .../` to new `@since ...` syntaxHerbert Valerio Riedel2014-12-161-10/+10
| | | | | | Starting with Haddock 2.16 there's a new built-in support for since-annotations Note: This exposes a bug in the `@since` implementation (see e.g. `Data.Bits`)
* Be consistent with placement of Safe Haskell mode at top of fileDavid Terei2014-11-211-1/+1
|
* `M-x delete-trailing-whitespace` & `M-x untabify`Herbert Valerio Riedel2014-09-241-3/+3
| | | | ...several modules in `base` recently touched by me
* Move `when` to GHC.BaseHerbert Valerio Riedel2014-09-181-1/+0
| | | | | | | | | This allows several modules to avoid importing Control.Monad and thus break import cycles that manifest themselves when implementing #9586 Reviewed By: austin, ekmett Differential Revision: https://phabricator.haskell.org/D222
* Export `Traversable()` and `Foldable()` from PreludeHerbert Valerio Riedel2014-09-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | This exposes *only* the type-classes w/o any of their methods. This is the very first step for implementing BPP (see #9586), which already requires breaking up several import-cycles leading back to `Prelude`. Ideally, importing `Prelude` should be avoided in most `base` modules, as `Prelude` does not define any entities, but rather re-exports existing ones. Test Plan: validate passes Reviewers: ekmett, austin Reviewed By: ekmett, austin Subscribers: simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D209 GHC Trac Issues: #9586
* Filter out null bytes from trace, and warn accordingly, fixing #9395.Edward Z. Yang2014-08-051-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, if you ran trace "foo\0bar", the output was truncated so that everything after the null byte was omitted. This was terrible. Now we filter out null bytes, and emit an extra trace saying that null bytes were filtered out. NB: we CANNOT fix debugBelch, because all printf variants *always* respect null bytes, even if you're using string precision such as %.*s. The alternative would have been to introduce a new function debugRawBelch which did not use format strings and took an explicit string length, but I decided we generally should avoid putting null bytes in our trace messages, and warn the user. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: hvr, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D121 GHC Trac Issues: #9395
* Improve Haddock markupHerbert Valerio Riedel2014-01-301-2/+2
| | | | | | | | | | | This fixes the markup at the top of `Control.Arrow`, and improves the markup inside DEPRECATED strings. (Haddock supports markup inside DEPRECATED messages, which allows to turn references to Haskell entities into hyperlinks by using the usual Haddock markup.) Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Drop redundant `{-# LANGUAGE #-}` pragmasHerbert Valerio Riedel2013-09-281-1/+1
| | | | | | | | | | | | | This removes language pragmas from Haskell modules which are implicitly active with `default-language: Haskell2010`. Specifically, the following language extension pragmas are removed by this commit: - PatternGuards - ForeignFunctionInterface - EmptyDataDecls - NoBangPatterns Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Add Haddock `/Since: 4.5.[01].0/` comments to symbolsHerbert Valerio Riedel2013-09-221-0/+4
| | | | | | | | | | This commit retroactively adds `/Since: 4.5.[01].0/` annotations to symbols newly added/exposed in `base-4.5.[01].0` (as shipped with GHC 7.4.[12]). See also 6368362f which adds the respective annotation for symbols newly added in `base-4.7.0.0` (that goes together with GHC 7.8.1). Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Add Haddock `/Since: 4.7.0.0/` comments to new symbolsHerbert Valerio Riedel2013-09-211-0/+10
| | | | | | | | | | | | | | | | | | These annotations were added in such a way, that the line {{{ /Since: 4.7.0.0/ }}} represents the last paragraph of the Haddock comment. Maybe Haddock will have support for this meta-syntax at some point, and be able to inherited the since-version property to the children of an annotated symbol and display the since-version property in the rendered documentation only in cases when it's not visually obvious (for instance, when re-exporting documentation strings). Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Constant-fold `__GLASGOW_HASKELL__` CPP conditionalsHerbert Valerio Riedel2013-09-171-20/+1
| | | | | | | | | | Now that HUGS and NHC specific code has been removed, this commit "folds" the now redundant `#if((n)def)`s containing `__GLASGOW_HASKELL__`. This renders `base` officially GHC only. This commit also removes redundant `{-# LANGUAGE CPP #-}`. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Add Debug.Trace.{traceId,traceShowId,traceM,traceShowM}; fixes #7626Ian Lynagh2013-04-211-0/+42
|
* Mark DEPRECATED pragmas with when they were addedIan Lynagh2013-02-161-1/+1
|
* Remove commented types in module export listsIan Lynagh2012-10-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These comments are rather less useful now that haddock can give docs with the same informatino in the module synopsis. Having to maintain them when making changes to the library is a pain, and when people forget about doing so there is nothing that checks that the comments are right, so mistakes tend to linger. Of the comments that my script detected, 78 of 684 were already incorrect in one way or another, e.g. missing context: Text.Show.showsPrec Comment type: Int -> a -> ShowS Actual type: Show a => Int -> a -> ShowS wrong context: Numeric.readInt Comment type: Integral a => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a Actual type: Num a => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a not following a class change (e.g. Num losing its Eq superclass): Text.Read.Lex.readOctP Comment type: Num a => ReadP a Actual type: (Eq a, Num a) => ReadP a not following the Exceptions change: GHC.Conc.childHandler Comment type: Exception -> IO () Actual type: SomeException -> IO () or just always been wrong: GHC.Stable.deRefStablePtr Comment type: StablePtr a -> a Actual type: StablePtr a -> IO a
* Add Debug.Trace.traceMarker/traceMarkerIODuncan Coutts2012-10-151-13/+72
| | | | | | | Much like the traceEvent, but used for marking points in time during execution for use in profiling tools. This uses the traceMarker# primop. The underlying RTS code currently works for the eventlog system, but could be extended to cover heap profiling.
* Remove GHC.Exts.traceEventIOIan Lynagh2011-12-151-3/+8
| | | | Debug.Trace.traceEventIO should be used instead.
* Fix typoIan Lynagh2011-12-151-1/+1
|
* doc update: mention -fprof-auto-callsSimon Marlow2011-12-061-1/+1
|
* Add traceStack :: String -> a -> aSimon Marlow2011-11-301-0/+19
| | | | | | | | | | | -- | like 'trace', but additionally prints a call stack if one is -- available. -- -- In the current GHC implementation, the call stack is only -- availble if the program was compiled with @-prof@; otherwise -- 'traceStack' behaves exactly like 'trace'. Entries in the call -- stack correspond to @SCC@ annotations, so it is a good idea to use -- @-fprof-auto@ to add SCC annotations automatically.
* Update Debug.Trace haddock docs and rename putTraceMsg to traceIODuncan Coutts2011-10-261-16/+64
| | | | | putTraceMsg is deprecated in favour of traceIO. This makes the names more consistent.
* Add pure traceEvent and re-export from Debug.TraceDuncan Coutts2011-10-261-1/+36
| | | | | | | | | | | | | Previously traceEvent was exported only from GHC.Exts and had an IO type. The new scheme is: GHC.Exts.traceEventIO :: String -> IO () Debug.Trace.traceEventIO :: String -> IO () Debug.Trace.traceEvent :: String -> a -> a The new traceEvent has a pure type like Debug.Trace.trace and can be used in pure code. The previous GHC.Exts.traceEvent is deprecated.
* Update base for latest Safe Haskell.David Terei2011-10-251-0/+1
|
* Update base for new Safe Haskell designDavid Terei2011-10-251-0/+1
|
* Use explicit language extensions & remove extension fields from base.cabalsimonpj@microsoft.com2011-01-281-0/+2
| | | | | | | | | | Add explicit {-# LANGUAGE xxx #-} pragmas to each module, that say what extensions that module uses. This makes it clearer where different extensions are used in the (large, variagated) base package. Now base.cabal doesn't need any extensions field Thanks to Bas van Dijk for doing all the work.
* Avoid calling varargs functions using the FFISimon Marlow2008-05-091-1/+3
| | | | | | Calling varargs functions is explicitly deprecated according to the FFI specification. It used to work, just about, but it broke with the recent changes to the via-C backend to not use header files.
* untabifyDon Stewart2008-03-031-3/+3
|
* oops, we forgot to export traceShowSimon Marlow2007-11-211-1/+2
|
* Warning police: Make some prototypes from the RTS knownsven.panne@aedion.de2006-08-111-1/+2
|
* add traceShow (see #474)Simon Marlow2006-08-071-0/+8
|
* [project @ 2005-02-02 15:28:49 by simonmar]simonmar2005-02-021-1/+1
| | | | doc fix
* [project @ 2005-01-31 13:52:26 by malcolm]malcolm2005-01-311-2/+3
| | | | Make it compile for non-GHC.
* [project @ 2005-01-29 16:10:27 by wolfgang]wolfgang2005-01-291-2/+0
| | | | import CString on non-windows platforms.
* [project @ 2005-01-28 23:33:57 by krasimir]krasimir2005-01-281-57/+20
| | | | | | | | - The output from uncaught exceptions handler is redirected to RTS's errorBelch. - The output from Debug.Trace is redirected to RTS's debugBelch - Usually errorBelch and debugBelch messages go to stderr except for Windows GUI applications. For GUI applications the Debug.Trace output is redirected to debug console and the exceptions message is displayed in message box.
* [project @ 2005-01-28 14:55:05 by simonmar]simonmar2005-01-281-4/+0
| | | | Remove unnecessary ghcconfig.h include