{"record":{"id":"66e19b545af1b52a","repo":"NationalSecurityAgency/ghidra","slug":"usage-ghidra-trace-disassemble-address","errorCode":null,"errorMessage":"Usage: ghidra trace disassemble ADDRESS","messagePattern":"Usage: ghidra trace disassemble ADDRESS","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py","lineNumber":1430,"sourceCode":"\n    activate(path)\n\n\n@convert_errors\ndef ghidra_trace_disassemble(debugger: lldb.SBDebugger, command: str,\n                             result: lldb.SBCommandReturnObject,\n                             internal_dict: Dict[str, Any]) -> None:\n    \"\"\"Disassemble starting at the given seed.\n\n    Usage: ghidra trace disassemble ADDRESS\n\n    Disassembly proceeds linearly and terminates at the first branch or unknown\n    memory encountered.\n    \"\"\"\n\n    args = shlex.split(command)\n    if len(args) != 1:\n        raise RuntimeError(\"Usage: ghidra trace disassemble ADDRESS\")\n    address = args[0]\n\n    trace, tx = STATE.require_tx()\n    start = eval_address(address)\n    if start is None:\n        return\n    proc = util.get_process()\n    base, addr = trace.extra.require_mm().map(proc, start)\n    if base != addr.space:\n        trace.create_overlay_space(base, addr.space)\n\n    length = trace.disassemble(addr)\n    result.PutCString(f\"Disassembled {length} bytes\")\n\n\ndef compute_proc_state(proc: lldb.SBProcess) -> str:\n    if proc.is_running:\n        return 'RUNNING'","sourceCodeStart":1412,"sourceCodeEnd":1448,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py#L1412-L1448","documentation":"Raised by ghidra_trace_disassemble when the argument count is not exactly 1. The command disassembles linearly from a single seed ADDRESS into the Ghidra trace and needs precisely one address expression; zero, two, or more tokens are rejected at commands.py:1430.","triggerScenarios":"Calling `ghidra trace disassemble` with no address (`ghidra trace disassemble`), or with extra tokens such as `ghidra trace disassemble 0x1000 0x2000` (disassemble takes a start only, not a range), or a pasted address+label string that splits into two tokens.","commonSituations":"Developers assume disassemble accepts ADDRESS LENGTH (like putmem) and pass two values; or they forget the address after a target switch. Some forget to prefix a register/expr and the shell splits it.","solutions":["Provide exactly one seed: `ghidra trace disassemble 0x100000`.","Use an expression/register as the single token: `ghidra trace disassemble $pc`.","To disassemble a range, call disassemble repeatedly or rely on putmem + Ghidra's disassembly, not a length argument."],"exampleFix":"// before\nghidra trace disassemble 0x1000 0x2000\n// after\nghidra trace disassemble 0x1000","handlingStrategy":"validation","validationCode":"parts = command.split()\nassert len(parts) == 1, \"disassemble takes exactly one ADDRESS\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["disassemble takes a single seed address or register expression, not a range.","Quote expressions that contain spaces.","For ranges, call disassemble per seed or rely on putmem."],"tags":["lldb","ghidra","cli-usage","debugger-agent","disassembly"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}