NationalSecurityAgency/ghidra · error · IllegalStateException

Invalid value for {}

Error message

Invalid value for {}

What it means

Ghidra AbstractDebuggerParameterDialog.collectArguments() validates every parameter editor: if a editor's current text (getAsText()) does not equal its memorized value's string, the parameter is flagged invalid. If any parameter is invalid the method throws IllegalStateException listing the offending parameter labels, aborting argument collection.

Source

Thrown at Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/AbstractDebuggerParameterDialog.java:677

		}
	}

	protected Map<String, ValStr<?>> collectArguments() {
		Map<String, ValStr<?>> map = new LinkedHashMap<>();
		Set<String> invalid = new LinkedHashSet<>();
		for (Entry<P, PropertyEditor> ent : paramEditors.entrySet()) {
			P param = ent.getKey();
			PropertyEditor editor = ent.getValue();
			ValStr<?> val = memorized.get(parameterNameAndType(param));
			if (!Objects.equals(editor.getAsText(), val.str())) {
				invalid.add(parameterLabel(param));
			}
			if (val != null) {
				map.put(parameterName(param), val);
			}
		}
		if (!invalid.isEmpty()) {
			throw new IllegalStateException("Invalid value for " + invalid);
		}
		return map;
	}

	public Map<String, ValStr<?>> getArguments() {
		return arguments;
	}

	void setMemorizedArgument(P parameter, ValStr<?> value) {
		if (value == null) {
			return;
		}
		memorized.put(parameterNameAndType(parameter), value);
		PropertyEditor editor = paramEditors.get(parameter);
		// Editors may not be populated yet
		if (editor != null) {
			setEditorValue(editor, parameter, value);
		}

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Ensure every parameter editor is committed (getAsText() matches the memorized string) before collecting arguments.
  2. Surface the invalid set to the user and block the Apply/OK action until fields are valid.
  3. Re-populate editors via populateValues() from current memorized values before collecting.
  4. Catch IllegalStateException around collectArguments() and report invalid labels rather than crashing.

Example fix

// before
Map<String, ValStr<?>> args = collectArguments(); // throws if a field is dirty/invalid

// after
try {
    Map<String, ValStr<?>> args = collectArguments();
} catch (IllegalStateException ex) {
    setStatusText("Fix invalid parameters: " + ex.getMessage());
    return;
}
Defensive patterns

Strategy: try-catch

Validate before calling

// ensure all editors are committed before collecting
boolean allValid = true;
for (PropertyEditor ed : paramEditors.values()) {
    // confirm ed.getAsText() is parseable / matches a memorized value
    if (!isEditorValid(ed)) allValid = false;
}
if (!allValid) return;

Try / catch

try {
    Map<String, ValStr<?>> args = collectArguments();
} catch (IllegalStateException ex) {
    // ex.getMessage() lists invalid parameter labels; show to user
}

Prevention

When it happens

Trigger: Invoking collectArguments() while one or more parameter editors hold text that doesn't match their memorized ValStr.str() — i.e., an uncommitted, partially edited, or unparseable value remains in a field.

Common situations: User clicked OK/Apply with a parameter field still in an error state; a programmatic value set bypassed the editor; a memorized value became incompatible after a platform/trace change.

Related errors


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