{"record":{"id":"7723dfa97e781c4b","repo":"slint-ui/slint","slug":"unsupported-nonnull-layout-in-slice","errorCode":null,"errorMessage":"unsupported NonNull layout in Slice","messagePattern":"unsupported NonNull layout in Slice","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"warning","filePath":"internal/core/gdb_pretty_printers.py","lineNumber":112,"sourceCode":"            elem_type = data_ptr.type.target()\n            for i in range(length):\n                yield f\"[{i}]\", (data_ptr + i).dereference()\n        except Exception as e:\n            yield \"<error>\", f\"error reading elements: {e}\"\n\n    def display_hint(self):\n        return \"array\"\n\n    def _data_pointer(self):\n        nn = self.val[\"ptr\"]\n        if nn.type.code == gdb.TYPE_CODE_PTR:\n            return nn\n        for field in nn.type.fields():\n            if field.name in (\"pointer\", \"__0\", \"0\"):\n                candidate = nn[field]\n                if candidate.type.code == gdb.TYPE_CODE_PTR:\n                    return candidate\n        raise RuntimeError(\"unsupported NonNull layout in Slice\")\n\n\nclass SliceSubPrinter(gdb.printing.SubPrettyPrinter):\n    def __init__(self):\n        super().__init__(\"Slice\")\n\n    def __call__(self, val):\n        if not self.enabled:\n            return None\n        t = val.type.strip_typedefs()\n        if t.code == gdb.TYPE_CODE_PTR:  # also support reference to Slice\n            try:\n                val = val.dereference()\n                t = val.type.strip_typedefs()\n            except gdb.error:\n                return None\n        if (\n            t.code == gdb.TYPE_CODE_STRUCT","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/slint-ui/slint/blob/a9ea814a5813e7460fa1a867924872095a4d678d/internal/core/gdb_pretty_printers.py#L94-L130","documentation":"Part of Slint's GDB pretty printers: for a Slice value, the printer reads the `ptr` field (a NonNull) and expects either a direct pointer or a wrapped field named pointer/__0/0 holding the pointer. If the NonNull layout in the debug info has none of those shapes, it raises RuntimeError 'unsupported NonNull layout in Slice' and the value is not pretty-printed.","triggerScenarios":"Printing a Slice (`p some_slice`) or a reference to one in GDB with the Slint pretty printers enabled, when the NonNull wrapper's field layout is unrecognized for the current toolchain/build.","commonSituations":"Version skew between the slint printers and the rustc that produced the debug info; different codegen settings (e.g. -Zbuild-std, newer enum layout niches); using plain gdb without the rust pretty-printing setup.","solutions":["Update the Slint pretty printers to the revision matching the binary.","Debug with rust-gdb of the same toolchain version.","Workaround: `disable pretty-printer slint Slice` and read ptr/slice_len fields manually.","Report the layout upstream if versions already match."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep printer and toolchain versions in lockstep (rust-gdb of the same rustc).","When printers fail, disable the specific one (`disable pretty-printer slint Slice`) and read ptr/len fields manually.","Prefer LLDB's rust renderers if GDB layouts keep mismatching on your toolchain."],"tags":["gdb","debugging","rust","pretty-printers","nonnull"],"backgroundTag":"gdb-pretty-printer-mismatch","analyzedSha":"a9ea814a5813e7460fa1a867924872095a4d678d","analyzedAt":"2026-08-16T22:39:12.830Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}