[Libre-soc-bugs] [Bug 1094] insndb instruction database visitor-walker is needed

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Jun 16 21:31:37 BST 2023


https://bugs.libre-soc.org/show_bug.cgi?id=1094

--- Comment #143 from Dmitry Selyutin <ghostmansd at gmail.com> ---
Meanwhile I've updated the module, incorporating suggestions from Jacob as
well. Changes:

1. From now on we keep the original names for the functions and no longer
bother construct the new ones on-the-fly. This actually proved to be difficult,
because I had to reconsider how and where keep the established hooks.
2. There is no explicit separation between call hooks and typeid hooks,
corresponding to different decoration stages. Since both need class
information, we construct the call hook dynamically, and have only one class:
Hook. This type migrated into dispatcher module.
3. If there's a conflict in hooks, that is, a user attempted to hook the same
type several times, the exception will show all conflicting functions.
4. Dropped the "wrapper" argument. As Jacob suggested, if somebody needs
context managers, they should add these explicitly.
5. The representation for hooks is greatly simplified, this affects the help
text too. The example for a CustomWalker installing hook for dict (irrelevant
details snipped):

class CustomWalker(mdis.walker.Walker)
 |  Data and other attributes defined here:
 |  dispatch_dict = <dict>
 |  
 |  Data and other attributes inherited from mdis.walker.Walker:
 |  dispatch_mapping = <dict>
 |  dispatch_object = <object>
 |  dispatch_sequence = <tuple, list, set, frozenset>

Note that the example above had a method called dispatch_mapping at dict; but
instead the top-level method will be called due to MRO.


Again, until we decide on how to store the module, I published it to PyPI and
repo.or.cz (the reply from Luke considered an outdated state of art). I tend to
think we might have a standalone repository here, but at the same time have
this module in PyPI. On the other hand, the users would probably like something
more HW-agnostic; but please not Github (I still have an account there, but
would like something more liberal and open).

https://pypi.org/project/mdis
https://repo.or.cz/mdis.git

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list