Clear caches on `events.clear_objfiles`
See original GitHub issueFor the last several releases, GDB has supported the following events that may allow us to make pwndbg.events
more efficient: https://sourceware.org/gdb/onlinedocs/gdb/Events-In-Python.html#Events-In-Python
If we add support for these, we will need to add workarounds for older GDB versions that don’t support them. We should also add memoize
functions for these.
Support for all of these events tarted with GDB v7.9, which corresponds to Ubuntu 16.04. Since these have been available for 4 years, we can either stub them out (i.e. fire them on every prompt event) or just require GDB 7.9 (released in 2015) to use Pwndbg.
events.memory_changed
This will allow us to memoize memory addresses (e.g. pwndbg.memory.read
), which is useful when debugging over a high-latency link (e.g. tunneling a gdbserver connection over SSH).
Workaround can just be to fire this event on every prompt, or to not memoize at all (which is the current behavior).
Currently we have this in events
but nothing uses it. We just need to add stubs and apply the memoize to mem.py
.
events.register_changed
This allows us to be more precise in caching register values. Currently, we do double-caching:
Workaround can just be to fire the event when either of the two current events fire.
Currently we have pwndbg.events.register_changed
but nothing uses it. I think all that’s needed is to stub out the workaround and apply this judiciously to regs.py
.
events.clear_objfiles
This event seems like it only occurs when a new process shows, we should probably clear all memos when this occurs.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
I’d prefer to keep out-of-the-box support for Xenial (7.11) for now.
Zach Riggle
On Sat, Jun 6, 2020 at 5:49 PM Disconnect3d notifications@github.com wrote:
Also, new process may not be the only way to clear_objfiles, I think there was something to unload symbols from file. Maybe that triggers the event as well?