{"record":{"id":"beea7abbb36c2851","repo":"NationalSecurityAgency/ghidra","slug":"usage-ghidra-trace-stop","errorCode":null,"errorMessage":"Usage: ghidra trace stop","messagePattern":"Usage: ghidra trace stop","errorType":"validation","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py","lineNumber":430,"sourceCode":"        raise RuntimeError(\"Usage: ghidra trace start [NAME]\")\n\n    STATE.require_client()\n    STATE.require_no_trace()\n    start_trace(name)\n\n\n@convert_errors\ndef ghidra_trace_stop(debugger: lldb.SBDebugger, command: str,\n                      result: lldb.SBCommandReturnObject,\n                      internal_dict: Dict[str, Any]) -> None:\n    \"\"\"Stop the Trace in Ghidra.\n\n    Usage: ghidra trace stop\n    \"\"\"\n\n    args = shlex.split(command)\n    if len(args) != 0:\n        raise RuntimeError(\"Usage: ghidra trace stop\")\n\n    STATE.require_trace().close()\n    STATE.reset_trace()\n\n\n@convert_errors\ndef ghidra_trace_restart(debugger: lldb.SBDebugger, command: str,\n                         result: lldb.SBCommandReturnObject,\n                         internal_dict: Dict[str, Any]) -> None:\n    \"\"\"Restart or start the Trace in Ghidra.\n\n    Usage: ghidra trace restart [NAME]\n\n    Takes an optional name for the trace. If omitted, it tries to derive the\n    name from the target image.\n    \"\"\"\n\n    args = shlex.split(command)","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py#L412-L448","documentation":"`ghidra trace stop` takes no arguments; it closes and resets the active trace. Any extra token aborts before the close, leaving the trace active.","triggerScenarios":"`ghidra trace stop now`; `ghidra trace stop force`.","commonSituations":"Appending a confirmation or force keyword this command does not recognize.","solutions":["Call it with no arguments: `ghidra trace stop`"],"exampleFix":"// before\nghidra trace stop force\n// after\nghidra trace stop","handlingStrategy":"validation","validationCode":"import shlex\ndef no_args(command: str) -> bool:\n    return len(shlex.split(command)) == 0","typeGuard":null,"tryCatchPattern":"try:\n    ghidra_trace_stop(debugger, command, result, internal_dict)\nexcept RuntimeError as e:\n    if str(e).startswith('Usage: ghidra trace stop'):\n        # drop arguments and retry\n        ...\n    raise","preventionTips":["Stop takes no arguments","Confirm a trace is active first with `ghidra trace info`"],"tags":["ghidra","lldb","cli","validation","trace"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}