diff options
Diffstat (limited to 'lldb/bindings/python')
-rw-r--r-- | lldb/bindings/python/python-scripted-process.swig | 53 | ||||
-rw-r--r-- | lldb/bindings/python/python.swig | 1 |
2 files changed, 54 insertions, 0 deletions
diff --git a/lldb/bindings/python/python-scripted-process.swig b/lldb/bindings/python/python-scripted-process.swig new file mode 100644 index 000000000000..4b6888f86b77 --- /dev/null +++ b/lldb/bindings/python/python-scripted-process.swig @@ -0,0 +1,53 @@ +%pythoncode %{ +from abc import ABC, abstractmethod +from typing import List + +import lldb + +class ScriptedProcess(ABC): + @abstractmethod + def __init__(self): + pass + + # Optional initializer + def __init__(self, dictionary: lldb.SBStructuredData): + pass + + ### Main funcitonnalities + @abstractmethod + def get_num_memory_regions(self) -> int: + pass + + @abstractmethod + def get_memory_region_at_index(self, idx: int) -> lldb.SBMemoryRegionInfo: + pass + + @abstractmethod + def get_num_threads(self): + pass + + @abstractmethod + def get_thread_at_index(self, idx: int) -> lldb.SBThread: + pass + + @abstractmethod + def get_register_for_thread(self, tid:int): + pass + + @abstractmethod + def read_memory_at_address(self, addr:int) -> lldb.SBData: + pass + + @abstractmethod + def get_loaded_images(self) -> List[str]: # -> List[lldb.SBModule]: + pass + + ### Process state + @abstractmethod + def can_debug(self) -> bool: + pass + + @abstractmethod + def is_alive(self) -> bool: + pass +%} diff --git a/lldb/bindings/python/python.swig b/lldb/bindings/python/python.swig index 66a75328d1e7..9459c8c7be2e 100644 --- a/lldb/bindings/python/python.swig +++ b/lldb/bindings/python/python.swig @@ -126,6 +126,7 @@ using namespace lldb; %include "interfaces.swig" %include "python-extensions.swig" %include "python-wrapper.swig" +%include "python-scripted-process.swig" %pythoncode%{ _initialize = True |