{"record":{"id":"5b4acb6e2a84d9cc","repo":"NationalSecurityAgency/ghidra","slug":"usage-ghidra-trace-put-modules","errorCode":null,"errorMessage":"Usage: ghidra trace put-modules","messagePattern":"Usage: ghidra trace put-modules","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py","lineNumber":1819,"sourceCode":"        modobj.insert()\n        trace.proxy_object_path(\n            mpath + SECTIONS_ADD_PATTERN).retain_values(sec_keys)\n    trace.proxy_object_path(MODULES_PATTERN.format(\n        procnum=proc.GetProcessID())).retain_values(mod_keys)\n\n\n@convert_errors\ndef ghidra_trace_put_modules(debugger: lldb.SBDebugger, command: str,\n                             result: lldb.SBCommandReturnObject,\n                             internal_dict: Dict[str, Any]) -> None:\n    \"\"\"Gather object files, if applicable, and write to the trace's Modules.\n\n    Usage: ghidra trace put-modules\n    \"\"\"\n\n    args = shlex.split(command)\n    if len(args) != 0:\n        raise RuntimeError(\"Usage: ghidra trace put-modules\")\n\n    trace, tx = STATE.require_tx()\n    with trace.client.batch() as b:\n        put_modules()\n\n\ndef convert_state(t: lldb.SBThread) -> str:\n    # TODO: This does not seem to work - currently supplanted by proc.is_running\n    if t.IsSuspended():\n        return 'SUSPENDED'\n    if t.IsStopped():\n        return 'STOPPED'\n    return 'RUNNING'\n\n\ndef compute_thread_display(t: lldb.SBThread) -> str:\n    return util.get_description(t)\n","sourceCodeStart":1801,"sourceCodeEnd":1837,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py#L1801-L1837","documentation":"Raised by ghidra_trace_put_modules when any argument is passed. put-modules gathers the target's object files/modules and writes them to the trace's Modules; it takes no parameters (commands.py:1819).","triggerScenarios":"Appending a module name, base address, or index, e.g. `ghidra trace put-modules a.out`, or trailing tokens.","commonSituations":"Users expect to refresh a single module; the agent always publishes all modules of the current process. Non-empty arg from a templated script is a frequent cause.","solutions":["Run bare: `ghidra trace put-modules`.","Filter/inspect modules in Ghidra after publishing, not via this command's arguments."],"exampleFix":"// before\nghidra trace put-modules a.out\n// after\nghidra trace put-modules","handlingStrategy":"validation","validationCode":"assert len(command.split()) == 0, \"put-modules takes no arguments\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["put-modules publishes all modules of the current process.","Filter modules in Ghidra after publishing."],"tags":["lldb","ghidra","cli-usage","debugger-agent","modules"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}