{"record":{"id":"28d017ee1c6674f9","repo":"NationalSecurityAgency/ghidra","slug":"no-trace-started","errorCode":null,"errorMessage":"No trace started","messagePattern":"No trace started","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiCommands.java","lineNumber":84,"sourceCode":"\t\t}\n\t\treturn client;\n\t}\n\n\tpublic void requireNoClient() {\n\t\tif (client != null) {\n\t\t\tclient = null;\n\t\t\tthrow new RuntimeException(\"Already connected\");\n\t\t}\n\t}\n\n\tpublic void resetClient() {\n\t\tclient = null;\n\t\tresetTrace();\n\t}\n\n\tpublic RmiTrace requireTrace() {\n\t\tif (trace == null) {\n\t\t\tthrow new RuntimeException(\"No trace started\");\n\t\t}\n\t\treturn trace;\n\t}\n\n\tpublic void requireNoTrace() {\n\t\tif (trace != null) {\n\t\t\tthrow new RuntimeException(\"Trace already started\");\n\t\t}\n\t}\n\n\tpublic void resetTrace() {\n\t\ttrace = null;\n\t\tresetTx();\n\t}\n\n\tpublic RmiTransaction requireTx() {\n\t\tif (tx == null) {\n\t\t\tthrow new RuntimeException(\"No transaction\");","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-jpda/src/main/java/ghidra/dbg/jdi/rmi/jpda/JdiCommands.java#L66-L102","documentation":"RuntimeException('No trace started') thrown by State.requireTrace() when the trace field is null. Commands that manipulate a trace (snapshots, objects, memory) route through requireTrace() to obtain the RmiTrace; calling them before a trace has been started fails here.","triggerScenarios":"Issuing trace-manipulation commands (snapshot, object, memory, stepping that records) that call requireTrace() before State.trace has been created by a start-trace command.","commonSituations":"Command sequence that skips start trace; trace was reset (resetTrace sets trace=null) and commands continued; running a record/step command before starting the trace session.","solutions":["Run the start-trace command to initialize State.trace before any trace-requiring command.","Guard by checking state.trace != null before invoking, or catch RuntimeException.","After resetTrace/disconnect, start a new trace before continuing."],"exampleFix":"// before\nstate.requireTrace().recordSnapshot();\n\n// after\nif (state.trace == null) {\n    throw new IllegalStateException(\"Start a trace before recording snapshots\");\n}\nstate.requireTrace().recordSnapshot();","handlingStrategy":"validation","validationCode":"if (state.trace == null) {\n    throw new IllegalStateException(\"Start a trace first\");\n}\nstate.requireTrace().recordSnapshot();","typeGuard":null,"tryCatchPattern":"try {\n    state.requireTrace();\n} catch (RuntimeException e) {\n    if (\"No trace started\".equals(e.getMessage())) {\n        // run start-trace first\n    }\n}","preventionTips":["Start a trace before issuing trace-manipulation commands.","Check state.trace != null as a precondition.","Restart the trace after a reset/disconnect."],"tags":["ghidra","jdi","jpda","trace","state-machine","validation"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}