{"record":{"id":"58b6b6f504199a7a","repo":"NationalSecurityAgency/ghidra","slug":"unrecognized-order-order","errorCode":null,"errorMessage":"Unrecognized order: {order}","messagePattern":"Unrecognized order: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py","lineNumber":1088,"sourceCode":"    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],\n        str, None], Optional[sch.Schema]]:\n    return convert_value(expr, util.get_eval(expr), schema)","sourceCodeStart":1070,"sourceCodeEnd":1106,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py#L1070-L1106","documentation":"ValueError raised by get_byte_order() when SBData.byte_order is not one of big, little, or PDP. This is a defensive fallthrough for an unrecognized lldb byte-order enum value, indicating either a new LLDB API addition or corrupt/unexpected data.","triggerScenarios":"A newer LLDB version introduces a new eByteOrder* enum that this code does not handle; byte_order returns an out-of-range integer due to API misuse or an unloaded target.","commonSituations":"Upgrading LLDB to a version that adds endianness variants; querying byte_order before a target/process is properly selected so the field is uninitialized.","solutions":["Ensure a valid target/process/frame is selected before calling commands that read byte_order.","Check the LLDB version changelog for new eByteOrder constants and extend get_byte_order if needed.","Downgrade or pin LLDB to a version whose byte-order enum this agent was written against."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import lldb\n\nKNOWN_ORDERS = {lldb.eByteOrderBig, lldb.eByteOrderLittle, lldb.eByteOrderPDP}\n\ndef order_recognized(order: int) -> bool:\n    return order in KNOWN_ORDERS","typeGuard":"def is_known_order(order: int) -> bool:\n    import lldb\n    return order in {lldb.eByteOrderBig, lldb.eByteOrderLittle, lldb.eByteOrderPDP}","tryCatchPattern":"try:\n    order = get_byte_order(data.byte_order)\nexcept ValueError as e:\n    if 'Unrecognized' in str(e):\n        # log and skip; new/unknown LLDB byte order\n        return None\n    raise","preventionTips":["Ensure a valid target/process is selected before reading byte_order.","When upgrading LLDB, review new eByteOrder constants and extend get_byte_order.","Pin LLDB to a version this agent supports if a new constant breaks recording."],"tags":["ghidra-trace","byte-order","version-compat","lldb"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}