|
8 | 8 |
|
9 | 9 | logger = logging.getLogger(__name__) |
10 | 10 |
|
| 11 | + |
11 | 12 | @lru_cache(maxsize=1) |
12 | 13 | def get_module_symbols(module_name: str): |
13 | 14 | imported_module = importlib.import_module(module_name) |
14 | 15 | return [name for name in dir(imported_module)], imported_module |
15 | 16 |
|
| 17 | + |
16 | 18 | # Recursive function that gets all the dependent classes and adds them to handler |
17 | 19 | def process_vmlinux_class(node, llvm_module, handler: DependencyHandler): |
18 | 20 | symbols_in_module, imported_module = get_module_symbols("vmlinux") |
@@ -64,11 +66,12 @@ def process_vmlinux_class(node, llvm_module, handler: DependencyHandler): |
64 | 66 | elif module_name == "vmlinux": |
65 | 67 | new_dep_node.add_field(elem_name, elem_type, ready=False) |
66 | 68 | # Create a temporary node-like object for recursion |
67 | | - temp_node = type('TempNode', (), {'name': elem_type.__name__ if hasattr(elem_type, '__name__') else str(elem_type)})() |
| 69 | + temp_node = type('TempNode', (), |
| 70 | + {'name': elem_type.__name__ if hasattr(elem_type, '__name__') else str(elem_type)})() |
68 | 71 | if process_vmlinux_class(temp_node, llvm_module, handler): |
69 | 72 | new_dep_node.set_field_ready(elem_name, True) |
70 | 73 | else: |
71 | | - print(f"[other] {elem_name} -> {elem_type}") |
| 74 | + raise ValueError(f"{elem_name} with type {elem_type} not supported in recursive resolver") |
72 | 75 | handler.add_node(new_dep_node) |
73 | 76 |
|
74 | 77 | return True |
0 commit comments