We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, just done LLDB SyntheticProvider for GenericArray, it is not ideal, but works :)
import lldb class GenericArraySyntheticProvider: def __init__(self, valobj, internal_dict): self.valobj = valobj self.count = 0 self.extract_values() def extract_values(self): self.values = [] self.types = [] self.count = 0 # Assuming data is the root field containing the array structure data_valobj = self.valobj.GetChildMemberWithName('data') self.traverse(data_valobj) def traverse(self, valobj): if not valobj.IsValid(): return if valobj.GetNumChildren() == 0: return for i in range(valobj.GetNumChildren()): child = valobj.GetChildAtIndex(i) if child.IsValid(): data_child = child.GetChildMemberWithName('data') if data_child.IsValid(): self.values.append(data_child.GetData()) self.types.append(data_child.GetType()) self.count += 1 self.traverse(child) def num_children(self): return self.count def get_child_index(self, name): try: return int(name.lstrip('[').rstrip(']')) except ValueError: return -1 def get_child_at_index(self, index): if index < 0 or index >= self.count: return None value = self.values[index] typo = self.types[index] return self.valobj.CreateValueFromData(f"[{index}]", value, typo) def update(self): # Re-extract values in case the underlying object has changed self.extract_values() def has_children(self): return True def __lldb_init_module(debugger, internal_dict): debugger.HandleCommand(f'type synthetic add -l { __name__ }.GenericArraySyntheticProvider -x "^generic_array::GenericArray<.*>$"')
And command to add it: command script import ~/.lldb/scripts/GenericArray.py in .lldbinit
command script import ~/.lldb/scripts/GenericArray.py
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello, just done LLDB SyntheticProvider for GenericArray, it is not ideal, but works :)
And command to add it:
command script import ~/.lldb/scripts/GenericArray.py
in .lldbinitThe text was updated successfully, but these errors were encountered: