NationalSecurityAgency/ghidra · error · IllegalArgumentException
This mapper cannot handle Harvard guests
Error message
This mapper cannot handle Harvard guests
What it means
Thrown by DefaultDebuggerPlatformMapper.validate when the target language is a Harvard architecture (separate instruction and data address spaces). The default mapper assumes a von Neumann (unified) memory model and cannot reconcile split code/data spaces.
Source
Thrown at Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/mapping/DefaultDebuggerPlatformMapper.java:47
public class DefaultDebuggerPlatformMapper extends AbstractDebuggerPlatformMapper {
protected static boolean isHarvard(Language language) {
return language.getDefaultSpace() != language.getDefaultDataSpace();
}
protected final PluginTool tool;
protected final CompilerSpec cSpec;
public DefaultDebuggerPlatformMapper(PluginTool tool, Trace trace, CompilerSpec cSpec) {
super(tool, trace);
validate(cSpec);
this.tool = tool;
this.cSpec = cSpec;
}
protected void validate(CompilerSpec cSpec) {
if (isHarvard(cSpec.getLanguage())) {
throw new IllegalArgumentException("This mapper cannot handle Harvard guests");
}
}
@Override
public CompilerSpec getCompilerSpec(TraceObject object, long snap) {
return cSpec;
}
protected TracePlatform addOrGetPlatform(CompilerSpec cSpec, long snap) {
String description = "Add guest " + cSpec.getLanguage().getLanguageDescription() + "/" +
cSpec.getCompilerSpecDescription();
try (Transaction tx = trace.openTransaction(description)) {
TracePlatformManager platformManager = trace.getPlatformManager();
TracePlatform platform = platformManager.getOrAddPlatform(cSpec);
if (!platform.isHost()) {
addMappedRanges((TraceGuestPlatform) platform);
}
return platform;View on GitHub (pinned to d5f144c24d)
Solutions
- Use a Harvard-capable platform mapper subclass for the target architecture.
- Confirm the selected processor module/compiler spec is correct for the target; switch to the appropriate mapper via the platform mapping UI.
- If you are extending the mapper, override validate() to handle split address spaces instead of rejecting them.
- Report/extend mapping support for the specific Harvard target upstream.
Example fix
// before
new DefaultDebuggerPlatformMapper(tool, trace, cSpec); // throws for Harvard lang
// after
if (isHarvard(cSpec.getLanguage())) {
mapper = new HarvardDebuggerPlatformMapper(tool, trace, cSpec);
} else {
mapper = new DefaultDebuggerPlatformMapper(tool, trace, cSpec);
} Defensive patterns
Strategy: type-guard
Validate before calling
boolean defaultOk = !isHarvard(cSpec.getLanguage());
Type guard
static boolean isHarvardLang(Language l) {
// mirrors DefaultDebuggerPlatformMapper.isHarvard
return l != null && l.getAddressFactory().getInstructionSpace() != null
&& l.getAddressFactory().getAddressSpaces().length > 1; // illustrative
} Try / catch
try {
new DefaultDebuggerPlatformMapper(tool, trace, cSpec);
} catch (IllegalArgumentException e) {
// select a Harvard-aware mapper instead
} Prevention
- Detect Harvard targets and choose the matching mapper.
- Do not apply the default mapper to split code/data architectures.
When it happens
Trigger: Constructing a DefaultDebuggerPlatformMapper (or a mapper whose validate calls super) for a CompilerSpec whose Language is Harvard (isHarvard(language) returns true), e.g., AVR, 8051, PIC.
Common situations: Debugging an embedded Harvard-architecture target (AVR, 8051, PIC, MSP430 variants) with the default platform mapper instead of a Harvard-aware one; misconfigured platform mapping for such targets.
Related errors
- Emulation requires a Sleigh language
- Trace is not opened in this tool
- The function for the frame is no longer present in the mappe
- Cannot find static program for frame ({pc}={pcVal})
- No such register: {name}
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/889e942466b7c0a3.
Report an issue: GitHub.