{"record":{"id":"6efa3ace3955afe5","repo":"NationalSecurityAgency/ghidra","slug":"usage-ghidra-trace-sync-enable","errorCode":null,"errorMessage":"Usage: ghidra trace sync-enable","messagePattern":"Usage: ghidra trace sync-enable","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py","lineNumber":2027,"sourceCode":"def ghidra_trace_sync_enable(debugger: lldb.SBDebugger, command: str,\n                             result: lldb.SBCommandReturnObject,\n                             internal_dict: Dict[str, Any]) -> None:\n    \"\"\"Synchronize the current process with the Ghidra trace.\n\n    Usage: ghidra trace sync-enable\n\n    This will automatically install hooks if necessary. The goal is to record\n    the current frame, thread, and process into the trace immediately, and then\n    to append the trace upon stopping and/or selecting new frames. This action\n    is effective only for the current process. This command must be executed\n    for each individual process you'd like to synchronize.\n\n    This will have no effect unless or until you start a trace.\n    \"\"\"\n\n    args = shlex.split(command)\n    if len(args) != 0:\n        raise RuntimeError(\"Usage: ghidra trace sync-enable\")\n\n    hooks.install_hooks()\n    hooks.enable_current_process()\n\n\n@convert_errors\ndef ghidra_trace_sync_disable(debugger: lldb.SBDebugger, command: str,\n                              result: lldb.SBCommandReturnObject,\n                              internal_dict: Dict[str, Any]) -> None:\n    \"\"\"Cease synchronizing the current process with the Ghidra trace.\n\n    Usage: ghidra trace sync-disable\n\n    This is the opposite of 'ghidra trace sync-enable', except it will not\n    automatically remove hooks.\n    \"\"\"\n\n    args = shlex.split(command)","sourceCodeStart":2009,"sourceCodeEnd":2045,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py#L2009-L2045","documentation":"Raised by ghidra_trace_sync_enable when any argument is passed. sync-enable installs hooks (if needed) and enables synchronization for the current process so stops/frames are recorded into the trace; it is parameterless (commands.py:2027). Must be run per-process and only takes effect once a trace is started.","triggerScenarios":"Appending a process id or `all` like `ghidra trace sync-enable all`, or trailing text.","commonSituations":"Users try to enable sync for every process at once; the command targets only the current process and must be repeated per process. It also silently does nothing until a trace exists.","solutions":["Run bare: `ghidra trace sync-enable`.","Ensure a trace is started (`ghidra trace start`) first, and repeat the command for each process you want synced."],"exampleFix":"// before\nghidra trace sync-enable all\n// after\nghidra trace sync-enable","handlingStrategy":"validation","validationCode":"assert len(command.split()) == 0, \"sync-enable takes no arguments\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["sync-enable targets the current process only; repeat per process.","Start a trace first; sync-enable is a no-op without one."],"tags":["lldb","ghidra","cli-usage","debugger-agent","sync"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}