NationalSecurityAgency/ghidra · error · IllegalStateException
Breakpoint must be saved to a program before naming
Error message
Breakpoint must be saved to a program before naming
What it means
Thrown by LoneLogicalBreakpoint.setName because a 'lone' logical breakpoint has no backing program bookmark (it is not yet persisted/saved). Naming requires a saved breakpoint so the name can be stored on the program bookmark.
Source
Thrown at Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/service/breakpoint/LoneLogicalBreakpoint.java:90
@Override
public Bookmark getProgramBookmark() {
return null;
}
@Override
public List<Bookmark> getProgramBookmarksValidOrNot() {
return List.of();
}
@Override
public String getName() {
return "";
}
@Override
public void setName(String name) {
throw new IllegalStateException("Breakpoint must be saved to a program before naming");
}
@Override
public String getEmuSleigh() {
return breaks.computeSleigh();
}
@Override
public void setEmuSleigh(String sleigh) {
breaks.setEmuSleigh(sleigh);
}
@Override
public void setTraceAddress(Trace trace, Address address) {
throw new AssertionError();
}
@OverrideView on GitHub (pinned to d5f144c24d)
Solutions
- Save/persist the breakpoint to a program before renaming it.
- Check getProgramBookmarksValidOrNot().isEmpty() / whether the breakpoint is a LoneLogicalBreakpoint before calling setName.
- Use the trace/object API to set a display name for trace-only breakpoints instead of setName.
- Recreate the breakpoint via the normal breakpoint service so it is program-backed.
Example fix
// before
logicalBreakpoint.setName("mybp"); // throws if lone/unsaved
// after
if (logicalBreakpoint.getProgramBookmarksValidOrNot().isEmpty()) {
Msg.warn(this, "Breakpoint not saved to a program; cannot name it");
} else {
logicalBreakpoint.setName("mybp");
} Defensive patterns
Strategy: validation
Validate before calling
boolean nameable = !logicalBreakpoint.getProgramBookmarksValidOrNot().isEmpty();
Type guard
static boolean isSaved(LogicalBreakpoint bp) {
return !bp.getProgramBookmarksValidOrNot().isEmpty();
} Try / catch
try {
bp.setName(name);
} catch (IllegalStateException e) {
Msg.showWarn(this, null, "Not saved", e.getMessage());
} Prevention
- Persist breakpoints to a program before exposing rename.
- Distinguish lone vs program-backed breakpoints in the UI.
When it happens
Trigger: Calling setName(name) on a LogicalBreakpoint instance that is a LoneLogicalBreakpoint (created without a program-scoped bookmark, e.g., a trace-only/emulated breakpoint).
Common situations: Attempting to rename an emulated or trace-only breakpoint that was never saved to a Program; operating on a breakpoint whose program was closed or never assigned.
Related errors
- Address does not belong to a memory in the trace
- Address is not associated with a breakpoint container
- Cannot find path to breakpoint specifications
- Too many wildcards to breakpoint specification
- Cannot find path to breakpoint locations
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/ca5971019dd2863f.
Report an issue: GitHub.