blob: d769e137d3f34bedf7b99e821f0481a7f6382ae3 [file] [log] [blame]
import os
import lldb
from lldb.plugins.scripted_process import ScriptedProcess
class MyScriptedProcess(ScriptedProcess):
def __init__(self, target: lldb.SBTarget, args : lldb.SBStructuredData):
super().__init__(target, args)
def get_memory_region_containing_address(self, addr: int) -> lldb.SBMemoryRegionInfo:
return self.memory_regions[0]
def get_thread_with_id(self, tid: int):
return {}
def get_registers_for_thread(self, tid: int):
return {}
def read_memory_at_address(self, addr: int, size: int) -> lldb.SBData:
data = lldb.SBData().CreateDataFromCString(,,
"Hello, world!")
return data
def get_loaded_images(self):
return self.loaded_images
def get_process_id(self) -> int:
return 42
def is_alive(self) -> bool:
return True
def __lldb_init_module(debugger, dict):
if not 'SKIP_SCRIPTED_PROCESS_LAUNCH' in os.environ:
"process launch -C %s.%s" % (__name__,
print("Name of the class that will manage the scripted process: '%s.%s'"
% (__name__, MyScriptedProcess.__name__))