Skip to content
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

Fix context failed to execute because breakpoint.location is None #715

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

RafaelLeeImg
Copy link
Contributor

@RafaelLeeImg RafaelLeeImg commented Sep 14, 2021

Fix context failed to execute because breakpoint.location is None when watchpoint is set

Description

Fix error of

[ Legend: Modified register | Code | Heap | Stack | String ]
[!] Command 'context' failed to execute properly, reason: argument of type 'NoneType' is not iterable

when breakpoints are set and breakpoint.location is not available.

20210914-191847-gef-fail-blur

How Has This Been Tested?

Architecture Yes/No Comments
x86-32 ✖️
x86-64 Yes
ARM ✖️
AARCH64 ✖️
MIPS ✖️
POWERPC ✖️
SPARC ✖️
RISC-V ✖️
make test Yes

Checklist

  • My PR was done against the dev branch, not master.
  • My code follows the code style of this project.
  • My change includes a change to the documentation, if required.
  • My change adds tests as appropriate.
  • I have read and agree to the CONTRIBUTING document.

@theguy147
Copy link
Collaborator

theguy147 commented Sep 14, 2021

Thank you for the PR.

Usually it would be helpful if you could also provide a scenario in which this error occurs for you so other people can reproduce the issue and understand the problem better.

I looked into it some more: gdb.breakpoints() returns a list of breakpoint objects that are documented here. According to the docs location can actually be None if the breakpoint is a watchpoint (i guess your error occurred after you set a watchpoint?)

This identical issue can be found at 4 locations in GEF (not just 1): L5544, L5575, L8024 and this L8249. So it would be good if all of them could be patched.

P.S.
As to why your tests fail locally: If you have the possibility to investigate this further and/or send us the output of your make test (in a new issue here on GH) this would be helpful as well.

gef.py Show resolved Hide resolved
gef.py Show resolved Hide resolved
@RafaelLeeImg RafaelLeeImg force-pushed the fix/context_command_fails branch from 1bea83a to 2eb45e7 Compare September 15, 2021 03:36
Copy link
Owner

@hugsy hugsy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better now, all good for me

@RafaelLeeImg
Copy link
Contributor Author

The condition I have is setting watchpoints in my debugging session.
Tests failed yesterday is because I have write ~/.gef.rc.
I removed the file ~/.gef.rc and installed all the dependencies, all tests passed on my local amd64 computer. About the identical lines in L5544, L5575, these requires IDA which I don't have, I cannot verify them.
I checked L8024, with the config contex.layout "code". It's already fixed with the commit 852f9f6.
Now, all tests in make test are passed.

@hugsy
Copy link
Owner

hugsy commented Sep 15, 2021

Yeah I wouldn't worry too much for you as long as tests pass on our CI.

Waiting for @theguy147 final review and we can merge.

Thanks @RafaelLeeImg

@theguy147 theguy147 added this to the Release: next milestone Sep 15, 2021
@theguy147 theguy147 added the bug label Sep 15, 2021
@theguy147 theguy147 merged commit 44c12c6 into hugsy:dev Sep 15, 2021
@RafaelLeeImg RafaelLeeImg deleted the fix/context_command_fails branch September 15, 2021 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants