{"record":{"id":"b7e4905e5edd5fa8","repo":"NationalSecurityAgency/ghidra","slug":"pdp-byte-order-unsupported","errorCode":null,"errorMessage":"PDP byte order unsupported","messagePattern":"PDP byte order unsupported","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py","lineNumber":1086,"sourceCode":"def to_int_list(value: lldb.SBValue) -> List[int]:\n    n = value.GetNumChildren()\n    return [int(value.GetChildAtIndex(i).GetValueAsUnsigned())\n            for i in range(0, n)]\n\n\ndef to_short_list(value: lldb.SBValue) -> List[int]:\n    n = value.GetNumChildren()\n    return [int(value.GetChildAtIndex(i).GetValueAsUnsigned())\n            for i in range(0, n)]\n\n\ndef get_byte_order(order: int) -> Literal['big', 'little']:\n    if order == lldb.eByteOrderBig:\n        return 'big'\n    elif order == lldb.eByteOrderLittle:\n        return 'little'\n    elif order == lldb.eByteOrderPDP:\n        raise ValueError(\"PDP byte order unsupported\")\n    else:\n        raise ValueError(f\"Unrecognized order: {order}\")\n\n\ndef data_to_int(data: lldb.SBData) -> int:\n    order = get_byte_order(data.byte_order)\n    return int.from_bytes(data.uint8s, order)\n\n\ndef data_to_reg_bytes(data: lldb.SBData) -> bytes:\n    order = get_byte_order(data.byte_order)\n    if order == 'little':\n        return bytes(reversed(data.uint8s))\n    return bytes(data.uint8s)\n\n\ndef eval_value(expr: str, schema: Optional[sch.Schema] = None) -> Tuple[Union[\n        bool, int, float, bytes, Tuple[str, Address], List[bool], List[int],","sourceCodeStart":1068,"sourceCodeEnd":1104,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py#L1068-L1104","documentation":"ValueError raised by get_byte_order() when the target data reports lldb.eByteOrderPDP (PDP-11 middle-endian). The Ghidra trace layer only supports big- and little-endian, so PDP-endian data cannot be faithfully serialized and is rejected outright.","triggerScenarios":"Inspecting/recording memory or register values on a target whose SBData.byte_order equals eByteOrderPDP. This typically only appears on legacy PDP-11 or certain emulated middle-endian cores.","commonSituations":"Connecting LLDB to a niche/emulated target that advertises PDP byte order; misconfigured emulator exposing PDP endianness for an otherwise little-endian guest.","solutions":["Use a target that reports big- or little-endian byte order.","If controlling an emulator, configure it to expose a supported endianness.","Patch get_byte_order to synthesize a best-effort ordering only if you can tolerate incorrect byte layout (not recommended)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import lldb\n\ndef supports_byte_order(data: 'lldb.SBData') -> bool:\n    return data.byte_order in (lldb.eByteOrderBig, lldb.eByteOrderLittle)","typeGuard":"def is_supported_order(order: int) -> bool:\n    import lldb\n    return order in (lldb.eByteOrderBig, lldb.eByteOrderLittle)","tryCatchPattern":"try:\n    order = get_byte_order(data.byte_order)\nexcept ValueError:\n    # skip recording this value; target endianness unsupported\n    return None","preventionTips":["Use a target that reports big- or little-endian byte order.","Check data.byte_order before calling data_to_int/data_to_reg_bytes.","Configure emulators to expose a supported endianness."],"tags":["ghidra-trace","byte-order","endian","unsupported-target"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}