CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
60 lines
1.8 KiB
Python
60 lines
1.8 KiB
Python
import lldb
|
|
|
|
|
|
class PythonObjectSyntheticChildProvider(object):
|
|
def __init__(self, value, internal_dict):
|
|
self.value = value
|
|
self.values = self.make_children()
|
|
self.built_values = {}
|
|
self.bo = self.value.target.byte_order
|
|
self.ps = self.value.target.addr_size
|
|
|
|
def make_children(self):
|
|
pass
|
|
|
|
def num_children(self):
|
|
return len(self.values)
|
|
|
|
def get_child_index(self, name):
|
|
i = 0
|
|
for N, value in self.values:
|
|
if N == name:
|
|
return i
|
|
i += 1
|
|
return None
|
|
|
|
def update(self):
|
|
pass
|
|
|
|
def has_children(self):
|
|
return len(self.values) > 0
|
|
|
|
def gen_child(self, name, value):
|
|
data = None
|
|
type = None
|
|
if isinstance(value, int):
|
|
data = lldb.SBData.CreateDataFromUInt64Array(self.bo, self.ps, [value])
|
|
type = self.value.target.GetBasicType(lldb.eBasicTypeLong)
|
|
elif isinstance(value, float):
|
|
data = lldb.SBData.CreateDataFromDoubleArray(self.bo, self.ps, [value])
|
|
type = self.value.target.GetBasicType(lldb.eBasicTypeDouble)
|
|
elif isinstance(value, str):
|
|
data = lldb.SBData.CreateDataFromCString(self.bo, self.ps, value)
|
|
type = self.value.target.GetBasicType(lldb.eBasicTypeChar).GetArrayType(
|
|
len(value)
|
|
)
|
|
if (data is not None) and (type is not None):
|
|
return self.value.CreateValueFromData(name, data, type)
|
|
return None
|
|
|
|
def get_child_at_index(self, index):
|
|
if index in self.built_values:
|
|
return self.built_values[index]
|
|
|
|
bv = None
|
|
|
|
name, value = self.values[index]
|
|
bv = self.gen_child(name, value)
|
|
self.built_values[index] = bv
|
|
return bv
|