Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghc-debug
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Travis Whitaker
ghc-debug
Commits
869ccde2
Commit
869ccde2
authored
2 years ago
by
Matthew Pickering
Browse files
Options
Downloads
Patches
Plain Diff
Add support for orig_thunk_info closures
parent
06dc852d
Branches
wip/orig_thunk_info
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc-debug-brick/src/Lib.hs
+18
-7
18 additions, 7 deletions
ghc-debug-brick/src/Lib.hs
with
18 additions
and
7 deletions
ghc-debug-brick/src/Lib.hs
+
18
−
7
View file @
869ccde2
...
...
@@ -338,16 +338,27 @@ closureReferences e (Stack _ stack) = run e $ do
let
action
(
GD
.
SPtr
ptr
)
=
(
"Pointer"
,
ListFullClosure
.
Closure
ptr
<$>
GD
.
dereferenceClosure
ptr
)
action
(
GD
.
SNonPtr
dat
)
=
(
"Data:"
++
show
dat
,
return
ListData
)
frame_items
frame
=
(
"Info: "
++
show
(
tableId
(
frame_info
frame
)),
return
(
ListOnlyInfo
(
tableId
(
frame_info
frame
))))
:
[
(
"SRT: "
,
ListFullClosure
.
Closure
srt
<$>
GD
.
dereferenceClosure
srt
)
|
Just
srt
<-
[
getSrt
(
frame_srt
frame
)]]
++
map
action
(
GD
.
values
frame
)
-- frame_items :: DebugStackFrame
-- (GenSrtPayload ClosurePtr) ClosurePtr -> GD.DebugM [(String, _)]
frame_items
frame
=
do
info
<-
GD
.
getSourceInfo
(
tableId
(
frame_info
frame
))
case
info
of
Just
(
SourceInformation
{
infoName
=
"stg_orig_thunk_info_frame_info"
})
->
let
[
GD
.
SNonPtr
dat
]
=
GD
.
values
frame
in
return
[(
"Blackhole arising from thunk:"
,
(
ListOnlyInfo
(
InfoTablePtr
dat
)))]
_
->
traverse
sequenceA
$
(
"Info: "
++
show
(
tableId
(
frame_info
frame
)),
return
(
ListOnlyInfo
(
tableId
(
frame_info
frame
))))
:
[
(
"SRT: "
,
ListFullClosure
.
Closure
srt
<$>
GD
.
dereferenceClosure
srt
)
|
Just
srt
<-
[
getSrt
(
frame_srt
frame
)]]
++
map
action
(
GD
.
values
frame
)
add_frame_ix
ix
(
lbl
,
x
)
=
(
"Frame "
++
show
ix
++
" "
++
lbl
,
x
)
let
lblAndPtrs
=
[
map
(
add_frame_ix
frameIx
)
(
frame_items
frame
)
|
(
frameIx
,
frame
)
<-
zip
[(
0
::
Int
)
..
]
(
GD
.
getFrames
stack'
)
]
lblAndPtrs
<-
sequence
[
map
(
add_frame_ix
frameIx
)
<$>
(
frame_items
frame
)
|
(
frameIx
,
frame
)
<-
zip
[(
0
::
Int
)
..
]
(
GD
.
getFrames
stack'
)
]
-- traverse GD.dereferenceClosures (snd <$> lblAndPtrs)
traverse
(
traverse
id
)
(
concat
lblAndPtrs
)
-- traverse (traverse id) (concat lblAndPtrs)
return
(
concat
lblAndPtrs
)
{-
return $ zipWith (\(lbl,ptr) c -> (lbl, Closure ptr c))
lblAndPtrs
...
...
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