NationalSecurityAgency/ghidra · error · RuntimeError

Usage: ghidra trace put-modules

Error message

Usage: ghidra trace put-modules

What it means

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).

Source

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

        modobj.insert()
        trace.proxy_object_path(
            mpath + SECTIONS_ADD_PATTERN).retain_values(sec_keys)
    trace.proxy_object_path(MODULES_PATTERN.format(
        procnum=proc.GetProcessID())).retain_values(mod_keys)


@convert_errors
def ghidra_trace_put_modules(debugger: lldb.SBDebugger, command: str,
                             result: lldb.SBCommandReturnObject,
                             internal_dict: Dict[str, Any]) -> None:
    """Gather object files, if applicable, and write to the trace's Modules.

    Usage: ghidra trace put-modules
    """

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

    trace, tx = STATE.require_tx()
    with trace.client.batch() as b:
        put_modules()


def convert_state(t: lldb.SBThread) -> str:
    # TODO: This does not seem to work - currently supplanted by proc.is_running
    if t.IsSuspended():
        return 'SUSPENDED'
    if t.IsStopped():
        return 'STOPPED'
    return 'RUNNING'


def compute_thread_display(t: lldb.SBThread) -> str:
    return util.get_description(t)

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Run bare: `ghidra trace put-modules`.
  2. Filter/inspect modules in Ghidra after publishing, not via this command's arguments.

Example fix

// before
ghidra trace put-modules a.out
// after
ghidra trace put-modules
Defensive patterns

Strategy: validation

Validate before calling

assert len(command.split()) == 0, "put-modules takes no arguments"

Prevention

When it happens

Trigger: Appending a module name, base address, or index, e.g. `ghidra trace put-modules a.out`, or trailing tokens.

Common situations: 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.

Related errors


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