self.extended_thread_info = None
self.parse_crashlog()
- def get_memory_region_containing_address(self, addr: int) -> lldb.SBMemoryRegionInfo:
- return None
-
- 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, error: lldb.SBError) -> lldb.SBData:
# NOTE: CrashLogs don't contain any memory.
return lldb.SBData()
"""
return self.capabilities
- @abstractmethod
def get_memory_region_containing_address(self, addr):
""" Get the memory region for the scripted process, containing a
specific address.
lldb.SBMemoryRegionInfo: The memory region containing the address.
None if out of bounds.
"""
- pass
+ return None
def get_threads_info(self):
""" Get the dictionary describing the process' Scripted Threads.
return self.threads
@abstractmethod
- def get_thread_with_id(self, tid):
- """ Get the scripted process thread with a specific ID.
-
- Args:
- tid (int): Thread ID to look for in the scripted process.
-
- Returns:
- Dict: The thread represented as a dictionary, with the
- tid thread ID. None if tid doesn't match any of the scripted
- process threads.
- """
- pass
-
- @abstractmethod
- def get_registers_for_thread(self, tid):
- """ Get the register context dictionary for a certain thread of
- the scripted process.
-
- Args:
- tid (int): Thread ID for the thread's register context.
-
- Returns:
- Dict: The register context represented as a dictionary, for the
- tid thread. None if tid doesn't match any of the scripted
- process threads.
- """
- pass
-
- @abstractmethod
def read_memory_at_address(self, addr, size, error):
""" Get a memory buffer from the scripted process at a certain address,
of a certain size.
virtual StructuredData::DictionarySP GetThreadsInfo() { return {}; }
- virtual StructuredData::DictionarySP GetThreadWithID(lldb::tid_t tid) {
- return {};
- }
-
- virtual StructuredData::DictionarySP GetRegistersForThread(lldb::tid_t tid) {
- return {};
- }
-
virtual lldb::DataExtractorSP
ReadMemoryAtAddress(lldb::addr_t address, size_t size, Status &error) {
return {};
return dict;
}
-StructuredData::DictionarySP
-ScriptedProcessPythonInterface::GetThreadWithID(lldb::tid_t tid) {
- Status error;
- StructuredData::ObjectSP obj = Dispatch("get_thread_with_id", error, tid);
-
- if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error))
- return {};
-
- StructuredData::DictionarySP dict{obj->GetAsDictionary()};
-
- return dict;
-}
-
-StructuredData::DictionarySP
-ScriptedProcessPythonInterface::GetRegistersForThread(lldb::tid_t tid) {
- // TODO: Implement
- return {};
-}
-
lldb::DataExtractorSP ScriptedProcessPythonInterface::ReadMemoryAtAddress(
lldb::addr_t address, size_t size, Status &error) {
Status py_error;
StructuredData::DictionarySP GetThreadsInfo() override;
- StructuredData::DictionarySP GetThreadWithID(lldb::tid_t tid) override;
-
- StructuredData::DictionarySP GetRegistersForThread(lldb::tid_t tid) override;
-
lldb::DataExtractorSP ReadMemoryAtAddress(lldb::addr_t address, size_t size,
Status &error) override;
+
StructuredData::ArraySP GetLoadedImages() override;
super().__init__(exe_ctx, args)
self.threads[0] = DummyScriptedThread(self, None)
- def get_memory_region_containing_address(self, addr: int) -> lldb.SBMemoryRegionInfo:
- return None
-
- 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, error: lldb.SBError) -> lldb.SBData:
debugger = self.target.GetDebugger()
index = debugger.GetIndexOfTarget(self.target)
super().__init__(exe_ctx, args)
self.threads[0] = InvalidScriptedThread(self, None)
- def get_memory_region_containing_address(self, addr: int) -> lldb.SBMemoryRegionInfo:
- return None
-
- 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, error: lldb.SBError) -> lldb.SBData:
error.SetErrorString("This is an invalid scripted process!")
return lldb.SBData()
return None
return mem_region
- 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, error: lldb.SBError) -> lldb.SBData:
data = lldb.SBData()
bytes_read = self.corefile_process.ReadMemory(addr, size, error)