clayborg wrote:

To extend on Pavel's modification of my idea:
```
class ScriptedPlatform:
  def extends_platform_name(self):
    '''Get the name of the internal platform this class extends.'''
    return "iPhoneOS.platform"
```
Then every function would have 3 variants:
```
def pre_XXX(...):
def XXX(...)
def post_XXX(...)
```
So for "attach_to_process" this would mean the possible functions are:
```
class ScriptedPlatform:
  def pre_attach_to_process(self, ...):
    # Called before the extended platform default attach_to_process() 
functionality
    # but only if `def extends_platform_name(self)` exists in this class. The 
default
    # attach_to_process() from the extended platform will be called after this 
function
    # completes.

  def attach_to_process(self, ...):
    # This will override the attach_to_process() functionality. Clients that 
implement
    # this function should not override pre_attach_to_process() or 
    # post_attach_to_process() as everything can be done in this function.

  def post_attach_to_process(...)
    # Called after the extended platform's default attach_to_process() 
functionality
    # but only if `def extends_platform_name(self)` exists in this class. 
```

https://github.com/llvm/llvm-project/pull/99814
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to