[fpc-devel] [RFC] Add OPDF — Object Pascal Debug Format (-gO flag)

mailinglists at geldenhuys.co.uk mailinglists at geldenhuys.co.uk
Wed Mar 4 01:25:45 CET 2026


NOTE: Recompile required — TypeID allocation change

Hi all,

If you have been testing with OPDF-enabled binaries, please
recompile everything (both the FPC compiler and all target
programs) before your next debugging session.

I switched TypeID allocation from sequential counters to
FNV-1a 32-bit hashes of each type's canonical mangled name.
The same type now receives the same TypeID regardless of
which compilation unit emits it. This eliminates the
cross-compilation TypeID collisions I were seeing with
many large multi-unit projects, where separately compiled
frameworks+application produced overlapping TypeID namespaces.

The debugger's remap infrastructure (FTypeIDRemap,
FHeaderTypeIDRemap, RemapTypeID) has been removed — it is
no longer needed. A minimal collision-remap fallback handles
the statistically rare case of two different types hashing
to the same 32-bit value.

Verified: all 27 integration tests pass, and previous
problematic projects now resolve variables correctly on
first attempt.

Design rationale:
   
https://github.com/graemeg/opdebugger/blob/master/docs/design-decisions.adoc#11-hash-based-typeid-allocation
   docs/design-decisions.adoc, line 660
   (section "Hash-Based TypeID Allocation")

Regards,
   - Graeme -


More information about the fpc-devel mailing list