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
Douglas Wilson
ghc-debug
Commits
418e9d6a
Commit
418e9d6a
authored
2 years ago
by
Matthew Pickering
Browse files
Options
Downloads
Patches
Plain Diff
ui: Fix Search for Constructors
parent
58a246b9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ghc-debug-brick/src/Main.hs
+23
-18
23 additions, 18 deletions
ghc-debug-brick/src/Main.hs
ghc-debug-brick/src/Model.hs
+6
-1
6 additions, 1 deletion
ghc-debug-brick/src/Model.hs
with
29 additions
and
19 deletions
ghc-debug-brick/src/Main.hs
+
23
−
18
View file @
418e9d6a
...
...
@@ -107,9 +107,7 @@ myAppDraw (AppState majorState') =
,
txt
"Write Profile (^w)"
,
txt
"Find Retainers (^f)"
,
txt
"Find Retainers (Exact) (^e)"
-- Secret as a bit buggy with confusing behaviour about setting the
-- roots for subsequent operations.
-- , txt "Find Closures (Exact) (^c)"
,
txt
"Find Closures (Exact) (^c)"
,
txt
"Take Snapshot (^x)"
,
txt
"Exit (ESC)"
])
...
...
@@ -123,6 +121,7 @@ myAppDraw (AppState majorState') =
SavedAndGCRoots
->
"Root Closures"
Reverse
->
"Reverse Edges"
Retainer
{}
->
"Retainers"
Searched
{}
->
"Search Results"
)
(
pauseModeTree
renderIOTree
os
)
,
hBorder
...
...
@@ -342,19 +341,21 @@ myAppHandleEvent eventChan appState@(AppState majorState') brickEvent = case bri
return
$
(
mkIOTree
debuggee'
manalysis
(
savedClosures'
++
rootClosures'
)
getChildren
id
,
fmap
toPtr
<$>
(
raw_roots
++
raw_saved
))
where
getChildren
::
Debuggee
->
DebugClosure
PayloadCont
ConstrDesc
StackCont
ClosurePtr
->
IO
[(
String
,
ListItem
PayloadCont
ConstrDesc
StackCont
ClosurePtr
)]
getChildren
d
c
=
do
children
<-
closureReferences
d
c
traverse
(
traverse
(
fillListItem
d
))
children
fillListItem
::
Debuggee
->
ListItem
PayloadCont
ConstrDescCont
StackCont
ClosurePtr
->
IO
(
ListItem
PayloadCont
ConstrDesc
StackCont
ClosurePtr
)
fillListItem
_
(
ListOnlyInfo
x
)
=
return
$
ListOnlyInfo
x
fillListItem
d
(
ListFullClosure
cd
)
=
ListFullClosure
<$>
fillConstrDesc
d
cd
fillListItem
_
ListData
=
return
ListData
getChildren
::
Debuggee
->
DebugClosure
PayloadCont
ConstrDesc
StackCont
ClosurePtr
->
IO
[(
String
,
ListItem
PayloadCont
ConstrDesc
StackCont
ClosurePtr
)]
getChildren
d
c
=
do
children
<-
closureReferences
d
c
traverse
(
traverse
(
fillListItem
d
))
children
fillListItem
::
Debuggee
->
ListItem
PayloadCont
ConstrDescCont
StackCont
ClosurePtr
->
IO
(
ListItem
PayloadCont
ConstrDesc
StackCont
ClosurePtr
)
fillListItem
_
(
ListOnlyInfo
x
)
=
return
$
ListOnlyInfo
x
fillListItem
d
(
ListFullClosure
cd
)
=
ListFullClosure
<$>
fillConstrDesc
d
cd
fillListItem
_
ListData
=
return
ListData
mkIOTree
::
Show
c
=>
Debuggee
...
...
@@ -508,6 +509,10 @@ handleMainWindowEvent _dbg os@(OperationalState treeMode' _footerMode _curRoots
newTree
<-
handleIOTreeEvent
event
t
continue
(
os
&
treeMode
.~
Retainer
newTree
)
Searched
t
->
do
newTree
<-
handleIOTreeEvent
event
t
continue
(
os
&
treeMode
.~
Searched
newTree
)
_
->
continue
os
inputFooterHandler
::
Debuggee
...
...
@@ -537,10 +542,10 @@ dispatchFooterInput dbg FSearch tc os = do
res
<-
liftIO
$
mapM
(
completeClosureDetails
dbg
Nothing
)
cps'
let
new_roots
=
map
(
second
toPtr
)
cps'
root_details
=
res
tree
=
mkIOTree
dbg
Nothing
res
getChildren
id
continue
(
os
&
resetFooter
&
rootsFrom
.~
SearchedRoots
new_roots
&
treeMode
.~
SavedAndGCRoots
&
treeSavedAndGCRoots
%~
setIOTreeRoots
root_details
)
&
treeMode
.~
Searched
tree
)
dispatchFooterInput
dbg
FProfile
tc
os
=
do
liftIO
$
profile
dbg
(
T
.
unpack
(
rebuildTextCursor
tc
))
continue
(
os
&
resetFooter
)
...
...
This diff is collapsed.
Click to expand it.
ghc-debug-brick/src/Model.hs
+
6
−
1
View file @
418e9d6a
...
...
@@ -101,7 +101,11 @@ data ClosureDetails pap s c = ClosureDetails
|
InfoDetails
{
_info
::
InfoInfo
}
|
LabelNode
{
_label
::
Text
}
data
TreeMode
=
Dominator
|
SavedAndGCRoots
|
Reverse
|
Retainer
(
IOTree
(
ClosureDetails
PayloadCont
StackCont
ClosurePtr
)
Name
)
data
TreeMode
=
Dominator
|
SavedAndGCRoots
|
Reverse
|
Retainer
(
IOTree
(
ClosureDetails
PayloadCont
StackCont
ClosurePtr
)
Name
)
|
Searched
(
IOTree
(
ClosureDetails
PayloadCont
StackCont
ClosurePtr
)
Name
)
data
FooterMode
=
FooterInfo
|
FooterMessage
Text
...
...
@@ -158,6 +162,7 @@ pauseModeTree k (OperationalState mode _ _footer dom roots reverseA _) = case mo
SavedAndGCRoots
->
k
roots
Reverse
->
k
$
maybe
(
error
"bop it, flip, reverse it, DavidE"
)
_reverseIOTree
reverseA
Retainer
r
->
k
r
Searched
r
->
k
r
makeLenses
''AppState
makeLenses
''MajorState
...
...
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