New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: add missing py3.6 type hints #797
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except just a few points to address
Cheers
Co-authored-by: hugsy <hugsy@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed to line 5000
gef.py
Outdated
try: | ||
arena = gdb.parse_and_eval(addr) | ||
malloc_state_t = cached_lookup_type("struct malloc_state") | ||
self.__arena = arena.cast(malloc_state_t) | ||
self.__arena = arena.cast(malloc_state_t) # "gdb.Value" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't do self.__arena : "gdb.Value" = ...
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually that is a comment for understanding the code better. I put it there to emphasize it for the reader because actually what we do is highly problematic (to sometimes have the arena be a gdb.Value
and sometimes a MallocStateStruct
with different ways of handling them)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its actually not a type hint. the type hint is a few lines above that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Let's reword it with basically what you just said?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this better now? please resolve if you agree
Add missing type hints (py3.6)
Description/Motivation/Screenshots
This PR adds still missing type hints to
gef.py
(Issue #787).Also a few very minor type hint related issues have been fixed (e.g. removing
return <expression>
where expression always evaluates toNone
)EDIT:
The PR also removes a few unnecessary function/method arguments
How Has This Been Tested?
make test
Checklist
dev
branch, notmaster
.