Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
ghc-utils
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
3
Merge Requests
3
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ben Gamari
ghc-utils
Commits
fe2a2b57
Commit
fe2a2b57
authored
Dec 19, 2020
by
Ben Gamari
🐢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdb.find_refs: Things
parent
af398a35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
gdb/ghc_gdb/find_refs.py
gdb/ghc_gdb/find_refs.py
+4
-3
No files found.
gdb/ghc_gdb/find_refs.py
View file @
fe2a2b57
...
...
@@ -14,6 +14,8 @@ T = TypeVar('T')
stg_STACK_info
=
gdb
.
parse_and_eval
(
'&stg_STACK_info'
)
CLOSURE_HEADER_SIZE
=
gdb
.
parse_and_eval
(
'sizeof(StgHeader)'
)
# bytes
def
search_memory_many
(
inferior
:
gdb
.
Inferior
,
start
:
Ptr
,
end
:
Ptr
,
val
:
bytes
)
->
Iterator
[
Ptr
]:
#print('Searching for %r in %d to %d' % (val, start.addr(), end.addr()))
assert
end
.
addr
()
>
start
.
addr
()
...
...
@@ -167,7 +169,7 @@ def find_containing_closure(inferior: gdb.Inferior,
if
ptr
.
addr
()
-
start
.
addr
()
>
8
:
# Only trace the indirectee of IND_STATICs
return
None
elif
i
<=
nptrs
+
5
:
# A bit of fudge for the headers
elif
i
<=
nptrs
+
CLOSURE_HEADER_SIZE
:
# A bit of fudge for the headers
return
start
elif
int
(
info
[
'type'
])
==
closure
.
ClosureType
.
STACK
:
stack
=
gdb
.
parse_and_eval
(
'(StgStack *) %d'
%
start
.
addr
())
...
...
@@ -182,8 +184,7 @@ def find_containing_closure(inferior: gdb.Inferior,
except
gdb
.
MemoryError
as
e
:
print
(
'failed to find containing closure of 0x%x:'
%
ptr
.
addr
())
traceback
.
print_exc
()
continue
return
None
return
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment