NationalSecurityAgency/ghidra · error · RuntimeError

Usage: ghidra trace stop

Error message

Usage: ghidra trace stop

What it means

`ghidra trace stop` takes no arguments; it closes and resets the active trace. Any extra token aborts before the close, leaving the trace active.

Source

Thrown at Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py:430

        raise RuntimeError("Usage: ghidra trace start [NAME]")

    STATE.require_client()
    STATE.require_no_trace()
    start_trace(name)


@convert_errors
def ghidra_trace_stop(debugger: lldb.SBDebugger, command: str,
                      result: lldb.SBCommandReturnObject,
                      internal_dict: Dict[str, Any]) -> None:
    """Stop the Trace in Ghidra.

    Usage: ghidra trace stop
    """

    args = shlex.split(command)
    if len(args) != 0:
        raise RuntimeError("Usage: ghidra trace stop")

    STATE.require_trace().close()
    STATE.reset_trace()


@convert_errors
def ghidra_trace_restart(debugger: lldb.SBDebugger, command: str,
                         result: lldb.SBCommandReturnObject,
                         internal_dict: Dict[str, Any]) -> None:
    """Restart or start the Trace in Ghidra.

    Usage: ghidra trace restart [NAME]

    Takes an optional name for the trace. If omitted, it tries to derive the
    name from the target image.
    """

    args = shlex.split(command)

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Call it with no arguments: `ghidra trace stop`

Example fix

// before
ghidra trace stop force
// after
ghidra trace stop
Defensive patterns

Strategy: validation

Validate before calling

import shlex
def no_args(command: str) -> bool:
    return len(shlex.split(command)) == 0

Try / catch

try:
    ghidra_trace_stop(debugger, command, result, internal_dict)
except RuntimeError as e:
    if str(e).startswith('Usage: ghidra trace stop'):
        # drop arguments and retry
        ...
    raise

Prevention

When it happens

Trigger: `ghidra trace stop now`; `ghidra trace stop force`.

Common situations: Appending a confirmation or force keyword this command does not recognize.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/beea7abbb36c2851. Report an issue: GitHub.