Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reinier Maas
GHC
Commits
125714a6
Commit
125714a6
authored
2 years ago
by
Ben Gamari
Browse files
Options
Downloads
Patches
Plain Diff
base: Factor out errorBelch
This was useful when debugging
parent
3e5c9e3c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/ghc-internal/src/GHC/Internal/TopHandler.hs
+8
-4
8 additions, 4 deletions
libraries/ghc-internal/src/GHC/Internal/TopHandler.hs
with
8 additions
and
4 deletions
libraries/ghc-internal/src/GHC/Internal/TopHandler.hs
+
8
−
4
View file @
125714a6
...
...
@@ -216,13 +216,17 @@ real_handler exit se = do
-- don't use errorBelch() directly, because we cannot call varargs functions
-- using the FFI.
foreign
import
ccall
unsafe
"HsBase.h errorBelch2"
errorBelch
::
CString
->
CString
->
IO
()
c_errorBelch
::
CString
->
CString
->
IO
()
errorBelch
::
String
->
IO
()
errorBelch
msg
=
withCAString
"%s"
$
\
fmt
->
withCAString
msg
$
\
msg'
->
c_errorBelch
fmt
msg'
disasterHandler
::
(
Int
->
IO
a
)
->
IOError
->
IO
a
disasterHandler
exit
_
=
withCAString
"%s"
$
\
fmt
->
withCAString
msgStr
$
\
msg
->
errorBelch
fmt
msg
>>
exit
1
errorBelch
msgStr
>>
exit
1
where
msgStr
=
"encountered an exception while trying to report an exception.
\n
"
++
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment