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: Allow setting attributes on gdb Breakpoints #2339

Merged
merged 3 commits into from
Jan 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add __getattr__ accidentally deleted from FinishBreakpoint
  • Loading branch information
Nils1729 committed Jan 27, 2024
commit e85743ce41798f4beac96ec0982065b2a6ae8dd5
16 changes: 16 additions & 0 deletions pwnlib/gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,22 @@ def _server_set_breakpoint(self, *args, **kwargs):
self, hasattr(self, 'stop'), hasattr(self, 'out_of_scope'),
*args, **kwargs)

def __getattr__(self, item):
"""Return attributes of the real breakpoint."""
if item in (
'____id_pack__',
'__name__',
'____conn__',
'stop',
'out_of_scope',
):
# Ignore RPyC netref attributes.
# Also, if stop() or out_of_scope() are not defined, hasattr() call
# in our __init__() will bring us here. Don't contact the
# server in this case either.
raise AttributeError()
return getattr(self.server_breakpoint, item)

def exposed_out_of_scope(self):
# Handle out_of_scope() call from the server.
return self.out_of_scope()
Expand Down