{"record":{"id":"36399919887c63f2","repo":"NationalSecurityAgency/ghidra","slug":"no-such-address-space-s","errorCode":null,"errorMessage":"No such address space: %s","messagePattern":"No such address space: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerGoToTrait.java","lineNumber":99,"sourceCode":"\t\tTracePlatform platform = current.getPlatform();\n\t\tgoToDialog.show(platform.getAddressFactory(), getDefaultInput());\n\t}\n\n\tprotected String adjustOffset(String offset) {\n\t\toffset = offset.strip();\n\t\tif (offset.startsWith(\"+\")) {\n\t\t\treturn \".+(%s)\".formatted(offset.substring(1));\n\t\t}\n\t\tif (offset.startsWith(\"-\")) {\n\t\t\treturn \".-(%s)\".formatted(offset.substring(1));\n\t\t}\n\t\treturn offset;\n\t}\n\n\tprotected Address tryAddress(AddressFactory factory, String spaceName, String offset) {\n\t\tAddressSpace space = factory.getAddressSpace(spaceName);\n\t\tif (space == null) {\n\t\t\tthrow new IllegalArgumentException(\"No such address space: \" + spaceName);\n\t\t}\n\n\t\ttry {\n\t\t\tAddress address = space.getAddress(offset);\n\t\t\tif (address == null) {\n\t\t\t\taddress = factory.getAddress(offset);\n\t\t\t}\n\t\t\treturn address;\n\t\t}\n\t\tcatch (AddressFormatException e) {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tpublic void validate(AddressFactory factory, String spaceName, String offset, LitIdMode mode) {\n\t\toffset = adjustOffset(offset);\n\t\t/**\n\t\t * NOTE: Even though the SleighParser can how handle bare addresses, we still want to","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/action/DebuggerGoToTrait.java#L81-L117","documentation":"Ghidra DebuggerGoToTrait.tryAddress() looks up the named address space via factory.getAddressSpace(spaceName); if it returns null the method throws IllegalArgumentException. This is the platform/address-factory path used before falling back to Sleigh expression evaluation.","triggerScenarios":"A Go-To request names an address space that the current platform's AddressFactory does not provide (e.g., 'ram' vs 'mem' vs 'register'), or a typo in the space name.","commonSituations":"Trace's language defines different space names than the user typed; cross-language copy-paste of an address expression; stale plugin state after switching traces.","solutions":["Use a space name that exists for the current platform: enumerate via factory.getAddressSpaces().","Let the offset be resolved without an explicit space, or use the register/ram convention for the active language.","Switch to a trace whose language provides the expected space.","Catch IllegalArgumentException and report available spaces to the user."],"exampleFix":"// before\nAddress a = tryAddress(factory, \"mem\", \"1000\"); // 'mem' not defined -> throws\n\n// after\nString space = factory.getDefaultAddressSpace().getName(); // e.g. \"ram\"\nAddress a = tryAddress(factory, space, \"1000\");","handlingStrategy":"validation","validationCode":"AddressSpace space = factory.getAddressSpace(spaceName);\nif (space == null) {\n    // list valid spaces: factory.getAddressSpaces()\n    return;\n}","typeGuard":"boolean spaceExists(ghidra.program.model.address.AddressFactory f, String name) {\n    return f.getAddressSpace(name) != null;\n}","tryCatchPattern":"try {\n    Address a = tryAddress(factory, spaceName, offset);\n} catch (IllegalArgumentException ex) {\n    // 'No such address space'; pick factory.getDefaultAddressSpace()\n}","preventionTips":["Enumerate spaces via getAddressSpaces() before offering them in the UI.","Prefer the default address space when the user gives a bare offset.","Clear stale space names when switching traces."],"tags":["ghidra","debugger","java","address-space","validation"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}