NationalSecurityAgency/ghidra · error · IllegalArgumentException

Too many wildcards to breakpoint specification

Error message

Too many wildcards to breakpoint specification

What it means

Thrown by computePath when applying the breakpoint name as a key to the spec PathFilter yields a non-singleton (null) KeyPath, i.e., the filter contains more than one wildcard so a unique path cannot be resolved. Exactly one spec path must result from key substitution.

Source

Thrown at Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/PlaceEmuBreakpointActionItem.java:87

			throw new IllegalArgumentException("Address does not belong to a memory in the trace");
		}
		return region.getObject().findSuitableContainerInterface(TraceBreakpointSpec.class);
	}

	private String computePath() {
		String name = createName(address);
		TraceObject container = findBreakpointContainer();
		if (container == null) {
			throw new IllegalArgumentException(
				"Address is not associated with a breakpoint container");
		}
		PathFilter specFilter = container.getSchema().searchFor(TraceBreakpointSpec.class, true);
		if (specFilter == null) {
			throw new IllegalArgumentException("Cannot find path to breakpoint specifications");
		}
		KeyPath specRelPath = specFilter.applyKeys(name).getSingletonPath();
		if (specRelPath == null) {
			throw new IllegalArgumentException("Too many wildcards to breakpoint specification");
		}
		PathFilter locFilter = container.getSchema()
				.getSuccessorSchema(specRelPath)
				.searchFor(TraceBreakpointLocation.class, true);
		if (locFilter == null) {
			throw new IllegalArgumentException("Cannot find path to breakpoint locations");
		}
		KeyPath locRelPath = locFilter.applyIntKeys(0).getSingletonPath();
		if (locRelPath == null) {
			throw new IllegalArgumentException("Too many wildcards to breakpoint location");
		}
		return container.getCanonicalPath().extend(specRelPath).extend(locRelPath).toString();
	}

	@Override
	public CompletableFuture<Void> execute() {
		try (Transaction tx = trace.openTransaction("Place Emulated Breakpoint")) {
			// Defaults with emuEnable=true

View on GitHub (pinned to d5f144c24d)

Solutions

  1. Use a schema whose breakpoint specification path contains at most one wildcard (the breakpoint name key).
  2. Reduce the number of wildcarded path segments in the spec container schema.
  3. If you control the schema, pin extra key segments to constants so only the name remains variable.
  4. Report the schema configuration; the standard schema guarantees a single-wildcard spec path.

Example fix

// before
KeyPath specRelPath = specFilter.applyKeys(name).getSingletonPath();
if (specRelPath == null) throw ...; // 'Too many wildcards'

// after - diagnose the filter shape
List<KeyPath> paths = specFilter.applyKeys(name).getPaths();
if (paths.size() != 1) {
    throw new IllegalStateException(
        "Expected single spec path, got " + paths.size() + ": " + specFilter);
}
Defensive patterns

Strategy: validation

Validate before calling

PathFilter f = container.getSchema().searchFor(TraceBreakpointSpec.class, true);
boolean single = f != null && f.applyKeys(name).getSingletonPath() != null;

Type guard

static boolean specPathResolves(PathFilter f, String name) {
    return f != null && f.applyKeys(name).getSingletonPath() != null;
}

Try / catch

try {
    item.execute();
} catch (IllegalArgumentException e) {
    Msg.showError(this, null, "Ambiguous spec path", e.getMessage());
}

Prevention

When it happens

Trigger: specFilter.applyKeys(name).getSingletonPath() returns null because the PathFilter pattern has multiple wildcard elements, preventing resolution to a single concrete path.

Common situations: A custom schema where the breakpoint spec path has more than one variable/wildcard key; misconfigured schema templates; key collisions producing ambiguous paths.

Related errors


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