NationalSecurityAgency/ghidra · error · LoadException

No progam to associate with trace was given

Error message

No progam to associate with trace was given

What it means

LoadException from TenetPlusPlusLoader when programPath is null or blank. Same contract as TenetLoader: a Tenet++ trace needs an associated Program, supplied via the DOMAIN_FILE_OPTION_NAME option. The option must be present and non-blank. Message contains the same source typo ('progam').

Source

Thrown at Ghidra/Debug/Debugger-importers/src/main/java/ghidra/app/util/opinion/TenetPlusPlusLoader.java:300

			throws IOException, CancelledException, VersionException, LoadException {
		Trace trace;
		String programPath = null;

		for (final Option option : settings.options()) {
			final String name = option.getName();
			if (name.equals(DOMAIN_FILE_OPTION_NAME)) {
				programPath = (String) option.getValue();
			}
			else if (name.equals(STORE_REGS_AS_ATTRS_OPTION_NAME)) {
				storeRegsAsAttrs = (boolean) option.getValue();
			}
			else if (name.equals(ADD_ALL_MEM_REFS_OPTION_NAME)) {
				addAllMemRefs = (boolean) option.getValue();
			}
		}

		if ((programPath == null) || programPath.isBlank()) {
			throw new LoadException("No progam to associate with trace was given");
		}

		Msg.info(this, "Loading trace for %s".formatted(programPath));

		final DomainFile df = settings.project().getProjectData().getFile(programPath);
		if (!df.getContentType().equals(ProgramContentHandler.PROGRAM_CONTENT_TYPE)) {
			throw new LoadException("Selected file is not a program");
		}
		Program program = null;

		try {
			program = (Program) df.getDomainObject(this, false, false, settings.monitor());

			final long start = System.currentTimeMillis();

			trace = loadTrace(settings.provider(), settings.importName(), program,
				settings.consumer(), settings.log(), settings.monitor());

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Include an Option named DOMAIN_FILE_OPTION_NAME (TenetPlusPlusLoader constant) set to the target program's project path.
  2. In the GUI, select the program in the loader options panel before importing the Tenet++ trace.
  3. Verify the option name string matches the loader's constant exactly.

Example fix

// before
// options list missing DOMAIN_FILE_OPTION_NAME

// after
List<Option> opts = new ArrayList<>(settings.options());
opts.add(new Option(TenetPlusPlusLoader.DOMAIN_FILE_OPTION_NAME, "/myproj/exe"));
settings = settings.withOptions(opts);
Defensive patterns

Strategy: validation

Validate before calling

String programPath = options.stream()
    .filter(o -> TenetPlusPlusLoader.DOMAIN_FILE_OPTION_NAME.equals(o.getName()))
    .map(Option::getValue).map(String::valueOf).findFirst().orElse(null);
if (programPath == null || programPath.isBlank()) {
    throw new IllegalArgumentException("Set " + TenetPlusPlusLoader.DOMAIN_FILE_OPTION_NAME);
}

Try / catch

try {
    loader.load(settings);
} catch (LoadException e) {
    if (e.getMessage().contains("progam to associate")) {
        // prompt for the associated program
    }
}

Prevention

When it happens

Trigger: load() on TenetPlusPlusLoader is invoked with settings.options() lacking DOMAIN_FILE_OPTION_NAME, or with a null/blank value. The loader also reads STORE_REGS_AS_ATTRS_OPTION_NAME and ADD_ALL_MEM_REFS_OPTION_NAME but none of those supply programPath.

Common situations: Headless import script that builds options for Tenet++ but omits the domain-file option; import dialog finished without selecting the program; option added under the wrong name.

Related errors


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/62ac5deca9d7fe18. Report an issue: GitHub.