{"record":{"id":"62ac5deca9d7fe18","repo":"NationalSecurityAgency/ghidra","slug":"no-progam-to-associate-with-trace-was-given-62ac5d","errorCode":null,"errorMessage":"No progam to associate with trace was given","messagePattern":"No progam to associate with trace was given","errorType":"exception","errorClass":"LoadException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-importers/src/main/java/ghidra/app/util/opinion/TenetPlusPlusLoader.java","lineNumber":300,"sourceCode":"\t\t\tthrows IOException, CancelledException, VersionException, LoadException {\n\t\tTrace trace;\n\t\tString programPath = null;\n\n\t\tfor (final Option option : settings.options()) {\n\t\t\tfinal String name = option.getName();\n\t\t\tif (name.equals(DOMAIN_FILE_OPTION_NAME)) {\n\t\t\t\tprogramPath = (String) option.getValue();\n\t\t\t}\n\t\t\telse if (name.equals(STORE_REGS_AS_ATTRS_OPTION_NAME)) {\n\t\t\t\tstoreRegsAsAttrs = (boolean) option.getValue();\n\t\t\t}\n\t\t\telse if (name.equals(ADD_ALL_MEM_REFS_OPTION_NAME)) {\n\t\t\t\taddAllMemRefs = (boolean) option.getValue();\n\t\t\t}\n\t\t}\n\n\t\tif ((programPath == null) || programPath.isBlank()) {\n\t\t\tthrow new LoadException(\"No progam to associate with trace was given\");\n\t\t}\n\n\t\tMsg.info(this, \"Loading trace for %s\".formatted(programPath));\n\n\t\tfinal DomainFile df = settings.project().getProjectData().getFile(programPath);\n\t\tif (!df.getContentType().equals(ProgramContentHandler.PROGRAM_CONTENT_TYPE)) {\n\t\t\tthrow new LoadException(\"Selected file is not a program\");\n\t\t}\n\t\tProgram program = null;\n\n\t\ttry {\n\t\t\tprogram = (Program) df.getDomainObject(this, false, false, settings.monitor());\n\n\t\t\tfinal long start = System.currentTimeMillis();\n\n\t\t\ttrace = loadTrace(settings.provider(), settings.importName(), program,\n\t\t\t\tsettings.consumer(), settings.log(), settings.monitor());\n","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-importers/src/main/java/ghidra/app/util/opinion/TenetPlusPlusLoader.java#L282-L318","documentation":"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').","triggerScenarios":"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.","commonSituations":"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.","solutions":["Include an Option named DOMAIN_FILE_OPTION_NAME (TenetPlusPlusLoader constant) set to the target program's project path.","In the GUI, select the program in the loader options panel before importing the Tenet++ trace.","Verify the option name string matches the loader's constant exactly."],"exampleFix":"// before\n// options list missing DOMAIN_FILE_OPTION_NAME\n\n// after\nList<Option> opts = new ArrayList<>(settings.options());\nopts.add(new Option(TenetPlusPlusLoader.DOMAIN_FILE_OPTION_NAME, \"/myproj/exe\"));\nsettings = settings.withOptions(opts);","handlingStrategy":"validation","validationCode":"String programPath = options.stream()\n    .filter(o -> TenetPlusPlusLoader.DOMAIN_FILE_OPTION_NAME.equals(o.getName()))\n    .map(Option::getValue).map(String::valueOf).findFirst().orElse(null);\nif (programPath == null || programPath.isBlank()) {\n    throw new IllegalArgumentException(\"Set \" + TenetPlusPlusLoader.DOMAIN_FILE_OPTION_NAME);\n}","typeGuard":null,"tryCatchPattern":"try {\n    loader.load(settings);\n} catch (LoadException e) {\n    if (e.getMessage().contains(\"progam to associate\")) {\n        // prompt for the associated program\n    }\n}","preventionTips":["Always set DOMAIN_FILE_OPTION_NAME for Tenet++ imports.","Use the loader's constant for the option name.","Validate options in automated import scripts."],"tags":["ghidra","import","loader","trace","tenet","validation"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}