{"record":{"id":"99db1d49b8d18479","repo":"NationalSecurityAgency/ghidra","slug":"current-trace-does-not-use-sleigh","errorCode":null,"errorMessage":"Current trace does not use Sleigh","messagePattern":"Current trace does not use Sleigh","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerGoToTrait.java","lineNumber":159,"sourceCode":"\t * @return the result\n\t */\n\tpublic CompletableFuture<GoToResult> goTo(String spaceName, String offset, LitIdMode mode) {\n\t\tTracePlatform platform = current.getPlatform();\n\t\toffset = adjustOffset(offset);\n\n\t\tAddress address = tryAddress(platform.getAddressFactory(), spaceName, offset);\n\t\tif (address != null) {\n\t\t\treturn CompletableFuture\n\t\t\t\t\t.completedFuture(new GoToResult(address, goToAddress(address)));\n\t\t}\n\t\treturn goToSleigh(spaceName, offset, mode);\n\t}\n\n\tprotected CompletableFuture<GoToResult> goToSleigh(String spaceName, String expression,\n\t\t\tLitIdMode mode) {\n\t\tTracePlatform platform = current.getPlatform();\n\t\tif (!(platform.getLanguage() instanceof SleighLanguage)) {\n\t\t\tthrow new IllegalStateException(\"Current trace does not use Sleigh\");\n\t\t}\n\t\tAddressSpace space = platform.getAddressFactory().getAddressSpace(spaceName);\n\t\tif (space == null) {\n\t\t\tthrow new IllegalArgumentException(\"No such address space: \" + spaceName);\n\t\t}\n\t\tPcodeExpression expr = DebuggerPcodeUtils.compileExpression(tool, current,\n\t\t\tgetCurrentAddress(), expression, mode);\n\t\treturn goToSleigh(platform, space, expr);\n\t}\n\n\tprotected CompletableFuture<GoToResult> goToSleigh(TracePlatform platform, AddressSpace space,\n\t\t\tPcodeExpression expression) {\n\t\tPcodeExecutor<byte[]> executor = DebuggerPcodeUtils.executorForCoordinates(tool, current);\n\t\tCompletableFuture<byte[]> result =\n\t\t\tCompletableFuture.supplyAsync(() -> expression.evaluate(executor));\n\t\treturn result.thenApplyAsync(offset -> {\n\t\t\tAddress address = space.getAddress(\n\t\t\t\tUtils.bytesToLong(offset, offset.length, expression.getLanguage().isBigEndian()));","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerGoToTrait.java#L141-L177","documentation":"Ghidra DebuggerGoToTrait.goToSleigh() requires the current trace's language to be a SleighLanguage. If platform.getLanguage() is not a SleighLanguage, an IllegalStateException is thrown because Pcode/Sleigh expression evaluation is unavailable for that language type.","triggerScenarios":"Issuing a Go-To that resolves to a Sleigh/Pcode expression (the plain-address path returned null) while the active trace uses a non-Sleigh language.","commonSituations":"Loading or attaching to a program whose processor language is not Sleigh-based; a custom/legacy language module; switching traces to one without Sleigh support mid-session.","solutions":["Use a trace backed by a Sleigh language (Ghidra's standard processor definitions are Sleigh-based).","Provide a literal address/space+offset instead of a Sleigh expression so the plain-address path resolves.","Verify `platform.getLanguage() instanceof SleighLanguage` before enabling expression-based Go-To.","Catch IllegalStateException and degrade to address-only navigation."],"exampleFix":"// before\n// trace loaded with a non-Sleigh language; user enters a pcode expression\nfuture = goToSleigh(space, \"inst_start + 5\", mode); // throws\n\n// after\nif (platform.getLanguage() instanceof SleighLanguage) {\n    future = goToSleigh(space, \"inst_start + 5\", mode);\n} else {\n    future = goToAddress(plainOffset); // address-only fallback\n}","handlingStrategy":"type-guard","validationCode":"if (!(platform.getLanguage() instanceof SleighLanguage)) {\n    // disable Sleigh expression Go-To; offer address-only navigation\n    return;\n}","typeGuard":"boolean isSleighTrace(TracePlatform p) {\n    return p.getLanguage() instanceof SleighLanguage;\n}","tryCatchPattern":"try {\n    goToSleigh(space, expr, mode);\n} catch (IllegalStateException ex) {\n    // 'Current trace does not use Sleigh'; fall back to plain address\n}","preventionTips":["Gate expression-based Go-To UI on a SleighLanguage check.","Load traces backed by Sleigh processor definitions.","Provide address-only navigation for non-Sleigh traces."],"tags":["ghidra","debugger","java","sleigh","pcode"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}