{"record":{"id":"6b07c8d921f954de","repo":"NationalSecurityAgency/ghidra","slug":"usage-ghidra-trace-get-values-rng-address-length","errorCode":null,"errorMessage":"Usage: ghidra trace get-values-rng ADDRESS LENGTH","messagePattern":"Usage: ghidra trace get-values-rng ADDRESS LENGTH","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py","lineNumber":1360,"sourceCode":"    values = wait(trace.get_values(pattern))\n    print_tabular_values(values, result.PutCString)\n\n\n@convert_errors\ndef ghidra_trace_get_values_rng(debugger: lldb.SBDebugger, command: str,\n                                result: lldb.SBCommandReturnObject,\n                                internal_dict: Dict[str, Any]) -> None:\n    \"\"\"List all values intersecting a given address range.\n\n    Usage: ghidra trace get-values-rng ADDRESS LENGTH\n\n    This can only retrieve values of type ADDRESS or RANGE.\n    NOTE: Even in batch mode, this request will block for the result.\n    \"\"\"\n\n    args = shlex.split(command)\n    if len(args) != 2:\n        raise RuntimeError(\"Usage: ghidra trace get-values-rng ADDRESS LENGTH\")\n    address = args[0]\n    length = args[1]\n\n    trace = STATE.require_trace()\n    start, end = eval_range(address, length)\n    if start is None or end is None:\n        return\n    proc = util.get_process()\n    base, addr = trace.extra.require_mm().map(proc, start)\n    # Do not create the space. We're querying. No tx.\n    values = wait(trace.get_values_intersecting(addr.extend(end - start)))\n    print_tabular_values(values, result.PutCString)\n\n\ndef activate(path: Optional[str] = None) -> None:\n    trace = STATE.require_trace()\n    if path is None:\n        proc = util.get_process()","sourceCodeStart":1342,"sourceCodeEnd":1378,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py#L1342-L1378","documentation":"Usage error raised by ghidra_trace_get_values_rng when the token count is not exactly 2. The command lists ADDRESS/RANGE values intersecting [ADDRESS, ADDRESS+LENGTH); both ADDRESS and LENGTH must be supplied.","triggerScenarios":"Passing one token or 3+; omitting LENGTH; adding flags; quoting issues that split ADDRESS or LENGTH.","commonSituations":"User passes only an address expecting a default length; user adds a PAGES argument (not supported here); user copy-pastes a putmem-style 3-token command.","solutions":["Pass exactly two tokens: ADDRESS LENGTH.","Use explicit numeric literals for both, since evaluation depends on LLDB expression resolution and a stopped target.","Note this command blocks for the result even in batch mode; ensure the target is in a queryable state."],"exampleFix":"// before\nghidra trace get-values-rng 0x10000\n// after\nghidra trace get-values-rng 0x10000 0x40","handlingStrategy":"validation","validationCode":"import shlex\n\ndef validate_get_values_rng(command: str) -> None:\n    if len(shlex.split(command)) != 2:\n        raise ValueError('get-values-rng needs exactly ADDRESS LENGTH')","typeGuard":null,"tryCatchPattern":"try:\n    ghidra_trace_get_values_rng(debugger, command, result, internal_dict)\nexcept RuntimeError as e:\n    if str(e).startswith('Usage:'):\n        result.SetError(str(e))\n    else:\n        raise","preventionTips":["Pass exactly ADDRESS LENGTH (no PAGES).","Use explicit numeric literals and a stopped target.","Remember this command blocks even in batch mode."],"tags":["ghidra-trace","argument-validation","memory-range","cli-usage"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}