question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clear caches on `events.clear_objfiles`

See original GitHub issue

For 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:

https://github.com/pwndbg/pwndbg/blob/677dfa2a1947fed41bcae315eb5656234150e43f/pwndbg/regs.py#L283-L285

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:open
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
zachrigglecommented, Jun 9, 2020

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:

or just require GDB 7.9 (released in 2015) to use Pwndbg

I’d be even up for bumping the required version even more, like 9.x as it’s not that big deal to compile GDB from scratch 😛.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pwndbg/pwndbg/issues/773#issuecomment-640128128, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA3IGFCNYOJZSR3GPIUQB3RVLBYVANCNFSM4NO7H4OQ .

0reactions
disconnect3dcommented, Oct 9, 2022

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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

CacheStorage.delete() - Web APIs - MDN Web Docs
The delete() method of the CacheStorage interface finds the Cache object matching the cacheName, and if found, deletes the Cache object and ...
Read more >
Clear Analysis Services caches | Microsoft Learn
Learn how and when to clear caches in SQL Server Analysis Services for different kinds of models.
Read more >
I want to delete all bin and obj folders to force all projects to ...
I needed to delete all files in bin and obj folders for debug and release. My solution: 1.Right click project, unload, right click...
Read more >
Clean does not delete all files in bin and obj folders
I created a new iOS project using Visual Studio for Mac 7.6 built the solution and then ran a Clean and all files...
Read more >
When should you clear the object cache? - NI Community
And if there's ANY other weirdness, then the FIRST thing I do is close the project, clear the cache, and re-open the project....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found