NationalSecurityAgency/ghidra · error · RuntimeError

Usage: ghidra trace info

Error message

Usage: ghidra trace info

What it means

`ghidra trace info` prints connection and trace status and takes no arguments. Any extra token aborts before the status is printed.

Source

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

    STATE.require_client()
    if STATE.trace is not None:
        STATE.trace.close()
        STATE.reset_trace()
    start_trace(name)


@convert_errors
def ghidra_trace_info(debugger: lldb.SBDebugger, command: str,
                      result: lldb.SBCommandReturnObject,
                      internal_dict: Dict[str, Any]) -> None:
    """Get info about the Ghidra connection.

    Usage: ghidra trace info
    """

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

    result = {}
    if STATE.client is None:
        print("Not connected to Ghidra")
        return
    host, port = STATE.client.s.getpeername()
    print(f"Connected to Ghidra at {host}:{port}")
    if STATE.trace is None:
        print("No trace")
        return
    print("Trace active")
    return result


@convert_errors
def ghidra_trace_info_lcsp(debugger: lldb.SBDebugger, command: str,
                           result: lldb.SBCommandReturnObject,
                           internal_dict: Dict[str, Any]) -> None:

View on GitHub (pinned to d5f144c24d)

Solutions

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

Example fix

// before
ghidra trace info all
// after
ghidra trace info
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_info(debugger, command, result, internal_dict)
except RuntimeError as e:
    if str(e).startswith('Usage: ghidra trace info'):
        # drop arguments and retry
        ...
    raise

Prevention

When it happens

Trigger: `ghidra trace info verbose`; `ghidra trace info all`.

Common situations: Expecting a verbosity flag or filter that this command does not support.

Related errors


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